diff --git a/AUTHORS b/AUTHORS index 3beb5b0..f55feb7a 100644 --- a/AUTHORS +++ b/AUTHORS
@@ -1220,6 +1220,7 @@ Will Watts <willwatts.ww@googlemail.com> William Xie <william.xie@intel.com> Winston Chen <winston.c1@samsung.com> +Xialei Qin <qinxialei@uniontech.com> Xiang Long <xiang.long@intel.com> XiangYang <yangxiang12@huawei.com> Xiangze Zhang <xiangze.zhang@intel.com>
diff --git a/DEPS b/DEPS index e07c2f2..d28c9b0 100644 --- a/DEPS +++ b/DEPS
@@ -253,19 +253,19 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling Skia # and whatever else without interference from each other. - 'skia_revision': '27be14f2ca99bb8800b356461a5077af7989881d', + 'skia_revision': '43557a6d5535b98fefdbbd6ee5687339b900bfdc', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. - 'v8_revision': '412fc23ff5587db033f7ff3612b476b9c90c0d31', + 'v8_revision': 'c25a4438c6ac726f8d381a0b02dfe2468410e9ac', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling ANGLE # and whatever else without interference from each other. - 'angle_revision': '48c86e1b38439aa0ae127dff3d1076056f9466f2', + 'angle_revision': '09b55fbe98b4d8b32c658fc4d46643dc63137dd6', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling SwiftShader # and whatever else without interference from each other. - 'swiftshader_revision': '89bd767fec5336b717cd982af6eef524293f360c', + 'swiftshader_revision': 'e3d910c94d3334bf47319e0bc2f8d48f16063e42', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling PDFium # and whatever else without interference from each other. @@ -328,7 +328,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling devtools-frontend # and whatever else without interference from each other. - 'devtools_frontend_revision': '133980b8824c3122f28683d783f45ff52069ee65', + 'devtools_frontend_revision': '8363c28e524789a6cdffd79742f6f23694df1ab8', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libprotobuf-mutator # and whatever else without interference from each other. @@ -368,7 +368,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. - 'dawn_revision': '5b9b9867cde3fe452ab97d8afcc728f4f564b5d8', + 'dawn_revision': '44beca5b50c41fbbfe83a5a8a23f8ab813a6cf00', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. @@ -412,7 +412,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. - 'libcxxabi_revision': '4d411388aacc2b7d0072aaacb80cb736d75ad51e', + 'libcxxabi_revision': '289d52ce75d6091a79e90ae6aead38c5c701d786', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. @@ -435,7 +435,7 @@ 'libcxx_revision': '79a2e924d96e2fc1e4b937c42efd08898fa472d7', # GN CIPD package version. - 'gn_version': 'git_revision:46f94b5a7f5527b5d7ef57271d3e9447a65e22ac', + 'gn_version': 'git_revision:4ffb87ad613d822e47ca1e21f9d832055ef95891', } # Only these hosts are allowed for dependencies in this DEPS file. @@ -728,7 +728,7 @@ }, 'src/ios/third_party/material_components_ios/src': { - 'url': Var('chromium_git') + '/external/github.com/material-components/material-components-ios.git' + '@' + 'd808b408a1a5a43c9547347bc530dcaf0277de99', + 'url': Var('chromium_git') + '/external/github.com/material-components/material-components-ios.git' + '@' + '5dce9626ae787c33d7bdbda5f156c1415b986c08', 'condition': 'checkout_ios', }, @@ -892,7 +892,7 @@ 'packages': [ { 'package': 'chromium/third_party/androidx', - 'version': '3VkiRTe5qdPdzmIzC63lc6LJPSEUMNjCHwQM4OBH_pgC', + 'version': 'Au8GY56lt8eqtp-di9ooOGsOQprr7zRtGIq2kozVfMcC', }, ], 'condition': 'checkout_android', @@ -947,7 +947,7 @@ 'packages': [ { 'package': 'chromium/third_party/android_build_tools/bundletool', - 'version': '2ZcLVDxyRwp8FzpeYLtLT0TfSRweZxvwh1-Kx1jZ_FoC', + 'version': 'LoldiQDpZ0uTdAm5EPgZ8hBJ3La2KlTWLuaRxE7eDigC', }, ], 'condition': 'checkout_android', @@ -1131,7 +1131,7 @@ }, 'src/third_party/depot_tools': - Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '1b4881c9300a81bac80eace84caa2c10c2e41fa5', + Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '4ca9e1c783b8fa9c8ca39edfcded3028dc7f3e1b', 'src/third_party/devtools-frontend/src': Var('chromium_git') + '/devtools/devtools-frontend' + '@' + Var('devtools_frontend_revision'), @@ -1268,7 +1268,7 @@ }, 'src/third_party/hunspell_dictionaries': - Var('chromium_git') + '/chromium/deps/hunspell_dictionaries.git' + '@' + 'd8be441f37cac500908ddefdc872cf0397550b8c', + Var('chromium_git') + '/chromium/deps/hunspell_dictionaries.git' + '@' + '41cdffd71c9948f63c7ad36e1fb0ff519aa7a37e', 'src/third_party/icu': Var('chromium_git') + '/chromium/deps/icu.git' + '@' + '1fa4e3959ec6637182b7318ac1d382799454806d', @@ -1514,7 +1514,7 @@ }, 'src/third_party/perfetto': - Var('android_git') + '/platform/external/perfetto.git' + '@' + '6eb273237653c5c8d417fd1b556c6d361eb6a79d', + Var('android_git') + '/platform/external/perfetto.git' + '@' + 'e26fd0a8a5e96b82f71b3c86240d8c8c0429245e', 'src/third_party/perl': { 'url': Var('chromium_git') + '/chromium/deps/perl.git' + '@' + '6f3e5028eb65d0b4c5fdd792106ac4c84eee1eb3', @@ -1592,7 +1592,7 @@ 'packages': [ { 'package': 'fuchsia/third_party/android/aemu/release/linux-amd64', - 'version': 'zB8Bv2er0E-n3l3q1QNaqEtzd8Mr4HhrfxrwsBqzDBwC' + 'version': '8CsLSLrKIFVCEVTplLND7Rm6k5N-AprYuOSHOINGFdAC' }, ], 'condition': 'host_os == "linux" and checkout_fuchsia', @@ -1735,7 +1735,7 @@ Var('chromium_git') + '/external/github.com/gpuweb/cts.git' + '@' + '2860185ed0581ee6b884dfb727a42e82b8b7e7a5', 'src/third_party/webrtc': - Var('webrtc_git') + '/src.git' + '@' + 'fdaa77cd218a5190a7a0e42107d002e55f46a5e2', + Var('webrtc_git') + '/src.git' + '@' + '03fad386d528822209d084982f58e4fef2519a8b', 'src/third_party/libgifcodec': Var('skia_git') + '/libgifcodec' + '@'+ Var('libgifcodec_revision'), @@ -1805,7 +1805,7 @@ Var('chromium_git') + '/v8/v8.git' + '@' + Var('v8_revision'), 'src-internal': { - 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@2a3fe4bc34d596d697b17a9ed5a10db4417c4d5f', + 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@fec9f117f22bd3a18af5c57187396839baee30dd', 'condition': 'checkout_src_internal', }, @@ -1835,7 +1835,7 @@ 'packages': [ { 'package': 'chromeos_internal/apps/help_app/app', - 'version': 'Zt1sOHX4279X2V0t4yVW-nuHaarExsKZDs1Q5GzIhVYC', + 'version': 'uDiwkMVyC10EnEMl-8utZEAytrhGGEFQfbLQUxZAHf8C', }, ], 'condition': 'checkout_chromeos and checkout_src_internal', @@ -1846,7 +1846,7 @@ 'packages': [ { 'package': 'chromeos_internal/apps/media_app/app', - 'version': 'OxRBMEo3pEiyw8SFqgrqn3mCc2IC4fMW9GYenAckbXYC', + 'version': 'CflU0D-lTnJJZHRRU9GMM_-hzlNZnSXInx3sci0HjsQC', }, ], 'condition': 'checkout_chromeos and checkout_src_internal', @@ -1857,7 +1857,7 @@ 'packages': [ { 'package': 'chromeos_internal/apps/projector_app/app', - 'version': 'jBhJS2PQSJ_ctuGBqryBJIl0YhUB_WyRTAg5DGMUrrgC', + 'version': 'CgniE4sAabn4KF_XWY-q6Vvqs_vNu1KPpcsI9v-TGU8C', }, ], 'condition': 'checkout_chromeos and checkout_src_internal',
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AwSettingsTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/AwSettingsTest.java index 005d713..9df35bb7 100644 --- a/android_webview/javatests/src/org/chromium/android_webview/test/AwSettingsTest.java +++ b/android_webview/javatests/src/org/chromium/android_webview/test/AwSettingsTest.java
@@ -56,6 +56,7 @@ import org.chromium.content_public.common.ContentSwitches; import org.chromium.content_public.common.ContentUrlConstants; import org.chromium.net.test.EmbeddedTestServer; +import org.chromium.net.test.ServerCertificate; import org.chromium.net.test.util.TestWebServer; import org.chromium.ui.display.DisplayAndroid; import org.chromium.ui.display.DisplayUtil; @@ -1954,6 +1955,40 @@ @Test @SmallTest @Feature({"AndroidWebView", "Preferences"}) + @CommandLineFlags.Add({"enable-features=UserAgentClientHint"}) + public void testUserAgentOverrideClientHints() throws Throwable { + final TestAwContentsClient contentClient = new TestAwContentsClient(); + final AwTestContainerView testContainerView = + mActivityTestRule.createAwTestContainerViewOnMainSync(contentClient); + final String customUserAgentString = "testUserAgentOverrideClientHints"; + AwContents awContents = testContainerView.getAwContents(); + AwSettings settings = mActivityTestRule.getAwSettingsOnUiThread(awContents); + settings.setUserAgentString(customUserAgentString); + + EmbeddedTestServer testServer = EmbeddedTestServer.createAndStartHTTPSServer( + InstrumentationRegistry.getInstrumentation().getContext(), + ServerCertificate.CERT_OK); + + AwActivityTestRule.enableJavaScriptOnUiThread(awContents); + + try { + String targetUrl = testServer.getURL("/android_webview/test/data/fetch-echo.html") + + "?url=" + + URLEncoder.encode("/echoheader?Sec-CH-UA&Sec-CH-UA-Mobile&User-Agent"); + mActivityTestRule.loadUrlSync( + awContents, contentClient.getOnPageFinishedHelper(), targetUrl); + AwActivityTestRule.pollInstrumentationThread( + () -> !"running".equals(mActivityTestRule.getTitleOnUiThread(awContents))); + Assert.assertEquals("?0 " + customUserAgentString, + mActivityTestRule.getTitleOnUiThread(awContents)); + } finally { + testServer.stopAndDestroyServer(); + } + } + + @Test + @SmallTest + @Feature({"AndroidWebView", "Preferences"}) public void testDomStorageEnabledWithTwoViews() throws Throwable { ViewPair views = createViews(); runPerViewSettingsTest(
diff --git a/android_webview/support_library/java/src/org/chromium/support_lib_glue/SupportLibWebViewChromiumFactory.java b/android_webview/support_library/java/src/org/chromium/support_lib_glue/SupportLibWebViewChromiumFactory.java index e81724b..db956ae 100644 --- a/android_webview/support_library/java/src/org/chromium/support_lib_glue/SupportLibWebViewChromiumFactory.java +++ b/android_webview/support_library/java/src/org/chromium/support_lib_glue/SupportLibWebViewChromiumFactory.java
@@ -85,7 +85,7 @@ Features.DOCUMENT_START_SCRIPT, Features.PROXY_OVERRIDE_REVERSE_BYPASS, Features.REQUESTED_WITH_HEADER_CONTROL + Features.DEV_SUFFIX, - Features.GET_VARIATIONS_HEADER + Features.DEV_SUFFIX + Features.GET_VARIATIONS_HEADER, }; // These values are persisted to logs. Entries should not be renumbered and
diff --git a/android_webview/test/data/fetch-echo.html b/android_webview/test/data/fetch-echo.html new file mode 100644 index 0000000..d2fab23 --- /dev/null +++ b/android_webview/test/data/fetch-echo.html
@@ -0,0 +1,10 @@ +<!doctype html> +<html> +<head><title>running</title></head> +<body><script> +window.onload = function () { + const params = new URL(document.location).searchParams; + fetch(params.get('url')).then(e => e.text()).then(text => document.title = text); +}; +</script></body> +</html>
diff --git a/ash/BUILD.gn b/ash/BUILD.gn index 5f1379a..64302f3 100644 --- a/ash/BUILD.gn +++ b/ash/BUILD.gn
@@ -1070,6 +1070,8 @@ "system/cast/unified_cast_detailed_view_controller.h", "system/dark_mode/dark_mode_feature_pod_controller.cc", "system/dark_mode/dark_mode_feature_pod_controller.h", + "system/eche/eche_icon_loading_indicator_view.cc", + "system/eche/eche_icon_loading_indicator_view.h", "system/eche/eche_tray.cc", "system/eche/eche_tray.h", "system/enterprise/enterprise_domain_observer.h", @@ -2241,6 +2243,7 @@ "//ash/app_list", "//ash/assistant/ui", "//ash/quick_pair/feature_status_tracker", + "//ash/quick_pair/keyed_service:keyed_service", "//ash/quick_pair/pairing", "//ash/quick_pair/repository", "//ash/quick_pair/ui", @@ -2569,6 +2572,7 @@ "system/bluetooth/tray_bluetooth_helper_legacy_unittest.cc", "system/bluetooth/unified_bluetooth_detailed_view_controller_unittest.cc", "system/caps_lock_notification_controller_unittest.cc", + "system/eche/eche_icon_loading_indicator_view_unittest.cc", "system/eche/eche_tray_unittest.cc", "system/firmware_update/firmware_update_notification_controller_unittest.cc", "system/geolocation/geolocation_controller_unittest.cc",
diff --git a/ash/DEPS b/ash/DEPS index 654ec07..88f5332c 100644 --- a/ash/DEPS +++ b/ash/DEPS
@@ -26,6 +26,7 @@ "+components/viz/common", "+components/viz/host", "+components/wallpaper", + "+crypto", "+dbus", "+extensions/common/constants.h", "+gpu/config",
diff --git a/ash/accessibility/ui/accessibility_animation_one_shot.cc b/ash/accessibility/ui/accessibility_animation_one_shot.cc index 24daa7b..1863d3d 100644 --- a/ash/accessibility/ui/accessibility_animation_one_shot.cc +++ b/ash/accessibility/ui/accessibility_animation_one_shot.cc
@@ -5,7 +5,6 @@ #include "ash/accessibility/ui/accessibility_animation_one_shot.h" #include "ash/shell.h" -#include "base/debug/crash_logging.h" #include "ui/compositor/layer.h" #include "ui/display/display.h" #include "ui/display/screen.h" @@ -18,14 +17,13 @@ : callback_(callback) { display::Display display = display::Screen::GetScreen()->GetDisplayMatching(bounds_in_dip); - // Crash keys for https://crbug.com/1254275 - SCOPED_CRASH_KEY_STRING32("Accessibility", "BoundsInDip", - bounds_in_dip.ToString()); - SCOPED_CRASH_KEY_STRING32("Accessibility", "Display", display.ToString()); aura::Window* root_window = Shell::GetRootWindowForDisplayId(display.id()); - SCOPED_CRASH_KEY_STRING32( - "Accessibility", "RootWindow", - !root_window ? "Root window is null" : "Root window is valid"); + if (!root_window) { + // `root_window` can be invalid in some scenarios e.g. if an external + // display is unplugged or disconnected. + return; + } + ui::Compositor* compositor = root_window->layer()->GetCompositor(); animation_observation_.Observe(compositor); }
diff --git a/ash/ambient/ui/ambient_animation_view.cc b/ash/ambient/ui/ambient_animation_view.cc index 62f61e8..97037ac 100644 --- a/ash/ambient/ui/ambient_animation_view.cc +++ b/ash/ambient/ui/ambient_animation_view.cc
@@ -18,6 +18,8 @@ #include "ash/ambient/ui/ambient_view_delegate.h" #include "ash/ambient/ui/ambient_view_ids.h" #include "ash/ambient/ui/glanceable_info_view.h" +#include "ash/ambient/ui/media_string_view.h" +#include "ash/ambient/util/ambient_util.h" #include "base/bind.h" #include "base/check.h" #include "base/containers/span.h" @@ -32,7 +34,9 @@ #include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/compositor.h" #include "ui/gfx/color_palette.h" +#include "ui/gfx/geometry/insets.h" #include "ui/gfx/geometry/vector2d.h" +#include "ui/gfx/shadow_value.h" #include "ui/lottie/animation.h" #include "ui/views/background.h" #include "ui/views/border.h" @@ -61,6 +65,13 @@ // AmbientAnimationView to the top-left of the weather/time content views. constexpr int kWeatherTimeBorderPaddingDip = 28; +// Amount of padding from the left and bottom of the AmbientAnimationView's +// bounds to the bottom-left of the media string content views. +constexpr int kMediaStringPaddingFromLeftDip = 28; +constexpr int kMediaStringPaddingFromBottomDip = 24; + +constexpr int kMediaStringTextElevation = 1; + constexpr int kTimeFontSizeDip = 32; // Google Grey 500 with 10% opacity. @@ -107,6 +118,22 @@ /*bottom=*/0, /*right=*/0); } +// The border serves as padding between the MediaStringView and its +// parent view's bounds. +std::unique_ptr<views::Border> CreateMediaStringBorder( + const gfx::Vector2d& jitter = gfx::Vector2d()) { + gfx::Insets shadow_insets = gfx::ShadowValue::GetMargin( + ambient::util::GetTextShadowValues(nullptr, kMediaStringTextElevation)); + int bottom_padding = + kMediaStringPaddingFromBottomDip + shadow_insets.bottom() + jitter.y(); + int left_padding = + kMediaStringPaddingFromLeftDip + shadow_insets.left() + jitter.x(); + DCHECK_GE(bottom_padding, 0); + DCHECK_GE(left_padding, 0); + return views::CreateEmptyBorder(/*top=*/0, left_padding, bottom_padding, + /*right=*/0); +} + } // namespace AmbientAnimationView::AmbientAnimationView( @@ -208,6 +235,26 @@ glanceable_info_container_->AddChildView(std::make_unique<GlanceableInfoView>( view_delegate, kTimeFontSizeDip, /*time_temperature_font_color=*/gfx::kGoogleGrey900)); + + // Media string should appear in the bottom-left corner of the + // AmbientAnimationView's bounds. + media_string_container_ = + AddChildView(std::make_unique<views::BoxLayoutView>()); + media_string_container_->SetOrientation( + views::BoxLayout::Orientation::kVertical); + media_string_container_->SetMainAxisAlignment( + views::BoxLayout::MainAxisAlignment::kEnd); + media_string_container_->SetCrossAxisAlignment( + views::BoxLayout::CrossAxisAlignment::kStart); + media_string_container_->SetBorder(CreateMediaStringBorder()); + MediaStringView* media_string_view = media_string_container_->AddChildView( + std::make_unique<MediaStringView>(MediaStringView::Settings( + {/*icon_light_mode_color=*/gfx::kGoogleGrey600, + /*icon_dark_mode_color=*/gfx::kGoogleGrey500, + /*text_light_mode_color=*/gfx::kGoogleGrey600, + /*text_dark_mode_color=*/gfx::kGoogleGrey500, + kMediaStringTextElevation}))); + media_string_view->SetVisible(false); } void AmbientAnimationView::AnimationWillStartPlaying( @@ -279,10 +326,11 @@ void AmbientAnimationView::ApplyJitter() { gfx::Vector2d jitter = animation_jitter_calculator_.Calculate(); DVLOG(4) << "Applying jitter to animation: " << jitter.ToString(); - // Sharing the same jitter between the animation and glanceable info keeps the - // spacing between the weather/time and animation features consistent. + // Sharing the same jitter between the animation and other peripheral content + // keeps the spacing between features consistent. animated_image_view_->SetAdditionalTranslation(jitter); glanceable_info_container_->SetBorder(CreateGlanceableInfoBorder(jitter)); + media_string_container_->SetBorder(CreateMediaStringBorder(jitter)); } BEGIN_METADATA(AmbientAnimationView, views::View)
diff --git a/ash/ambient/ui/ambient_animation_view.h b/ash/ambient/ui/ambient_animation_view.h index 9252355..8fe53ca 100644 --- a/ash/ambient/ui/ambient_animation_view.h +++ b/ash/ambient/ui/ambient_animation_view.h
@@ -65,6 +65,7 @@ views::AnimatedImageView* animated_image_view_ = nullptr; views::BoxLayoutView* glanceable_info_container_ = nullptr; + views::BoxLayoutView* media_string_container_ = nullptr; std::unique_ptr<AmbientAnimationShieldController> shield_view_controller_; base::ScopedObservation<View, ViewObserver> animated_image_view_observer_{ this};
diff --git a/ash/ambient/ui/ambient_background_image_view.cc b/ash/ambient/ui/ambient_background_image_view.cc index 7864e18..63dae813 100644 --- a/ash/ambient/ui/ambient_background_image_view.cc +++ b/ash/ambient/ui/ambient_background_image_view.cc
@@ -264,7 +264,24 @@ gfx::Insets(kMediaStringMarginDip + shadow_insets.top(), 0, 0, kMediaStringMarginDip + shadow_insets.right())); media_string_view_ = media_string_view_container_->AddChildView( - std::make_unique<MediaStringView>()); + std::make_unique<MediaStringView>(MediaStringView::Settings( + {/*icon_light_mode_color=*/ambient::util::GetContentLayerColor( + AshColorProvider::ContentLayerType::kIconColorPrimary, + /*dark_mode_enable=*/false), + /*icon_dark_mode_color=*/ + ambient::util::GetContentLayerColor( + AshColorProvider::ContentLayerType::kIconColorPrimary, + /*dark_mode_enable=*/true), + /*text_light_mode_color=*/ + ambient::util::GetContentLayerColor( + AshColorProvider::ContentLayerType::kTextColorPrimary, + /*dark_mode_enable=*/false), + /*text_dark_mode_color=*/ + ambient::util::GetContentLayerColor( + AshColorProvider::ContentLayerType::kTextColorPrimary, + /*dark_mode_enable=*/true), + /*text_shadow_elevation=*/ + ambient::util::kDefaultTextShadowElevation}))); media_string_view_->SetVisible(false); }
diff --git a/ash/ambient/ui/ambient_shield_view.cc b/ash/ambient/ui/ambient_shield_view.cc index 9436d6c..2a46a6c 100644 --- a/ash/ambient/ui/ambient_shield_view.cc +++ b/ash/ambient/ui/ambient_shield_view.cc
@@ -118,6 +118,7 @@ for (auto* view : {top, bottom}) view->SetProperty(views::kFlexBehaviorKey, kScaleUnbounded); + // TODO(b/223270660): Listen for dark/light mode changes. bool dark_mode = AshColorProvider::Get()->IsDarkModeEnabled(); const auto& colors = dark_mode ? kDarkModeColors : kLightModeColors;
diff --git a/ash/ambient/ui/media_string_view.cc b/ash/ambient/ui/media_string_view.cc index a13bfb2..86c1a88f 100644 --- a/ash/ambient/ui/media_string_view.cc +++ b/ash/ambient/ui/media_string_view.cc
@@ -6,6 +6,7 @@ #include <memory> #include <string> +#include <utility> #include "ash/ambient/ambient_constants.h" #include "ash/ambient/ui/ambient_view_ids.h" @@ -15,13 +16,13 @@ #include "ash/session/session_controller_impl.h" #include "ash/shell.h" #include "ash/shell_delegate.h" +#include "ash/style/ash_color_provider.h" #include "base/bind.h" #include "base/strings/utf_string_conversions.h" #include "base/time/time.h" #include "components/prefs/pref_service.h" #include "services/media_session/public/cpp/media_session_service.h" #include "services/media_session/public/mojom/media_session.mojom.h" -#include "third_party/skia/include/core/SkColor.h" #include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/layer.h" #include "ui/compositor/paint_recorder.h" @@ -119,7 +120,8 @@ } // namespace -MediaStringView::MediaStringView() { +MediaStringView::MediaStringView(Settings settings) + : settings_(std::move(settings)) { SetID(AmbientViewID::kAmbientMediaStringView); InitLayout(); } @@ -128,8 +130,8 @@ void MediaStringView::OnThemeChanged() { views::View::OnThemeChanged(); - media_text_->SetShadows( - ambient::util::GetTextShadowValues(GetColorProvider())); + media_text_->SetShadows(ambient::util::GetTextShadowValues( + GetColorProvider(), settings_.text_shadow_elevation)); } void MediaStringView::OnViewBoundsChanged(views::View* observed_view) { UpdateMaskLayer(); @@ -202,6 +204,9 @@ SetPaintToLayer(); layer()->SetFillsBoundsOpaquely(false); + // TODO(b/223270660): Listen for dark/light mode changes. + bool dark_mode_enabled = AshColorProvider::Get()->IsDarkModeEnabled(); + constexpr int kChildSpacingDip = 8; auto* layout = SetLayoutManager(std::make_unique<views::BoxLayout>( views::BoxLayout::Orientation::kHorizontal)); @@ -213,10 +218,10 @@ icon_ = AddChildView(std::make_unique<views::ImageView>()); icon_->SetPreferredSize( gfx::Size(kMusicNoteIconSizeDip, kMusicNoteIconSizeDip)); - icon_->SetImage(gfx::CreateVectorIcon( - kMusicNoteIcon, kMusicNoteIconSizeDip, - ambient::util::GetContentLayerColor( - AshColorProvider::ContentLayerType::kIconColorPrimary))); + icon_->SetImage(gfx::CreateVectorIcon(kMusicNoteIcon, kMusicNoteIconSizeDip, + dark_mode_enabled + ? settings_.icon_dark_mode_color + : settings_.icon_light_mode_color)); media_text_container_ = AddChildView(std::make_unique<views::View>()); media_text_container_->SetPaintToLayer(); @@ -240,15 +245,17 @@ media_text_->SetHorizontalAlignment(gfx::HorizontalAlignment::ALIGN_TO_HEAD); media_text_->SetVerticalAlignment(gfx::VerticalAlignment::ALIGN_MIDDLE); media_text_->SetAutoColorReadabilityEnabled(false); - media_text_->SetEnabledColor(ambient::util::GetContentLayerColor( - AshColorProvider::ContentLayerType::kTextColorPrimary)); + media_text_->SetEnabledColor(dark_mode_enabled + ? settings_.text_dark_mode_color + : settings_.text_light_mode_color); media_text_->SetFontList( ambient::util::GetDefaultFontlist() .DeriveWithSizeDelta(kMediaStringFontSizeDip - kDefaultFontSizeDip) .DeriveWithWeight(gfx::Font::Weight::MEDIUM)); media_text_->SetElideBehavior(gfx::ElideBehavior::NO_ELIDE); gfx::Insets shadow_insets = - gfx::ShadowValue::GetMargin(ambient::util::GetTextShadowValues(nullptr)); + gfx::ShadowValue::GetMargin(ambient::util::GetTextShadowValues( + nullptr, settings_.text_shadow_elevation)); // Compensate the shadow insets to put the text middle align with the icon. media_text_->SetBorder(views::CreateEmptyBorder( /*top=*/-shadow_insets.bottom(), @@ -324,9 +331,10 @@ { // Desired speed is 10 seconds for kMediaStringMaxWidthDip. const int text_width = media_text_->GetPreferredSize().width(); - const int shadow_width = - gfx::ShadowValue::GetMargin(ambient::util::GetTextShadowValues(nullptr)) - .width(); + const int shadow_width = gfx::ShadowValue::GetMargin( + ambient::util::GetTextShadowValues( + nullptr, settings_.text_shadow_elevation)) + .width(); const int start_x = text_layer->GetTargetTransform().To2dTranslation().x(); const int end_x = -(text_width + shadow_width) / 2; const int transform_distance = start_x - end_x;
diff --git a/ash/ambient/ui/media_string_view.h b/ash/ambient/ui/media_string_view.h index c9ffd9e..5c4b5e7 100644 --- a/ash/ambient/ui/media_string_view.h +++ b/ash/ambient/ui/media_string_view.h
@@ -11,6 +11,7 @@ #include "mojo/public/cpp/bindings/receiver.h" #include "mojo/public/cpp/bindings/remote.h" #include "services/media_session/public/mojom/media_controller.mojom.h" +#include "third_party/skia/include/core/SkColor.h" #include "ui/compositor/layer_animation_observer.h" #include "ui/views/view.h" #include "ui/views/view_observer.h" @@ -34,9 +35,17 @@ public media_session::mojom::MediaControllerObserver, public ui::ImplicitAnimationObserver { public: + struct Settings { + SkColor icon_light_mode_color; + SkColor icon_dark_mode_color; + SkColor text_light_mode_color; + SkColor text_dark_mode_color; + int text_shadow_elevation; + }; + METADATA_HEADER(MediaStringView); - MediaStringView(); + explicit MediaStringView(Settings settings); MediaStringView(const MediaStringView&) = delete; MediaStringView& operator=(const MediaStringView&) = delete; ~MediaStringView() override; @@ -85,6 +94,8 @@ views::Label* media_text_label_for_testing() { return media_text_; } + const Settings settings_; + // Music eighth note. views::ImageView* icon_ = nullptr;
diff --git a/ash/ambient/util/ambient_util.cc b/ash/ambient/util/ambient_util.cc index b498dfe..f19ed0a 100644 --- a/ash/ambient/util/ambient_util.cc +++ b/ash/ambient/util/ambient_util.cc
@@ -24,15 +24,19 @@ namespace ambient { namespace util { -// Appearance of the text shadow. -constexpr int kTextShadowElevation = 2; - bool IsShowing(LockScreen::ScreenType type) { return LockScreen::HasInstance() && LockScreen::Get()->screen_type() == type; } SkColor GetContentLayerColor( AshColorProvider::ContentLayerType content_layer_type) { + return GetContentLayerColor(content_layer_type, + AshColorProvider::Get()->IsDarkModeEnabled()); +} + +SkColor GetContentLayerColor( + AshColorProvider::ContentLayerType content_layer_type, + bool dark_mode_enable) { auto* ash_color_provider = AshColorProvider::Get(); switch (content_layer_type) { @@ -40,7 +44,7 @@ case AshColorProvider::ContentLayerType::kTextColorSecondary: case AshColorProvider::ContentLayerType::kIconColorPrimary: case AshColorProvider::ContentLayerType::kIconColorSecondary: - return ash_color_provider->IsDarkModeEnabled() + return dark_mode_enable ? ash_color_provider->GetContentLayerColor(content_layer_type) : SK_ColorWHITE; default: @@ -55,7 +59,8 @@ return *font_list; } -gfx::ShadowValues GetTextShadowValues(const ui::ColorProvider* color_provider) { +gfx::ShadowValues GetTextShadowValues(const ui::ColorProvider* color_provider, + int elevation) { // If `color_provider` does not exist the shadow values are being created in // order to calculate margins. In that case the color plays no role so set it // to gfx::kPlaceholderColor. @@ -67,8 +72,8 @@ SkColor shadow_base_color = color_provider ? color_provider->GetColor(ui::kColorShadowBase) : gfx::kPlaceholderColor; - return gfx::ShadowValue::MakeShadowValues( - kTextShadowElevation, shadow_base_color, shadow_base_color); + return gfx::ShadowValue::MakeShadowValues(elevation, shadow_base_color, + shadow_base_color); } bool IsAmbientModeTopicTypeAllowed(::ambient::TopicType topic_type) {
diff --git a/ash/ambient/util/ambient_util.h b/ash/ambient/util/ambient_util.h index fae607dd2..297ff5ac6 100644 --- a/ash/ambient/util/ambient_util.h +++ b/ash/ambient/util/ambient_util.h
@@ -25,6 +25,8 @@ namespace ambient { namespace util { +inline constexpr int kDefaultTextShadowElevation = 2; + // Returns true if Ash is showing lock screen. ASH_EXPORT bool IsShowing(LockScreen::ScreenType type); @@ -32,6 +34,10 @@ // provides a wrapper for |AshColorProvider::GetContentLayerColor|. This is // currently only supported for primary and secondary text and icons. ASH_EXPORT SkColor +GetContentLayerColor(AshColorProvider::ContentLayerType content_layer_type, + bool dark_mode_enable); +// Version of the above that uses AshColorProvider::IsDarkModeEnabled(). +ASH_EXPORT SkColor GetContentLayerColor(AshColorProvider::ContentLayerType content_layer_type); // Returns the default fontlist for Ambient Mode. @@ -41,7 +47,8 @@ // nullptr if the ShadowValues returned are only used to calculate margins, in // which kPlaceholderColor will be used for the shadow color. ASH_EXPORT gfx::ShadowValues GetTextShadowValues( - const ui::ColorProvider* color_provider); + const ui::ColorProvider* color_provider, + int elevation = kDefaultTextShadowElevation); ASH_EXPORT bool IsAmbientModeTopicTypeAllowed(::ambient::TopicType topic);
diff --git a/ash/app_list/views/apps_grid_view.cc b/ash/app_list/views/apps_grid_view.cc index 18405ed..bf1f68a 100644 --- a/ash/app_list/views/apps_grid_view.cc +++ b/ash/app_list/views/apps_grid_view.cc
@@ -533,7 +533,6 @@ folder_to_open_after_drag_icon_animation_.clear(); drag_icon_proxy_.reset(); - items_need_layer_for_drag_ = true; for (const auto& entry : view_model_.entries()) static_cast<AppListItemView*>(entry.view)->EnsureLayer(); drag_view_ = view; @@ -808,7 +807,6 @@ // entire apps grid. reorder_placeholder_ = view_structure_.GetLastTargetIndex(); - items_need_layer_for_drag_ = true; for (const auto& entry : view_model_.entries()) static_cast<AppListItemView*>(entry.view)->EnsureLayer(); @@ -1039,7 +1037,7 @@ auto view = std::make_unique<AppListItemView>( app_list_config_, this, item_list_->item_at(index), app_list_view_delegate_, AppListItemView::Context::kAppsGridView); - if (items_need_layer_for_drag_) + if (ItemViewsRequireLayers()) view->EnsureLayer(); if (cardified_state_) view->EnterCardifyState(); @@ -2432,24 +2430,32 @@ } void AppsGridView::OnBoundsAnimatorDone(views::BoundsAnimator* animator) { - if (drag_item_ || drag_icon_proxy_) + if (ItemViewsRequireLayers()) return; - if (bounds_animation_for_cardified_state_in_progress_ || - (bounds_animator_ && bounds_animator_->IsAnimating())) { - return; - } - - // Return early if the item views' layers are used by the active reorder - // animation - if (IsUnderReorderAnimation()) - return; - - items_need_layer_for_drag_ = false; for (const auto& entry : view_model_.entries()) entry.view->DestroyLayer(); } +bool AppsGridView::ItemViewsRequireLayers() const { + // Layers required for app list item move animations during drag (to make room + // for the current placeholder). + if (drag_item_ || drag_icon_proxy_) + return true; + + // Bounds animations are in progress, which use layers to animate transforms. + if (bounds_animation_for_cardified_state_in_progress_ || + (bounds_animator_ && bounds_animator_->IsAnimating())) { + return true; + } + + // Reorder animation animate app list item layers. + if (IsUnderReorderAnimation()) + return true; + + return false; +} + GridIndex AppsGridView::GetNearestTileIndexForPoint( const gfx::Point& point) const { gfx::Rect bounds = GetContentsBounds();
diff --git a/ash/app_list/views/apps_grid_view.h b/ash/app_list/views/apps_grid_view.h index d060c18..ee998be 100644 --- a/ash/app_list/views/apps_grid_view.h +++ b/ash/app_list/views/apps_grid_view.h
@@ -503,6 +503,10 @@ void OnBoundsAnimatorProgressed(views::BoundsAnimator* animator) override; void OnBoundsAnimatorDone(views::BoundsAnimator* animator) override; + // Whether app list item views require layers - for example during drag, or + // folder repositioning animation. + bool ItemViewsRequireLayers() const; + void BeginHideCurrentGhostImageView(); bool ignore_layout() const { return ignore_layout_; } @@ -523,11 +527,6 @@ // View structure used only for non-folder. PagedViewStructure view_structure_{this}; - // Set while apps grid items have layers to handle app list item drag - // operation. It's reset when the app list bounds animations requested after - // drag state is cleared complete. - bool items_need_layer_for_drag_ = false; - // The `AppListItemView` that is being dragged within the apps grid (i.e. the // AppListItemView for `drag_item_`) if the drag item is currently part of the // item list shown in the apps grid. `drag_view_` may be nullptr during item
diff --git a/ash/app_list/views/continue_section_view.cc b/ash/app_list/views/continue_section_view.cc index 4bb2a41..bf4a5095 100644 --- a/ash/app_list/views/continue_section_view.cc +++ b/ash/app_list/views/continue_section_view.cc
@@ -7,6 +7,7 @@ #include <algorithm> #include <memory> #include <string> +#include <utility> #include <vector> #include "ash/app_list/app_list_controller_impl.h" @@ -148,7 +149,7 @@ void ContinueSectionView::OnSearchResultContainerResultsChanged() { MaybeCreatePrivacyNotice(); - UpdateElementsVisibility(); + MaybeAnimateOutPrivacyNotice(); } bool ContinueSectionView::HasMinimumFilesToShow() const { @@ -210,24 +211,23 @@ } // Keep the privacy notice view for the dismiss animation in clamshell mode. - if (tablet_mode_) + if (tablet_mode_) { RemovePrivacyNotice(); - else - AnimateDismissToast(); + } else { + AnimateDismissToast( + base::BindRepeating(&ContinueSectionView::AnimateShowContinueSection, + weak_ptr_factory_.GetWeakPtr())); + } } -void ContinueSectionView::AnimateDismissToast() { +void ContinueSectionView::AnimateDismissToast(base::RepeatingClosure callback) { DCHECK(!tablet_mode_); PrepareForLayerAnimation(privacy_toast_); views::AnimationBuilder animation_builder; - animation_builder.OnEnded( - base::BindOnce(&ContinueSectionView::AnimateShowContinueSection, - weak_ptr_factory_.GetWeakPtr())); - animation_builder.OnAborted( - base::BindOnce(&ContinueSectionView::AnimateShowContinueSection, - weak_ptr_factory_.GetWeakPtr())); + animation_builder.OnEnded(std::move(callback)); + animation_builder.OnAborted(std::move(callback)); animation_builder .SetPreemptionStrategy( @@ -237,6 +237,21 @@ .SetDuration(kDismissToastAnimationDuration); } +void ContinueSectionView::AnimateSlideLauncherContent(int vertical_offset) { + RemovePrivacyNotice(); + // The sibling views from this should slide down the total of the height + // difference to make room for the continue section suggestions and title. + for (views::View* view : parent()->children()) { + if (view == this) + continue; + const bool create_layer = PrepareForLayerAnimation(view); + auto cleanup = create_layer ? base::BindRepeating(&CleanupLayer, view) + : base::DoNothing(); + StartSlideInAnimation(view, vertical_offset, base::Milliseconds(300), + gfx::Tween::ACCEL_40_DECEL_100_3, cleanup); + } +} + void ContinueSectionView::AnimateShowContinueSection() { DCHECK(!tablet_mode_); @@ -266,26 +281,13 @@ height_difference + kVerticalPaddingFromParent, kShowSuggestionsAnimationDuration, animation_tween); - // The siblings views from this should slide down the total of the height - // difference to make room for the continue section suggestions and title. - for (views::View* view : parent()->children()) { - if (view == this) - continue; - const bool create_layer = PrepareForLayerAnimation(view); - auto cleanup = create_layer ? base::BindRepeating(&CleanupLayer, view) - : base::DoNothing(); - StartSlideInAnimation(view, height_difference, - kShowSuggestionsAnimationDuration, animation_tween, - cleanup); - } + AnimateSlideLauncherContent(height_difference); + + auto cleanup = base::BindRepeating(&CleanupLayer, continue_label_); views::AnimationBuilder animation_builder; - animation_builder.OnEnded( - base::BindOnce(&ContinueSectionView::RemovePrivacyNotice, - weak_ptr_factory_.GetWeakPtr())); - animation_builder.OnAborted( - base::BindOnce(&ContinueSectionView::RemovePrivacyNotice, - weak_ptr_factory_.GetWeakPtr())); + animation_builder.OnEnded(cleanup); + animation_builder.OnAborted(cleanup); animation_builder .SetPreemptionStrategy( @@ -303,9 +305,6 @@ privacy_toast_ = nullptr; } UpdateElementsVisibility(); - - if (continue_label_) - continue_label_->DestroyLayer(); } void ContinueSectionView::OnPrivacyNoticeShowTimerDone() { @@ -374,6 +373,19 @@ return true; } +void ContinueSectionView::MaybeAnimateOutPrivacyNotice() { + if (Shell::HasInstance() && Shell::Get()->app_list_controller() && + Shell::Get()->app_list_controller()->IsVisible() && !tablet_mode_ && + privacy_toast_ && !ShouldShowPrivacyNotice()) { + AnimateDismissToast( + base::BindRepeating(&ContinueSectionView::AnimateSlideLauncherContent, + weak_ptr_factory_.GetWeakPtr(), + privacy_toast_->GetPreferredSize().height())); + return; + } + UpdateElementsVisibility(); +} + void ContinueSectionView::UpdateElementsVisibility() { const bool show_files_section = ShouldShowFilesSection(); const bool show_privacy_notice = ShouldShowPrivacyNotice();
diff --git a/ash/app_list/views/continue_section_view.h b/ash/app_list/views/continue_section_view.h index f59f4d03..3c6d569 100644 --- a/ash/app_list/views/continue_section_view.h +++ b/ash/app_list/views/continue_section_view.h
@@ -119,11 +119,19 @@ void OnPrivacyToastAcknowledged(); // Starts the animation to dismiss the privacy notice toast. - void AnimateDismissToast(); + void AnimateDismissToast(base::RepeatingClosure callback); // Starts the animation to show the continue section in the app list bubble. void AnimateShowContinueSection(); + // Starts the animation for sliding other launcher content by + // `vertical_offset`. + void AnimateSlideLauncherContent(int vertical_offset); + + // Starts the animation to dismiss the privacy notice toast only. This is used + // when the privacy notice does not have enough items after an update. + void MaybeAnimateOutPrivacyNotice(); + bool tablet_mode_ = false; // Timer for marking the privacy notice as shown.
diff --git a/ash/app_list/views/continue_section_view_unittest.cc b/ash/app_list/views/continue_section_view_unittest.cc index d5a784f0..a424aec 100644 --- a/ash/app_list/views/continue_section_view_unittest.cc +++ b/ash/app_list/views/continue_section_view_unittest.cc
@@ -1960,5 +1960,67 @@ } } +TEST_F(ContinueSectionViewClamshellModeTest, AnimatesOutAfterRemovingResults) { + ResetPrivacyNoticePref(); + InitializeForAnimationTest(/*result_count=*/3); + + EXPECT_TRUE(IsPrivacyNoticeVisible()); + EXPECT_EQ(GetAppListNudgeController()->current_nudge(), + AppListNudgeController::NudgeType::kPrivacyNotice); + + views::View* privacy_notice = + GetContinueSectionView()->GetPrivacyNoticeForTest(); + + RemoveSearchResultAt(1); + + ContinueTaskContainerView* const container_view = + GetContinueSectionView()->suggestions_container(); + container_view->Update(); + + EXPECT_EQ(1.0f, privacy_notice->layer()->opacity()); + EXPECT_EQ(0.0f, privacy_notice->layer()->GetTargetOpacity()); + EXPECT_TRUE(privacy_notice->layer()->GetAnimator()->is_animating()); + + LayerAnimationStoppedWaiter waiter; + waiter.Wait(privacy_notice->layer()); + + VerifyResultViewsUpdated(); + + ASSERT_LE(GetContinueSectionView()->GetTasksSuggestionsCount(), 2u); + EXPECT_FALSE(IsPrivacyNoticeVisible()); + + EXPECT_FALSE(GetContinueSectionView()->GetVisible()); +} + +TEST_F(ContinueSectionViewClamshellModeTest, AnimatesPrivacyNoticeAccept) { + ResetPrivacyNoticePref(); + InitializeForAnimationTest(/*result_count=*/3); + + EXPECT_TRUE(IsPrivacyNoticeVisible()); + EXPECT_EQ(GetAppListNudgeController()->current_nudge(), + AppListNudgeController::NudgeType::kPrivacyNotice); + + AppListToastView* privacy_notice = + GetContinueSectionView()->GetPrivacyNoticeForTest(); + + GestureTapOn(privacy_notice->toast_button()); + + EXPECT_EQ(1.0f, privacy_notice->layer()->opacity()); + EXPECT_EQ(0.0f, privacy_notice->layer()->GetTargetOpacity()); + EXPECT_TRUE(privacy_notice->layer()->GetAnimator()->is_animating()); + + LayerAnimationStoppedWaiter waiter; + waiter.Wait(privacy_notice->layer()); + + ContinueTaskContainerView* container_view = + GetContinueSectionView()->suggestions_container(); + + EXPECT_TRUE(container_view->layer()->GetAnimator()->is_animating()); + WaitForAllChildrenAnimationsToComplete(container_view); + EXPECT_FALSE(IsPrivacyNoticeVisible()); + + EXPECT_TRUE(GetContinueSectionView()->GetVisible()); +} + } // namespace } // namespace ash
diff --git a/ash/app_list/views/paged_apps_grid_view.cc b/ash/app_list/views/paged_apps_grid_view.cc index 490cc2d7..0af2747 100644 --- a/ash/app_list/views/paged_apps_grid_view.cc +++ b/ash/app_list/views/paged_apps_grid_view.cc
@@ -309,9 +309,9 @@ // since the creation/destruction of the layer requires to repaint the parent // view (i.e. this class). if (restore_opacity) { - // If drag is in progress, layers are still required, so just update the - // opacity (the layers will be deleted when drag operation completes). - if (items_need_layer_for_drag_) { + // If item layers are still required (e.g. during drag), only update the + // opacity (the layers will be deleted when they are no longer needed). + if (ItemViewsRequireLayers()) { for (const auto& entry : view_model()->entries()) { if (!IsViewHiddenForDrag(entry.view) && entry.view->layer()) entry.view->layer()->SetOpacity(1.0f);
diff --git a/ash/app_list/views/search_result_inline_icon_view.cc b/ash/app_list/views/search_result_inline_icon_view.cc index e98135d..3ca05d8 100644 --- a/ash/app_list/views/search_result_inline_icon_view.cc +++ b/ash/app_list/views/search_result_inline_icon_view.cc
@@ -90,7 +90,9 @@ AshColorProvider::ContentLayerType::kTextColorURL)); paint_flags.setStyle(cc::PaintFlags::kStroke_Style); paint_flags.setStrokeWidth(kBorderThickness); - canvas->DrawRoundRect(GetContentsBounds(), kButtonCornerRadius, paint_flags); + gfx::Rect bounds = GetContentsBounds(); + bounds.Inset(gfx::Insets(kBorderThickness)); + canvas->DrawRoundRect(bounds, kButtonCornerRadius, paint_flags); } void SearchResultInlineIconView::OnThemeChanged() {
diff --git a/ash/app_list/views/search_result_view.cc b/ash/app_list/views/search_result_view.cc index 4b5d385..6fb4c4e 100644 --- a/ash/app_list/views/search_result_view.cc +++ b/ash/app_list/views/search_result_view.cc
@@ -317,18 +317,6 @@ void SearchResultView::OnResultChanged() { OnMetadataChanged(); - // Update tile, separator, and details text visibility. - if (view_type_ == SearchResultViewType::kAnswerCard) - UpdateBigTitleContainer(); - if (view_type_ != SearchResultViewType::kClassic && - app_list_features::IsSearchResultInlineIconEnabled()) { - UpdateKeyboardShortcutContainer(); - } - UpdateTitleContainer(); - UpdateDetailsContainer(); - UpdateBadgeIcon(); - UpdateRating(); - UpdateAccessibleName(); SchedulePaint(); } @@ -950,6 +938,9 @@ } UpdateTitleContainer(); UpdateDetailsContainer(); + UpdateAccessibleName(); + UpdateBadgeIcon(); + UpdateRating(); // Updates |icon_|. // Note: this might leave the view with an old icon. But it is needed to avoid // flash when a SearchResult's icon is loaded asynchronously. In this case, it
diff --git a/ash/components/fwupd/BUILD.gn b/ash/components/fwupd/BUILD.gn index bfbc207..9679aab 100644 --- a/ash/components/fwupd/BUILD.gn +++ b/ash/components/fwupd/BUILD.gn
@@ -15,6 +15,7 @@ "//ash/webui/firmware_update_ui/mojom", "//base:base", "//chromeos/dbus/fwupd", + "//crypto", "//dbus", ]
diff --git a/ash/components/fwupd/firmware_update_manager.cc b/ash/components/fwupd/firmware_update_manager.cc index 60ebf7d..0cce0f89 100644 --- a/ash/components/fwupd/firmware_update_manager.cc +++ b/ash/components/fwupd/firmware_update_manager.cc
@@ -25,6 +25,7 @@ #include "base/task/task_traits.h" #include "base/task/thread_pool.h" #include "chromeos/dbus/fwupd/fwupd_client.h" +#include "crypto/sha2.h" #include "dbus/message.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/receiver.h" @@ -106,6 +107,50 @@ return base::ScopedFD(dest_file.TakePlatformFile()); } +base::File VerifyChecksum(base::File file, const std::string& checksum) { + // Sha256 is 32 bytes, if it isn't Sha256 then return false. + // The Sha256 string representation is 64 bytes, Sha256 is 32 bytes long. + if (checksum.length() != crypto::kSHA256Length * 2) { + return base::File(); + } + + const int64_t raw_file_length = file.GetLength(); + + // Length of the file should not exceed int::max. + if (raw_file_length > std::numeric_limits<int>::max()) { + return base::File(); + } + + // Safe to truncate down to <int>. + int file_length = raw_file_length; + + // Check checksum of the file. + std::vector<char> buf(file_length); + if (file.Read(0, buf.data(), file_length) != file_length) { + return base::File(); + } + + const base::StringPiece contents(buf.data(), file_length); + + const std::string sha_contents = crypto::SHA256HashString(contents); + + const std::string encoded_sha = base::ToLowerASCII( + base::HexEncode(sha_contents.data(), sha_contents.size())); + + if (encoded_sha != checksum) { + LOG(ERROR) << "Wrong checksum, expected: " << checksum + << " but got: " << encoded_sha; + return base::File(); + } + + // Reset current pointer of file so that it can be read again. + if (file.Seek(base::File::FROM_BEGIN, 0) != 0) { + return base::File(); + } + + return file; +} + bool CreateDirIfNotExists(const base::FilePath& path) { return base::DirectoryExists(path) || base::CreateDirectory(path); } @@ -122,6 +167,7 @@ update->priority = firmware_update::mojom::UpdatePriority(update_details.priority); update->filepath = update_details.filepath; + update->checksum = update_details.checksum; return update; } @@ -420,7 +466,7 @@ {"none", false}, {"force", true}, {"allow-reinstall", true}}; task_runner_->PostTaskAndReplyWithResult( FROM_HERE, base::BindOnce(&OpenFileAndGetFileDescriptor, file), - base::BindOnce(&FirmwareUpdateManager::InstallUpdate, + base::BindOnce(&FirmwareUpdateManager::OnGetFileDescriptor, weak_ptr_factory_.GetWeakPtr(), device_id, std::move(options), std::move(callback))); return; @@ -485,12 +531,12 @@ task_runner_->PostTaskAndReplyWithResult( FROM_HERE, base::BindOnce(&OpenFileAndGetFileDescriptor, download_path), - base::BindOnce(&FirmwareUpdateManager::InstallUpdate, + base::BindOnce(&FirmwareUpdateManager::OnGetFileDescriptor, weak_ptr_factory_.GetWeakPtr(), device_id, std::move(options), std::move(callback))); } -void FirmwareUpdateManager::InstallUpdate( +void FirmwareUpdateManager::OnGetFileDescriptor( const std::string& device_id, chromeos::FirmwareInstallOptions options, base::OnceCallback<void()> callback, @@ -512,8 +558,29 @@ } } + base::File patch_file(std::move(file_descriptor)); + task_runner_->PostTaskAndReplyWithResult( + FROM_HERE, + base::BindOnce(&VerifyChecksum, std::move(patch_file), + inflight_update_->checksum), + base::BindOnce(&FirmwareUpdateManager::InstallUpdate, + weak_ptr_factory_.GetWeakPtr(), device_id, + std::move(options), std::move(callback))); +} + +void FirmwareUpdateManager::InstallUpdate( + const std::string& device_id, + chromeos::FirmwareInstallOptions options, + base::OnceCallback<void()> callback, + base::File patch_file) { + if (!patch_file.IsValid()) { + inflight_update_.reset(); + std::move(callback).Run(); + return; + } + chromeos::FwupdClient::Get()->InstallUpdate( - device_id, std::move(file_descriptor), options); + device_id, base::ScopedFD(patch_file.TakePlatformFile()), options); std::move(callback).Run(); }
diff --git a/ash/components/fwupd/firmware_update_manager.h b/ash/components/fwupd/firmware_update_manager.h index 223a3a8..32a3e113 100644 --- a/ash/components/fwupd/firmware_update_manager.h +++ b/ash/components/fwupd/firmware_update_manager.h
@@ -12,6 +12,7 @@ #include "base/component_export.h" #include "base/containers/flat_map.h" #include "base/containers/flat_set.h" +#include "base/files/file.h" #include "base/files/file_path.h" #include "base/files/scoped_file.h" #include "base/memory/weak_ptr.h" @@ -127,11 +128,17 @@ // Query the fwupd DBus client for updates for a certain device. void RequestUpdates(const std::string& device_id); + // Callback handler after fetching the file descriptor. + void OnGetFileDescriptor(const std::string& device_id, + chromeos::FirmwareInstallOptions options, + base::OnceCallback<void()> callback, + base::ScopedFD file_descriptor); + // Query the fwupd DBus client to install an update for a certain device. void InstallUpdate(const std::string& device_id, chromeos::FirmwareInstallOptions options, base::OnceCallback<void()> callback, - base::ScopedFD file_descriptor); + base::File patch_file); void CreateLocalPatchFile(const base::FilePath& cache_path, const std::string& device_id,
diff --git a/ash/components/fwupd/firmware_update_manager_unittest.cc b/ash/components/fwupd/firmware_update_manager_unittest.cc index fed15a49..1306f63f 100644 --- a/ash/components/fwupd/firmware_update_manager_unittest.cc +++ b/ash/components/fwupd/firmware_update_manager_unittest.cc
@@ -60,6 +60,8 @@ const char kFakeUpdateUriForTesting[] = "file:///usr/share/fwupd/remotes.d/vendor/firmware/testFirmwarePath-V1.cab"; const char kFakeUpdateFileNameForTesting[] = "testFirmwarePath-V1.cab"; +const char kEmptyFileSha256ForTesting[] = + "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"; const char kFilePathIdentifier[] = "file://"; const char kFwupdServiceName[] = "org.freedesktop.fwupd"; const char kFwupdServicePath[] = "/"; @@ -69,6 +71,7 @@ const char kPriorityKey[] = "Urgency"; const char kUriKey[] = "Uri"; const char kVersionKey[] = "Version"; +const char kChecksumKey[] = "Checksum"; const char kDownloadDir[] = "firmware-updates"; const char kCacheDir[] = "cache"; const char kCabExtension[] = ".cab"; @@ -379,6 +382,56 @@ dict_writer.AppendVariantOfString(kFakeUpdateUriForTesting); device_array_writer.CloseContainer(&dict_writer); + device_array_writer.OpenDictEntry(&dict_writer); + dict_writer.AppendString(kChecksumKey); + dict_writer.AppendVariantOfString(kEmptyFileSha256ForTesting); + device_array_writer.CloseContainer(&dict_writer); + + response_array_writer.CloseContainer(&device_array_writer); + response_writer.CloseContainer(&response_array_writer); + + return response; + } + + std::unique_ptr<dbus::Response> CreateOneUpdateResponseWithChecksum( + const std::string& checksum) { + auto response = dbus::Response::CreateEmpty(); + + dbus::MessageWriter response_writer(response.get()); + dbus::MessageWriter response_array_writer(nullptr); + dbus::MessageWriter device_array_writer(nullptr); + dbus::MessageWriter dict_writer(nullptr); + + // The response is an array of arrays of dictionaries. Each dictionary is + // one device description. + response_writer.OpenArray("a{sv}", &response_array_writer); + response_array_writer.OpenArray("{sv}", &device_array_writer); + + device_array_writer.OpenDictEntry(&dict_writer); + dict_writer.AppendString(kDescriptionKey); + dict_writer.AppendVariantOfString(kFakeUpdateDescriptionForTesting); + device_array_writer.CloseContainer(&dict_writer); + + device_array_writer.OpenDictEntry(&dict_writer); + dict_writer.AppendString(kVersionKey); + dict_writer.AppendVariantOfString(kFakeUpdateVersionForTesting); + device_array_writer.CloseContainer(&dict_writer); + + device_array_writer.OpenDictEntry(&dict_writer); + dict_writer.AppendString(kPriorityKey); + dict_writer.AppendVariantOfUint32(kFakeUpdatePriorityForTesting); + device_array_writer.CloseContainer(&dict_writer); + + device_array_writer.OpenDictEntry(&dict_writer); + dict_writer.AppendString(kUriKey); + dict_writer.AppendVariantOfString(kFakeUpdateUriForTesting); + device_array_writer.CloseContainer(&dict_writer); + + device_array_writer.OpenDictEntry(&dict_writer); + dict_writer.AppendString(kChecksumKey); + dict_writer.AppendVariantOfString(checksum); + device_array_writer.CloseContainer(&dict_writer); + response_array_writer.CloseContainer(&device_array_writer); response_writer.CloseContainer(&response_array_writer); @@ -418,6 +471,11 @@ dict_writer.AppendVariantOfString(kFakeUpdateUriForTesting); device_array_writer.CloseContainer(&dict_writer); + device_array_writer.OpenDictEntry(&dict_writer); + dict_writer.AppendString(kChecksumKey); + dict_writer.AppendVariantOfString(kEmptyFileSha256ForTesting); + device_array_writer.CloseContainer(&dict_writer); + response_array_writer.CloseContainer(&device_array_writer); response_writer.CloseContainer(&response_array_writer); @@ -818,6 +876,61 @@ EXPECT_TRUE(!update_progress_observer.GetLatestUpdate()); } +TEST_F(FirmwareUpdateManagerTest, InvalidChecksum) { + base::HistogramTester histogram_tester; + EXPECT_CALL(*proxy_, DoCallMethodWithErrorResponse(_, _, _)) + .WillRepeatedly(Invoke(this, &FirmwareUpdateManagerTest::OnMethodCalled)); + + dbus_responses_.push_back(CreateOneDeviceResponse()); + dbus_responses_.push_back(CreateOneUpdateResponseWithChecksum( + "badbbadbad1ef97238fb24c5e40a979bc544bb2b0967b863e43e7d58e0d9a923f")); + dbus_responses_.push_back(dbus::Response::CreateEmpty()); + FakeUpdateObserver update_observer; + SetupObserver(&update_observer); + ASSERT_EQ(1, update_observer.num_times_notified()); + + // No updates available since checksum is empty. + const auto& updates = update_observer.updates(); + ASSERT_TRUE(updates.empty()); +} + +TEST_F(FirmwareUpdateManagerTest, EmptyChecksum) { + base::HistogramTester histogram_tester; + EXPECT_CALL(*proxy_, DoCallMethodWithErrorResponse(_, _, _)) + .WillRepeatedly(Invoke(this, &FirmwareUpdateManagerTest::OnMethodCalled)); + + dbus_responses_.push_back(CreateOneDeviceResponse()); + dbus_responses_.push_back(CreateOneUpdateResponseWithChecksum("")); + dbus_responses_.push_back(dbus::Response::CreateEmpty()); + + FakeUpdateObserver update_observer; + SetupObserver(&update_observer); + ASSERT_EQ(1, update_observer.num_times_notified()); + + // No updates available since checksum is empty. + const auto& updates = update_observer.updates(); + ASSERT_TRUE(updates.empty()); +} + +TEST_F(FirmwareUpdateManagerTest, WrongChecksumVariant) { + base::HistogramTester histogram_tester; + EXPECT_CALL(*proxy_, DoCallMethodWithErrorResponse(_, _, _)) + .WillRepeatedly(Invoke(this, &FirmwareUpdateManagerTest::OnMethodCalled)); + + dbus_responses_.push_back(CreateOneDeviceResponse()); + dbus_responses_.push_back(CreateOneUpdateResponseWithChecksum( + "badbbadbad1ef97238fb24c5e40a979bc544bb2b")); + dbus_responses_.push_back(dbus::Response::CreateEmpty()); + + FakeUpdateObserver update_observer; + SetupObserver(&update_observer); + ASSERT_EQ(1, update_observer.num_times_notified()); + + // No updates available since checksum is empty. + const auto& updates = update_observer.updates(); + ASSERT_TRUE(updates.empty()); +} + TEST_F(FirmwareUpdateManagerTest, NotificationShownForCriticalUpdate) { InitializeNotificationController(); EXPECT_CALL(*proxy_, DoCallMethodWithErrorResponse(_, _, _))
diff --git a/ash/quick_pair/keyed_service/BUILD.gn b/ash/quick_pair/keyed_service/BUILD.gn index 30a9824..314ed60 100644 --- a/ash/quick_pair/keyed_service/BUILD.gn +++ b/ash/quick_pair/keyed_service/BUILD.gn
@@ -22,6 +22,7 @@ ] deps = [ + "//ash/public/cpp", "//ash/quick_pair/common", "//ash/quick_pair/fast_pair_handshake", "//ash/quick_pair/feature_status_tracker", @@ -34,10 +35,12 @@ "//base", "//chromeos/services/bluetooth_config", "//chromeos/services/bluetooth_config/public/cpp", + "//chromeos/services/bluetooth_config/public/mojom", "//components/keyed_service/core", "//components/prefs", "//components/user_manager", "//device/bluetooth", + "//mojo/public/cpp/bindings", ] } @@ -52,9 +55,11 @@ deps = [ ":keyed_service", + "//ash:test_support", "//ash/constants:constants", "//ash/quick_pair/common", "//ash/quick_pair/common:test_support", + "//ash/quick_pair/fast_pair_handshake:test_support", "//ash/quick_pair/feature_status_tracker:test_support", "//ash/quick_pair/message_stream", "//ash/quick_pair/message_stream:test_support", @@ -67,11 +72,13 @@ "//ash/services/quick_pair:test_support", "//base", "//base/test:test_support", + "//chromeos/services/bluetooth_config:test_support", + "//chromeos/services/bluetooth_config/public/mojom", "//components/prefs:test_support", "//components/user_manager:test_support", "//device/bluetooth", "//device/bluetooth:mocks", - "//mojo/public/cpp/bindings:bindings", + "//mojo/public/cpp/bindings", "//testing/gtest", ] }
diff --git a/ash/quick_pair/keyed_service/quick_pair_mediator.cc b/ash/quick_pair/keyed_service/quick_pair_mediator.cc index 7e77528..5ff619a 100644 --- a/ash/quick_pair/keyed_service/quick_pair_mediator.cc +++ b/ash/quick_pair/keyed_service/quick_pair_mediator.cc
@@ -7,6 +7,7 @@ #include <cstdint> #include <memory> +#include "ash/public/cpp/bluetooth_config_service.h" #include "ash/quick_pair/common/device.h" #include "ash/quick_pair/common/logging.h" #include "ash/quick_pair/fast_pair_handshake/fast_pair_handshake_lookup.h" @@ -30,6 +31,7 @@ #include "ash/quick_pair/ui/ui_broker_impl.h" #include "ash/services/quick_pair/quick_pair_process.h" #include "ash/services/quick_pair/quick_pair_process_manager_impl.h" +#include "base/threading/thread_task_runner_handle.h" #include "chromeos/services/bluetooth_config/fast_pair_delegate.h" #include "components/prefs/pref_registry_simple.h" @@ -98,8 +100,17 @@ pairer_broker_observation_.Observe(pairer_broker_.get()); ui_broker_observation_.Observe(ui_broker_.get()); - SetFastPairState(feature_status_tracker_->IsFastPairEnabled()); + // If we already have a discovery session via the Settings pairing dialog, + // don't start Fast Pair scanning. + SetFastPairState(feature_status_tracker_->IsFastPairEnabled() && + !has_at_least_one_discovery_session_); quick_pair_process::SetProcessManager(process_manager_.get()); + + // Asynchronously bind to CrosBluetoothConfig so that we don't want to attempt + // to bind to it before it has initialized. + base::ThreadTaskRunnerHandle::Get()->PostTask( + FROM_HERE, base::BindOnce(&Mediator::BindToCrosBluetoothConfig, + weak_ptr_factory_.GetWeakPtr())); } Mediator::~Mediator() { @@ -121,12 +132,21 @@ DeviceImageStore::RegisterLocalStatePrefs(registry); } +void Mediator::BindToCrosBluetoothConfig() { + GetBluetoothConfigService( + remote_cros_bluetooth_config_.BindNewPipeAndPassReceiver()); + remote_cros_bluetooth_config_->ObserveDiscoverySessionStatusChanges( + cros_discovery_session_observer_receiver_.BindNewPipeAndPassRemote()); +} + chromeos::bluetooth_config::FastPairDelegate* Mediator::GetFastPairDelegate() { return fast_pair_bluetooth_config_delegate_.get(); } void Mediator::OnFastPairEnabledChanged(bool is_enabled) { - SetFastPairState(is_enabled); + // If we already have a discovery session via the Settings pairing dialog, + // don't start Fast Pair scanning. + SetFastPairState(is_enabled && !has_at_least_one_discovery_session_); } void Mediator::OnDeviceFound(scoped_refptr<Device> device) { @@ -138,7 +158,7 @@ void Mediator::OnDeviceLost(scoped_refptr<Device> device) { QP_LOG(INFO) << __func__ << ": " << device; - ui_broker_->RemoveNotifications(device); + ui_broker_->RemoveNotifications(); FastPairHandshakeLookup::GetInstance()->Erase(device); } @@ -158,7 +178,7 @@ void Mediator::OnDevicePaired(scoped_refptr<Device> device) { QP_LOG(INFO) << __func__ << ": Device=" << device; - ui_broker_->RemoveNotifications(device); + ui_broker_->RemoveNotifications(); fast_pair_repository_->PersistDeviceImages(device); } @@ -231,5 +251,37 @@ } } +void Mediator::OnHasAtLeastOneDiscoverySessionChanged( + bool has_at_least_one_discovery_session) { + has_at_least_one_discovery_session_ = has_at_least_one_discovery_session; + QP_LOG(VERBOSE) << __func__ + << ": Discovery session status changed, we" + " have at least one discovery session: " + << has_at_least_one_discovery_session_; + + // If we have a discovery session via the Settings pairing dialog, stop + // Fast Pair scanning. Else, start/stop scanning according to the feature + // status tracker. Stopping scanning stops all GATT connections that + // haven't completed their handshake + SetFastPairState(!has_at_least_one_discovery_session_ && + feature_status_tracker_->IsFastPairEnabled()); + + if (!has_at_least_one_discovery_session_) { + return; + } + + // If we are midway through pairing, return early so we don't remove + // handshakes where they are required. + if (pairer_broker_->IsPairing()) { + return; + } + + // Clear all existing handshakes. + FastPairHandshakeLookup::GetInstance()->Clear(); + + // Dismiss all UI notifications. + ui_broker_->RemoveNotifications(); +} + } // namespace quick_pair } // namespace ash
diff --git a/ash/quick_pair/keyed_service/quick_pair_mediator.h b/ash/quick_pair/keyed_service/quick_pair_mediator.h index 2d02897..4de6f5b7 100644 --- a/ash/quick_pair/keyed_service/quick_pair_mediator.h +++ b/ash/quick_pair/keyed_service/quick_pair_mediator.h
@@ -14,6 +14,9 @@ #include "ash/quick_pair/ui/ui_broker.h" #include "base/memory/scoped_refptr.h" #include "base/scoped_observation.h" +#include "chromeos/services/bluetooth_config/public/mojom/cros_bluetooth_config.mojom.h" +#include "mojo/public/cpp/bindings/receiver.h" +#include "mojo/public/cpp/bindings/remote.h" class PrefRegistrySimple; @@ -36,11 +39,13 @@ // Implements the Mediator design pattern for the components in the Quick Pair // system, e.g. the UI Broker, Scanning Broker and Pairing Broker. -class Mediator final : public FeatureStatusTracker::Observer, - public ScannerBroker::Observer, - public PairerBroker::Observer, - public UIBroker::Observer, - public RetroactivePairingDetector::Observer { +class Mediator final + : public FeatureStatusTracker::Observer, + public ScannerBroker::Observer, + public PairerBroker::Observer, + public UIBroker::Observer, + public RetroactivePairingDetector::Observer, + public chromeos::bluetooth_config::mojom::DiscoverySessionStatusObserver { public: class Factory { public: @@ -97,9 +102,15 @@ // RetroactivePairingDetector::Observer void OnRetroactivePairFound(scoped_refptr<Device> device) override; + // chromeos::bluetooth_config::mojom::DiscoverySessionStatusObserver + void OnHasAtLeastOneDiscoverySessionChanged( + bool has_at_least_one_discovery_session) override; + private: void SetFastPairState(bool is_enabled); + void BindToCrosBluetoothConfig(); + bool has_at_least_one_discovery_session_ = false; std::unique_ptr<FeatureStatusTracker> feature_status_tracker_; std::unique_ptr<ScannerBroker> scanner_broker_; std::unique_ptr<MessageStreamLookup> message_stream_lookup_; @@ -124,6 +135,12 @@ retroactive_pairing_detector_observation_{this}; base::ScopedObservation<UIBroker, UIBroker::Observer> ui_broker_observation_{ this}; + mojo::Remote<chromeos::bluetooth_config::mojom::CrosBluetoothConfig> + remote_cros_bluetooth_config_; + mojo::Receiver< + chromeos::bluetooth_config::mojom::DiscoverySessionStatusObserver> + cros_discovery_session_observer_receiver_{this}; + base::WeakPtrFactory<Mediator> weak_ptr_factory_{this}; }; } // namespace quick_pair
diff --git a/ash/quick_pair/keyed_service/quick_pair_mediator_unittest.cc b/ash/quick_pair/keyed_service/quick_pair_mediator_unittest.cc index 932954c9..c74f2de 100644 --- a/ash/quick_pair/keyed_service/quick_pair_mediator_unittest.cc +++ b/ash/quick_pair/keyed_service/quick_pair_mediator_unittest.cc
@@ -12,6 +12,10 @@ #include "ash/quick_pair/common/mock_quick_pair_browser_delegate.h" #include "ash/quick_pair/common/pair_failure.h" #include "ash/quick_pair/common/protocol.h" +#include "ash/quick_pair/fast_pair_handshake/fake_fast_pair_handshake.h" +#include "ash/quick_pair/fast_pair_handshake/fast_pair_data_encryptor.h" +#include "ash/quick_pair/fast_pair_handshake/fast_pair_gatt_service_client.h" +#include "ash/quick_pair/fast_pair_handshake/fast_pair_handshake_lookup.h" #include "ash/quick_pair/feature_status_tracker/fake_feature_status_tracker.h" #include "ash/quick_pair/feature_status_tracker/mock_quick_pair_feature_status_tracker.h" #include "ash/quick_pair/feature_status_tracker/quick_pair_feature_status_tracker.h" @@ -28,19 +32,25 @@ #include "ash/quick_pair/ui/mock_ui_broker.h" #include "ash/quick_pair/ui/ui_broker.h" #include "ash/services/quick_pair/quick_pair_process_manager_impl.h" +#include "ash/test/ash_test_base.h" +#include "ash/test/ash_test_helper.h" #include "base/memory/scoped_refptr.h" -#include "base/test/task_environment.h" +#include "chromeos/services/bluetooth_config/fake_discovery_session_manager.h" +#include "chromeos/services/bluetooth_config/public/mojom/cros_bluetooth_config.mojom.h" #include "components/prefs/pref_registry.h" #include "components/prefs/pref_registry_simple.h" #include "components/prefs/testing_pref_service.h" #include "device/bluetooth/bluetooth_adapter.h" #include "device/bluetooth/bluetooth_adapter_factory.h" #include "device/bluetooth/test/mock_bluetooth_adapter.h" +#include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/abseil-cpp/absl/types/optional.h" namespace { +using testing::Return; + constexpr char kTestMetadataId[] = "test_metadata_id"; constexpr char kTestAddress[] = "test_address"; @@ -49,9 +59,10 @@ namespace ash { namespace quick_pair { -class MediatorTest : public testing::Test { +class MediatorTest : public AshTestBase { public: void SetUp() override { + AshTestBase::SetUp(); adapter_ = base::MakeRefCounted<testing::NiceMock<device::MockBluetoothAdapter>>(); ON_CALL(*adapter_, IsPresent()).WillByDefault(testing::Return(true)); @@ -94,6 +105,10 @@ .WillByDefault(testing::Return(&pref_service_)); pref_service_.registry()->RegisterBooleanPref(ash::prefs::kFastPairEnabled, /*default_value=*/true); + + FastPairHandshakeLookup::SetCreateFunctionForTesting(base::BindRepeating( + &MediatorTest::CreateHandshake, base::Unretained(this))); + mediator_ = std::make_unique<Mediator>( std::move(tracker), std::move(scanner_broker), std::move(retroactive_pairing_detector), @@ -103,9 +118,33 @@ device_ = base::MakeRefCounted<Device>(kTestMetadataId, kTestAddress, Protocol::kFastPairInitial); + base::RunLoop().RunUntilIdle(); + } + + void SetHasAtLeastOneDiscoverySessionChanged( + bool has_at_least_one_discovery_session) { + fake_discovery_session_manager()->SetIsDiscoverySessionActive( + /*has_at_least_one_discovery_session = */ + has_at_least_one_discovery_session); + base::RunLoop().RunUntilIdle(); + } + + std::unique_ptr<FastPairHandshake> CreateHandshake( + scoped_refptr<Device> device, + FastPairHandshake::OnCompleteCallback callback) { + auto fake = std::make_unique<FakeFastPairHandshake>( + adapter_, std::move(device), std::move(callback)); + return fake; } protected: + chromeos::bluetooth_config::FakeDiscoverySessionManager* + fake_discovery_session_manager() { + return ash_test_helper() + ->bluetooth_config_test_helper() + ->fake_discovery_session_manager(); + } + scoped_refptr<Device> device_; scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>> adapter_; FakeFeatureStatusTracker* feature_status_tracker_; @@ -117,7 +156,6 @@ std::unique_ptr<MockQuickPairBrowserDelegate> browser_delegate_; TestingPrefServiceSimple pref_service_; std::unique_ptr<Mediator> mediator_; - base::test::SingleThreadTaskEnvironment task_environment_; }; TEST_F(MediatorTest, TogglesScanningWhenFastPairEnabledChanges) { @@ -131,6 +169,20 @@ feature_status_tracker_->SetIsFastPairEnabled(false); } +TEST_F(MediatorTest, ToggleScanningWhenHasAtLeastOneDiscoverySession) { + // When one or more discovery sessions, are active, don't toggle + // scanning when fast pair enabled changes. + SetHasAtLeastOneDiscoverySessionChanged(true); + EXPECT_CALL(*mock_scanner_broker_, StopScanning); + feature_status_tracker_->SetIsFastPairEnabled(true); + EXPECT_CALL(*mock_scanner_broker_, StopScanning); + feature_status_tracker_->SetIsFastPairEnabled(false); + EXPECT_CALL(*mock_scanner_broker_, StopScanning); + feature_status_tracker_->SetIsFastPairEnabled(true); + EXPECT_CALL(*mock_scanner_broker_, StopScanning); + feature_status_tracker_->SetIsFastPairEnabled(false); +} + TEST_F(MediatorTest, InvokesShowDiscoveryWhenDeviceFound) { feature_status_tracker_->SetIsFastPairEnabled(true); EXPECT_CALL(*mock_ui_broker_, ShowDiscovery); @@ -467,5 +519,39 @@ EXPECT_EQ(delegate->GetDeviceImageInfo(kTestMetadataId), absl::nullopt); } +TEST_F(MediatorTest, HasAtLeastOneDiscoverySessionChanges) { + // Start with fast pair enabled and one handshake in progress. + feature_status_tracker_->SetIsFastPairEnabled(true); + FastPairHandshakeLookup::GetInstance()->Create(adapter_, device_, + base::DoNothing()); + EXPECT_TRUE(FastPairHandshakeLookup::GetInstance()->Get(device_)); + + // If a discovery session becomes active, stop scanning, clear existing + // handshakes, and dismiss notifications. + EXPECT_CALL(*mock_scanner_broker_, StopScanning); + EXPECT_CALL(*mock_ui_broker_, RemoveNotifications); + SetHasAtLeastOneDiscoverySessionChanged(true); + EXPECT_FALSE(FastPairHandshakeLookup::GetInstance()->Get(device_)); + + // If we now have 0 discovery sessions, resume scanning. + EXPECT_CALL(*mock_scanner_broker_, StartScanning); + SetHasAtLeastOneDiscoverySessionChanged(false); +} + +TEST_F(MediatorTest, HasAtLeastOneDiscoverySessionMidPair) { + // Start with fast pair enabled and one handshake in progress. + feature_status_tracker_->SetIsFastPairEnabled(true); + FastPairHandshakeLookup::GetInstance()->Create(adapter_, device_, + base::DoNothing()); + EXPECT_TRUE(FastPairHandshakeLookup::GetInstance()->Get(device_)); + + // If a discovery session becomes active while we are mid pair, stop + // scanning but do not clear existing handshakes. + EXPECT_CALL(*mock_scanner_broker_, StopScanning); + EXPECT_CALL(*mock_pairer_broker_, IsPairing).WillOnce(Return(true)); + SetHasAtLeastOneDiscoverySessionChanged(true); + EXPECT_TRUE(FastPairHandshakeLookup::GetInstance()->Get(device_)); +} + } // namespace quick_pair } // namespace ash
diff --git a/ash/quick_pair/pairing/mock_pairer_broker.h b/ash/quick_pair/pairing/mock_pairer_broker.h index 46996dc..c058e1b 100644 --- a/ash/quick_pair/pairing/mock_pairer_broker.h +++ b/ash/quick_pair/pairing/mock_pairer_broker.h
@@ -26,6 +26,7 @@ ~MockPairerBroker() override; MOCK_METHOD(void, PairDevice, (scoped_refptr<Device>), (override)); + MOCK_METHOD(bool, IsPairing, (), (override)); void AddObserver(Observer* observer) override; void RemoveObserver(Observer* observer) override;
diff --git a/ash/quick_pair/pairing/pairer_broker.h b/ash/quick_pair/pairing/pairer_broker.h index 76f62bf0..c84d11d0 100644 --- a/ash/quick_pair/pairing/pairer_broker.h +++ b/ash/quick_pair/pairing/pairer_broker.h
@@ -36,6 +36,7 @@ virtual void AddObserver(Observer* observer) = 0; virtual void RemoveObserver(Observer* observer) = 0; virtual void PairDevice(scoped_refptr<Device> device) = 0; + virtual bool IsPairing() = 0; }; } // namespace quick_pair
diff --git a/ash/quick_pair/pairing/pairer_broker_impl.cc b/ash/quick_pair/pairing/pairer_broker_impl.cc index 9533ac4..e27ff61 100644 --- a/ash/quick_pair/pairing/pairer_broker_impl.cc +++ b/ash/quick_pair/pairing/pairer_broker_impl.cc
@@ -63,6 +63,12 @@ } } +bool PairerBrokerImpl::IsPairing() { + // We are guaranteed to not be pairing when the following two maps are + // empty. + return !fast_pair_pairers_.empty() || !pair_failure_counts_.empty(); +} + void PairerBrokerImpl::PairFastPairDevice(scoped_refptr<Device> device) { if (base::Contains(fast_pair_pairers_, device->ble_address)) { QP_LOG(WARNING) << __func__ << ": Already pairing device" << device; @@ -130,13 +136,18 @@ for (auto& observer : observers_) { observer.OnAccountKeyWrite(device, failure); } + + FastPairHandshakeLookup::GetInstance()->Erase(device); + pair_failure_counts_.erase(device->ble_address); + fast_pair_pairers_.erase(device->ble_address); } void PairerBrokerImpl::OnFastPairProcedureComplete( scoped_refptr<Device> device) { QP_LOG(INFO) << __func__ << ": Device=" << device; - fast_pair_pairers_.erase(device->ble_address); FastPairHandshakeLookup::GetInstance()->Erase(device); + fast_pair_pairers_.erase(device->ble_address); + pair_failure_counts_.erase(device->ble_address); } } // namespace quick_pair
diff --git a/ash/quick_pair/pairing/pairer_broker_impl.h b/ash/quick_pair/pairing/pairer_broker_impl.h index 4455113e..60f43a8d 100644 --- a/ash/quick_pair/pairing/pairer_broker_impl.h +++ b/ash/quick_pair/pairing/pairer_broker_impl.h
@@ -43,6 +43,7 @@ void AddObserver(Observer* observer) override; void RemoveObserver(Observer* observer) override; void PairDevice(scoped_refptr<Device> device) override; + bool IsPairing() override; private: void PairFastPairDevice(scoped_refptr<Device> device);
diff --git a/ash/quick_pair/pairing/pairer_broker_impl_unittest.cc b/ash/quick_pair/pairing/pairer_broker_impl_unittest.cc index 1ad91fd..526b783 100644 --- a/ash/quick_pair/pairing/pairer_broker_impl_unittest.cc +++ b/ash/quick_pair/pairing/pairer_broker_impl_unittest.cc
@@ -59,6 +59,11 @@ std::move(paired_callback_).Run(device_); } + void TriggerPairingProcedureCompleteCallback() { + EXPECT_TRUE(pairing_procedure_complete_); + std::move(pairing_procedure_complete_).Run(device_); + } + void TriggerAccountKeyFailureCallback( ash::quick_pair::AccountKeyFailure failure) { EXPECT_TRUE(account_key_failure_callback_); @@ -179,12 +184,19 @@ Protocol::kFastPairInitial); pairer_broker_->PairDevice(device); base::RunLoop().RunUntilIdle(); + EXPECT_TRUE(pairer_broker_->IsPairing()); fast_pair_pairer_factory_->fake_fast_pair_pairer()->TriggerPairedCallback(); base::RunLoop().RunUntilIdle(); + EXPECT_TRUE(pairer_broker_->IsPairing()); EXPECT_EQ(device_paired_count_, 1); histogram_tester_.ExpectTotalCount(kFastPairRetryCountMetricName, 1); + + fast_pair_pairer_factory_->fake_fast_pair_pairer() + ->TriggerPairingProcedureCompleteCallback(); + base::RunLoop().RunUntilIdle(); + EXPECT_FALSE(pairer_broker_->IsPairing()); } TEST_F(PairerBrokerImplTest, PairDevice_Subsequent) { @@ -194,12 +206,19 @@ pairer_broker_->PairDevice(device); base::RunLoop().RunUntilIdle(); + EXPECT_TRUE(pairer_broker_->IsPairing()); fast_pair_pairer_factory_->fake_fast_pair_pairer()->TriggerPairedCallback(); base::RunLoop().RunUntilIdle(); + EXPECT_TRUE(pairer_broker_->IsPairing()); EXPECT_EQ(device_paired_count_, 1); histogram_tester_.ExpectTotalCount(kFastPairRetryCountMetricName, 1); + + fast_pair_pairer_factory_->fake_fast_pair_pairer() + ->TriggerPairingProcedureCompleteCallback(); + base::RunLoop().RunUntilIdle(); + EXPECT_FALSE(pairer_broker_->IsPairing()); } TEST_F(PairerBrokerImplTest, PairDevice_Retroactive) { @@ -209,12 +228,19 @@ pairer_broker_->PairDevice(device); base::RunLoop().RunUntilIdle(); + EXPECT_TRUE(pairer_broker_->IsPairing()); fast_pair_pairer_factory_->fake_fast_pair_pairer()->TriggerPairedCallback(); base::RunLoop().RunUntilIdle(); + EXPECT_TRUE(pairer_broker_->IsPairing()); EXPECT_EQ(device_paired_count_, 1); histogram_tester_.ExpectTotalCount(kFastPairRetryCountMetricName, 1); + + fast_pair_pairer_factory_->fake_fast_pair_pairer() + ->TriggerPairingProcedureCompleteCallback(); + base::RunLoop().RunUntilIdle(); + EXPECT_FALSE(pairer_broker_->IsPairing()); } TEST_F(PairerBrokerImplTest, AlreadyPairingDevice) { @@ -225,10 +251,12 @@ pairer_broker_->PairDevice(device); pairer_broker_->PairDevice(device); base::RunLoop().RunUntilIdle(); + EXPECT_TRUE(pairer_broker_->IsPairing()); fast_pair_pairer_factory_->fake_fast_pair_pairer()->TriggerPairedCallback(); base::RunLoop().RunUntilIdle(); + EXPECT_TRUE(pairer_broker_->IsPairing()); EXPECT_EQ(device_paired_count_, 1); histogram_tester_.ExpectTotalCount(kFastPairRetryCountMetricName, 1); } @@ -240,6 +268,8 @@ pairer_broker_->PairDevice(device); base::RunLoop().RunUntilIdle(); + EXPECT_TRUE(pairer_broker_->IsPairing()); + fast_pair_pairer_factory_->fake_fast_pair_pairer() ->TriggerPairFailureCallback( PairFailure::kPasskeyCharacteristicNotifySession); @@ -253,6 +283,7 @@ PairFailure::kPasskeyCharacteristicNotifySession); base::RunLoop().RunUntilIdle(); + EXPECT_FALSE(pairer_broker_->IsPairing()); EXPECT_EQ(pair_failure_count_, 1); histogram_tester_.ExpectTotalCount(kFastPairRetryCountMetricName, 0); } @@ -264,6 +295,7 @@ pairer_broker_->PairDevice(device); base::RunLoop().RunUntilIdle(); + EXPECT_TRUE(pairer_broker_->IsPairing()); fast_pair_pairer_factory_->fake_fast_pair_pairer() ->TriggerPairFailureCallback( PairFailure::kPasskeyCharacteristicNotifySession); @@ -277,6 +309,7 @@ PairFailure::kPasskeyCharacteristicNotifySession); base::RunLoop().RunUntilIdle(); + EXPECT_FALSE(pairer_broker_->IsPairing()); EXPECT_EQ(pair_failure_count_, 1); histogram_tester_.ExpectTotalCount(kFastPairRetryCountMetricName, 0); } @@ -288,6 +321,7 @@ pairer_broker_->PairDevice(device); base::RunLoop().RunUntilIdle(); + EXPECT_TRUE(pairer_broker_->IsPairing()); fast_pair_pairer_factory_->fake_fast_pair_pairer() ->TriggerPairFailureCallback( PairFailure::kPasskeyCharacteristicNotifySession); @@ -301,6 +335,7 @@ PairFailure::kPasskeyCharacteristicNotifySession); base::RunLoop().RunUntilIdle(); + EXPECT_FALSE(pairer_broker_->IsPairing()); EXPECT_EQ(pair_failure_count_, 1); histogram_tester_.ExpectTotalCount(kFastPairRetryCountMetricName, 0); } @@ -311,11 +346,13 @@ pairer_broker_->PairDevice(device); base::RunLoop().RunUntilIdle(); + EXPECT_TRUE(pairer_broker_->IsPairing()); fast_pair_pairer_factory_->fake_fast_pair_pairer() ->TriggerAccountKeyFailureCallback( AccountKeyFailure::kAccountKeyCharacteristicDiscovery); + EXPECT_FALSE(pairer_broker_->IsPairing()); EXPECT_EQ(account_key_write_count_, 1); } @@ -325,11 +362,13 @@ pairer_broker_->PairDevice(device); base::RunLoop().RunUntilIdle(); + EXPECT_TRUE(pairer_broker_->IsPairing()); fast_pair_pairer_factory_->fake_fast_pair_pairer() ->TriggerAccountKeyFailureCallback( AccountKeyFailure::kAccountKeyCharacteristicDiscovery); + EXPECT_FALSE(pairer_broker_->IsPairing()); EXPECT_EQ(account_key_write_count_, 1); } @@ -339,11 +378,13 @@ pairer_broker_->PairDevice(device); base::RunLoop().RunUntilIdle(); + EXPECT_TRUE(pairer_broker_->IsPairing()); fast_pair_pairer_factory_->fake_fast_pair_pairer() ->TriggerAccountKeyFailureCallback( AccountKeyFailure::kAccountKeyCharacteristicDiscovery); + EXPECT_FALSE(pairer_broker_->IsPairing()); EXPECT_EQ(account_key_write_count_, 1); }
diff --git a/ash/quick_pair/ui/fast_pair/fast_pair_presenter.h b/ash/quick_pair/ui/fast_pair/fast_pair_presenter.h index 5abeaaa9..dc60586c 100644 --- a/ash/quick_pair/ui/fast_pair/fast_pair_presenter.h +++ b/ash/quick_pair/ui/fast_pair/fast_pair_presenter.h
@@ -36,7 +36,7 @@ AssociateAccountCallback callback) = 0; virtual void ShowCompanionApp(scoped_refptr<Device> device, CompanionAppCallback callback) = 0; - virtual void RemoveNotifications(scoped_refptr<Device> device) = 0; + virtual void RemoveNotifications() = 0; virtual ~FastPairPresenter() = default; };
diff --git a/ash/quick_pair/ui/fast_pair/fast_pair_presenter_impl.cc b/ash/quick_pair/ui/fast_pair/fast_pair_presenter_impl.cc index e3a96c72..8dbea8b 100644 --- a/ash/quick_pair/ui/fast_pair/fast_pair_presenter_impl.cc +++ b/ash/quick_pair/ui/fast_pair/fast_pair_presenter_impl.cc
@@ -309,7 +309,7 @@ void FastPairPresenterImpl::ShowCompanionApp(scoped_refptr<Device> device, CompanionAppCallback callback) {} -void FastPairPresenterImpl::RemoveNotifications(scoped_refptr<Device> device) { +void FastPairPresenterImpl::RemoveNotifications() { notification_controller_->RemoveNotifications(); }
diff --git a/ash/quick_pair/ui/fast_pair/fast_pair_presenter_impl.h b/ash/quick_pair/ui/fast_pair/fast_pair_presenter_impl.h index 03cfc12..087e0e40 100644 --- a/ash/quick_pair/ui/fast_pair/fast_pair_presenter_impl.h +++ b/ash/quick_pair/ui/fast_pair/fast_pair_presenter_impl.h
@@ -61,7 +61,7 @@ AssociateAccountCallback callback) override; void ShowCompanionApp(scoped_refptr<Device> device, CompanionAppCallback callback) override; - void RemoveNotifications(scoped_refptr<Device> device) override; + void RemoveNotifications() override; private: FastPairPresenterImpl(const FastPairPresenterImpl&) = delete;
diff --git a/ash/quick_pair/ui/fast_pair/fast_pair_presenter_impl_unittest.cc b/ash/quick_pair/ui/fast_pair/fast_pair_presenter_impl_unittest.cc index 7efcd9b6..f4fb5532 100644 --- a/ash/quick_pair/ui/fast_pair/fast_pair_presenter_impl_unittest.cc +++ b/ash/quick_pair/ui/fast_pair/fast_pair_presenter_impl_unittest.cc
@@ -237,7 +237,7 @@ EXPECT_TRUE(test_message_center_.FindVisibleNotificationById( kFastPairDiscoveryUserNotificationId)); - fast_pair_presenter_->RemoveNotifications(device_); + fast_pair_presenter_->RemoveNotifications(); base::RunLoop().RunUntilIdle(); EXPECT_TRUE(test_message_center_.remove_notifications_for_notifier_id()); EXPECT_FALSE(test_message_center_.FindVisibleNotificationById(
diff --git a/ash/quick_pair/ui/mock_ui_broker.h b/ash/quick_pair/ui/mock_ui_broker.h index 1ab4c7d..306b4aeb 100644 --- a/ash/quick_pair/ui/mock_ui_broker.h +++ b/ash/quick_pair/ui/mock_ui_broker.h
@@ -27,7 +27,7 @@ MOCK_METHOD(void, ShowPairingFailed, (scoped_refptr<Device>), (override)); MOCK_METHOD(void, ShowAssociateAccount, (scoped_refptr<Device>), (override)); MOCK_METHOD(void, ShowCompanionApp, (scoped_refptr<Device>), (override)); - MOCK_METHOD(void, RemoveNotifications, (scoped_refptr<Device>), (override)); + MOCK_METHOD(void, RemoveNotifications, (), (override)); void AddObserver(Observer* observer) override; void RemoveObserver(Observer* observer) override;
diff --git a/ash/quick_pair/ui/ui_broker.h b/ash/quick_pair/ui/ui_broker.h index f471a6a3..d512b414 100644 --- a/ash/quick_pair/ui/ui_broker.h +++ b/ash/quick_pair/ui/ui_broker.h
@@ -39,7 +39,7 @@ virtual void ShowPairingFailed(scoped_refptr<Device> device) = 0; virtual void ShowAssociateAccount(scoped_refptr<Device> device) = 0; virtual void ShowCompanionApp(scoped_refptr<Device> device) = 0; - virtual void RemoveNotifications(scoped_refptr<Device> device) = 0; + virtual void RemoveNotifications() = 0; }; } // namespace quick_pair
diff --git a/ash/quick_pair/ui/ui_broker_impl.cc b/ash/quick_pair/ui/ui_broker_impl.cc index 14a79e828..3c61e45 100644 --- a/ash/quick_pair/ui/ui_broker_impl.cc +++ b/ash/quick_pair/ui/ui_broker_impl.cc
@@ -101,14 +101,8 @@ } } -void UIBrokerImpl::RemoveNotifications(scoped_refptr<Device> device) { - switch (device->protocol) { - case Protocol::kFastPairInitial: - case Protocol::kFastPairRetroactive: - case Protocol::kFastPairSubsequent: - fast_pair_presenter_->RemoveNotifications(std::move(device)); - break; - } +void UIBrokerImpl::RemoveNotifications() { + fast_pair_presenter_->RemoveNotifications(); } void UIBrokerImpl::NotifyDiscoveryAction(scoped_refptr<Device> device,
diff --git a/ash/quick_pair/ui/ui_broker_impl.h b/ash/quick_pair/ui/ui_broker_impl.h index e9364f75..bdbc71f 100644 --- a/ash/quick_pair/ui/ui_broker_impl.h +++ b/ash/quick_pair/ui/ui_broker_impl.h
@@ -33,7 +33,7 @@ void ShowPairingFailed(scoped_refptr<Device> device) override; void ShowAssociateAccount(scoped_refptr<Device> device) override; void ShowCompanionApp(scoped_refptr<Device> device) override; - void RemoveNotifications(scoped_refptr<Device> device) override; + void RemoveNotifications() override; private: void NotifyDiscoveryAction(scoped_refptr<Device> device,
diff --git a/ash/quick_pair/ui/ui_broker_impl_unittest.cc b/ash/quick_pair/ui/ui_broker_impl_unittest.cc index be9e7cb..4c2688d8 100644 --- a/ash/quick_pair/ui/ui_broker_impl_unittest.cc +++ b/ash/quick_pair/ui/ui_broker_impl_unittest.cc
@@ -58,10 +58,7 @@ callback.Run(ash::quick_pair::CompanionAppAction::kDownloadAndLaunchApp); } - void RemoveNotifications( - scoped_refptr<ash::quick_pair::Device> device) override { - removed_ = true; - } + void RemoveNotifications() override { removed_ = true; } bool removed() { return removed_; } @@ -258,7 +255,7 @@ TEST_F(UIBrokerImplTest, RemoveNotifications_Initial) { auto device = base::MakeRefCounted<Device>(kValidModelId, kTestDeviceAddress, Protocol::kFastPairInitial); - ui_broker_->RemoveNotifications(device); + ui_broker_->RemoveNotifications(); base::RunLoop().RunUntilIdle(); EXPECT_TRUE(presenter_factory_->fake_fast_pair_presenter()->removed()); @@ -267,7 +264,7 @@ TEST_F(UIBrokerImplTest, RemoveNotifications_Subsequent) { auto device = base::MakeRefCounted<Device>(kValidModelId, kTestDeviceAddress, Protocol::kFastPairSubsequent); - ui_broker_->RemoveNotifications(device); + ui_broker_->RemoveNotifications(); base::RunLoop().RunUntilIdle(); EXPECT_TRUE(presenter_factory_->fake_fast_pair_presenter()->removed()); @@ -276,7 +273,7 @@ TEST_F(UIBrokerImplTest, RemoveNotifications_Retroactive) { auto device = base::MakeRefCounted<Device>(kValidModelId, kTestDeviceAddress, Protocol::kFastPairRetroactive); - ui_broker_->RemoveNotifications(device); + ui_broker_->RemoveNotifications(); base::RunLoop().RunUntilIdle(); EXPECT_TRUE(presenter_factory_->fake_fast_pair_presenter()->removed());
diff --git a/ash/services/ime/ime_service.cc b/ash/services/ime/ime_service.cc index 1cdf8164..371f477c 100644 --- a/ash/services/ime/ime_service.cc +++ b/ash/services/ime/ime_service.cc
@@ -269,7 +269,7 @@ } } -const MojoSystemThunks32* ImeService::GetMojoSystemThunks() { +const MojoSystemThunks* ImeService::GetMojoSystemThunks() { return MojoEmbedderGetSystemThunks32(); }
diff --git a/ash/services/ime/ime_service.h b/ash/services/ime/ime_service.h index b8bb2b55..2ab7e4f 100644 --- a/ash/services/ime/ime_service.h +++ b/ash/services/ime/ime_service.h
@@ -108,7 +108,7 @@ void SimpleDownloadFinishedV2(SimpleDownloadCallbackV2 callback, const std::string& url_str, const base::FilePath& file); - const MojoSystemThunks32* GetMojoSystemThunks() override; + const MojoSystemThunks* GetMojoSystemThunks() override; mojo::Receiver<mojom::ImeService> receiver_; scoped_refptr<base::SequencedTaskRunner> main_task_runner_;
diff --git a/ash/services/ime/public/cpp/shared_lib/interfaces.h b/ash/services/ime/public/cpp/shared_lib/interfaces.h index 72b7028..723b06c3 100644 --- a/ash/services/ime/public/cpp/shared_lib/interfaces.h +++ b/ash/services/ime/public/cpp/shared_lib/interfaces.h
@@ -56,11 +56,11 @@ // // And it's important to keep any unnecessary information out of this header. -// Forward declare MojoSystemThunks32 to keep this file free of direct +// Forward declare MojoSystemThunks to keep this file free of direct // dependencies on Chromium, making it easier to use this file outside of the // Chromium repo. When using this file, consumers should also #include their own -// copy of the MojoSystemThunks32 struct definition. -struct MojoSystemThunks32; +// copy of the MojoSystemThunks struct definition. +struct MojoSystemThunks; namespace ash { namespace ime { @@ -131,9 +131,9 @@ // Returns a pointer to the Mojo system thunks. // The shared library can use this pointer for its own Mojo environment in // order to communicate directly with the browser process. - // MojoSystemThunks32 has a stable ABI, hence it is safe to use it from the + // MojoSystemThunks has a stable ABI, hence it is safe to use it from the // shared library - virtual const MojoSystemThunks32* GetMojoSystemThunks() = 0; + virtual const MojoSystemThunks* GetMojoSystemThunks() = 0; // Retrieves the string value of a CrOS feature's Finch param. Only a subset // of CrOS features are considered (see impl for details). |feature_name| is
diff --git a/ash/shelf/shelf_widget.cc b/ash/shelf/shelf_widget.cc index dbd1ec1f..7748591 100644 --- a/ash/shelf/shelf_widget.cc +++ b/ash/shelf/shelf_widget.cc
@@ -32,14 +32,18 @@ #include "ash/shelf/shelf_view.h" #include "ash/shell.h" #include "ash/style/ash_color_provider.h" +#include "ash/style/highlight_border.h" #include "ash/system/status_area_widget.h" #include "ash/wm/tablet_mode/tablet_mode_controller.h" #include "ash/wm/work_area_insets.h" #include "base/bind.h" #include "base/command_line.h" #include "ui/compositor/layer.h" +#include "ui/compositor/layer_delegate.h" #include "ui/compositor/layer_owner.h" +#include "ui/compositor/paint_recorder.h" #include "ui/compositor/scoped_layer_animation_settings.h" +#include "ui/gfx/canvas.h" #include "ui/gfx/skbitmap_operations.h" #include "ui/views/accessible_pane_view.h" #include "ui/views/focus/focus_search.h" @@ -54,7 +58,7 @@ constexpr int kShelfBlurRadius = 30; // The maximum size of the opaque layer during an "overshoot" (drag away from // the screen edge). -constexpr int kShelfMaxOvershootHeight = 40; +constexpr int kShelfMaxOvershootHeight = 60; constexpr int kDragHandleCornerRadius = 2; // Return the first or last focusable child of |root|. @@ -90,6 +94,62 @@ ui::Layer* const layer_; }; +class ShelfBackgroundLayerDelegate : public ui::LayerDelegate { + public: + explicit ShelfBackgroundLayerDelegate(ui::Layer* layer) : layer_(layer) {} + ShelfBackgroundLayerDelegate(const ShelfBackgroundLayerDelegate&) = delete; + ShelfBackgroundLayerDelegate& operator=(const ShelfBackgroundLayerDelegate&) = + delete; + ~ShelfBackgroundLayerDelegate() override {} + + void SetBackgroundColor(SkColor color) { + background_color_ = color; + layer_->SchedulePaint(layer_->bounds()); + } + void SetBorderType(HighlightBorder::Type type) { + highlight_border_type_ = type; + layer_->SchedulePaint(layer_->bounds()); + } + void SetLoginShelfView(LoginShelfView* view) { login_shelf_view_ = view; } + + private: + // views::LayerDelegate: + void OnPaintLayer(const ui::PaintContext& context) override { + ui::PaintRecorder recorder(context, layer_->size()); + gfx::Canvas* canvas = recorder.canvas(); + + // Refer to the upper left corner radius of the shelf background layer to + // draw the border. + const int corner_radius = layer_->rounded_corner_radii().upper_left(); + + // cc::PaintFlags flags for the background. + cc::PaintFlags flags; + flags.setColor(background_color_); + flags.setAntiAlias(true); + flags.setStyle(cc::PaintFlags::kFill_Style); + canvas->DrawRoundRect(gfx::Rect(layer_->size()), corner_radius, flags); + + // Don't draw highlight border in login screen. + if (login_shelf_view_ && login_shelf_view_->GetVisible()) + return; + + HighlightBorder::PaintBorderToCanvas(canvas, gfx::Rect(layer_->size()), + corner_radius, highlight_border_type_, + false); + } + + void OnDeviceScaleFactorChanged(float old_device_scale_factor, + float new_device_scale_factor) override { + layer_->SchedulePaint(layer_->bounds()); + } + + ui::Layer* const layer_; + LoginShelfView* login_shelf_view_ = nullptr; + SkColor background_color_; + HighlightBorder::Type highlight_border_type_ = + HighlightBorder::Type::kHighlightBorder1; +}; + } // namespace // The contents view of the Shelf. In an active session, this is used to @@ -120,6 +180,8 @@ LoginShelfView* AddLoginShelfView( std::unique_ptr<LoginShelfView> login_shelf_view) { login_shelf_view_ = AddChildView(std::move(login_shelf_view)); + if (background_delegate_) + background_delegate_->SetLoginShelfView(login_shelf_view_); return login_shelf_view_; } @@ -170,6 +232,9 @@ SkColor GetShelfBackgroundColor() const; ui::Layer* opaque_background() { return opaque_background_.layer(); } + ShelfBackgroundLayerDelegate* background_delegate() { + return background_delegate_.get(); + } ui::Layer* animating_background() { return &animating_background_; } ui::Layer* animating_drag_handle() { return &animating_drag_handle_; } DragHandle* drag_handle() { return drag_handle_; } @@ -190,6 +255,10 @@ // ShelfBackgroundAnimator. ui::LayerOwner opaque_background_; + // The layer delegate that helps drawing the highlight border on + // `opaque_background_`. + std::unique_ptr<ShelfBackgroundLayerDelegate> background_delegate_; + // A background layer used to animate hotseat transitions. ui::Layer animating_background_; @@ -210,10 +279,18 @@ ShelfWidget::DelegateView::DelegateView(ShelfWidget* shelf_widget, Shelf* shelf) : shelf_widget_(shelf_widget), - opaque_background_(std::make_unique<ui::Layer>(ui::LAYER_SOLID_COLOR)), + opaque_background_(std::make_unique<ui::Layer>( + features::IsDarkLightModeEnabled() ? ui::LAYER_TEXTURED + : ui::LAYER_SOLID_COLOR)), animating_background_(ui::LAYER_SOLID_COLOR), animating_drag_handle_(ui::LAYER_SOLID_COLOR) { - opaque_background_.layer()->SetName("shelf/Background"); + if (features::IsDarkLightModeEnabled()) { + background_delegate_ = + std::make_unique<ShelfBackgroundLayerDelegate>(opaque_background()); + opaque_background()->set_delegate(background_delegate_.get()); + opaque_background()->SetFillsBoundsOpaquely(false); + } + opaque_background()->SetName("shelf/Background"); animating_background_.SetName("shelf/Animation"); animating_background_.Add(&animating_drag_handle_); @@ -361,6 +438,8 @@ UpdateDragHandle(); UpdateBackgroundBlur(); + if (background_delegate_) + opaque_background()->SchedulePaint(opaque_background_bounds); SchedulePaint(); } @@ -425,7 +504,11 @@ } void ShelfWidget::DelegateView::UpdateShelfBackground(SkColor color) { - opaque_background()->SetColor(color); + if (background_delegate_) + background_delegate_->SetBackgroundColor(color); + else + opaque_background()->SetColor(color); + UpdateOpaqueBackground(); } @@ -743,6 +826,18 @@ if (!hotseat_transition_animator_) return; hotseat_transition_animator_->OnHotseatStateChanged(old_state, new_state); + + // Update the highlight border color on the shelf background. + if (!delegate_view_->background_delegate()) + return; + + if (new_state == HotseatState::kExtended) { + delegate_view_->background_delegate()->SetBorderType( + HighlightBorder::Type::kHighlightBorder2); + } else { + delegate_view_->background_delegate()->SetBorderType( + HighlightBorder::Type::kHighlightBorder1); + } } void ShelfWidget::OnBackgroundTypeChanged(ShelfBackgroundType background_type,
diff --git a/ash/shutdown_reason.cc b/ash/shutdown_reason.cc index ea92121..f8a6a2ac 100644 --- a/ash/shutdown_reason.cc +++ b/ash/shutdown_reason.cc
@@ -18,6 +18,8 @@ return "login shut down button"; case ShutdownReason::TRAY_SHUT_DOWN_BUTTON: return "tray shut down button"; + case ShutdownReason::ARC_POWER_BUTTON: + return "arc power button"; } NOTREACHED() << "Invalid reason " << static_cast<int>(reason); return "invalid";
diff --git a/ash/shutdown_reason.h b/ash/shutdown_reason.h index 62170a5..8a3042e 100644 --- a/ash/shutdown_reason.h +++ b/ash/shutdown_reason.h
@@ -11,6 +11,7 @@ POWER_BUTTON, // User pressed the (physical) power button. LOGIN_SHUT_DOWN_BUTTON, // User pressed the login screen shut down button. TRAY_SHUT_DOWN_BUTTON, // User pressed the tray shut down button. + ARC_POWER_BUTTON, // ARC power button is invoked. }; // Returns a string describing |reason|.
diff --git a/ash/style/highlight_border.cc b/ash/style/highlight_border.cc index 521e1a7..38960e5 100644 --- a/ash/style/highlight_border.cc +++ b/ash/style/highlight_border.cc
@@ -15,23 +15,19 @@ constexpr int kHighlightBorderThickness = 1; -HighlightBorder::HighlightBorder(int corner_radius, - Type type, - bool use_light_colors, - InsetsType insets_type) - : corner_radius_(corner_radius), - type_(type), - use_light_colors_(use_light_colors), - insets_type_(insets_type) {} - -void HighlightBorder::Paint(const views::View& view, gfx::Canvas* canvas) { +// static +void HighlightBorder::PaintBorderToCanvas(gfx::Canvas* canvas, + const gfx::Rect& bounds, + int corner_radius, + HighlightBorder::Type type, + bool use_light_colors) { AshColorProvider* color_provider = AshColorProvider::Get(); const AshColorProvider::ControlsLayerType highlight_color_type = - type_ == HighlightBorder::Type::kHighlightBorder1 + type == HighlightBorder::Type::kHighlightBorder1 ? AshColorProvider::ControlsLayerType::kHighlightColor1 : AshColorProvider::ControlsLayerType::kHighlightColor2; const AshColorProvider::ControlsLayerType border_color_type = - type_ == HighlightBorder::Type::kHighlightBorder1 + type == HighlightBorder::Type::kHighlightBorder1 ? AshColorProvider::ControlsLayerType::kBorderColor1 : AshColorProvider::ControlsLayerType::kBorderColor2; SkColor inner_color = @@ -39,7 +35,7 @@ SkColor outer_color = color_provider->GetControlsLayerColor(border_color_type); - if (use_light_colors_ && !features::IsDarkLightModeEnabled()) { + if (use_light_colors && !features::IsDarkLightModeEnabled()) { ScopedLightModeAsDefault scoped_light_mode_as_default; inner_color = color_provider->GetControlsLayerColor(highlight_color_type); outer_color = color_provider->GetControlsLayerColor(border_color_type); @@ -52,13 +48,12 @@ flags.setAntiAlias(true); const float half_thickness = kHighlightBorderThickness / 2.0f; - const gfx::Rect bounds = view.GetLocalBounds(); // Scale bounds and corner radius with device scale factor to make sure // border bounds match content bounds but keep border stroke width the same. const float dsf = canvas->UndoDeviceScaleFactor(); const gfx::RectF pixel_bounds = gfx::ConvertRectToPixels(bounds, dsf); - const float scaled_corner_radius = dsf * corner_radius_; + const float scaled_corner_radius = dsf * corner_radius; gfx::RectF outer_border_bounds(pixel_bounds); outer_border_bounds.Inset(half_thickness, half_thickness); @@ -71,6 +66,20 @@ canvas->DrawRoundRect(inner_border_bounds, scaled_corner_radius, flags); } +HighlightBorder::HighlightBorder(int corner_radius, + Type type, + bool use_light_colors, + InsetsType insets_type) + : corner_radius_(corner_radius), + type_(type), + use_light_colors_(use_light_colors), + insets_type_(insets_type) {} + +void HighlightBorder::Paint(const views::View& view, gfx::Canvas* canvas) { + PaintBorderToCanvas(canvas, view.GetLocalBounds(), corner_radius_, type_, + use_light_colors_); +} + gfx::Insets HighlightBorder::GetInsets() const { switch (insets_type_) { case InsetsType::kNoInsets:
diff --git a/ash/style/highlight_border.h b/ash/style/highlight_border.h index 456de7ff..3380ef4 100644 --- a/ash/style/highlight_border.h +++ b/ash/style/highlight_border.h
@@ -8,6 +8,10 @@ #include "ash/ash_export.h" #include "ui/views/border.h" +namespace gfx { +class Rect; +} // namespace gfx + namespace ash { // A rounded rectangle border that has inner (highlight) and outer color. @@ -39,6 +43,15 @@ kFullInsets, }; + // Paints the highlight border onto `canvas`. Note that directly using this + // function won't set the insets on any view so it acts like setting kNoInsets + // when using HighlightBorder class. + static void PaintBorderToCanvas(gfx::Canvas* canvas, + const gfx::Rect& bounds, + int corner_radius, + Type type, + bool use_light_colors); + HighlightBorder(int corner_radius, Type type, bool use_light_colors,
diff --git a/ash/system/eche/eche_icon_loading_indicator_view.cc b/ash/system/eche/eche_icon_loading_indicator_view.cc new file mode 100644 index 0000000..570480dd8 --- /dev/null +++ b/ash/system/eche/eche_icon_loading_indicator_view.cc
@@ -0,0 +1,82 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "ash/system/eche/eche_icon_loading_indicator_view.h" + +#include "ash/session/session_controller_impl.h" +#include "ash/shell.h" +#include "ash/system/tray/tray_utils.h" +#include "base/scoped_observation.h" +#include "base/time/default_tick_clock.h" +#include "base/time/time.h" +#include "ui/gfx/animation/animation_delegate.h" +#include "ui/gfx/animation/throb_animation.h" +#include "ui/gfx/canvas.h" +#include "ui/gfx/color_palette.h" +#include "ui/gfx/paint_throbber.h" +#include "ui/views/controls/image_view.h" +#include "ui/views/view.h" +#include "ui/views/view_observer.h" + +namespace ash { + +namespace { + +constexpr int kThrobberStrokeWidth = 2; + +} // namespace + +EcheIconLoadingIndicatorView::EcheIconLoadingIndicatorView( + views::ImageView* parent) + : parent_(parent) { + observed_session_.Observe(parent_); + + // Don't let the loading indicator process events. + SetCanProcessEventsWithinSubtree(false); +} + +EcheIconLoadingIndicatorView::~EcheIconLoadingIndicatorView() = default; + +void EcheIconLoadingIndicatorView::SetAnimating(bool animating) { + SetVisible(animating); + + if (animating && !throbber_start_time_.has_value()) { + throbber_start_time_ = base::TimeTicks::Now(); + animation_.StartThrobbing(-1); + } else { + throbber_start_time_.reset(); + animation_.Reset(); + } + OnPropertyChanged(&throbber_start_time_, views::kPropertyEffectsNone); +} + +bool EcheIconLoadingIndicatorView::GetAnimating() const { + return animation_.is_animating(); +} + +void EcheIconLoadingIndicatorView::OnPaint(gfx::Canvas* canvas) { + if (!throbber_start_time_) + return; + + const SkColor color = + TrayIconColor(Shell::Get()->session_controller()->GetSessionState()); + + gfx::PaintThrobberSpinning(canvas, GetLocalBounds(), color, + base::TimeTicks::Now() - *throbber_start_time_, + kThrobberStrokeWidth); +} + +void EcheIconLoadingIndicatorView::OnViewBoundsChanged( + views::View* observed_view) { + DCHECK_EQ(observed_view, parent_); + SetBoundsRect(observed_view->GetLocalBounds()); +} + +void EcheIconLoadingIndicatorView::AnimationProgressed( + const gfx::Animation* animation) { + DCHECK_EQ(animation, &animation_); + SchedulePaint(); +} + +} // namespace ash \ No newline at end of file
diff --git a/ash/system/eche/eche_icon_loading_indicator_view.h b/ash/system/eche/eche_icon_loading_indicator_view.h new file mode 100644 index 0000000..a5547a6 --- /dev/null +++ b/ash/system/eche/eche_icon_loading_indicator_view.h
@@ -0,0 +1,63 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef ASH_SYSTEM_ECHE_ECHE_ICON_LOADING_INDICATOR_VIEW_H_ +#define ASH_SYSTEM_ECHE_ECHE_ICON_LOADING_INDICATOR_VIEW_H_ + +#include "ash/ash_export.h" +#include "base/scoped_observation.h" +#include "base/time/time.h" +#include "ui/gfx/animation/animation_delegate.h" +#include "ui/gfx/animation/throb_animation.h" +#include "ui/views/view.h" +#include "ui/views/view_observer.h" + +namespace views { +class ImageView; +} // namespace views + +namespace gfx { +class Canvas; +class Animation; +} // namespace gfx + +namespace ash { + +// Draws a spinner around a given parent view. +class ASH_EXPORT EcheIconLoadingIndicatorView : public views::View, + public views::ViewObserver, + public gfx::AnimationDelegate { + public: + explicit EcheIconLoadingIndicatorView(views::ImageView* parent); + EcheIconLoadingIndicatorView(const EcheIconLoadingIndicatorView&) = delete; + EcheIconLoadingIndicatorView& operator=(const EcheIconLoadingIndicatorView&) = + delete; + ~EcheIconLoadingIndicatorView() override; + + void SetAnimating(bool animating); + bool GetAnimating() const; + + // views::View: + void OnPaint(gfx::Canvas* canvas) override; + + // views::ViewObserver: + void OnViewBoundsChanged(views::View* observed_view) override; + + // gfx::AnimationDelegate: + void AnimationProgressed(const gfx::Animation* animation) override; + + private: + absl::optional<base::TimeTicks> throbber_start_time_; + + views::ImageView* parent_ = nullptr; + + base::ScopedObservation<views::View, views::ViewObserver> observed_session_{ + this}; + + gfx::ThrobAnimation animation_{this}; +}; + +} // namespace ash + +#endif // ASH_SYSTEM_ECHE_ECHE_ICON_LOADING_INDICATOR_VIEW_H_
diff --git a/ash/system/eche/eche_icon_loading_indicator_view_unittest.cc b/ash/system/eche/eche_icon_loading_indicator_view_unittest.cc new file mode 100644 index 0000000..372c97d0 --- /dev/null +++ b/ash/system/eche/eche_icon_loading_indicator_view_unittest.cc
@@ -0,0 +1,73 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "ash/system/eche/eche_icon_loading_indicator_view.h" + +#include "ash/test/ash_test_base.h" +#include "ui/views/controls/image_view.h" + +namespace ash { + +class EcheIconLoadingIndicatorViewTest : public AshTestBase { + public: + EcheIconLoadingIndicatorViewTest() = default; + + EcheIconLoadingIndicatorViewTest(const EcheIconLoadingIndicatorViewTest&) = + delete; + EcheIconLoadingIndicatorViewTest& operator=( + const EcheIconLoadingIndicatorViewTest&) = delete; + + ~EcheIconLoadingIndicatorViewTest() override = default; + + // AshTestBase: + void SetUp() override { + AshTestBase::SetUp(); + icon_ = std::make_unique<views::ImageView>(); + eche_icon_loading_indicatior_view_ = + std::make_unique<EcheIconLoadingIndicatorView>(icon_.get()); + } + + void TearDown() override { + eche_icon_loading_indicatior_view_.reset(); + AshTestBase::TearDown(); + } + + protected: + EcheIconLoadingIndicatorView* eche_icon_loading_indicatior_view() { + return eche_icon_loading_indicatior_view_.get(); + } + + private: + std::unique_ptr<EcheIconLoadingIndicatorView> + eche_icon_loading_indicatior_view_; + std::unique_ptr<views::ImageView> icon_; +}; + +TEST_F(EcheIconLoadingIndicatorViewTest, SetAnimating) { + // The loading indicator default is visible and not animating. + EXPECT_TRUE(eche_icon_loading_indicatior_view()->GetVisible()); + EXPECT_FALSE(eche_icon_loading_indicatior_view()->GetAnimating()); + + eche_icon_loading_indicatior_view()->SetVisible(false); + EXPECT_FALSE(eche_icon_loading_indicatior_view()->GetVisible()); + + // The loading indicator should be invisible and not animating if we set + // animating to false. + eche_icon_loading_indicatior_view()->SetAnimating(false); + EXPECT_FALSE(eche_icon_loading_indicatior_view()->GetVisible()); + EXPECT_FALSE(eche_icon_loading_indicatior_view()->GetAnimating()); + + // The loading indicator shows up and animates if we set animating to true. + eche_icon_loading_indicatior_view()->SetAnimating(true); + EXPECT_TRUE(eche_icon_loading_indicatior_view()->GetVisible()); + EXPECT_TRUE(eche_icon_loading_indicatior_view()->GetAnimating()); + + // Again, the loading indicator is invisible and not animating if we set it + // back. + eche_icon_loading_indicatior_view()->SetAnimating(false); + EXPECT_FALSE(eche_icon_loading_indicatior_view()->GetVisible()); + EXPECT_FALSE(eche_icon_loading_indicatior_view()->GetAnimating()); +} + +} // namespace ash \ No newline at end of file
diff --git a/ash/system/eche/eche_tray.cc b/ash/system/eche/eche_tray.cc index 5582abc..6dede40 100644 --- a/ash/system/eche/eche_tray.cc +++ b/ash/system/eche/eche_tray.cc
@@ -7,6 +7,7 @@ #include <algorithm> #include "ash/accessibility/accessibility_controller_impl.h" +#include "ash/constants/ash_features.h" #include "ash/public/cpp/ash_web_view.h" #include "ash/public/cpp/ash_web_view_factory.h" #include "ash/session/session_controller_impl.h" @@ -14,6 +15,7 @@ #include "ash/shell.h" #include "ash/strings/grit/ash_strings.h" #include "ash/style/icon_button.h" +#include "ash/system/eche/eche_icon_loading_indicator_view.h" #include "ash/system/phonehub/ui_constants.h" #include "ash/system/tray/tray_bubble_wrapper.h" #include "ash/system/tray/tray_container.h" @@ -45,13 +47,11 @@ namespace { -// Padding for tray icon (dp; the button that shows the eche menu). -constexpr int kTrayIconMainAxisInset = 6; -constexpr int kTrayIconCrossAxisInset = 0; - constexpr int kIconColumnWidth = 16; -constexpr int kIconWidth = 22; -constexpr int kIconHeight = 22; + +// The icon size should be smaller than the tray item size to avoid the icon +// padding becoming negative. +constexpr int kIconSize = 22; constexpr gfx::Insets kBubblePadding(4, 4, kBubbleBottomPaddingDip, 4); @@ -65,8 +65,19 @@ icon_(tray_container()->AddChildView( std::make_unique<views::ImageView>())) { observed_session_.Observe(Shell::Get()->session_controller()); + + const int icon_padding = (kTrayItemSize - kIconSize) / 2; + + icon_->SetBorder( + views::CreateEmptyBorder(gfx::Insets(icon_padding, icon_padding))); + icon_->SetTooltipText(GetAccessibleNameForTray()); - tray_container()->SetMargin(kTrayIconMainAxisInset, kTrayIconCrossAxisInset); + + if (features::IsEcheSWAInBackgroundEnabled()) { + loading_indicator_ = icon_->AddChildView( + std::make_unique<EcheIconLoadingIndicatorView>(icon_)); + loading_indicator_->SetVisible(false); + } } EcheTray::~EcheTray() { @@ -116,6 +127,13 @@ bubble_->GetBubbleWidget()->Activate(); bubble_->bubble_view()->SetVisible(true); SetIsActive(true); + + // TODO(b/223297066): Observe the connection status and add/remove the + // loading indicator based on the connection status. + if (features::IsEcheSWAInBackgroundEnabled() && + loading_indicator_->GetAnimating()) { + loading_indicator_->SetAnimating(false); + } return; } @@ -168,10 +186,15 @@ void EcheTray::SetIcon(const gfx::Image& icon) { icon_->SetImage(gfx::ImageSkiaOperations::CreateResizedImage( icon.AsImageSkia(), skia::ImageOperations::RESIZE_BEST, - gfx::Size(kIconWidth, kIconHeight))); + gfx::Size(kIconSize, kIconSize))); } void EcheTray::PurgeAndClose() { + if (features::IsEcheSWAInBackgroundEnabled() && + loading_indicator_->GetAnimating()) { + loading_indicator_->SetAnimating(false); + } + if (!bubble_) return; @@ -227,6 +250,9 @@ SetIsActive(true); bubble_->GetBubbleView()->UpdateBubble(); + + if (features::IsEcheSWAInBackgroundEnabled()) + loading_indicator_->SetAnimating(true); } gfx::Size EcheTray::GetSizeForEche() const {
diff --git a/ash/system/eche/eche_tray.h b/ash/system/eche/eche_tray.h index 925db3fc..cbae3a0 100644 --- a/ash/system/eche/eche_tray.h +++ b/ash/system/eche/eche_tray.h
@@ -10,7 +10,9 @@ #include "ash/ash_export.h" #include "ash/public/cpp/session/session_observer.h" #include "ash/session/session_controller_impl.h" +#include "ash/system/eche/eche_icon_loading_indicator_view.h" #include "ash/system/tray/tray_background_view.h" +#include "base/gtest_prod_util.h" #include "components/session_manager/session_manager_types.h" #include "ui/views/controls/button/button.h" #include "url/gurl.h" @@ -93,6 +95,8 @@ TrayBubbleWrapper* get_bubble_wrapper_for_test() { return bubble_.get(); } private: + FRIEND_TEST_ALL_PREFIXES(EcheTrayTest, EcheTrayCreatesBubbleButHideFirst); + // Returns the size of the Exo bubble based on the screen size and // orientation. gfx::Size GetSizeForEche() const; @@ -127,6 +131,9 @@ std::unique_ptr<views::Button> CreateArrowBackButton( views::Button::PressedCallback callback); + // The loading indicator, showing a throbber animation on top of the icon. + EcheIconLoadingIndicatorView* loading_indicator_ = nullptr; + base::WeakPtrFactory<EcheTray> weak_factory_{this}; };
diff --git a/ash/system/eche/eche_tray_unittest.cc b/ash/system/eche/eche_tray_unittest.cc index 72fb867..102ede9 100644 --- a/ash/system/eche/eche_tray_unittest.cc +++ b/ash/system/eche/eche_tray_unittest.cc
@@ -29,8 +29,10 @@ // AshTestBase: void SetUp() override { feature_list_.InitWithFeatures( - {chromeos::features::kEcheSWA, chromeos::features::kEcheCustomWidget}, - {}); + /*enabled_features=*/{chromeos::features::kEcheSWA, + chromeos::features::kEcheCustomWidget, + chromeos::features::kEcheSWAInBackground}, + /*disabled_features=*/{}); DCHECK(test_web_view_factory_.get()); @@ -121,6 +123,7 @@ EXPECT_TRUE(eche_tray()->get_bubble_wrapper_for_test()); EXPECT_FALSE( eche_tray()->get_bubble_wrapper_for_test()->bubble_view()->GetVisible()); + EXPECT_TRUE(eche_tray()->loading_indicator_->GetAnimating()); // Request this bubble to show up. eche_tray()->ShowBubble(); @@ -130,6 +133,7 @@ EXPECT_TRUE(eche_tray()->get_bubble_wrapper_for_test()); EXPECT_TRUE( eche_tray()->get_bubble_wrapper_for_test()->bubble_view()->GetVisible()); + EXPECT_FALSE(eche_tray()->loading_indicator_->GetAnimating()); } } // namespace ash
diff --git a/ash/system/hps/hps_configuration.cc b/ash/system/hps/hps_configuration.cc index 6ff1967..62eecc7 100644 --- a/ash/system/hps/hps_configuration.cc +++ b/ash/system/hps/hps_configuration.cc
@@ -22,12 +22,10 @@ base::Seconds(4); // Default quick dim delay to configure power_manager. -constexpr base::TimeDelta kQuickDimDelayDefault = base::Seconds(45); +constexpr base::TimeDelta kQuickDimDelayDefault = base::Seconds(6); -// Default quick lock delay to configure power_manager. This default value is -// set to be zero which disables quick lock in order to be consistent with -// current behaviour. -constexpr base::TimeDelta kQuickLockDelayDefault; +// Default quick lock delay to configure power_manager. +constexpr base::TimeDelta kQuickLockDelayDefault = base::Seconds(126); // Default value determines whether send feedback to configure power_manager. constexpr int kShouldSendFeedbackIfUndimmed = false;
diff --git a/ash/system/media/media_notification_provider_impl_unittest.cc b/ash/system/media/media_notification_provider_impl_unittest.cc index 53c9d7e..77f20f6 100644 --- a/ash/system/media/media_notification_provider_impl_unittest.cc +++ b/ash/system/media/media_notification_provider_impl_unittest.cc
@@ -10,6 +10,7 @@ #include "base/unguessable_token.h" #include "components/global_media_controls/public/media_session_item_producer.h" #include "components/global_media_controls/public/views/media_item_ui_list_view.h" +#include "components/media_message_center/notification_theme.h" #include "services/media_session/public/cpp/media_session_service.h" #include "services/media_session/public/mojom/audio_focus.mojom.h" #include "services/media_session/public/mojom/media_session.mojom.h"
diff --git a/ash/system/media/media_tray.cc b/ash/system/media/media_tray.cc index cf27305..fe2a1916 100644 --- a/ash/system/media/media_tray.cc +++ b/ash/system/media/media_tray.cc
@@ -22,7 +22,7 @@ #include "base/bind.h" #include "base/metrics/histogram_functions.h" #include "base/strings/string_util.h" -#include "components/media_message_center/media_notification_view_impl.h" +#include "components/media_message_center/notification_theme.h" #include "components/prefs/pref_change_registrar.h" #include "components/prefs/pref_registry_simple.h" #include "components/prefs/pref_service.h"
diff --git a/ash/system/media/unified_media_controls_detailed_view_controller.cc b/ash/system/media/unified_media_controls_detailed_view_controller.cc index a94ce3f..2e926ee3 100644 --- a/ash/system/media/unified_media_controls_detailed_view_controller.cc +++ b/ash/system/media/unified_media_controls_detailed_view_controller.cc
@@ -11,7 +11,7 @@ #include "ash/system/tray/detailed_view_delegate.h" #include "ash/system/tray/tray_constants.h" #include "base/metrics/histogram_functions.h" -#include "components/media_message_center/media_notification_view_impl.h" +#include "components/media_message_center/notification_theme.h" #include "ui/base/l10n/l10n_util.h" namespace ash {
diff --git a/ash/system/network/active_network_icon.cc b/ash/system/network/active_network_icon.cc index 20b86ab..b849ad7 100644 --- a/ash/system/network/active_network_icon.cc +++ b/ash/system/network/active_network_icon.cc
@@ -301,6 +301,14 @@ return; } + // If cellular is not scanning and cellular device is enabled reset cellular + // initializing state. + if (cellular && !cellular->scanning && + (cellular->device_state == DeviceStateType::kEnabled || + cellular->device_state == DeviceStateType::kEnabling)) { + cellular_uninitialized_msg_ = 0; + } + // There can be a delay between leaving the Initializing state and when // a Cellular device shows up, so keep showing the initializing // animation for a bit to avoid flashing the disconnect icon. @@ -316,6 +324,10 @@ SetCellularUninitializedMsg(); } +void ActiveNetworkIcon::DeviceStateListChanged() { + SetCellularUninitializedMsg(); +} + void ActiveNetworkIcon::NetworkListChanged() { if (purge_timer_.IsRunning()) return;
diff --git a/ash/system/network/active_network_icon.h b/ash/system/network/active_network_icon.h index 545429f..58a2343 100644 --- a/ash/system/network/active_network_icon.h +++ b/ash/system/network/active_network_icon.h
@@ -90,6 +90,7 @@ // TrayNetworkStateObserver void ActiveNetworkStateChanged() override; void NetworkListChanged() override; + void DeviceStateListChanged() override; const chromeos::network_config::mojom::NetworkStateProperties* GetNetworkForType(Type type);
diff --git a/ash/system/network/active_network_icon_unittest.cc b/ash/system/network/active_network_icon_unittest.cc index c8f9276..9cbd0e1 100644 --- a/ash/system/network/active_network_icon_unittest.cc +++ b/ash/system/network/active_network_icon_unittest.cc
@@ -273,6 +273,18 @@ AreImagesEqual(image, ImageForNetwork(NetworkType::kCellular, ConnectionStateType::kConnecting))); EXPECT_TRUE(animating); + + // Set scanning property to false, expect no network connections icon. + network_state_helper().device_test()->SetDeviceProperty( + kShillManagerClientStubCellularDevice, shill::kScanningProperty, + base::Value(false), true /* notify_changed */); + base::RunLoop().RunUntilIdle(); + + image = active_network_icon()->GetImage(ActiveNetworkIcon::Type::kSingle, + icon_type(), &animating); + EXPECT_TRUE(AreImagesEqual( + image, network_icon::GetImageForWiFiNoConnections(icon_type()))); + EXPECT_FALSE(animating); } TEST_F(ActiveNetworkIconTest, CellularDisable) {
diff --git a/ash/system/power/power_button_controller.cc b/ash/system/power/power_button_controller.cc index ca87233e..7a06485 100644 --- a/ash/system/power/power_button_controller.cc +++ b/ash/system/power/power_button_controller.cc
@@ -14,7 +14,6 @@ #include "ash/public/cpp/shell_window_ids.h" #include "ash/session/session_controller_impl.h" #include "ash/shell.h" -#include "ash/shutdown_reason.h" #include "ash/system/power/power_button_display_controller.h" #include "ash/system/power/power_button_menu_item_view.h" #include "ash/system/power/power_button_menu_metrics_type.h" @@ -168,7 +167,7 @@ // button press. On a further press while the menu is open, simply shut down // (http://crbug.com/945005). if (!show_menu_animation_done_) - StartPowerMenuAnimation(/*allow_pre_shutdown=*/true); + StartPowerMenuAnimation(ShutdownReason::POWER_BUTTON); else lock_state_controller_->RequestShutdown(ShutdownReason::POWER_BUTTON); } @@ -210,7 +209,7 @@ } if (!UseTabletBehavior()) { - StartPowerMenuAnimation(/*allow_pre_shutdown=*/true); + StartPowerMenuAnimation(ShutdownReason::POWER_BUTTON); } else { base::TimeDelta timeout = screen_off_when_power_button_down_ ? kShowMenuWhenScreenOffTimeout @@ -219,7 +218,7 @@ power_button_menu_timer_.Start( FROM_HERE, timeout, base::BindOnce(&PowerButtonController::StartPowerMenuAnimation, - base::Unretained(this), true)); + base::Unretained(this), ShutdownReason::POWER_BUTTON)); } } else { uint32_t up_state = UP_NONE; @@ -319,7 +318,7 @@ } void PowerButtonController::OnArcPowerButtonMenuEvent() { - StartPowerMenuAnimation(/*allow_pre_shutdown=*/false); + StartPowerMenuAnimation(ShutdownReason::ARC_POWER_BUTTON); } void PowerButtonController::CancelPowerButtonEvent() { @@ -448,7 +447,9 @@ DismissMenu(); } -void PowerButtonController::StartPowerMenuAnimation(bool allow_pre_shutdown) { +void PowerButtonController::StartPowerMenuAnimation(ShutdownReason reason) { + shutdown_reason_ = reason; + // Avoid a distracting deactivation animation on the formerly-active // window when the menu is activated. views::Widget* active_toplevel_widget = @@ -460,15 +461,11 @@ if (!menu_widget_) { menu_widget_ = CreateMenuWidget(); - base::RepeatingClosure show_animation_done_callback = base::BindRepeating( - allow_pre_shutdown - ? &PowerButtonController::SetShowMenuAnimationDoneWithPreShutdown - : &PowerButtonController::SetShowMenuAnimationDone, - base::Unretained(this)); - menu_widget_->SetContentsView(std::make_unique<PowerButtonMenuScreenView>( - power_button_position_, power_button_offset_percentage_, - show_animation_done_callback)); + shutdown_reason_, power_button_position_, + power_button_offset_percentage_, + base::BindRepeating(&PowerButtonController::SetShowMenuAnimationDone, + base::Unretained(this)))); } auto* contents_view = static_cast<PowerButtonMenuScreenView*>(menu_widget_->GetContentsView()); @@ -512,18 +509,15 @@ } } -void PowerButtonController::SetShowMenuAnimationDoneWithPreShutdown() { +void PowerButtonController::SetShowMenuAnimationDone() { show_menu_animation_done_ = true; - if (button_type_ != ButtonType::LEGACY) { + if (button_type_ != ButtonType::LEGACY && + shutdown_reason_ == ShutdownReason::POWER_BUTTON) { pre_shutdown_timer_.Start(FROM_HERE, kStartShutdownAnimationTimeout, this, &PowerButtonController::OnPreShutdownTimeout); } } -void PowerButtonController::SetShowMenuAnimationDone() { - show_menu_animation_done_ = true; -} - void PowerButtonController::ParsePowerButtonPositionSwitch() { const base::CommandLine* cl = base::CommandLine::ForCurrentProcess(); if (!cl->HasSwitch(switches::kAshPowerButtonPosition))
diff --git a/ash/system/power/power_button_controller.h b/ash/system/power/power_button_controller.h index e54c11e3..a5f37b7 100644 --- a/ash/system/power/power_button_controller.h +++ b/ash/system/power/power_button_controller.h
@@ -12,6 +12,7 @@ #include "ash/public/cpp/session/session_observer.h" #include "ash/public/cpp/system/power/power_button_controller_base.h" #include "ash/public/cpp/tablet_mode_observer.h" +#include "ash/shutdown_reason.h" #include "ash/system/power/backlights_forced_off_setter.h" #include "ash/wm/lock_state_observer.h" #include "base/memory/weak_ptr.h" @@ -170,10 +171,9 @@ void StopTimersAndDismissMenu(); // Starts the power menu animation. Called when a clamshell device's power - // button is pressed or when |power_button_menu_timer_| fires. - // |allow_pre_shutdown| determines whether PreShutdown action should be - // started when animation finished. - void StartPowerMenuAnimation(bool allow_pre_shutdown); + // button is pressed, or when |power_button_menu_timer_| fires, or by arc + // power button to show the PowerButtonMenu. + void StartPowerMenuAnimation(ShutdownReason reason); // Called by |pre_shutdown_timer_| to start the cancellable pre-shutdown // animation. @@ -191,9 +191,6 @@ // set and locking is possible. void LockScreenIfRequired(); - // Sets |show_menu_animation_done_| to true and starts pre-shutdown process. - void SetShowMenuAnimationDoneWithPreShutdown(); - // Sets |show_menu_animation_done_| to true. void SetShowMenuAnimationDone(); @@ -210,7 +207,12 @@ bool power_button_down_ = false; bool lock_button_down_ = false; - // True if the device is curently in tablet mode (per TabletModeController). + // Passed in StartPowerMenuAnimation(ShutdownReason reason). When it is not + // POWER_BUTTON such as when called from arc, we do not start + // |pre_shutdown_timer_|. + ShutdownReason shutdown_reason_ = ShutdownReason::POWER_BUTTON; + + // True if the device is currently in tablet mode (per TabletModeController). bool in_tablet_mode_ = false; // Has the screen brightness been reduced to 0%?
diff --git a/ash/system/power/power_button_menu_screen_view.cc b/ash/system/power/power_button_menu_screen_view.cc index ca05aea..085c9a6 100644 --- a/ash/system/power/power_button_menu_screen_view.cc +++ b/ash/system/power/power_button_menu_screen_view.cc
@@ -118,6 +118,7 @@ }; PowerButtonMenuScreenView::PowerButtonMenuScreenView( + ShutdownReason shutdown_reason, PowerButtonPosition power_button_position, double power_button_offset_percentage, base::RepeatingClosure show_animation_done) @@ -126,7 +127,8 @@ power_button_screen_background_shield_ = new PowerButtonMenuBackgroundView(show_animation_done); AddChildView(power_button_screen_background_shield_); - power_button_menu_view_ = new PowerButtonMenuView(power_button_position_); + power_button_menu_view_ = + new PowerButtonMenuView(shutdown_reason, power_button_position_); AddChildView(power_button_menu_view_); AddAccelerator(ui::Accelerator(ui::VKEY_ESCAPE, ui::EF_NONE));
diff --git a/ash/system/power/power_button_menu_screen_view.h b/ash/system/power/power_button_menu_screen_view.h index f9cc5a2..a5921850 100644 --- a/ash/system/power/power_button_menu_screen_view.h +++ b/ash/system/power/power_button_menu_screen_view.h
@@ -14,6 +14,7 @@ #include "ui/views/view.h" namespace ash { +enum class ShutdownReason; class PowerButtonMenuView; // PowerButtonMenuScreenView is the top-level view of power button menu UI. It @@ -25,6 +26,7 @@ // |show_animation_done| is a callback for when the animation that shows the // power menu has finished. PowerButtonMenuScreenView( + ShutdownReason shutdown_reason, PowerButtonController::PowerButtonPosition power_button_position, double power_button_offset, base::RepeatingClosure show_animation_done);
diff --git a/ash/system/power/power_button_menu_view.cc b/ash/system/power/power_button_menu_view.cc index 7f34c99..cec3d30 100644 --- a/ash/system/power/power_button_menu_view.cc +++ b/ash/system/power/power_button_menu_view.cc
@@ -79,8 +79,10 @@ constexpr base::TimeDelta PowerButtonMenuView::kMenuAnimationDuration; PowerButtonMenuView::PowerButtonMenuView( + ShutdownReason shutdown_reason, PowerButtonPosition power_button_position) - : power_button_position_(power_button_position) { + : shutdown_reason_(shutdown_reason), + power_button_position_(power_button_position) { SetFocusBehavior(FocusBehavior::ALWAYS); SetPaintToLayer(); layer()->SetFillsBoundsOpaquely(false); @@ -212,7 +214,7 @@ base::BindRepeating( &LockStateController::StartShutdownAnimation, base::Unretained(Shell::Get()->lock_state_controller()), - ShutdownReason::POWER_BUTTON), + shutdown_reason_), kSystemPowerButtonMenuPowerOffIcon, l10n_util::GetStringUTF16(IDS_ASH_POWER_BUTTON_MENU_POWER_OFF_BUTTON), &power_off_item_);
diff --git a/ash/system/power/power_button_menu_view.h b/ash/system/power/power_button_menu_view.h index f5e93f1f..830f509 100644 --- a/ash/system/power/power_button_menu_view.h +++ b/ash/system/power/power_button_menu_view.h
@@ -6,6 +6,7 @@ #define ASH_SYSTEM_POWER_POWER_BUTTON_MENU_VIEW_H_ #include "ash/ash_export.h" +#include "ash/shutdown_reason.h" #include "ash/system/power/power_button_controller.h" #include "ui/compositor/layer_animation_observer.h" #include "ui/views/view.h" @@ -37,7 +38,8 @@ int distance; }; - explicit PowerButtonMenuView( + PowerButtonMenuView( + ShutdownReason shutdown_reason, PowerButtonController::PowerButtonPosition power_button_position); PowerButtonMenuView(const PowerButtonMenuView&) = delete; PowerButtonMenuView& operator=(const PowerButtonMenuView&) = delete; @@ -91,6 +93,7 @@ PowerButtonMenuItemView* capture_mode_item_ = nullptr; PowerButtonMenuItemView* feedback_item_ = nullptr; + ShutdownReason shutdown_reason_; // The physical display side of power button in landscape primary. PowerButtonController::PowerButtonPosition power_button_position_;
diff --git a/ash/webui/common/BUILD.gn b/ash/webui/common/BUILD.gn index eb28305..2dd02ba5 100644 --- a/ash/webui/common/BUILD.gn +++ b/ash/webui/common/BUILD.gn
@@ -9,6 +9,19 @@ static_library("common") { } +static_library("keyboard_diagram_strings") { + sources = [ + "keyboard_diagram_strings.cc", + "keyboard_diagram_strings.h", + ] + + deps = [ + "//chromeos/strings/", + "//content/public/browser", + "//ui/base", + ] +} + group("closure_compile") { deps = [ "resources:closure_compile_module" ] }
diff --git a/ash/webui/common/keyboard_diagram_strings.cc b/ash/webui/common/keyboard_diagram_strings.cc new file mode 100644 index 0000000..dfbd51a --- /dev/null +++ b/ash/webui/common/keyboard_diagram_strings.cc
@@ -0,0 +1,89 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "ash/webui/common/keyboard_diagram_strings.h" + +#include "chromeos/strings/grit/chromeos_strings.h" +#include "content/public/browser/web_ui_data_source.h" +#include "ui/base/webui/web_ui_util.h" + +namespace ash { + +namespace common { + +void AddKeyboardDiagramStrings(content::WebUIDataSource* html_source) { + static constexpr webui::LocalizedString kLocalizedStrings[] = { + {"keyboardDiagramAriaLabelNotPressed", + IDS_KEYBOARD_DIAGRAM_ARIA_LABEL_NOT_PRESSED}, + {"keyboardDiagramAriaLabelPressed", + IDS_KEYBOARD_DIAGRAM_ARIA_LABEL_PRESSED}, + {"keyboardDiagramAriaLabelTested", + IDS_KEYBOARD_DIAGRAM_ARIA_LABEL_TESTED}, + {"keyboardDiagramAriaNameArrowDown", + IDS_KEYBOARD_DIAGRAM_ARIA_NAME_ARROW_DOWN}, + {"keyboardDiagramAriaNameArrowLeft", + IDS_KEYBOARD_DIAGRAM_ARIA_NAME_ARROW_LEFT}, + {"keyboardDiagramAriaNameArrowRight", + IDS_KEYBOARD_DIAGRAM_ARIA_NAME_ARROW_RIGHT}, + {"keyboardDiagramAriaNameArrowUp", + IDS_KEYBOARD_DIAGRAM_ARIA_NAME_ARROW_UP}, + {"keyboardDiagramAriaNameAssistant", + IDS_KEYBOARD_DIAGRAM_ARIA_NAME_ASSISTANT}, + {"keyboardDiagramAriaNameBack", IDS_KEYBOARD_DIAGRAM_ARIA_NAME_BACK}, + {"keyboardDiagramAriaNameBackspace", + IDS_KEYBOARD_DIAGRAM_ARIA_NAME_BACKSPACE}, + {"keyboardDiagramAriaNameEnter", IDS_KEYBOARD_DIAGRAM_ARIA_NAME_ENTER}, + {"keyboardDiagramAriaNameForward", + IDS_KEYBOARD_DIAGRAM_ARIA_NAME_FORWARD}, + {"keyboardDiagramAriaNameFullscreen", + IDS_KEYBOARD_DIAGRAM_ARIA_NAME_FULLSCREEN}, + {"keyboardDiagramAriaNameJisLetterSwitch", + IDS_KEYBOARD_DIAGRAM_ARIA_NAME_JIS_LETTER_SWITCH}, + {"keyboardDiagramAriaNameKeyboardBacklightDown", + IDS_KEYBOARD_DIAGRAM_ARIA_NAME_KEYBOARD_BACKLIGHT_DOWN}, + {"keyboardDiagramAriaNameKeyboardBacklightUp", + IDS_KEYBOARD_DIAGRAM_ARIA_NAME_KEYBOARD_BACKLIGHT_UP}, + {"keyboardDiagramAriaNameLauncher", + IDS_KEYBOARD_DIAGRAM_ARIA_NAME_LAUNCHER}, + {"keyboardDiagramAriaNameLayoutSwitch", + IDS_KEYBOARD_DIAGRAM_ARIA_NAME_LAYOUT_SWITCH}, + {"keyboardDiagramAriaNameMute", IDS_KEYBOARD_DIAGRAM_ARIA_NAME_MUTE}, + {"keyboardDiagramAriaNameOverview", + IDS_KEYBOARD_DIAGRAM_ARIA_NAME_OVERVIEW}, + {"keyboardDiagramAriaNamePlayPause", + IDS_KEYBOARD_DIAGRAM_ARIA_NAME_PLAY_PAUSE}, + {"keyboardDiagramAriaNamePower", IDS_KEYBOARD_DIAGRAM_ARIA_NAME_POWER}, + {"keyboardDiagramAriaNamePrivacyScreenToggle", + IDS_KEYBOARD_DIAGRAM_ARIA_NAME_PRIVACY_SCREEN_TOGGLE}, + {"keyboardDiagramAriaNameRefresh", + IDS_KEYBOARD_DIAGRAM_ARIA_NAME_REFRESH}, + {"keyboardDiagramAriaNameScreenBrightnessDown", + IDS_KEYBOARD_DIAGRAM_ARIA_NAME_SCREEN_BRIGHTNESS_DOWN}, + {"keyboardDiagramAriaNameScreenBrightnessUp", + IDS_KEYBOARD_DIAGRAM_ARIA_NAME_SCREEN_BRIGHTNESS_UP}, + {"keyboardDiagramAriaNameScreenMirror", + IDS_KEYBOARD_DIAGRAM_ARIA_NAME_SCREEN_MIRROR}, + {"keyboardDiagramAriaNameScreenshot", + IDS_KEYBOARD_DIAGRAM_ARIA_NAME_SCREENSHOT}, + {"keyboardDiagramAriaNameShiftLeft", + IDS_KEYBOARD_DIAGRAM_ARIA_NAME_SHIFT_LEFT}, + {"keyboardDiagramAriaNameShiftRight", + IDS_KEYBOARD_DIAGRAM_ARIA_NAME_SHIFT_RIGHT}, + {"keyboardDiagramAriaNameTab", IDS_KEYBOARD_DIAGRAM_ARIA_NAME_TAB}, + {"keyboardDiagramAriaNameTrackNext", + IDS_KEYBOARD_DIAGRAM_ARIA_NAME_TRACK_NEXT}, + {"keyboardDiagramAriaNameTrackPrevious", + IDS_KEYBOARD_DIAGRAM_ARIA_NAME_TRACK_PREVIOUS}, + {"keyboardDiagramAriaNameVolumeDown", + IDS_KEYBOARD_DIAGRAM_ARIA_NAME_VOLUME_DOWN}, + {"keyboardDiagramAriaNameVolumeUp", + IDS_KEYBOARD_DIAGRAM_ARIA_NAME_VOLUME_UP}, + }; + html_source->AddLocalizedStrings(kLocalizedStrings); + html_source->UseStringsJs(); +} + +} // namespace common + +} // namespace ash
diff --git a/ash/webui/common/keyboard_diagram_strings.h b/ash/webui/common/keyboard_diagram_strings.h new file mode 100644 index 0000000..7a8569a --- /dev/null +++ b/ash/webui/common/keyboard_diagram_strings.h
@@ -0,0 +1,22 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef ASH_WEBUI_COMMON_KEYBOARD_DIAGRAM_STRINGS_H_ +#define ASH_WEBUI_COMMON_KEYBOARD_DIAGRAM_STRINGS_H_ + +namespace content { +class WebUIDataSource; +} + +namespace ash { + +namespace common { + +void AddKeyboardDiagramStrings(content::WebUIDataSource* html_source); + +} // namespace common + +} // namespace ash + +#endif // ASH_WEBUI_COMMON_KEYBOARD_DIAGRAM_STRINGS_H_
diff --git a/ash/webui/common/resources/BUILD.gn b/ash/webui/common/resources/BUILD.gn index 72748dd..563da69 100644 --- a/ash/webui/common/resources/BUILD.gn +++ b/ash/webui/common/resources/BUILD.gn
@@ -70,6 +70,7 @@ ":keyboard_key", ":keyboard_layouts", "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", + "//ui/webui/resources/js:i18n_behavior.m", ] } @@ -83,6 +84,7 @@ deps = [ ":keyboard_icons", "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", + "//ui/webui/resources/js:i18n_behavior.m", ] }
diff --git a/ash/webui/common/resources/keyboard_diagram.html b/ash/webui/common/resources/keyboard_diagram.html index 56acc8d..9523860 100644 --- a/ash/webui/common/resources/keyboard_diagram.html +++ b/ash/webui/common/resources/keyboard_diagram.html
@@ -239,10 +239,17 @@ <keyboard-key main-glyph="esc" data-code="1"></keyboard-key> <dom-repeat items="[[topRowKeys]]" as="key"> <template> - <keyboard-key icon="[[key.icon]]" main-glyph="[[key.text]]"></keyboard-key> + <keyboard-key + icon="[[key.icon]]" + main-glyph="[[key.text]]" + aria-name="[[optionalI18n_(key.ariaNameI18n)]]"> + </keyboard-key> </template> </dom-repeat> - <keyboard-key icon="keyboard:power"></keyboard-key> + <keyboard-key + icon="keyboard:power" + aria-name="[[i18n('keyboardDiagramAriaNamePower')]]"> + </keyboard-key> </div> <keyboard-key data-code="41"></keyboard-key> @@ -261,9 +268,21 @@ <template is="dom-if" if="[[isEqual_(mechanicalLayout, 'jis')]]"> <keyboard-key id="jisYenKey" data-code="124"></keyboard-key> </template> - <keyboard-key id="backspaceKey" class="right" icon="keyboard:backspace" data-code="14"></keyboard-key> + <keyboard-key + id="backspaceKey" + class="right" + icon="keyboard:backspace" + data-code="14" + aria-name="[[i18n('keyboardDiagramAriaNameBackspace')]]"> + </keyboard-key> - <keyboard-key id="tabKey" class="left" icon="keyboard:tab" data-code="15"></keyboard-key> + <keyboard-key + id="tabKey" + class="left" + icon="keyboard:tab" + data-code="15" + aria-name="[[i18n('keyboardDiagramAriaNameTab')]]"> + </keyboard-key> <keyboard-key data-code="16"></keyboard-key> <keyboard-key data-code="17"></keyboard-key> <keyboard-key data-code="18"></keyboard-key> @@ -278,7 +297,13 @@ <keyboard-key data-code="27"></keyboard-key> <keyboard-key id="backslashKey" data-code="43"></keyboard-key> - <keyboard-key id="launcherKey" class="left" icon="keyboard:launcher" data-code="125"></keyboard-key> + <keyboard-key + id="launcherKey" + class="left" + icon="keyboard:launcher" + data-code="125" + aria-name="[[i18n('keyboardDiagramAriaNameLauncher')]]"> + </keyboard-key> <keyboard-key data-code="30"></keyboard-key> <keyboard-key data-code="31"></keyboard-key> <keyboard-key data-code="32"></keyboard-key> @@ -290,10 +315,22 @@ <keyboard-key data-code="38"></keyboard-key> <keyboard-key data-code="39"></keyboard-key> <keyboard-key data-code="40"></keyboard-key> - <keyboard-key id="enterKey" class="right" icon="keyboard:return" data-code="28"></keyboard-key> - <keyboard-key id="enterKeyLowerPart" data-code="28"></keyboard-key> + <keyboard-key + id="enterKey" + class="right" + icon="keyboard:return" + data-code="28" + aria-name="[[i18n('keyboardDiagramAriaNameEnter')]]"> + </keyboard-key> + <keyboard-key id="enterKeyLowerPart" data-code="28" aria-hidden="true"></keyboard-key> - <keyboard-key id="leftShiftKey" class="left" icon="keyboard:shift" data-code="42"></keyboard-key> + <keyboard-key + id="leftShiftKey" + class="left" + icon="keyboard:shift" + data-code="42" + aria-name="[[i18n('keyboardDiagramAriaNameShiftLeft')]]"> + </keyboard-key> <template is="dom-if" if="[[isEqual_(mechanicalLayout, 'iso')]]"> <keyboard-key id="isoKey" bottom-left-glyph="<" top-left-glyph=">" data-code="86"></keyboard-key> </template> @@ -310,15 +347,30 @@ <template is="dom-if" if="[[isEqual_(mechanicalLayout, 'jis')]]"> <keyboard-key id="jisBackslashKey" data-code="89"></keyboard-key> </template> - <keyboard-key id="rightShiftKey" class="right" icon="keyboard:shift" data-code="54"></keyboard-key> + <keyboard-key + id="rightShiftKey" + class="right" + icon="keyboard:shift" + data-code="54" + aria-name="[[i18n('keyboardDiagramAriaNameShiftRight')]]"> + </keyboard-key> <keyboard-key id="leftCtrlKey" class="left" main-glyph="ctrl" data-code="29"></keyboard-key> <template is="dom-if" if="[[showFnAndGlobeKeys_]]"> <keyboard-key id="fnKey" class="disabled" main-glyph="fn"></keyboard-key> - <keyboard-key id="layoutSwitchKey" icon="keyboard:layout-switch" data-code="584"></keyboard-key> + <keyboard-key + id="layoutSwitchKey" + icon="keyboard:layout-switch" + data-code="584" + aria-name="[[i18n('keyboardDiagramAriaNameLayoutSwitch')]]"> + </keyboard-key> </template> <template is="dom-if" if="[[showAssistantKey]]"> - <keyboard-key icon="keyboard:assistant" data-code="583"></keyboard-key> + <keyboard-key + icon="keyboard:assistant" + data-code="583" + aria-name="[[i18n('keyboardDiagramAriaNameAssistant')]]"> + </keyboard-key> </template> <keyboard-key id="leftAltKey" class="left" main-glyph="alt" data-code="56"></keyboard-key> <template is="dom-if" if="[[isEqual_(mechanicalLayout, 'jis')]]"> @@ -336,14 +388,31 @@ if="[[isEqual_(physicalLayout, 'dell-enterprise-wilco')]]"> <keyboard-key id="dellPageUpKey" main-glyph="pg up" data-code="104"></keyboard-key> </template> - <keyboard-key id="upArrow" icon="keyboard:arrow-up" data-code="103"></keyboard-key> + <keyboard-key + id="upArrow" + icon="keyboard:arrow-up" + data-code="103" + aria-name="[[i18n('keyboardDiagramAriaNameArrowUp')]]"> + </keyboard-key> <template is="dom-if" if="[[isEqual_(physicalLayout, 'dell-enterprise-wilco')]]"> <keyboard-key id="dellPageDownKey" main-glyph="pg dn" data-code="109"></keyboard-key> </template> - <keyboard-key icon="keyboard:arrow-left" data-code="105"></keyboard-key> - <keyboard-key icon="keyboard:arrow-down" data-code="108"></keyboard-key> - <keyboard-key icon="keyboard:arrow-right" data-code="106"></keyboard-key> + <keyboard-key + icon="keyboard:arrow-left" + data-code="105" + aria-name="[[i18n('keyboardDiagramAriaNameArrowLeft')]]"> + </keyboard-key> + <keyboard-key + icon="keyboard:arrow-down" + data-code="108" + aria-name="[[i18n('keyboardDiagramAriaNameArrowDown')]]"> + </keyboard-key> + <keyboard-key + icon="keyboard:arrow-right" + data-code="106" + aria-name="[[i18n('keyboardDiagramAriaNameArrowRight')]]"> + </keyboard-key> </div> </div> <div id="numberPad">
diff --git a/ash/webui/common/resources/keyboard_diagram.js b/ash/webui/common/resources/keyboard_diagram.js index 7bb1b66..23835199 100644 --- a/ash/webui/common/resources/keyboard_diagram.js +++ b/ash/webui/common/resources/keyboard_diagram.js
@@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {html, PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; +import {I18nBehavior, I18nBehaviorInterface} from 'chrome://resources/js/i18n_behavior.m.js'; +import {html, mixinBehaviors, PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import {KeyboardKeyState} from './keyboard_key.js'; import {getKeyboardLayoutForRegionCode} from './keyboard_layouts.js'; @@ -41,35 +42,96 @@ /** * Enum of action keys to be shown on the top row. - * @enum {!Object<string, !{icon: ?string, text: ?string}>} + * @enum {!Object<string, + * !{icon: ?string, text: ?string, ariaNameI18n: ?string}>} */ export const TopRowKey = { kNone: {}, - kBack: {icon: 'keyboard:back'}, - kForward: {icon: 'keyboard:forward'}, - kRefresh: {icon: 'keyboard:refresh'}, - kFullscreen: {icon: 'keyboard:fullscreen'}, - kOverview: {icon: 'keyboard:overview'}, - kScreenshot: {icon: 'keyboard:screenshot'}, - kScreenBrightnessDown: {icon: 'keyboard:display-brightness-down'}, - kScreenBrightnessUp: {icon: 'keyboard:display-brightness-up'}, - kPrivacyScreenToggle: {icon: 'keyboard:electronic-privacy-screen'}, - kVolumeMute: {icon: 'keyboard:volume-mute'}, - kVolumeDown: {icon: 'keyboard:volume-down'}, - kVolumeUp: {icon: 'keyboard:volume-up'}, - kKeyboardBacklightDown: {icon: 'keyboard:keyboard-brightness-down'}, - kKeyboardBacklightUp: {icon: 'keyboard:keyboard-brightness-up'}, - kNextTrack: {icon: 'keyboard:next-track'}, - kPreviousTrack: {icon: 'keyboard:last-track'}, - kPlayPause: {icon: 'keyboard:play-pause'}, - kScreenMirror: {icon: 'keyboard:screen-mirror'}, + kBack: {icon: 'keyboard:back', ariaNameI18n: 'keyboardDiagramAriaNameBack'}, + kForward: { + icon: 'keyboard:forward', + ariaNameI18n: 'keyboardDiagramAriaNameForward' + }, + kRefresh: { + icon: 'keyboard:refresh', + ariaNameI18n: 'keyboardDiagramAriaNameRefresh' + }, + kFullscreen: { + icon: 'keyboard:fullscreen', + ariaNameI18n: 'keyboardDiagramAriaNameFullscreen' + }, + kOverview: { + icon: 'keyboard:overview', + ariaNameI18n: 'keyboardDiagramAriaNameOverview' + }, + kScreenshot: { + icon: 'keyboard:screenshot', + ariaNameI18n: 'keyboardDiagramAriaNameScreenshot' + }, + kScreenBrightnessDown: { + icon: 'keyboard:display-brightness-down', + ariaNameI18n: 'keyboardDiagramAriaNameScreenBrightnessDown' + }, + kScreenBrightnessUp: { + icon: 'keyboard:display-brightness-up', + ariaNameI18n: 'keyboardDiagramAriaNameScreenBrightnessUp' + }, + kPrivacyScreenToggle: { + icon: 'keyboard:electronic-privacy-screen', + ariaNameI18n: 'keyboardDiagramAriaNamePrivacyScreenToggle' + }, + kVolumeMute: { + icon: 'keyboard:volume-mute', + ariaNameI18n: 'keyboardDiagramAriaNameMute' + }, + kVolumeDown: { + icon: 'keyboard:volume-down', + ariaNameI18n: 'keyboardDiagramAriaNameVolumeDown' + }, + kVolumeUp: { + icon: 'keyboard:volume-up', + ariaNameI18n: 'keyboardDiagramAriaNameVolumeUp' + }, + kKeyboardBacklightDown: { + icon: 'keyboard:keyboard-brightness-down', + ariaNameI18n: 'keyboardDiagramAriaNameKeyboardBacklightDown' + }, + kKeyboardBacklightUp: { + icon: 'keyboard:keyboard-brightness-up', + ariaNameI18n: 'keyboardDiagramAriaNameKeyboardBacklightUp' + }, + kNextTrack: { + icon: 'keyboard:next-track', + ariaNameI18n: 'keyboardDiagramAriaNameTrackNext' + }, + kPreviousTrack: { + icon: 'keyboard:last-track', + ariaNameI18n: 'keyboardDiagramAriaNameTrackPrevious' + }, + kPlayPause: { + icon: 'keyboard:play-pause', + ariaNameI18n: 'keyboardDiagramAriaNamePlayPause' + }, + kScreenMirror: { + icon: 'keyboard:screen-mirror', + ariaNameI18n: 'keyboardDiagramAriaNameScreenMirror' + }, // TODO(crbug.com/1207678): work out the localization scheme for keys like // delete and unknown. kDelete: {text: 'delete'}, kUnknown: {text: 'unknown'}, }; -export class KeyboardDiagramElement extends PolymerElement { +/** + * @constructor + * @extends {PolymerElement} + * @implements {I18nBehaviorInterface} + */ +const KeyboardDiagramElementBase = + mixinBehaviors([I18nBehavior], PolymerElement); + +/** @polymer */ +export class KeyboardDiagramElement extends KeyboardDiagramElementBase { static get is() { return 'keyboard-diagram'; } @@ -170,6 +232,21 @@ } /** + * Utility method for the HTML template to retrieve a localized string, that + * returns null if the ID is null or undefined. + * @param {?string} stringId The ID to retrieve. + * @return {?string} The localized string, or null if stringId is null or + * undefined. + * @protected + */ + optionalI18n_(stringId) { + if (!stringId) { + return null; + } + return this.i18n(stringId); + } + + /** * @param {?string} newValue * @param {?string} oldValue * @private @@ -187,6 +264,7 @@ `:not(#enterKeyLowerPart)[data-code="${evdevCode}"]`); for (const key of keys) { if (typeof glyphs === 'string') { + key.ariaName = null; key.topLeftGlyph = null; key.topRightGlyph = null; key.bottomLeftGlyph = null; @@ -200,6 +278,10 @@ key.bottomRightGlyph = glyphs.bottomRight; key.icon = glyphs.icon; key.mainGlyph = glyphs.main; + + if (glyphs.ariaNameI18n) { + key.ariaName = this.i18n(glyphs.ariaNameI18n); + } } } }
diff --git a/ash/webui/common/resources/keyboard_key.html b/ash/webui/common/resources/keyboard_key.html index e506e3c6..77771e6d 100644 --- a/ash/webui/common/resources/keyboard_key.html +++ b/ash/webui/common/resources/keyboard_key.html
@@ -149,19 +149,24 @@ } </style> <div id="background"></div> -<div id="foreground"> +<div id="foreground" aria-label="[[ariaLabel_]]"> + <!-- + Child elements are aria-hidden to make ChromeVox treat the whole key as + one unit with an aria-label, rather than individual labels that don't + reflect the key's state. + --> <template is="dom-if" if="[[icon]]"> - <iron-icon icon="[[icon]]"></iron-icon> + <iron-icon aria-hidden="true" icon="[[icon]]"></iron-icon> </template> <template is="dom-if" if="[[mainGlyph]]"> - <span id="mainGlyph">[[mainGlyph]]</span> + <span aria-hidden="true" id="mainGlyph">[[mainGlyph]]</span> </template> <template is="dom-if" if="[[showCornerGlyphs_]]"> - <span>[[topLeftGlyph]]</span> - <span>[[bottomLeftGlyph]]</span> + <span aria-hidden="true">[[topLeftGlyph]]</span> + <span aria-hidden="true">[[bottomLeftGlyph]]</span> <template is="dom-if" if="[[showSecondColumn_]]"> - <span>[[topRightGlyph]]</span> - <span>[[bottomRightGlyph]]</span> + <span aria-hidden="true">[[topRightGlyph]]</span> + <span aria-hidden="true">[[bottomRightGlyph]]</span> </template> </template> </div>
diff --git a/ash/webui/common/resources/keyboard_key.js b/ash/webui/common/resources/keyboard_key.js index ce2bd0d..9014361 100644 --- a/ash/webui/common/resources/keyboard_key.js +++ b/ash/webui/common/resources/keyboard_key.js
@@ -5,7 +5,8 @@ import 'chrome://resources/polymer/v3_0/iron-icon/iron-icon.js'; import './keyboard_icons.js'; -import {html, PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; +import {I18nBehavior, I18nBehaviorInterface} from 'chrome://resources/js/i18n_behavior.m.js'; +import {html, mixinBehaviors, PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; /** * @fileoverview @@ -67,7 +68,16 @@ kTested: 'tested', }; -export class KeyboardKeyElement extends PolymerElement { +/** + * @constructor + * @extends {PolymerElement} + * @implements {I18nBehaviorInterface} + */ +const KeyboardKeyElementBase = + mixinBehaviors([I18nBehavior], PolymerElement); + +/** @polymer */ +export class KeyboardKeyElement extends KeyboardKeyElementBase { static get is() { return 'keyboard-key'; } @@ -139,9 +149,35 @@ value: KeyboardKeyState.kNotPressed, reflectToAttribute: true, }, + + /** + * The key name to report to assistive technologies. Defaults to mainGlyph + * if not set. + * @type {?string} + */ + ariaName: String, + + /** @protected {string} */ + ariaLabel_: { + type: String, + computed: 'computeAriaLabel_(' + + 'ariaName, mainGlyph, bottomLeftGlyph, bottomRightGlyph, state)', + }, }; } + computeAriaLabel_( + ariaName, mainGlyph, bottomLeftGlyph, bottomRightGlyph, state) { + const name = + ariaName || mainGlyph || bottomRightGlyph || bottomLeftGlyph || ''; + const stateStringIds = { + [KeyboardKeyState.kNotPressed]: 'keyboardDiagramAriaLabelNotPressed', + [KeyboardKeyState.kPressed]: 'keyboardDiagramAriaLabelPressed', + [KeyboardKeyState.kTested]: 'keyboardDiagramAriaLabelTested', + }; + return this.i18n(stateStringIds[state], name); + } + /** * @param {?string} topLeftGlyph * @param {?string} topRightGlyph
diff --git a/ash/webui/common/resources/keyboard_layouts.js b/ash/webui/common/resources/keyboard_layouts.js index c72acfb..675ea4d 100644 --- a/ash/webui/common/resources/keyboard_layouts.js +++ b/ash/webui/common/resources/keyboard_layouts.js
@@ -496,6 +496,7 @@ * topRight: ?string, * bottomLeft: ?string, * bottomRight: ?string, + * ariaNameI18n: ?string, * })>>>} */ const kLayouts = { @@ -1036,7 +1037,10 @@ ], /* Japan */ 'jp': [ - [41, {icon: 'keyboard:jis-letter-switch'}], + [41, { + icon: 'keyboard:jis-letter-switch', + ariaNameI18n: 'keyboardDiagramAriaNameJisLetterSwitch' + }], [ 2, {bottomLeft: '1', topLeft: '!', bottomRight: 'ぬ'}], [ 3, {bottomLeft: '2', topLeft: '"', bottomRight: 'ふ'}], [ 4, {bottomLeft: '3', topLeft: '#', bottomRight: 'あ'}],
diff --git a/ash/webui/diagnostics_ui/BUILD.gn b/ash/webui/diagnostics_ui/BUILD.gn index 81bb3e2..3a34332c5 100644 --- a/ash/webui/diagnostics_ui/BUILD.gn +++ b/ash/webui/diagnostics_ui/BUILD.gn
@@ -21,6 +21,7 @@ deps = [ "//ash/constants", + "//ash/webui/common:keyboard_diagram_strings", "//ash/webui/common/backend", "//ash/webui/diagnostics_ui/backend", "//ash/webui/diagnostics_ui/mojom",
diff --git a/ash/webui/diagnostics_ui/diagnostics_ui.cc b/ash/webui/diagnostics_ui/diagnostics_ui.cc index 5c9af21..d4ee2e58 100644 --- a/ash/webui/diagnostics_ui/diagnostics_ui.cc +++ b/ash/webui/diagnostics_ui/diagnostics_ui.cc
@@ -9,6 +9,7 @@ #include "ash/constants/ash_features.h" #include "ash/webui/common/backend/plural_string_handler.h" +#include "ash/webui/common/keyboard_diagram_strings.h" #include "ash/webui/diagnostics_ui/backend/diagnostics_manager.h" #include "ash/webui/diagnostics_ui/backend/histogram_util.h" #include "ash/webui/diagnostics_ui/backend/input_data_provider.h" @@ -395,6 +396,7 @@ web_ui->AddMessageHandler(std::move(session_log_handler)); AddDiagnosticsStrings(html_source); + ash::common::AddKeyboardDiagramStrings(html_source); // Add localized strings required for network-icon. ui::network_element::AddLocalizedStrings(html_source); ui::network_element::AddOncLocalizedStrings(html_source);
diff --git a/ash/webui/firmware_update_ui/mojom/firmware_update.mojom b/ash/webui/firmware_update_ui/mojom/firmware_update.mojom index b41e167..96f75058 100644 --- a/ash/webui/firmware_update_ui/mojom/firmware_update.mojom +++ b/ash/webui/firmware_update_ui/mojom/firmware_update.mojom
@@ -36,6 +36,10 @@ // Filepath of the device's firmware update. mojo_base.mojom.FilePath filepath; + + // The expected sha256 checksum of the firmware update patch. Formatted as: + // "{sha256}". + string checksum; }; // Contains the completion percentage and state of an in-progress firmware
diff --git a/ash/webui/firmware_update_ui/resources/fake_data.js b/ash/webui/firmware_update_ui/resources/fake_data.js index 88fca11..b543fc5 100644 --- a/ash/webui/firmware_update_ui/resources/fake_data.js +++ b/ash/webui/firmware_update_ui/resources/fake_data.js
@@ -16,6 +16,8 @@ dock device`), priority: UpdatePriority.kCritical, filepath: {'path': '1.cab'}, + checksum: + '3fab34cfa1ef97238fb24c5e40a979bc544bb2b0967b863e43e7d58e0d9a923f', }, { deviceId: '2', @@ -26,6 +28,8 @@ adds new features`), priority: UpdatePriority.kMedium, filepath: {'path': '2.cab'}, + checksum: + '3fab34cfa1ef97238fb24c5e40a979bc544bb2b0967b863e43e7d58e0d9a9231', }, { deviceId: '3', @@ -35,6 +39,8 @@ 'Update firmware for Logitech keyboard to improve performance'), priority: UpdatePriority.kLow, filepath: {'path': '3.cab'}, + checksum: + '3fab34cfa1ef97238fb24c5e40a979bc544bb2b0967b863e43e7d58e0d9a9232', }, ]]; @@ -62,6 +68,7 @@ 'Update firmware for Logitech keyboard to improve performance'), priority: UpdatePriority.kLow, filepath: {'path': '1.cab'}, + checksum: '3fab34cfa1ef97238fb24c5e40a979bc544bb2b0967b863e43e7d58e0d9a923f', }; /** @type {!FirmwareUpdate} */ @@ -73,4 +80,5 @@ 'Update firmware for Logitech keyboard to improve performance'), priority: UpdatePriority.kCritical, filepath: {'path': '2.cab'}, + checksum: '3fab34cfa1ef97238fb24c5e40a979bc544bb2b0967b863e43e7d58e0d9a923f', };
diff --git a/ash/webui/scanning/scanning_handler.cc b/ash/webui/scanning/scanning_handler.cc index 52aafdd8..f0c8a45 100644 --- a/ash/webui/scanning/scanning_handler.cc +++ b/ash/webui/scanning/scanning_handler.cc
@@ -193,8 +193,14 @@ const std::string name = args->GetListDeprecated()[1].GetString(); const int count = args->GetListDeprecated()[2].GetInt(); - const std::u16string localized_string = l10n_util::GetPluralStringFUTF16( - string_id_map_.find(name)->second, count); + auto iter = string_id_map_.find(name); + if (iter == string_id_map_.end()) { + // Only reachable if the WebUI renderer is misbehaving. + return; + } + + const std::u16string localized_string = + l10n_util::GetPluralStringFUTF16(iter->second, count); ResolveJavascriptCallback(base::Value(callback), base::Value(localized_string)); }
diff --git a/ash/webui/scanning/scanning_handler_unittest.cc b/ash/webui/scanning/scanning_handler_unittest.cc index 8a3b24b..ff3c702b 100644 --- a/ash/webui/scanning/scanning_handler_unittest.cc +++ b/ash/webui/scanning/scanning_handler_unittest.cc
@@ -382,4 +382,19 @@ EXPECT_EQ(std::string(), *selected_path_dict->FindStringPath("baseName")); } +// Validates a request for a plural string with a key missing in the plural +// string map does return a value. +TEST_F(ScanningHandlerTest, GetPluralStringBadKey) { + base::ListValue args; + args.Append(kHandlerFunctionName); + args.Append(/*name=*/"incorrectKey"); + args.Append(/*count=*/2); + web_ui_.HandleReceivedMessage("getPluralString", &args); + task_environment_.RunUntilIdle(); + + const std::vector<std::unique_ptr<content::TestWebUI::CallData>>& + call_data_list = web_ui_.call_data(); + EXPECT_EQ(0u, call_data_list.size()); +} + } // namespace ash
diff --git a/ash/webui/shimless_rma/resources/calibration_component_chip.html b/ash/webui/shimless_rma/resources/calibration_component_chip.html index ef10d68..63b7e865 100644 --- a/ash/webui/shimless_rma/resources/calibration_component_chip.html +++ b/ash/webui/shimless_rma/resources/calibration_component_chip.html
@@ -18,7 +18,6 @@ --vertical-padding: 24px; border-radius: 8px; box-shadow: var(--cros-elevation-1-shadow); - color: var(--shimless-component-text-color); font-family: var(--shimless-component-font-family); font-size: var(--shimless-component-font-size); font-weight: var(--shimless-medium-font-weight); @@ -30,7 +29,7 @@ } #labelDiv { - color: grey; + color: var(--shimless-component-text-color); flex-basis: 155px; inset-inline-start: 0; padding-inline-start: 24px;
diff --git a/ash/webui/shimless_rma/resources/repair_component_chip.html b/ash/webui/shimless_rma/resources/repair_component_chip.html index 4ebc0da..56a4abe 100644 --- a/ash/webui/shimless_rma/resources/repair_component_chip.html +++ b/ash/webui/shimless_rma/resources/repair_component_chip.html
@@ -12,7 +12,6 @@ --vertical-padding: 24px; border-radius: 8px; box-shadow: var(--cros-elevation-1-shadow); - color: var(--shimless-component-text-color); font-family: var(--shimless-component-font-family); font-size: var(--shimless-component-font-size); font-weight: var(--shimless-medium-font-weight); @@ -24,7 +23,7 @@ } #labelDiv { - color: grey; + color: var(--shimless-component-text-color); flex-basis: 155px; inset-inline-start: 0; padding-inline-start: 24px;
diff --git a/ash/wm/desks/desk_mini_view_animations.cc b/ash/wm/desks/desk_mini_view_animations.cc index 02cacb5..151b96d 100644 --- a/ash/wm/desks/desk_mini_view_animations.cc +++ b/ash/wm/desks/desk_mini_view_animations.cc
@@ -18,6 +18,7 @@ #include "ui/compositor/layer_animator.h" #include "ui/compositor/scoped_layer_animation_settings.h" #include "ui/gfx/geometry/transform_util.h" +#include "ui/views/view.h" namespace ash { @@ -370,4 +371,14 @@ layer->SetTransform(kEndTransform); } +void PerformDesksTemplatesButtonVisibilityAnimation( + const std::vector<DeskMiniView*>& mini_views, + views::View* new_desk_button, + int shift_x) { + gfx::Transform translation; + translation.Translate(shift_x, 0); + AnimateMiniViews(mini_views, translation); + AnimateView(new_desk_button, translation); +} + } // namespace ash
diff --git a/ash/wm/desks/desk_mini_view_animations.h b/ash/wm/desks/desk_mini_view_animations.h index d124e3c7..845e246 100644 --- a/ash/wm/desks/desk_mini_view_animations.h +++ b/ash/wm/desks/desk_mini_view_animations.h
@@ -8,6 +8,10 @@ #include <memory> #include <vector> +namespace views { +class View; +} + namespace ash { class DesksBarView; @@ -90,6 +94,17 @@ int new_index, const std::vector<DeskMiniView*>& mini_views); +// Performs the animation which happens when the desks templates button is shown +// or hidden. Shifts all the mini views and the new desk button to the left by +// `shift_x`. +// * Notes: +// - It assumes all the `mini_views` and new desk button have been laid out in +// their final positions. +void PerformDesksTemplatesButtonVisibilityAnimation( + const std::vector<DeskMiniView*>& mini_views, + views::View* new_desk_button, + int shift_x); + } // namespace ash #endif // ASH_WM_DESKS_DESK_MINI_VIEW_ANIMATIONS_H_
diff --git a/ash/wm/desks/desks_bar_view.cc b/ash/wm/desks/desks_bar_view.cc index 487498cb..f1e9aa56 100644 --- a/ash/wm/desks/desks_bar_view.cc +++ b/ash/wm/desks/desks_bar_view.cc
@@ -976,10 +976,27 @@ const bool should_show_ui = DesksTemplatesPresenter::Get()->should_show_templates_ui(); const bool is_zero_state = IsZeroState(); + zero_state_desks_templates_button_->SetVisible(should_show_ui && is_zero_state); expanded_state_desks_templates_button_->SetVisible(should_show_ui && !is_zero_state); + + const int begin_x = GetFirstMiniViewXOffset(); + Layout(); + + if (mini_views_.empty()) + return; + + // The mini views and new desk button are already laid out in the earlier + // `Layout()` call. This call shifts the transforms of the mini views and new + // desk button and then animates to the identity transform. + PerformDesksTemplatesButtonVisibilityAnimation( + mini_views_, + is_zero_state + ? static_cast<views::View*>(zero_state_new_desk_button_) + : static_cast<views::View*>(expanded_state_new_desk_button_), + begin_x - GetFirstMiniViewXOffset()); } DeskMiniView* DesksBarView::FindMiniViewForDesk(const Desk* desk) const {
diff --git a/ash/wm/desks/templates/desks_templates_grid_view.cc b/ash/wm/desks/templates/desks_templates_grid_view.cc index ea0dcf9..e7d3c5e7 100644 --- a/ash/wm/desks/templates/desks_templates_grid_view.cc +++ b/ash/wm/desks/templates/desks_templates_grid_view.cc
@@ -30,6 +30,7 @@ #include "ui/base/l10n/l10n_util.h" #include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/layer.h" +#include "ui/compositor/scoped_animation_duration_scale_mode.h" #include "ui/events/event_handler.h" #include "ui/gfx/geometry/transform.h" #include "ui/gfx/geometry/transform_util.h" @@ -118,7 +119,11 @@ DesksTemplatesGridView::DesksTemplatesGridView() : bounds_animator_(this, /*use_transforms=*/true) { - bounds_animator_.SetAnimationDuration(kBoundsChangeAnimationDuration); + // Bounds animator is unaffected by debug tools such as "--ui-slow-animations" + // flag, so manually multiply the duration here. + bounds_animator_.SetAnimationDuration( + ui::ScopedAnimationDurationScaleMode::duration_multiplier() * + kBoundsChangeAnimationDuration); bounds_animator_.set_tween_type(gfx::Tween::LINEAR); }
diff --git a/ash/wm/desks/templates/desks_templates_presenter.cc b/ash/wm/desks/templates/desks_templates_presenter.cc index 570e09b..c0fa219 100644 --- a/ash/wm/desks/templates/desks_templates_presenter.cc +++ b/ash/wm/desks/templates/desks_templates_presenter.cc
@@ -120,12 +120,8 @@ if (DesksBarView* desks_bar_view = const_cast<DesksBarView*>(overview_grid->desks_bar_view())) { - // When templates is enabled but templates haven't loaded, the templates - // button may be visible but have a size of 0x0 so we have to make a - // Layout() call here. desks_bar_view->UpdateDesksTemplatesButtonVisibility(); desks_bar_view->UpdateButtonsForDesksTemplatesGrid(); - desks_bar_view->Layout(); overview_grid->UpdateSaveDeskAsTemplateButton(); } }
diff --git a/base/BUILD.gn b/base/BUILD.gn index 5cc7094e..4fdd470d 100644 --- a/base/BUILD.gn +++ b/base/BUILD.gn
@@ -4379,6 +4379,7 @@ "test/android/javatests/src/org/chromium/base/test/task/SchedulerTestHelpers.java", "test/android/javatests/src/org/chromium/base/test/task/ThreadPoolTestHelpers.java", "test/android/javatests/src/org/chromium/base/test/util/AdvancedMockContext.java", + "test/android/javatests/src/org/chromium/base/test/util/AndroidSdkLevelSkipCheck.java", "test/android/javatests/src/org/chromium/base/test/util/AnnotationProcessingUtils.java", "test/android/javatests/src/org/chromium/base/test/util/AnnotationRule.java", "test/android/javatests/src/org/chromium/base/test/util/ApplicationContextWrapper.java", @@ -4404,9 +4405,9 @@ "test/android/javatests/src/org/chromium/base/test/util/LooperUtils.java", "test/android/javatests/src/org/chromium/base/test/util/Manual.java", "test/android/javatests/src/org/chromium/base/test/util/Matchers.java", + "test/android/javatests/src/org/chromium/base/test/util/MaxAndroidSdkLevel.java", "test/android/javatests/src/org/chromium/base/test/util/MetricsUtils.java", "test/android/javatests/src/org/chromium/base/test/util/MinAndroidSdkLevel.java", - "test/android/javatests/src/org/chromium/base/test/util/MinAndroidSdkLevelSkipCheck.java", "test/android/javatests/src/org/chromium/base/test/util/PayloadCallbackHelper.java", "test/android/javatests/src/org/chromium/base/test/util/RequiresRestart.java", "test/android/javatests/src/org/chromium/base/test/util/Restriction.java", @@ -4504,11 +4505,11 @@ "test/android/junit/src/org/chromium/base/test/params/ParameterizedRunnerDelegateFactoryTest.java", "test/android/junit/src/org/chromium/base/test/params/ParameterizedRunnerTest.java", "test/android/junit/src/org/chromium/base/test/params/ParameterizedTestNameTest.java", + "test/android/junit/src/org/chromium/base/test/util/AndroidSdkLevelSkipCheckTest.java", "test/android/junit/src/org/chromium/base/test/util/AnnotationProcessingUtilsTest.java", "test/android/junit/src/org/chromium/base/test/util/CommandLineFlagsNoClassAnnotationCheckTest.java", "test/android/junit/src/org/chromium/base/test/util/CommandLineFlagsWithClassAnnotationCheckTest.java", "test/android/junit/src/org/chromium/base/test/util/DisableIfTest.java", - "test/android/junit/src/org/chromium/base/test/util/MinAndroidSdkLevelSkipCheckTest.java", "test/android/junit/src/org/chromium/base/test/util/RestrictionSkipCheckTest.java", "test/android/junit/src/org/chromium/base/test/util/SkipCheckTest.java", ]
diff --git a/base/allocator/allocator_shim_default_dispatch_to_partition_alloc.cc b/base/allocator/allocator_shim_default_dispatch_to_partition_alloc.cc index bcc7d86..5b5113b2 100644 --- a/base/allocator/allocator_shim_default_dispatch_to_partition_alloc.cc +++ b/base/allocator/allocator_shim_default_dispatch_to_partition_alloc.cc
@@ -623,8 +623,8 @@ PA_CHECK(current_aligned_root == g_original_root); // Purge memory, now that the traffic to the original partition is cut off. - current_root->PurgeMemory(PartitionPurgeDecommitEmptySlotSpans | - PartitionPurgeDiscardUnusedSystemPages); + current_root->PurgeMemory(PurgeFlags::kDecommitEmptySlotSpans | + PurgeFlags::kDiscardUnusedSystemPages); if (!use_alternate_bucket_distribution) { g_root.Get()->SwitchToDenserBucketDistribution();
diff --git a/base/allocator/partition_allocator/memory_reclaimer.cc b/base/allocator/partition_allocator/memory_reclaimer.cc index 63819bf..387be1cc 100644 --- a/base/allocator/partition_allocator/memory_reclaimer.cc +++ b/base/allocator/partition_allocator/memory_reclaimer.cc
@@ -42,15 +42,15 @@ PartitionAllocMemoryReclaimer::~PartitionAllocMemoryReclaimer() = default; void PartitionAllocMemoryReclaimer::ReclaimAll() { - constexpr int kFlags = PartitionPurgeDecommitEmptySlotSpans | - PartitionPurgeDiscardUnusedSystemPages | - PartitionPurgeAggressiveReclaim; + constexpr int kFlags = PurgeFlags::kDecommitEmptySlotSpans | + PurgeFlags::kDiscardUnusedSystemPages | + PurgeFlags::kAggressiveReclaim; Reclaim(kFlags); } void PartitionAllocMemoryReclaimer::ReclaimNormal() { - constexpr int kFlags = PartitionPurgeDecommitEmptySlotSpans | - PartitionPurgeDiscardUnusedSystemPages; + constexpr int kFlags = PurgeFlags::kDecommitEmptySlotSpans | + PurgeFlags::kDiscardUnusedSystemPages; Reclaim(kFlags); } @@ -70,7 +70,7 @@ #if PA_STARSCAN_ENABLE_STARSCAN_ON_RECLAIM { using PCScan = internal::PCScan; - const auto invocation_mode = flags & PartitionPurgeAggressiveReclaim + const auto invocation_mode = flags & PurgeFlags::kAggressiveReclaim ? PCScan::InvocationMode::kForcedBlocking : PCScan::InvocationMode::kBlocking; PCScan::PerformScanIfNeeded(invocation_mode); @@ -81,7 +81,7 @@ // Don't completely empty the thread cache outside of low memory situations, // as there is periodic purge which makes sure that it doesn't take too much // space. - if (flags & PartitionPurgeAggressiveReclaim) + if (flags & PurgeFlags::kAggressiveReclaim) internal::ThreadCacheRegistry::Instance().PurgeAll(); #endif
diff --git a/base/allocator/partition_allocator/oom.cc b/base/allocator/partition_allocator/oom.cc index 486de50..e83e225b 100644 --- a/base/allocator/partition_allocator/oom.cc +++ b/base/allocator/partition_allocator/oom.cc
@@ -9,11 +9,15 @@ #include "base/immediate_crash.h" #include "base/process/memory.h" +namespace partition_alloc::internal { + // The crash is generated in a NOINLINE function so that we can classify the // crash as an OOM solely by analyzing the stack trace. It is tagged as // NOT_TAIL_CALLED to ensure that its parent function stays on the stack. [[noreturn]] NOINLINE void NOT_TAIL_CALLED OnNoMemory(size_t size) { - base::internal::RunPartitionAllocOomCallback(); + RunPartitionAllocOomCallback(); base::TerminateBecauseOutOfMemory(size); IMMEDIATE_CRASH(); } + +} // namespace partition_alloc::internal
diff --git a/base/allocator/partition_allocator/oom.h b/base/allocator/partition_allocator/oom.h index 33fe486..8be6fe3 100644 --- a/base/allocator/partition_allocator/oom.h +++ b/base/allocator/partition_allocator/oom.h
@@ -5,12 +5,14 @@ #ifndef BASE_ALLOCATOR_PARTITION_ALLOCATOR_OOM_H_ #define BASE_ALLOCATOR_PARTITION_ALLOCATOR_OOM_H_ -#include <stddef.h> +#include <cstddef> #include "base/allocator/partition_allocator/allocation_guard.h" #include "base/base_export.h" #include "base/compiler_specific.h" +namespace partition_alloc::internal { + // The crash is generated in a NOINLINE function so that we can classify the // crash as an OOM solely by analyzing the stack trace. It is tagged as // NOT_TAIL_CALLED to ensure that its parent function stays on the stack. @@ -23,8 +25,10 @@ #define OOM_CRASH(size) \ do { \ /* Raising an exception might allocate, allow that. */ \ - base::internal::ScopedAllowAllocations guard{}; \ - OnNoMemory(size); \ + ::partition_alloc::ScopedAllowAllocations guard{}; \ + ::partition_alloc::internal::OnNoMemory(size); \ } while (0) +} // namespace partition_alloc::internal + #endif // BASE_ALLOCATOR_PARTITION_ALLOCATOR_OOM_H_
diff --git a/base/allocator/partition_allocator/oom_callback.cc b/base/allocator/partition_allocator/oom_callback.cc index 1ad0b8b..2f355ff 100644 --- a/base/allocator/partition_allocator/oom_callback.cc +++ b/base/allocator/partition_allocator/oom_callback.cc
@@ -6,7 +6,7 @@ #include "base/allocator/partition_allocator/partition_alloc_check.h" -namespace base { +namespace partition_alloc { namespace { PartitionAllocOomCallback g_oom_callback; @@ -24,4 +24,4 @@ } } // namespace internal -} // namespace base +} // namespace partition_alloc
diff --git a/base/allocator/partition_allocator/oom_callback.h b/base/allocator/partition_allocator/oom_callback.h index d37d1cf6..e2e726d3 100644 --- a/base/allocator/partition_allocator/oom_callback.h +++ b/base/allocator/partition_allocator/oom_callback.h
@@ -7,8 +7,10 @@ #include "base/base_export.h" -namespace base { -typedef void (*PartitionAllocOomCallback)(); +namespace partition_alloc { + +using PartitionAllocOomCallback = void (*)(); + // Registers a callback to be invoked during an OOM_CRASH(). OOM_CRASH is // invoked by users of PageAllocator (including PartitionAlloc) to signify an // allocation failure from the platform. @@ -19,6 +21,6 @@ BASE_EXPORT void RunPartitionAllocOomCallback(); } // namespace internal -} // namespace base +} // namespace partition_alloc #endif // BASE_ALLOCATOR_PARTITION_ALLOCATOR_OOM_CALLBACK_H_
diff --git a/base/allocator/partition_allocator/partition_alloc_config.h b/base/allocator/partition_allocator/partition_alloc_config.h index 8ced44e..1fac13e 100644 --- a/base/allocator/partition_allocator/partition_alloc_config.h +++ b/base/allocator/partition_allocator/partition_alloc_config.h
@@ -210,9 +210,10 @@ // Smaller slot spans may improve dirty memory fragmentation, but may also // increase address space usage. // -// This is intended to roll out more broadly, but only enabled on Linux for now -// to get performance bot and real-world data pre-A/B experiment. -#if BUILDFLAG(IS_LINUX) +// This is intended to roll out more broadly, but only enabled on Linux and +// ARM64 macOS for now to get performance bot and real-world data pre-A/B +// experiment. ARM64 macOS because it has a larger OS page size. +#if BUILDFLAG(IS_LINUX) || (BUILDFLAG(IS_MAC) && defined(ARCH_CPU_ARM64)) #define PA_PREFER_SMALLER_SLOT_SPANS #endif // BUILDFLAG(IS_LINUX)
diff --git a/base/allocator/partition_allocator/partition_alloc_constants.h b/base/allocator/partition_allocator/partition_alloc_constants.h index ba5a0798..e0c871d 100644 --- a/base/allocator/partition_allocator/partition_alloc_constants.h +++ b/base/allocator/partition_allocator/partition_alloc_constants.h
@@ -6,6 +6,7 @@ #define BASE_ALLOCATOR_PARTITION_ALLOCATOR_PARTITION_ALLOC_CONSTANTS_H_ #include <algorithm> +#include <climits> #include <cstddef> #include <limits> @@ -389,7 +390,7 @@ // *possibly* empty SlotSpans. // // In all cases, PartitionRoot::PurgeMemory() with the -// PartitionPurgeDecommitEmptySlotSpans flag will eagerly decommit all entries +// PurgeFlags::kDecommitEmptySlotSpans flag will eagerly decommit all entries // in the ring buffer, so with periodic purge enabled, this typically happens // every few seconds. constexpr size_t kEmptyCacheIndexBits = 7;
diff --git a/base/allocator/partition_allocator/partition_alloc_unittest.cc b/base/allocator/partition_allocator/partition_alloc_unittest.cc index 7f5984e5..0e5424aa 100644 --- a/base/allocator/partition_allocator/partition_alloc_unittest.cc +++ b/base/allocator/partition_allocator/partition_alloc_unittest.cc
@@ -310,8 +310,8 @@ } void TearDown() override { - allocator.root()->PurgeMemory(PartitionPurgeDecommitEmptySlotSpans | - PartitionPurgeDiscardUnusedSystemPages); + allocator.root()->PurgeMemory(PurgeFlags::kDecommitEmptySlotSpans | + PurgeFlags::kDiscardUnusedSystemPages); PartitionAllocGlobalUninitForTesting(); } @@ -2505,7 +2505,7 @@ EXPECT_EQ(SystemPageSize(), stats->decommittable_bytes); EXPECT_EQ(SystemPageSize(), stats->resident_bytes); } - allocator.root()->PurgeMemory(PartitionPurgeDecommitEmptySlotSpans); + allocator.root()->PurgeMemory(PurgeFlags::kDecommitEmptySlotSpans); { MockPartitionStatsDumper dumper; allocator.root()->DumpStats("mock_allocator", false /* detailed dump */, @@ -2520,7 +2520,7 @@ } // Calling purge again here is a good way of testing we didn't mess up the // state of the free cache ring. - allocator.root()->PurgeMemory(PartitionPurgeDecommitEmptySlotSpans); + allocator.root()->PurgeMemory(PurgeFlags::kDecommitEmptySlotSpans); // A single-slot but non-direct-mapped allocation size. size_t single_slot_size = 512 * 1024; @@ -2529,7 +2529,7 @@ char* big_ptr = reinterpret_cast<char*>( allocator.root()->Alloc(single_slot_size, type_name)); allocator.root()->Free(big_ptr); - allocator.root()->PurgeMemory(PartitionPurgeDecommitEmptySlotSpans); + allocator.root()->PurgeMemory(PurgeFlags::kDecommitEmptySlotSpans); CHECK_PAGE_IN_CORE(ptr - kPointerOffset, false); CHECK_PAGE_IN_CORE(big_ptr - kPointerOffset, false); @@ -2617,7 +2617,7 @@ EXPECT_EQ(2 * SystemPageSize(), stats->resident_bytes); } CHECK_PAGE_IN_CORE(ptr2 - kPointerOffset, true); - allocator.root()->PurgeMemory(PartitionPurgeDiscardUnusedSystemPages); + allocator.root()->PurgeMemory(PurgeFlags::kDiscardUnusedSystemPages); CHECK_PAGE_IN_CORE(ptr2 - kPointerOffset, false); EXPECT_EQ(3u, slot_span->num_unprovisioned_slots); @@ -2651,7 +2651,7 @@ EXPECT_EQ(2 * SystemPageSize(), stats->resident_bytes); } CHECK_PAGE_IN_CORE(ptr1 - kPointerOffset, true); - allocator.root()->PurgeMemory(PartitionPurgeDiscardUnusedSystemPages); + allocator.root()->PurgeMemory(PurgeFlags::kDiscardUnusedSystemPages); CHECK_PAGE_IN_CORE(ptr1 - kPointerOffset, false); allocator.root()->Free(ptr2); @@ -2691,7 +2691,7 @@ CHECK_PAGE_IN_CORE(ptr1 - kPointerOffset + (SystemPageSize() * 2), true); CHECK_PAGE_IN_CORE(ptr1 - kPointerOffset + (SystemPageSize() * 3), true); CHECK_PAGE_IN_CORE(ptr1 - kPointerOffset + (SystemPageSize() * 4), true); - allocator.root()->PurgeMemory(PartitionPurgeDiscardUnusedSystemPages); + allocator.root()->PurgeMemory(PurgeFlags::kDiscardUnusedSystemPages); CHECK_PAGE_IN_CORE(ptr1 - kPointerOffset, true); CHECK_PAGE_IN_CORE(ptr1 - kPointerOffset + SystemPageSize(), false); CHECK_PAGE_IN_CORE(ptr1 - kPointerOffset + (SystemPageSize() * 2), true); @@ -2739,7 +2739,7 @@ for (size_t i = 0; i < kFirstAllocPages; i++) CHECK_PAGE_IN_CORE(p.PageAtIndex(i), true); - allocator.root()->PurgeMemory(PartitionPurgeDiscardUnusedSystemPages); + allocator.root()->PurgeMemory(PurgeFlags::kDiscardUnusedSystemPages); for (size_t i = 0; i < kSecondAllocPages; i++) CHECK_PAGE_IN_CORE(p.PageAtIndex(i), true); @@ -2750,7 +2750,7 @@ TEST_P(PartitionAllocTest, PurgeDiscardableWithFreeListRewrite) { // This sub-test tests truncation of the provisioned slots in a trickier // case where the freelist is rewritten. - allocator.root()->PurgeMemory(PartitionPurgeDecommitEmptySlotSpans); + allocator.root()->PurgeMemory(PurgeFlags::kDecommitEmptySlotSpans); char* ptr1 = reinterpret_cast<char*>( allocator.root()->Alloc(SystemPageSize() - kExtraAllocSize, type_name)); void* ptr2 = @@ -2794,7 +2794,7 @@ CHECK_PAGE_IN_CORE(ptr1 - kPointerOffset + SystemPageSize(), true); CHECK_PAGE_IN_CORE(ptr1 - kPointerOffset + (SystemPageSize() * 2), true); CHECK_PAGE_IN_CORE(ptr1 - kPointerOffset + (SystemPageSize() * 3), true); - allocator.root()->PurgeMemory(PartitionPurgeDiscardUnusedSystemPages); + allocator.root()->PurgeMemory(PurgeFlags::kDiscardUnusedSystemPages); EXPECT_EQ(1u, slot_span->num_unprovisioned_slots); CHECK_PAGE_IN_CORE(ptr1 - kPointerOffset, true); CHECK_PAGE_IN_CORE(ptr1 - kPointerOffset + SystemPageSize(), false); @@ -2817,7 +2817,7 @@ TEST_P(PartitionAllocTest, PurgeDiscardableDoubleTruncateFreeList) { // This sub-test is similar, but tests a double-truncation. - allocator.root()->PurgeMemory(PartitionPurgeDecommitEmptySlotSpans); + allocator.root()->PurgeMemory(PurgeFlags::kDecommitEmptySlotSpans); char* ptr1 = reinterpret_cast<char*>( allocator.root()->Alloc(SystemPageSize() - kExtraAllocSize, type_name)); void* ptr2 = @@ -2856,7 +2856,7 @@ CHECK_PAGE_IN_CORE(ptr1 - kPointerOffset + SystemPageSize(), true); CHECK_PAGE_IN_CORE(ptr1 - kPointerOffset + (SystemPageSize() * 2), true); CHECK_PAGE_IN_CORE(ptr1 - kPointerOffset + (SystemPageSize() * 3), true); - allocator.root()->PurgeMemory(PartitionPurgeDiscardUnusedSystemPages); + allocator.root()->PurgeMemory(PurgeFlags::kDiscardUnusedSystemPages); EXPECT_EQ(2u, slot_span->num_unprovisioned_slots); CHECK_PAGE_IN_CORE(ptr1 - kPointerOffset, true); CHECK_PAGE_IN_CORE(ptr1 - kPointerOffset + SystemPageSize(), true); @@ -3300,7 +3300,7 @@ // Now everything should be decommitted. The reserved space for super pages // stays the same and will never go away (by design). - root.PurgeMemory(PartitionPurgeDecommitEmptySlotSpans); + root.PurgeMemory(PurgeFlags::kDecommitEmptySlotSpans); expected_committed_size = 0; EXPECT_EQ(expected_committed_size, root.total_size_of_committed_pages); EXPECT_EQ(expected_max_committed_size, root.max_size_of_committed_pages); @@ -3911,8 +3911,8 @@ EXPECT_TRUE(ptr); // Create new root and call PurgeMemory to simulate ConfigurePartitions(). - allocator.root()->PurgeMemory(PartitionPurgeDecommitEmptySlotSpans | - PartitionPurgeDiscardUnusedSystemPages); + allocator.root()->PurgeMemory(PurgeFlags::kDecommitEmptySlotSpans | + PurgeFlags::kDiscardUnusedSystemPages); auto* new_root = new PartitionRoot<ThreadSafe>({ PartitionOptions::AlignedAlloc::kDisallowed, PartitionOptions::ThreadCache::kDisabled, @@ -4189,7 +4189,7 @@ single_slot_count * single_slot_size); // Nothing left after explicit purge. - root.PurgeMemory(PartitionPurgeDecommitEmptySlotSpans); + root.PurgeMemory(PurgeFlags::kDecommitEmptySlotSpans); EXPECT_EQ(TS_UNCHECKED_READ(root.empty_slot_spans_dirty_bytes), 0u); for (void* ptr : allocated_memory) @@ -4293,14 +4293,14 @@ allocator.root()->Free(ptr); allocations.clear(); - allocator.root()->PurgeMemory(PartitionPurgeDiscardUnusedSystemPages); + allocator.root()->PurgeMemory(PurgeFlags::kDiscardUnusedSystemPages); size_t bucket_index = SizeToIndex(allocation_size + kExtraAllocSize); auto& bucket = allocator.root()->buckets[bucket_index]; EXPECT_TRUE(bucket.active_slot_spans_head->freelist_is_sorted()); // Can sort again. - allocator.root()->PurgeMemory(PartitionPurgeDiscardUnusedSystemPages); + allocator.root()->PurgeMemory(PurgeFlags::kDiscardUnusedSystemPages); EXPECT_TRUE(bucket.active_slot_spans_head->freelist_is_sorted()); for (size_t i = 0; i < count; ++i) {
diff --git a/base/allocator/partition_allocator/partition_root.cc b/base/allocator/partition_allocator/partition_root.cc index 285f3d4e..39a3ee6 100644 --- a/base/allocator/partition_allocator/partition_root.cc +++ b/base/allocator/partition_allocator/partition_root.cc
@@ -1045,9 +1045,9 @@ // TODO(bikineev): Consider rescheduling the purging after PCScan. if (PCScan::IsInProgress()) return; - if (flags & PartitionPurgeDecommitEmptySlotSpans) + if (flags & PurgeFlags::kDecommitEmptySlotSpans) DecommitEmptySlotSpans(); - if (flags & PartitionPurgeDiscardUnusedSystemPages) { + if (flags & PurgeFlags::kDiscardUnusedSystemPages) { for (Bucket& bucket : buckets) { if (bucket.slot_size == kInvalidBucketSize) continue;
diff --git a/base/allocator/partition_allocator/partition_root.h b/base/allocator/partition_allocator/partition_root.h index e77d654..ca1afd4e 100644 --- a/base/allocator/partition_allocator/partition_root.h +++ b/base/allocator/partition_allocator/partition_root.h
@@ -113,17 +113,23 @@ } // namespace internal -enum PartitionPurgeFlags { - // Decommitting the ring list of empty slot spans is reasonably fast. - PartitionPurgeDecommitEmptySlotSpans = 1 << 0, - // Discarding unused system pages is slower, because it involves walking all - // freelists in all active slot spans of all buckets >= system page - // size. It often frees a similar amount of memory to decommitting the empty - // slot spans, though. - PartitionPurgeDiscardUnusedSystemPages = 1 << 1, - // Aggressively reclaim memory. This is meant to be used in low-memory - // situations, not for periodic memory reclaiming. - PartitionPurgeAggressiveReclaim = 1 << 2, +// Bit flag constants used to purge memory. See PartitionRoot::PurgeMemory. +// +// In order to support bit operations like `flag_a | flag_b`, the old-fashioned +// enum (+ surrounding named struct) is used instead of enum class. +struct PurgeFlags { + enum : int { + // Decommitting the ring list of empty slot spans is reasonably fast. + kDecommitEmptySlotSpans = 1 << 0, + // Discarding unused system pages is slower, because it involves walking all + // freelists in all active slot spans of all buckets >= system page + // size. It often frees a similar amount of memory to decommitting the empty + // slot spans, though. + kDiscardUnusedSystemPages = 1 << 1, + // Aggressively reclaim memory. This is meant to be used in low-memory + // situations, not for periodic memory reclaiming. + kAggressiveReclaim = 1 << 2, + }; }; // Options struct used to configure PartitionRoot and PartitionAllocator.
diff --git a/base/allocator/partition_allocator/starscan/metadata_allocator.cc b/base/allocator/partition_allocator/starscan/metadata_allocator.cc index 9fbe889..ac1cb46 100644 --- a/base/allocator/partition_allocator/starscan/metadata_allocator.cc +++ b/base/allocator/partition_allocator/starscan/metadata_allocator.cc
@@ -29,8 +29,8 @@ void ReinitPCScanMetadataAllocatorForTesting() { // First, purge memory owned by PCScanMetadataAllocator. - PCScanMetadataAllocator().PurgeMemory(PartitionPurgeDecommitEmptySlotSpans | - PartitionPurgeDiscardUnusedSystemPages); + PCScanMetadataAllocator().PurgeMemory(PurgeFlags::kDecommitEmptySlotSpans | + PurgeFlags::kDiscardUnusedSystemPages); // Then, reinit the allocator. PCScanMetadataAllocator().~PartitionRoot(); memset(&PCScanMetadataAllocator(), 0, sizeof(PCScanMetadataAllocator()));
diff --git a/base/allocator/partition_allocator/starscan/pcscan_unittest.cc b/base/allocator/partition_allocator/starscan/pcscan_unittest.cc index bee9561c..1f81434 100644 --- a/base/allocator/partition_allocator/starscan/pcscan_unittest.cc +++ b/base/allocator/partition_allocator/starscan/pcscan_unittest.cc
@@ -66,8 +66,8 @@ } ~PartitionAllocPCScanTestBase() override { - allocator_.root()->PurgeMemory(PartitionPurgeDecommitEmptySlotSpans | - PartitionPurgeDiscardUnusedSystemPages); + allocator_.root()->PurgeMemory(PurgeFlags::kDecommitEmptySlotSpans | + PurgeFlags::kDiscardUnusedSystemPages); PartitionAllocGlobalUninitForTesting(); }
diff --git a/base/allocator/partition_allocator/thread_cache_unittest.cc b/base/allocator/partition_allocator/thread_cache_unittest.cc index c068877..0871dff7 100644 --- a/base/allocator/partition_allocator/thread_cache_unittest.cc +++ b/base/allocator/partition_allocator/thread_cache_unittest.cc
@@ -912,8 +912,8 @@ void* arr[kFillCountForMediumBucket] = {}; auto* tcache = root_->thread_cache_for_testing(); - root_->PurgeMemory(PartitionPurgeDecommitEmptySlotSpans | - PartitionPurgeDiscardUnusedSystemPages); + root_->PurgeMemory(PurgeFlags::kDecommitEmptySlotSpans | + PurgeFlags::kDiscardUnusedSystemPages); root_->ResetBookkeepingForTesting(); // The ThreadCache is allocated before we change buckets, so its size is
diff --git a/base/message_loop/message_pump.h b/base/message_loop/message_pump.h index 4a73873..ba6b780 100644 --- a/base/message_loop/message_pump.h +++ b/base/message_loop/message_pump.h
@@ -56,7 +56,7 @@ // delayed tasks. TimeTicks delayed_run_time; - // A recent view of TimeTicks::Now(). Only valid if |next_task_run_time| + // A recent view of TimeTicks::Now(). Only valid if |delayed_run_time| // isn't null nor max. MessagePump impls should use remaining_delay() // instead of resampling Now() if they wish to sleep for a TimeDelta. TimeTicks recent_now; @@ -225,7 +225,8 @@ // TODO(crbug.com/885371): Determine if this must be called to ensure that // delayed tasks run when a message pump outside the control of Run is // entered. - virtual void ScheduleDelayedWork(const TimeTicks& delayed_work_time) = 0; + virtual void ScheduleDelayedWork( + const Delegate::NextWorkInfo& next_work_info) = 0; // Sets the timer slack to the specified value. virtual void SetTimerSlack(TimerSlack timer_slack);
diff --git a/base/message_loop/message_pump_android.cc b/base/message_loop/message_pump_android.cc index d7024583..ed7aa7cb 100644 --- a/base/message_loop/message_pump_android.cc +++ b/base/message_loop/message_pump_android.cc
@@ -171,7 +171,7 @@ DoIdleWork(); if (!next_work_info.delayed_run_time.is_max()) - ScheduleDelayedWork(next_work_info.delayed_run_time); + ScheduleDelayedWork(next_work_info); } void MessagePumpForUI::OnNonDelayedLooperCallback() { @@ -261,7 +261,7 @@ // are still queued up. DoIdleWork(); if (!next_work_info.delayed_run_time.is_max()) - ScheduleDelayedWork(next_work_info.delayed_run_time); + ScheduleDelayedWork(next_work_info); } void MessagePumpForUI::DoIdleWork() { @@ -339,16 +339,20 @@ DPCHECK(ret >= 0); } -void MessagePumpForUI::ScheduleDelayedWork(const TimeTicks& delayed_work_time) { +void MessagePumpForUI::ScheduleDelayedWork( + const Delegate::NextWorkInfo& next_work_info) { if (ShouldQuit()) return; - if (delayed_scheduled_time_ && *delayed_scheduled_time_ == delayed_work_time) + if (delayed_scheduled_time_ && + *delayed_scheduled_time_ == next_work_info.delayed_run_time) { return; + } - DCHECK(!delayed_work_time.is_null()); - delayed_scheduled_time_ = delayed_work_time; - int64_t nanos = delayed_work_time.since_origin().InNanoseconds(); + DCHECK(!next_work_info.is_immediate()); + delayed_scheduled_time_ = next_work_info.delayed_run_time; + int64_t nanos = + next_work_info.delayed_run_time.since_origin().InNanoseconds(); struct itimerspec ts; ts.it_interval.tv_sec = 0; // Don't repeat. ts.it_interval.tv_nsec = 0;
diff --git a/base/message_loop/message_pump_android.h b/base/message_loop/message_pump_android.h index a8752f7..121ecb9e 100644 --- a/base/message_loop/message_pump_android.h +++ b/base/message_loop/message_pump_android.h
@@ -37,7 +37,8 @@ void Run(Delegate* delegate) override; void Quit() override; void ScheduleWork() override; - void ScheduleDelayedWork(const TimeTicks& delayed_work_time) override; + void ScheduleDelayedWork( + const Delegate::NextWorkInfo& next_work_info) override; // Attaches |delegate| to this native MessagePump. |delegate| will from then // on be invoked by the native loop to process application tasks.
diff --git a/base/message_loop/message_pump_default.cc b/base/message_loop/message_pump_default.cc index 9cf0106a..b238682b 100644 --- a/base/message_loop/message_pump_default.cc +++ b/base/message_loop/message_pump_default.cc
@@ -71,7 +71,7 @@ } void MessagePumpDefault::ScheduleDelayedWork( - const TimeTicks& delayed_work_time) { + const Delegate::NextWorkInfo& next_work_info) { // Since this is always called from the same thread as Run(), there is nothing // to do as the loop is already running. It will wait in Run() with the // correct timeout when it's out of immediate tasks.
diff --git a/base/message_loop/message_pump_default.h b/base/message_loop/message_pump_default.h index 2e2fc1d..4747a4b 100644 --- a/base/message_loop/message_pump_default.h +++ b/base/message_loop/message_pump_default.h
@@ -26,7 +26,8 @@ void Run(Delegate* delegate) override; void Quit() override; void ScheduleWork() override; - void ScheduleDelayedWork(const TimeTicks& delayed_work_time) override; + void ScheduleDelayedWork( + const Delegate::NextWorkInfo& next_work_info) override; #if BUILDFLAG(IS_APPLE) void SetTimerSlack(TimerSlack timer_slack) override; #endif
diff --git a/base/message_loop/message_pump_fuchsia.cc b/base/message_loop/message_pump_fuchsia.cc index beb3f76..a75550c 100644 --- a/base/message_loop/message_pump_fuchsia.cc +++ b/base/message_loop/message_pump_fuchsia.cc
@@ -312,7 +312,7 @@ } void MessagePumpFuchsia::ScheduleDelayedWork( - const TimeTicks& delayed_work_time) { + const Delegate::NextWorkInfo& next_work_info) { // Since this is always called from the same thread as Run(), there is nothing // to do as the loop is already running. It will wait in Run() with the // correct timeout when it's out of immediate tasks.
diff --git a/base/message_loop/message_pump_fuchsia.h b/base/message_loop/message_pump_fuchsia.h index 204be9c..5bc63f80 100644 --- a/base/message_loop/message_pump_fuchsia.h +++ b/base/message_loop/message_pump_fuchsia.h
@@ -146,7 +146,8 @@ void Run(Delegate* delegate) override; void Quit() override; void ScheduleWork() override; - void ScheduleDelayedWork(const TimeTicks& delayed_work_time) override; + void ScheduleDelayedWork( + const Delegate::NextWorkInfo& next_work_info) override; private: // Handles IO events by running |async_dispatcher_| until |deadline|. Returns
diff --git a/base/message_loop/message_pump_glib.cc b/base/message_loop/message_pump_glib.cc index c74ceb0..7da03d89 100644 --- a/base/message_loop/message_pump_glib.cc +++ b/base/message_loop/message_pump_glib.cc
@@ -436,7 +436,8 @@ } } -void MessagePumpGlib::ScheduleDelayedWork(const TimeTicks& delayed_work_time) { +void MessagePumpGlib::ScheduleDelayedWork( + const Delegate::NextWorkInfo& next_work_info) { // We need to wake up the loop in case the poll timeout needs to be // adjusted. This will cause us to try to do work, but that's OK. ScheduleWork();
diff --git a/base/message_loop/message_pump_glib.h b/base/message_loop/message_pump_glib.h index 0ddb887..83b37df11 100644 --- a/base/message_loop/message_pump_glib.h +++ b/base/message_loop/message_pump_glib.h
@@ -99,7 +99,8 @@ void Run(Delegate* delegate) override; void Quit() override; void ScheduleWork() override; - void ScheduleDelayedWork(const TimeTicks& delayed_work_time) override; + void ScheduleDelayedWork( + const Delegate::NextWorkInfo& next_work_info) override; // Internal methods used for processing the FdWatchSource callbacks. As for // main pump callbacks, they are public for simplicity but should not be used
diff --git a/base/message_loop/message_pump_kqueue.cc b/base/message_loop/message_pump_kqueue.cc index ab437895..5f2d01ce 100644 --- a/base/message_loop/message_pump_kqueue.cc +++ b/base/message_loop/message_pump_kqueue.cc
@@ -223,7 +223,7 @@ } void MessagePumpKqueue::ScheduleDelayedWork( - const TimeTicks& delayed_work_time) { + const Delegate::NextWorkInfo& next_work_info) { // Nothing to do. This MessagePump uses DoWork(). }
diff --git a/base/message_loop/message_pump_kqueue.h b/base/message_loop/message_pump_kqueue.h index 627e499..aee05be2 100644 --- a/base/message_loop/message_pump_kqueue.h +++ b/base/message_loop/message_pump_kqueue.h
@@ -108,7 +108,8 @@ void Run(Delegate* delegate) override; void Quit() override; void ScheduleWork() override; - void ScheduleDelayedWork(const TimeTicks& delayed_work_time) override; + void ScheduleDelayedWork( + const Delegate::NextWorkInfo& next_work_info) override; // Begins watching the Mach receive right named by |port|. The |controller| // can be used to stop watching for incoming messages, and new message
diff --git a/base/message_loop/message_pump_libevent.cc b/base/message_loop/message_pump_libevent.cc index 42036ea..b58e5231 100644 --- a/base/message_loop/message_pump_libevent.cc +++ b/base/message_loop/message_pump_libevent.cc
@@ -271,7 +271,7 @@ } void MessagePumpLibevent::ScheduleDelayedWork( - const TimeTicks& delayed_work_time) { + const Delegate::NextWorkInfo& next_work_info) { // We know that we can't be blocked on Run()'s |timer_event| right now since // this method can only be called on the same thread as Run(). Hence we have // nothing to do here, this thread will sleep in Run() with the correct
diff --git a/base/message_loop/message_pump_libevent.h b/base/message_loop/message_pump_libevent.h index 4410314..21bbdf0 100644 --- a/base/message_loop/message_pump_libevent.h +++ b/base/message_loop/message_pump_libevent.h
@@ -80,7 +80,8 @@ void Run(Delegate* delegate) override; void Quit() override; void ScheduleWork() override; - void ScheduleDelayedWork(const TimeTicks& delayed_work_time) override; + void ScheduleDelayedWork( + const Delegate::NextWorkInfo& next_work_info) override; private: friend class MessagePumpLibeventTest;
diff --git a/base/message_loop/message_pump_mac.h b/base/message_loop/message_pump_mac.h index 7498f2433..17513b8 100644 --- a/base/message_loop/message_pump_mac.h +++ b/base/message_loop/message_pump_mac.h
@@ -59,7 +59,6 @@ namespace base { class RunLoop; -class TimeTicks; // AutoreleasePoolType is a proxy type for autorelease pools. Its definition // depends on the translation unit (TU) in which this header appears. In pure @@ -93,7 +92,8 @@ void Run(Delegate* delegate) override; void Quit() override; void ScheduleWork() override; - void ScheduleDelayedWork(const TimeTicks& delayed_work_time) override; + void ScheduleDelayedWork( + const Delegate::NextWorkInfo& next_work_info) override; void SetTimerSlack(TimerSlack timer_slack) override; #if BUILDFLAG(IS_IOS)
diff --git a/base/message_loop/message_pump_mac.mm b/base/message_loop/message_pump_mac.mm index 981822b7..234c7db 100644 --- a/base/message_loop/message_pump_mac.mm +++ b/base/message_loop/message_pump_mac.mm
@@ -181,8 +181,10 @@ // Must be called on the run loop thread. void MessagePumpCFRunLoopBase::ScheduleDelayedWork( - const TimeTicks& delayed_work_time) { - ScheduleDelayedWorkImpl(delayed_work_time - TimeTicks::Now()); + const Delegate::NextWorkInfo& next_work_info) { + DCHECK(!next_work_info.is_immediate()); + if (!next_work_info.delayed_run_time.is_max()) + ScheduleDelayedWorkImpl(next_work_info.remaining_delay()); } MessagePumpCFRunLoopBase::LudicrousSlackSetting
diff --git a/base/message_loop/message_pump_unittest.cc b/base/message_loop/message_pump_unittest.cc index 40041a4..814815db 100644 --- a/base/message_loop/message_pump_unittest.cc +++ b/base/message_loop/message_pump_unittest.cc
@@ -194,7 +194,8 @@ // We first schedule a delayed task far in the future with maximum timer // slack. message_pump_->SetTimerSlack(TIMER_SLACK_MAXIMUM); - message_pump_->ScheduleDelayedWork(TimeTicks::Now() + Hours(1)); + const TimeTicks now = TimeTicks::Now(); + message_pump_->ScheduleDelayedWork({now + Hours(1), now}); // Since we have no other work pending, the pump will initially be idle. action_.store(NONE);
diff --git a/base/message_loop/message_pump_win.cc b/base/message_loop/message_pump_win.cc index 1bfea3a..0af9724 100644 --- a/base/message_loop/message_pump_win.cc +++ b/base/message_loop/message_pump_win.cc
@@ -126,7 +126,8 @@ TRACE_EVENT_SCOPE_THREAD); } -void MessagePumpForUI::ScheduleDelayedWork(const TimeTicks& delayed_work_time) { +void MessagePumpForUI::ScheduleDelayedWork( + const Delegate::NextWorkInfo& next_work_info) { DCHECK_CALLED_ON_VALID_THREAD(bound_thread_); // Since this is always called from |bound_thread_|, there is almost always @@ -146,9 +147,7 @@ // TODO(gab): This could potentially be replaced by a ForegroundIdleProc hook // if Windows ends up being the only platform requiring ScheduleDelayedWork(). if (in_native_loop_ && !work_scheduled_) { - // TODO(gab): Consider passing a NextWorkInfo object to ScheduleDelayedWork - // to take advantage of |recent_now| here too. - ScheduleNativeTimer({delayed_work_time, TimeTicks::Now()}); + ScheduleNativeTimer(next_work_info); } } @@ -672,7 +671,8 @@ TRACE_EVENT_SCOPE_THREAD); } -void MessagePumpForIO::ScheduleDelayedWork(const TimeTicks& delayed_work_time) { +void MessagePumpForIO::ScheduleDelayedWork( + const Delegate::NextWorkInfo& next_work_info) { DCHECK_CALLED_ON_VALID_THREAD(bound_thread_); // Since this is always called from |bound_thread_|, there is nothing to do as
diff --git a/base/message_loop/message_pump_win.h b/base/message_loop/message_pump_win.h index baa5282..e2a0a002 100644 --- a/base/message_loop/message_pump_win.h +++ b/base/message_loop/message_pump_win.h
@@ -133,7 +133,8 @@ // MessagePump methods: void ScheduleWork() override; - void ScheduleDelayedWork(const TimeTicks& delayed_work_time) override; + void ScheduleDelayedWork( + const Delegate::NextWorkInfo& next_work_info) override; // Make the MessagePumpForUI respond to WM_QUIT messages. void EnableWmQuit(); @@ -260,7 +261,8 @@ // MessagePump methods: void ScheduleWork() override; - void ScheduleDelayedWork(const TimeTicks& delayed_work_time) override; + void ScheduleDelayedWork( + const Delegate::NextWorkInfo& next_work_info) override; // Register the handler to be used when asynchronous IO for the given file // completes. The registration persists as long as |file_handle| is valid, so
diff --git a/base/message_loop/timer_slack_unittest.cc b/base/message_loop/timer_slack_unittest.cc index 4bbd24b..025cdf67 100644 --- a/base/message_loop/timer_slack_unittest.cc +++ b/base/message_loop/timer_slack_unittest.cc
@@ -60,7 +60,7 @@ // Tickle the delay work path. const base::TimeTicks now = TimeTicks::Now(); - message_pump_cf_run_loop.ScheduleDelayedWork(now); + message_pump_cf_run_loop.ScheduleDelayedWork({now, now}); EXPECT_EQ(MessagePumpCFRunLoop::LudicrousSlackSetting::kLudicrousSlackOff, message_pump_cf_run_loop.GetLudicrousSlackStateForTesting()); @@ -90,7 +90,7 @@ // Tickle the delay work path. const base::TimeTicks now = TimeTicks::Now(); - message_pump_cf_run_loop.ScheduleDelayedWork(now); + message_pump_cf_run_loop.ScheduleDelayedWork({now, now}); EXPECT_EQ(MessagePumpCFRunLoop::LudicrousSlackSetting::kLudicrousSlackOn, message_pump_cf_run_loop.GetLudicrousSlackStateForTesting());
diff --git a/base/metrics/statistics_recorder.cc b/base/metrics/statistics_recorder.cc index c1fc3fa..90a296e 100644 --- a/base/metrics/statistics_recorder.cc +++ b/base/metrics/statistics_recorder.cc
@@ -257,7 +257,6 @@ const AutoLock auto_lock(lock_.Get()); EnsureGlobalRecorderWhileLocked(); - scoped_refptr<HistogramSampleObserverList> observers; auto iter = top_->observers_.find(name); if (iter == top_->observers_.end()) { top_->observers_.insert(
diff --git a/base/sampling_heap_profiler/poisson_allocation_sampler.cc b/base/sampling_heap_profiler/poisson_allocation_sampler.cc index ef65927c9..d20757f 100644 --- a/base/sampling_heap_profiler/poisson_allocation_sampler.cc +++ b/base/sampling_heap_profiler/poisson_allocation_sampler.cc
@@ -639,6 +639,11 @@ // static void PoissonAllocationSampler::SuppressRandomnessForTest(bool suppress) { g_deterministic = suppress; + // The g_tls_accumulated_bytes may contain a random value from previous + // test runs, which would make the behaviour of the next call to + // RecordAlloc unpredictable. + if (suppress) + g_tls_accumulated_bytes = 0; } void PoissonAllocationSampler::AddSamplesObserver(SamplesObserver* observer) {
diff --git a/base/task/sequence_manager/test/mock_time_message_pump.cc b/base/task/sequence_manager/test/mock_time_message_pump.cc index 521f9c7..4828c64 100644 --- a/base/task/sequence_manager/test/mock_time_message_pump.cc +++ b/base/task/sequence_manager/test/mock_time_message_pump.cc
@@ -81,8 +81,8 @@ void MockTimeMessagePump::ScheduleWork() {} void MockTimeMessagePump::ScheduleDelayedWork( - const TimeTicks& delayed_work_time) { - next_wake_up_time_ = delayed_work_time; + const Delegate::NextWorkInfo& next_work_info) { + next_wake_up_time_ = next_work_info.delayed_run_time; } } // namespace sequence_manager
diff --git a/base/task/sequence_manager/test/mock_time_message_pump.h b/base/task/sequence_manager/test/mock_time_message_pump.h index 65bc9dbc..b8868d0 100644 --- a/base/task/sequence_manager/test/mock_time_message_pump.h +++ b/base/task/sequence_manager/test/mock_time_message_pump.h
@@ -34,7 +34,8 @@ void Run(Delegate* delegate) override; void Quit() override; void ScheduleWork() override; - void ScheduleDelayedWork(const TimeTicks& delayed_work_time) override; + void ScheduleDelayedWork( + const Delegate::NextWorkInfo& next_work_info) override; // Returns the time at which the pump would have to wake up to be perform // work.
diff --git a/base/task/sequence_manager/test/mock_time_message_pump_unittest.cc b/base/task/sequence_manager/test/mock_time_message_pump_unittest.cc index 3a8fb03..06cac49 100644 --- a/base/task/sequence_manager/test/mock_time_message_pump_unittest.cc +++ b/base/task/sequence_manager/test/mock_time_message_pump_unittest.cc
@@ -133,9 +133,11 @@ SimpleTestTickClock mock_clock; StrictMock<MockMessagePumpDelegate> delegate; MockTimeMessagePump pump(&mock_clock); - const auto kNextDelayedWorkTime = mock_clock.NowTicks() + Seconds(2); + const auto kStartTime = mock_clock.NowTicks(); + const auto kNextDelayedWorkTime = kStartTime + Seconds(2); - pump.ScheduleDelayedWork(kNextDelayedWorkTime); + pump.ScheduleDelayedWork( + MessagePump::Delegate::NextWorkInfo{kNextDelayedWorkTime, kStartTime}); EXPECT_THAT(pump.next_wake_up_time(), Eq(kNextDelayedWorkTime)); }
diff --git a/base/task/sequence_manager/thread_controller_with_message_pump_impl.cc b/base/task/sequence_manager/thread_controller_with_message_pump_impl.cc index c40ecbd..e29bd2a 100644 --- a/base/task/sequence_manager/thread_controller_with_message_pump_impl.cc +++ b/base/task/sequence_manager/thread_controller_with_message_pump_impl.cc
@@ -184,7 +184,7 @@ // |pump_| can't be null as all postTasks are cross-thread before binding, // and delayed cross-thread postTasks do the thread hop through an immediate // task. - pump_->ScheduleDelayedWork(run_time); + pump_->ScheduleDelayedWork({run_time, lazy_now->Now()}); } }
diff --git a/base/task/sequence_manager/thread_controller_with_message_pump_impl_unittest.cc b/base/task/sequence_manager/thread_controller_with_message_pump_impl_unittest.cc index 7ce212d..f804de6 100644 --- a/base/task/sequence_manager/thread_controller_with_message_pump_impl_unittest.cc +++ b/base/task/sequence_manager/thread_controller_with_message_pump_impl_unittest.cc
@@ -82,8 +82,13 @@ MOCK_METHOD1(Run, void(MessagePump::Delegate*)); MOCK_METHOD0(Quit, void()); MOCK_METHOD0(ScheduleWork, void()); - MOCK_METHOD1(ScheduleDelayedWork, void(const TimeTicks&)); + MOCK_METHOD1(ScheduleDelayedWork_TimeTicks, void(const TimeTicks&)); MOCK_METHOD1(SetTimerSlack, void(TimerSlack)); + + void ScheduleDelayedWork( + const MessagePump::Delegate::NextWorkInfo& next_work_info) override { + ScheduleDelayedWork_TimeTicks(next_work_info.delayed_run_time); + } }; // TODO(crbug.com/901373): Deduplicate FakeTaskRunners. @@ -226,7 +231,7 @@ // Call a no-op DoWork. Expect that it doesn't do any work. clock_.SetNowTicks(Seconds(5)); - EXPECT_CALL(*message_pump_, ScheduleDelayedWork(_)).Times(0); + EXPECT_CALL(*message_pump_, ScheduleDelayedWork_TimeTicks(_)).Times(0); { auto next_work_info = thread_controller_.DoWork(); EXPECT_FALSE(next_work_info.is_immediate()); @@ -268,14 +273,14 @@ } TEST_F(ThreadControllerWithMessagePumpTest, SetNextDelayedDoWork) { - EXPECT_CALL(*message_pump_, ScheduleDelayedWork(Seconds(123))); + EXPECT_CALL(*message_pump_, ScheduleDelayedWork_TimeTicks(Seconds(123))); LazyNow lazy_now(&clock_); thread_controller_.SetNextDelayedDoWork(&lazy_now, WakeUp{Seconds(123)}); } TEST_F(ThreadControllerWithMessagePumpTest, SetNextDelayedDoWork_CapAtOneDay) { - EXPECT_CALL(*message_pump_, ScheduleDelayedWork(Days(1))); + EXPECT_CALL(*message_pump_, ScheduleDelayedWork_TimeTicks(Days(1))); LazyNow lazy_now(&clock_); thread_controller_.SetNextDelayedDoWork(&lazy_now, WakeUp{Days(2)}); @@ -293,7 +298,7 @@ MockCallback<OnceClosure> task1; task_source_.AddTask(FROM_HERE, task1.Get(), Seconds(10)); - EXPECT_CALL(*message_pump_, ScheduleDelayedWork(_)).Times(0); + EXPECT_CALL(*message_pump_, ScheduleDelayedWork_TimeTicks(_)).Times(0); auto next_work_info = thread_controller_.DoWork(); EXPECT_EQ(next_work_info.delayed_run_time, Seconds(10)); }
diff --git a/base/task/thread_pool/task_tracker.cc b/base/task/thread_pool/task_tracker.cc index 61cc19c7..214d6e2 100644 --- a/base/task/thread_pool/task_tracker.cc +++ b/base/task/thread_pool/task_tracker.cc
@@ -447,8 +447,7 @@ } RegisteredTaskSource TaskTracker::RunAndPopNextTask( - RegisteredTaskSource task_source, - base::Location* posted_from) { + RegisteredTaskSource task_source) { DCHECK(task_source); const bool should_run_tasks = BeforeRunTask(task_source->shutdown_behavior()); @@ -464,8 +463,6 @@ } if (task) { - if (posted_from) - *posted_from = task->posted_from; // Run the |task| (whether it's a worker task or the Clear() closure). RunTask(std::move(task.value()), task_source.get(), traits); }
diff --git a/base/task/thread_pool/task_tracker.h b/base/task/thread_pool/task_tracker.h index 802bf5f..43f40db 100644 --- a/base/task/thread_pool/task_tracker.h +++ b/base/task/thread_pool/task_tracker.h
@@ -117,11 +117,7 @@ // (which indicates that it should be reenqueued). WillPostTask() must have // allowed the task in front of |task_source| to be posted before this is // called. - // |posted_from| is optionally used to capture base::Location of the task ran - // for investigation of memory corruption. - // TODO(crbug.com/1218384): Remove |posted_from| once resolved. - RegisteredTaskSource RunAndPopNextTask(RegisteredTaskSource task_source, - base::Location* posted_from = nullptr); + RegisteredTaskSource RunAndPopNextTask(RegisteredTaskSource task_source); // Returns true once shutdown has started (StartShutdown() was called). // Note: sequential consistency with the thread calling StartShutdown() isn't
diff --git a/base/task/thread_pool/worker_thread.cc b/base/task/thread_pool/worker_thread.cc index 92bacb6..d4b5f65 100644 --- a/base/task/thread_pool/worker_thread.cc +++ b/base/task/thread_pool/worker_thread.cc
@@ -376,15 +376,12 @@ // Alias pointer for investigation of memory corruption. crbug.com/1218384 TaskSource* task_source_before_run = task_source.get(); base::debug::Alias(&task_source_before_run); - base::Location posted_from; - task_source = - task_tracker_->RunAndPopNextTask(std::move(task_source), &posted_from); - // Alias pointer and posted_from for investigation of memory corruption. - // crbug.com/1218384 + task_source = task_tracker_->RunAndPopNextTask(std::move(task_source)); + + // Alias pointer for investigation of memory corruption. crbug.com/1218384 TaskSource* task_source_before_move = task_source.get(); base::debug::Alias(&task_source_before_move); - DEBUG_ALIAS_FOR_CSTR(posted_from_str, posted_from.ToString().c_str(), 128); delegate_->DidProcessTask(std::move(task_source));
diff --git a/base/test/android/javatests/src/org/chromium/base/test/BaseJUnit4ClassRunner.java b/base/test/android/javatests/src/org/chromium/base/test/BaseJUnit4ClassRunner.java index 187bfa3..06ec9e5 100644 --- a/base/test/android/javatests/src/org/chromium/base/test/BaseJUnit4ClassRunner.java +++ b/base/test/android/javatests/src/org/chromium/base/test/BaseJUnit4ClassRunner.java
@@ -25,9 +25,9 @@ import org.chromium.base.CommandLine; import org.chromium.base.Log; import org.chromium.base.test.params.MethodParamAnnotationRule; +import org.chromium.base.test.util.AndroidSdkLevelSkipCheck; import org.chromium.base.test.util.CommandLineFlags; import org.chromium.base.test.util.DisableIfSkipCheck; -import org.chromium.base.test.util.MinAndroidSdkLevelSkipCheck; import org.chromium.base.test.util.RestrictionSkipCheck; import org.chromium.base.test.util.SkipCheck; @@ -163,7 +163,7 @@ @CallSuper protected List<SkipCheck> getSkipChecks() { return Arrays.asList(new RestrictionSkipCheck(InstrumentationRegistry.getTargetContext()), - new MinAndroidSdkLevelSkipCheck(), new DisableIfSkipCheck()); + new AndroidSdkLevelSkipCheck(), new DisableIfSkipCheck()); } /**
diff --git a/base/test/android/javatests/src/org/chromium/base/test/util/AndroidSdkLevelSkipCheck.java b/base/test/android/javatests/src/org/chromium/base/test/util/AndroidSdkLevelSkipCheck.java new file mode 100644 index 0000000..cbe3895 --- /dev/null +++ b/base/test/android/javatests/src/org/chromium/base/test/util/AndroidSdkLevelSkipCheck.java
@@ -0,0 +1,47 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.base.test.util; + +import android.os.Build; + +import org.junit.runners.model.FrameworkMethod; + +import org.chromium.base.Log; + +/** + * Checks the device's SDK level against any specified minimum or maximum requirement. + */ +public class AndroidSdkLevelSkipCheck extends SkipCheck { + private static final String TAG = "base_test"; + + /** + * If either {@link MinAndroidSdkLevel} or {@link MaxAndroidSdkLevel} is present, checks its + * boundary against the device's SDK level. + * + * @param testCase The test to check. + * @return true if the device's SDK level is below the specified minimum. + */ + @Override + public boolean shouldSkip(FrameworkMethod frameworkMethod) { + int minSdkLevel = 0; + for (MinAndroidSdkLevel m : AnnotationProcessingUtils.getAnnotations( + frameworkMethod.getMethod(), MinAndroidSdkLevel.class)) { + minSdkLevel = Math.max(minSdkLevel, m.value()); + } + int maxSdkLevel = Integer.MAX_VALUE; + for (MaxAndroidSdkLevel m : AnnotationProcessingUtils.getAnnotations( + frameworkMethod.getMethod(), MaxAndroidSdkLevel.class)) { + maxSdkLevel = Math.min(maxSdkLevel, m.value()); + } + if (Build.VERSION.SDK_INT < minSdkLevel || Build.VERSION.SDK_INT > maxSdkLevel) { + Log.i(TAG, + "Test " + frameworkMethod.getDeclaringClass().getName() + "#" + + frameworkMethod.getName() + " is not enabled at SDK level " + + Build.VERSION.SDK_INT + "."); + return true; + } + return false; + } +}
diff --git a/base/test/android/javatests/src/org/chromium/base/test/util/MaxAndroidSdkLevel.java b/base/test/android/javatests/src/org/chromium/base/test/util/MaxAndroidSdkLevel.java new file mode 100644 index 0000000..d8f7e29a --- /dev/null +++ b/base/test/android/javatests/src/org/chromium/base/test/util/MaxAndroidSdkLevel.java
@@ -0,0 +1,25 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.base.test.util; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Skips the annotated test when the device's API level is higher than {@code value()}. + */ +@Inherited +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.METHOD, ElementType.TYPE}) +public @interface MaxAndroidSdkLevel { + /** Maximum API level in which the test is run. */ + int value(); + + /** Why a test is skipped above this API level. */ + String reason() default ""; +}
diff --git a/base/test/android/javatests/src/org/chromium/base/test/util/MinAndroidSdkLevel.java b/base/test/android/javatests/src/org/chromium/base/test/util/MinAndroidSdkLevel.java index 13e2578..6663c50 100644 --- a/base/test/android/javatests/src/org/chromium/base/test/util/MinAndroidSdkLevel.java +++ b/base/test/android/javatests/src/org/chromium/base/test/util/MinAndroidSdkLevel.java
@@ -10,10 +10,17 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; +/** + * Skips the annotated test when the device's API level is lower than {@code value()}. + */ @Inherited @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD, ElementType.TYPE}) public @interface MinAndroidSdkLevel { - int value() default 0; + /** Minimum API level in which the test is run. */ + int value(); + + /** Why a test is skipped below this API level. */ + String reason() default ""; }
diff --git a/base/test/android/javatests/src/org/chromium/base/test/util/MinAndroidSdkLevelSkipCheck.java b/base/test/android/javatests/src/org/chromium/base/test/util/MinAndroidSdkLevelSkipCheck.java deleted file mode 100644 index 8b07c0f1..0000000 --- a/base/test/android/javatests/src/org/chromium/base/test/util/MinAndroidSdkLevelSkipCheck.java +++ /dev/null
@@ -1,43 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.base.test.util; - -import android.os.Build; - -import org.junit.runners.model.FrameworkMethod; - -import org.chromium.base.Log; - -/** - * Checks the device's SDK level against any specified minimum requirement. - */ -public class MinAndroidSdkLevelSkipCheck extends SkipCheck { - - private static final String TAG = "base_test"; - - /** - * If {@link MinAndroidSdkLevel} is present, checks its value - * against the device's SDK level. - * - * @param testCase The test to check. - * @return true if the device's SDK level is below the specified minimum. - */ - @Override - public boolean shouldSkip(FrameworkMethod frameworkMethod) { - int minSdkLevel = 0; - for (MinAndroidSdkLevel m : AnnotationProcessingUtils.getAnnotations( - frameworkMethod.getMethod(), MinAndroidSdkLevel.class)) { - minSdkLevel = Math.max(minSdkLevel, m.value()); - } - if (Build.VERSION.SDK_INT < minSdkLevel) { - Log.i(TAG, "Test " + frameworkMethod.getDeclaringClass().getName() + "#" - + frameworkMethod.getName() + " is not enabled at SDK level " - + Build.VERSION.SDK_INT + "."); - return true; - } - return false; - } - -}
diff --git a/base/test/android/junit/src/org/chromium/base/test/util/AndroidSdkLevelSkipCheckTest.java b/base/test/android/junit/src/org/chromium/base/test/util/AndroidSdkLevelSkipCheckTest.java new file mode 100644 index 0000000..1919501 --- /dev/null +++ b/base/test/android/junit/src/org/chromium/base/test/util/AndroidSdkLevelSkipCheckTest.java
@@ -0,0 +1,177 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.base.test.util; + +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.isIn; + +import org.junit.Assert; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.Description; +import org.junit.runner.RunWith; +import org.junit.runners.BlockJUnit4ClassRunner; +import org.junit.runners.model.FrameworkMethod; +import org.junit.runners.model.InitializationError; +import org.robolectric.annotation.Config; + +import org.chromium.base.test.BaseRobolectricTestRunner; + +/** Unit tests for {@link AndroidSdkLevelSkipCheck} */ +@RunWith(BaseRobolectricTestRunner.class) +@Config(manifest = Config.NONE, sdk = 29) +public class AndroidSdkLevelSkipCheckTest { + public static class UnannotatedBaseClass { + @Test + @MinAndroidSdkLevel(28) + public void min28Method() {} + + @Test + @MinAndroidSdkLevel(29) + public void min29Method() {} + + @Test + @MinAndroidSdkLevel(30) + public void min30Method() {} + + @Test + @MaxAndroidSdkLevel(28) + public void max28Method() {} + + @Test + @MaxAndroidSdkLevel(29) + public void max29Method() {} + + @Test + @MaxAndroidSdkLevel(30) + public void max30Method() {} + + @Test + @MinAndroidSdkLevel(28) + @MaxAndroidSdkLevel(30) + public void min28max30Method() {} + + @Test + @MinAndroidSdkLevel(30) + @MaxAndroidSdkLevel(28) + public void min30max28Method() {} + } + + @MinAndroidSdkLevel(28) + public static class Min28Class extends UnannotatedBaseClass { + @Test + public void unannotatedMethod() {} + } + + @MinAndroidSdkLevel(30) + public static class Min30Class extends UnannotatedBaseClass { + @Test + public void unannotatedMethod() {} + } + + public static class ExtendsMin28Class extends Min28Class { + @Override + @Test + public void unannotatedMethod() {} + } + + public static class ExtendsMin30Class extends Min30Class { + @Override + @Test + public void unannotatedMethod() {} + } + + private static final AndroidSdkLevelSkipCheck sSkipCheck = new AndroidSdkLevelSkipCheck(); + + private static class InnerTestRunner extends BlockJUnit4ClassRunner { + public InnerTestRunner(Class<?> klass) throws InitializationError { + super(klass); + } + + @Override + protected boolean isIgnored(FrameworkMethod method) { + return super.isIgnored(method) || sSkipCheck.shouldSkip(method); + } + } + + @Rule + public TestRunnerTestRule mTestRunnerTestRule = new TestRunnerTestRule(InnerTestRunner.class); + + private void expectShouldSkip(Class<?> testClass, String methodName, boolean shouldSkip) + throws Exception { + Assert.assertThat( + sSkipCheck.shouldSkip(new FrameworkMethod(testClass.getMethod(methodName))), + equalTo(shouldSkip)); + TestRunnerTestRule.TestLog runListener = mTestRunnerTestRule.runTest(testClass); + Assert.assertThat(Description.createTestDescription(testClass, methodName), + isIn(shouldSkip ? runListener.skippedTests : runListener.runTests)); + } + + // Test {@link MinAndroidSdkLevel} + + @Test + public void testAnnotatedMethodAboveMin_run() throws Exception { + expectShouldSkip(UnannotatedBaseClass.class, "min28Method", false); + } + + @Test + public void testAnnotatedMethodAtMin_run() throws Exception { + expectShouldSkip(UnannotatedBaseClass.class, "min29Method", false); + } + + @Test + public void testAnnotatedMethodBelowMin_skip() throws Exception { + expectShouldSkip(UnannotatedBaseClass.class, "min30Method", true); + } + + @Test + public void testAnnotatedClassAboveMin_run() throws Exception { + expectShouldSkip(Min28Class.class, "unannotatedMethod", false); + } + + @Test + public void testAnnotatedClassBelowMin_skip() throws Exception { + expectShouldSkip(Min30Class.class, "unannotatedMethod", true); + } + + @Test + public void testAnnotatedSuperclassAboveMin_run() throws Exception { + expectShouldSkip(ExtendsMin28Class.class, "unannotatedMethod", false); + } + + @Test + public void testAnnotatedSuperclassBelowMin_skip() throws Exception { + expectShouldSkip(ExtendsMin30Class.class, "unannotatedMethod", true); + } + + // Test {@link MaxAndroidSdkLevel} + + @Test + public void testAnnotatedMethodAboveMax_skip() throws Exception { + expectShouldSkip(UnannotatedBaseClass.class, "max28Method", true); + } + + @Test + public void testAnnotatedMethodAtMax_run() throws Exception { + expectShouldSkip(UnannotatedBaseClass.class, "max29Method", false); + } + + @Test + public void testAnnotatedMethodBelowMax_run() throws Exception { + expectShouldSkip(UnannotatedBaseClass.class, "max30Method", false); + } + + // Test combinations of {@link MinAndroidSdkLevel} and {@link MaxAndroidSdkLevel} + + @Test + public void testAnnotatedMethodAboveMinBelowMax_run() throws Exception { + expectShouldSkip(UnannotatedBaseClass.class, "min28max30Method", false); + } + + @Test + public void testAnnotatedMethodBelowMinAboveMax_skip() throws Exception { + expectShouldSkip(UnannotatedBaseClass.class, "min30max28Method", true); + } +}
diff --git a/base/test/android/junit/src/org/chromium/base/test/util/MinAndroidSdkLevelSkipCheckTest.java b/base/test/android/junit/src/org/chromium/base/test/util/MinAndroidSdkLevelSkipCheckTest.java deleted file mode 100644 index cfaa80fbc..0000000 --- a/base/test/android/junit/src/org/chromium/base/test/util/MinAndroidSdkLevelSkipCheckTest.java +++ /dev/null
@@ -1,110 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.base.test.util; - -import static org.hamcrest.Matchers.equalTo; -import static org.hamcrest.Matchers.isIn; - -import org.junit.Assert; -import org.junit.Rule; -import org.junit.Test; -import org.junit.runner.Description; -import org.junit.runner.RunWith; -import org.junit.runners.BlockJUnit4ClassRunner; -import org.junit.runners.model.FrameworkMethod; -import org.junit.runners.model.InitializationError; -import org.robolectric.annotation.Config; - -import org.chromium.base.test.BaseRobolectricTestRunner; - -/** Unit tests for MinAndroidSdkLevelSkipCheck. */ -@RunWith(BaseRobolectricTestRunner.class) -@Config(manifest = Config.NONE, sdk = 29) -public class MinAndroidSdkLevelSkipCheckTest { - public static class UnannotatedBaseClass { - @Test - @MinAndroidSdkLevel(28) - public void min28Method() {} - @Test - @MinAndroidSdkLevel(30) - public void min30Method() {} - } - - @MinAndroidSdkLevel(28) - public static class Min28Class extends UnannotatedBaseClass { - @Test public void unannotatedMethod() {} - } - - @MinAndroidSdkLevel(30) - public static class Min30Class extends UnannotatedBaseClass { - @Test public void unannotatedMethod() {} - } - - public static class ExtendsMin28Class extends Min28Class { - @Override - @Test public void unannotatedMethod() {} - } - - public static class ExtendsMin30Class extends Min30Class { - @Override - @Test public void unannotatedMethod() {} - } - - private static final MinAndroidSdkLevelSkipCheck sSkipCheck = new MinAndroidSdkLevelSkipCheck(); - - private static class InnerTestRunner extends BlockJUnit4ClassRunner { - public InnerTestRunner(Class<?> klass) throws InitializationError { - super(klass); - } - - @Override - protected boolean isIgnored(FrameworkMethod method) { - return super.isIgnored(method) || sSkipCheck.shouldSkip(method); - } - } - - @Rule - public TestRunnerTestRule mTestRunnerTestRule = new TestRunnerTestRule(InnerTestRunner.class); - - private void expectShouldSkip(Class<?> testClass, String methodName, boolean shouldSkip) - throws Exception { - Assert.assertThat( - sSkipCheck.shouldSkip(new FrameworkMethod(testClass.getMethod(methodName))), - equalTo(shouldSkip)); - TestRunnerTestRule.TestLog runListener = mTestRunnerTestRule.runTest(testClass); - Assert.assertThat(Description.createTestDescription(testClass, methodName), - isIn(shouldSkip ? runListener.skippedTests : runListener.runTests)); - } - - @Test - public void testAnnotatedMethodAboveMin() throws Exception { - expectShouldSkip(UnannotatedBaseClass.class, "min28Method", false); - } - - @Test - public void testAnnotatedMethodBelowMin() throws Exception { - expectShouldSkip(UnannotatedBaseClass.class, "min30Method", true); - } - - @Test - public void testAnnotatedClassAboveMin() throws Exception { - expectShouldSkip(Min28Class.class, "unannotatedMethod", false); - } - - @Test - public void testAnnotatedClassBelowMin() throws Exception { - expectShouldSkip(Min30Class.class, "unannotatedMethod", true); - } - - @Test - public void testAnnotatedSuperclassAboveMin() throws Exception { - expectShouldSkip(ExtendsMin28Class.class, "unannotatedMethod", false); - } - - @Test - public void testAnnotatedSuperclassBelowMin() throws Exception { - expectShouldSkip(ExtendsMin30Class.class, "unannotatedMethod", true); - } -}
diff --git a/base/test/test_support_android.cc b/base/test/test_support_android.cc index 91e3eab..ca36cce 100644 --- a/base/test/test_support_android.cc +++ b/base/test/test_support_android.cc
@@ -160,11 +160,12 @@ } } - void ScheduleDelayedWork(const base::TimeTicks& delayed_work_time) override { + void ScheduleDelayedWork( + const Delegate::NextWorkInfo& next_work_info) override { if (g_state && g_state->run_depth > 1) { Waitable::GetInstance()->Signal(); } else { - MessagePumpForUI::ScheduleDelayedWork(delayed_work_time); + MessagePumpForUI::ScheduleDelayedWork(next_work_info); } } };
diff --git a/base/tracing/protos/chrome_track_event.proto b/base/tracing/protos/chrome_track_event.proto index 1984ebc..aea927b 100644 --- a/base/tracing/protos/chrome_track_event.proto +++ b/base/tracing/protos/chrome_track_event.proto
@@ -268,8 +268,23 @@ // related SiteInstances in the same BrowsingInstance. optional int32 related_active_contents_count = 5; - // The number of active RenderFrameHosts which belong to this SiteInstance. + // The number of active RenderFrameHosts this SiteInstance's SiteInstanceGroup + // has. optional int32 active_rfh_count = 6; + + // The SiteInstanceGroup this SiteInstance belongs to. + optional SiteInstanceGroup site_instance_group = 7; +} + +message SiteInstanceGroup { + // The ID of the SiteInstanceGroup. + optional int32 site_instance_group_id = 1; + + // The number of active frames in this SiteInstanceGroup. + optional int32 active_frame_count = 2; + + // The process ID of the SiteInstanceGroup. + optional RenderProcessHost process = 3; } message RenderViewHost { @@ -306,6 +321,10 @@ // Whether the renderer-side RenderFrameProxy is live or not. optional bool is_render_frame_proxy_live = 5; + + // The SiteInstanceGroupId of the SiteInstanceGroup associated with the + // RenderFrameProxyHost. + optional int32 site_instance_group_id = 6; } message AndroidView { @@ -685,7 +704,7 @@ message ChromeTrackEvent { // Extension range for Chrome: 1000-1999 - // Next ID: 1034 + // Next ID: 1035 extend TrackEvent { optional ChromeAppState chrome_app_state = 1000; @@ -759,5 +778,7 @@ optional EventLatency event_latency = 1032; optional ProcessSingleton process_singleton = 1033; + + optional SiteInstanceGroup site_instance_group = 1034; } }
diff --git a/build/config/locales.gni b/build/config/locales.gni index 87703b7..1c8b7008 100644 --- a/build/config/locales.gni +++ b/build/config/locales.gni
@@ -4,7 +4,7 @@ import("//build/config/chromeos/ui_mode.gni") -# This file creates |platform_pak_locales| which is the set of current locales +# This file creates |platform_pak_locales| which is the set of packed locales # based on the current platform. Locales in this list are formatted based on # what .pak files expect. The |platform_pak_locales| variable *may* contain # pseudolocales, depending on the |enable_pseudolocales| flag. @@ -15,34 +15,7 @@ # The following additional platform specific lists are created: # - |extended_locales| list of locales not shipped on desktop builds # - |android_bundle_locales_as_resources| locales formatted for XML output names -# - |locales_as_mac_outputs| formated for mac output bundles -# - |ios_packed_locales| subset for iOS -# - |ios_packed_locales_as_mac_outputs| subset for iOS output - -# Chrome on iOS only ships with a subset of the locales supported by other -# version of Chrome as the corresponding locales are not supported by the -# operating system (but for simplicity, the corresponding .pak files are -# still generated). -ios_unsupported_locales = [ - "am", - "bn", - "et", - "fil", - "gu", - "kn", - "lv", - "ml", - "mr", - "sl", - "sw", - "ta", - "te", -] - -# These list are defined even when not building for Android or iOS for the -# sake of build/locale_tool.py. Ensure that GN doesn't complain about them -# being unused. -not_needed([ "ios_unsupported_locales" ]) +# - |locales_as_apple_outputs| formatted for mac output bundles pseudolocales = [ "ar-XB", @@ -135,6 +108,18 @@ "zu", ] + pseudolocales +if (is_ios) { + # Chrome on iOS uses "es-MX" and "pt" for "es-419" and "pt-BR". + all_chrome_locales -= [ + "es-419", + "pt-BR", + ] + all_chrome_locales += [ + "es-MX", + "pt", + ] +} + # Chrome locales not on Windows, Mac, or Linux extended_locales = [ "af", @@ -167,31 +152,41 @@ "zu", ] -# Chrome on iOS uses different names for "es-419" and "pt-BR" (called -# respectively "es-MX" and "pt" on iOS). -if (is_ios) { - all_chrome_locales -= [ - "es-419", - "pt-BR", +# Setup |platform_pak_locales| for each platform. +platform_pak_locales = all_chrome_locales +if (!is_android) { + platform_pak_locales -= extended_locales +} + +# The base list for all platforms except Android excludes the extended locales. +# Add or subtract platform specific locales below. +if (is_chromeos_ash || is_chromeos_lacros) { + platform_pak_locales += [ + "af", + "is", + "zu", ] - all_chrome_locales += [ - "es-MX", - "pt", +} else if (is_ios) { + platform_pak_locales -= [ + "am", + "bn", + "et", + "fil", + "gu", + "kn", + "lv", + "ml", + "mr", + "sl", + "sw", + "ta", + "te", ] } -# New locales added to ChromeOS builds. -chromeos_only_locales = [ - "af", - "is", - "zu", -] - +# List for Android locale names in .xml exports. Note: needs to stay in sync +# with |ToAndroidLocaleName| in build/android/gyp/util/resource_utils.py. if (is_android) { - platform_pak_locales = all_chrome_locales - - # List for Android locale names in .xml exports. Note: needs to stay in sync - # with |ToAndroidLocaleName| in build/android/gyp/util/resource_utils.py. # - add r: (e.g. zh-HK -> zh-rHK ) android_bundle_locales_as_resources = [] foreach(_locale, platform_pak_locales) { @@ -217,13 +212,6 @@ "iw", "tl", ] -} else if (is_chromeos_ash || is_chromeos_lacros) { - # In ChromeOS we support a few more locales than standard Chrome. - platform_pak_locales = - all_chrome_locales - extended_locales + chromeos_only_locales -} else { - # Change if other platforms support more locales. - platform_pak_locales = all_chrome_locales - extended_locales } locales_without_pseudolocales = platform_pak_locales - pseudolocales @@ -239,19 +227,15 @@ platform_pak_locales -= pseudolocales } -# Same as the locales list but in the format Mac expects for output files: -# it uses underscores instead of hyphens, and "en" instead of "en-US". -locales_as_mac_outputs = [] -foreach(locale, platform_pak_locales) { - if (locale == "en-US") { - locales_as_mac_outputs += [ "en" ] - } else { - locales_as_mac_outputs += [ string_replace(locale, "-", "_") ] +if (is_apple) { + # Same as the locales list but in the format Mac expects for output files: + # it uses underscores instead of hyphens, and "en" instead of "en-US". + locales_as_apple_outputs = [] + foreach(locale, platform_pak_locales) { + if (locale == "en-US") { + locales_as_apple_outputs += [ "en" ] + } else { + locales_as_apple_outputs += [ string_replace(locale, "-", "_") ] + } } } - -if (is_ios) { - ios_packed_locales = platform_pak_locales - ios_unsupported_locales - ios_packed_locales_as_mac_outputs = - locales_as_mac_outputs - ios_unsupported_locales -}
diff --git a/build/fuchsia/emu_target.py b/build/fuchsia/emu_target.py index be20626..b57f9cb 100644 --- a/build/fuchsia/emu_target.py +++ b/build/fuchsia/emu_target.py
@@ -45,10 +45,6 @@ def Start(self): if common.IsRunningUnattended(): - # On the bots, we sometimes find that a previous ffx daemon instance is - # wedged, leading to failures. Reach out and stop an old daemon if there - # happens to be one. - self._ffx_runner.stop_daemon() if not self._HasNetworking(): # Bots may accumulate stale manually-added targets with the same address # as the one to be added here. Preemtively remove any unknown targets at @@ -107,8 +103,6 @@ if not self._emu_process: logging.error('%s did not start' % (self.EMULATOR_NAME)) return - if common.IsRunningUnattended(): - self._ffx_runner.stop_daemon() returncode = self._emu_process.poll() if returncode == None: logging.info('Shutting down %s' % (self.EMULATOR_NAME))
diff --git a/build/fuchsia/ffx_session.py b/build/fuchsia/ffx_session.py index 0d87408..2d7db48 100755 --- a/build/fuchsia/ffx_session.py +++ b/build/fuchsia/ffx_session.py
@@ -40,6 +40,9 @@ def _run_repair_command(self, output): """Scans `output` for a self-repair command to run and, if found, runs it. + If logging is enabled, `ffx` is asked to emit its own logs to the log + directory. + Returns: True if a repair command was found and ran successfully. False otherwise. """ @@ -48,14 +51,31 @@ match = re.search('`ffx ([^`]+)`', output) if not match or len(match.groups()) != 1: return False # No repair command found. - try: - self.run_ffx(match.groups()[0].split(), suppress_repair=True) - except subprocess.CalledProcessError as cpe: - return False # Repair failed. - return True # Repair succeeded. + args = match.groups()[0].split() + # Tell ffx to include the configuration file without prompting in case + # logging is enabled. + with self.scoped_config('doctor.record_config', 'true'): + # If the repair command is `ffx doctor` and logging is enabled, add the + # options to emit ffx logs to the logging directory. + if len(args) and args[0] == 'doctor' and \ + self._log_manager.IsLoggingEnabled(): + args.extend( + ('--record', '--output-dir', self._log_manager.GetLogDirectory())) + try: + self.run_ffx(args, suppress_repair=True) + except subprocess.CalledProcessError as cpe: + return False # Repair failed. + return True # Repair succeeded. def run_ffx(self, args, check=True, suppress_repair=False): """Runs `ffx` with the given arguments, waiting for it to exit. + + If `ffx` exits with a non-zero exit code, the output is scanned for a + recommended repair command (e.g., "Run `ffx doctor --restart-daemon` for + further diagnostics."). If such a command is found, it is run and then the + original command is retried. This behavior can be suppressed via the + `suppress_repair` argument. + Args: args: A sequence of arguments to ffx. check: If True, CalledProcessError is raised if ffx returns a non-zero @@ -178,21 +198,6 @@ # If not, explicitly set the original value. self.run_ffx(['config', 'set', name, old_value]) - def stop_daemon(self): - """Stops the ffx daemon. - - If an initial attempt to stop it via `ffx daemon stop` fails, - `ffx doctor --restart-daemon` is used to force a restart. - """ - try: - self.run_ffx(['daemon', 'stop']) - return - except subprocess.CalledProcessError: - pass - logging.error('Failed to stop the damon. Attempting to restart it via ffx' + - ' doctor') - self.run_ffx(['doctor', '--restart-daemon'], check=False) - def list_targets(self): """Returns the (possibly empty) list of targets known to ffx.
diff --git a/build/fuchsia/linux.sdk.sha1 b/build/fuchsia/linux.sdk.sha1 index 6c9d9c5..cbfd945 100644 --- a/build/fuchsia/linux.sdk.sha1 +++ b/build/fuchsia/linux.sdk.sha1
@@ -1 +1 @@ -7.20220309.2.1 +7.20220310.1.1
diff --git a/build/fuchsia/linux_internal.sdk.sha1 b/build/fuchsia/linux_internal.sdk.sha1 index 54efe9f..24c1f51 100644 --- a/build/fuchsia/linux_internal.sdk.sha1 +++ b/build/fuchsia/linux_internal.sdk.sha1
@@ -1 +1 @@ -7.20220309.1.1 +7.20220310.0.1
diff --git a/build/fuchsia/mac.sdk.sha1 b/build/fuchsia/mac.sdk.sha1 index 6c9d9c5..cbfd945 100644 --- a/build/fuchsia/mac.sdk.sha1 +++ b/build/fuchsia/mac.sdk.sha1
@@ -1 +1 @@ -7.20220309.2.1 +7.20220310.1.1
diff --git a/build/rust/clanglibs/find_clanglibs.py b/build/rust/clanglibs/find_clanglibs.py index e92e739..65b8e9d 100755 --- a/build/rust/clanglibs/find_clanglibs.py +++ b/build/rust/clanglibs/find_clanglibs.py
@@ -27,6 +27,15 @@ help="Where to find clang and LLVM libs", required=True) args = parser.parse_args() + if not os.path.exists(os.path.join( + args.clang_libs_dir, "libclang.a")) and not os.path.exists( + os.path.join(args.clang_libs_dir, "libclang.lib")): + print("Couldn't find libclang.a|lib. Please ensure you set a custom var in " + "your .gclient file like so:\n" + " \"custom_vars\": { \"checkout_clang_libs\": True, }\n" + "Then run gclient sync; rm " + "<out dir>/obj/build/rust/clanglibs/clang_libs.rsp.") + return -1 with open(args.depfile, 'w') as depfile: depfile.write("%s:" % args.output) with open(args.output, 'w') as output:
diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn index 8ea492b..543c159c 100644 --- a/chrome/BUILD.gn +++ b/chrome/BUILD.gn
@@ -591,7 +591,7 @@ inputs += [ "$root_gen_dir/chrome/${_strings_file}_${locale}.pak" ] } - foreach(locale, locales_as_mac_outputs) { + foreach(locale, locales_as_apple_outputs) { outputs += [ "$target_gen_dir/app_infoplist_strings/$locale.lproj/InfoPlist.strings", ] @@ -618,7 +618,7 @@ } } - foreach(locale, locales_as_mac_outputs) { + foreach(locale, locales_as_apple_outputs) { bundle_data("chrome_app_strings_${locale}_bundle_data") { sources = [ "$target_gen_dir/app_infoplist_strings/$locale.lproj/InfoPlist.strings", @@ -630,7 +630,7 @@ } group("chrome_app_strings_bundle_data") { public_deps = [] - foreach(locale, locales_as_mac_outputs) { + foreach(locale, locales_as_apple_outputs) { public_deps += [ ":chrome_app_strings_${locale}_bundle_data" ] } }
diff --git a/chrome/VERSION b/chrome/VERSION index b3c1c105..be1b1cc9 100644 --- a/chrome/VERSION +++ b/chrome/VERSION
@@ -1,4 +1,4 @@ MAJOR=101 MINOR=0 -BUILD=4935 +BUILD=4936 PATCH=0
diff --git a/chrome/android/expectations/lint-baseline.xml b/chrome/android/expectations/lint-baseline.xml index 45bcd5b..825ffd7 100644 --- a/chrome/android/expectations/lint-baseline.xml +++ b/chrome/android/expectations/lint-baseline.xml
@@ -5679,39 +5679,6 @@ <issue id="WrongConstant" - message="Must be one of: AutofillAssistantGetClientTokenResult.CALLED, AutofillAssistantGetClientTokenResult.SUCCESS, AutofillAssistantGetClientTokenResult.FAILURE" - errorLine1=" AutofillAssistantGetClientTokenResult.NUM_ENTRIES);" - errorLine2=" ~~~~~~~~~~~"> - <location - file="../../clank/components/autofill_assistant/android/internal/java/src/org/chromium/chrome/browser/autofill_assistant/user_data/GmsIntegrator.java" - line="122" - column="55"/> - </issue> - - <issue - id="WrongConstant" - message="Must be one of: AutofillAssistantGetClientTokenResult.CALLED, AutofillAssistantGetClientTokenResult.SUCCESS, AutofillAssistantGetClientTokenResult.FAILURE" - errorLine1=" AutofillAssistantGetClientTokenResult.NUM_ENTRIES);" - errorLine2=" ~~~~~~~~~~~"> - <location - file="../../clank/components/autofill_assistant/android/internal/java/src/org/chromium/chrome/browser/autofill_assistant/user_data/GmsIntegrator.java" - line="129" - column="63"/> - </issue> - - <issue - id="WrongConstant" - message="Must be one of: AutofillAssistantGetClientTokenResult.CALLED, AutofillAssistantGetClientTokenResult.SUCCESS, AutofillAssistantGetClientTokenResult.FAILURE" - errorLine1=" AutofillAssistantGetClientTokenResult.NUM_ENTRIES);" - errorLine2=" ~~~~~~~~~~~"> - <location - file="../../clank/components/autofill_assistant/android/internal/java/src/org/chromium/chrome/browser/autofill_assistant/user_data/GmsIntegrator.java" - line="138" - column="63"/> - </issue> - - <issue - id="WrongConstant" message="Must be one of: OmniboxSuggestionUiType.DEFAULT, OmniboxSuggestionUiType.EDIT_URL_SUGGESTION, OmniboxSuggestionUiType.ANSWER_SUGGESTION, OmniboxSuggestionUiType.ENTITY_SUGGESTION, OmniboxSuggestionUiType.TAIL_SUGGESTION, OmniboxSuggestionUiType.CLIPBOARD_SUGGESTION, OmniboxSuggestionUiType.TILE_SUGGESTION, OmniboxSuggestionUiType.TILE_NAVSUGGEST, OmniboxSuggestionUiType.PEDAL_SUGGESTION" errorLine1=" return OmniboxSuggestionUiType.HEADER;" errorLine2=" ~~~~~~">
diff --git a/chrome/android/features/tab_ui/java/res/layout/tab_selection_editor_toolbar.xml b/chrome/android/features/tab_ui/java/res/layout/tab_selection_editor_toolbar.xml index 2077d666..1258de3 100644 --- a/chrome/android/features/tab_ui/java/res/layout/tab_selection_editor_toolbar.xml +++ b/chrome/android/features/tab_ui/java/res/layout/tab_selection_editor_toolbar.xml
@@ -14,5 +14,5 @@ android:layout_gravity="end" android:enabled="false" android:text="@string/tab_selection_editor_group" - style="@style/TextButton.Inverse" /> + style="@style/TextButton.OnAccent1" /> </org.chromium.chrome.browser.tasks.tab_management.TabSelectionEditorToolbar> \ No newline at end of file
diff --git a/chrome/android/java/res/layout/bookmark_save_flow.xml b/chrome/android/java/res/layout/bookmark_save_flow.xml index f4fb6dc..7a066f27 100644 --- a/chrome/android/java/res/layout/bookmark_save_flow.xml +++ b/chrome/android/java/res/layout/bookmark_save_flow.xml
@@ -5,6 +5,7 @@ <org.chromium.ui.widget.ViewLookupCachingFrameLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" android:focusable="true"> @@ -67,10 +68,10 @@ android:layout_width="wrap_content" android:layout_height="72dp" android:text="@string/bookmark_item_edit" - android:textAppearance="@style/TextAppearance.TextMedium.Link" style="@style/TextButton" android:paddingStart="24dp" - android:paddingEnd="24dp" /> + android:paddingEnd="24dp" + android:textAppearance="@style/TextAppearance.TextMedium.Link"/> </LinearLayout> <View
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeBaseAppCompatActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeBaseAppCompatActivity.java index 9be394e..b1915b02 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeBaseAppCompatActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeBaseAppCompatActivity.java
@@ -243,6 +243,10 @@ // still use dynamic colors, as in the android:textColorHighlight example where we use a // color state list that depends on colorPrimary. setTheme(R.style.ThemeOverlay_DynamicColorOverrides); + + if (CachedFeatureFlags.isEnabled(ChromeFeatureList.DYNAMIC_COLOR_BUTTONS_ANDROID)) { + setTheme(R.style.ThemeOverlay_DynamicButtons); + } } /**
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/accessibility_tab_switcher/AccessibilityTabModelAdapter.java b/chrome/android/java/src/org/chromium/chrome/browser/accessibility_tab_switcher/AccessibilityTabModelAdapter.java index f5aafc8..645f138 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/accessibility_tab_switcher/AccessibilityTabModelAdapter.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/accessibility_tab_switcher/AccessibilityTabModelAdapter.java
@@ -177,7 +177,7 @@ } void focusTabWithId(int tabId) { - if (mTabIdToFocus != Tab.INVALID_TAB_ID) { + if (mTabIdToFocus != Tab.INVALID_TAB_ID && mListItemToFocus != null) { mListItemToFocus.removeOnAttachStateChangeListener(mItemToFocusAttachedListener); mListItemToFocus = null; }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/read_later/ReadingListUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/read_later/ReadingListUtils.java index 8d57263..ee9be5c 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/read_later/ReadingListUtils.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/read_later/ReadingListUtils.java
@@ -9,6 +9,7 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import org.chromium.base.Log; import org.chromium.chrome.browser.bookmarks.BookmarkBridge; import org.chromium.chrome.browser.bookmarks.BookmarkBridge.BookmarkItem; import org.chromium.chrome.browser.bookmarks.BookmarkModel; @@ -28,6 +29,8 @@ /** Utility functions for reading list feature. */ public final class ReadingListUtils { + private static final String TAG = "ReadingListUtils"; + private static Boolean sReadingListSupportedForTesting; private static Boolean sSkipShowSaveFlowForTesting; @@ -98,7 +101,8 @@ } /** - * Performs type swapping on the given bookmarks if necessary. + * Performs type swapping on the given bookmarks if necessary. The input list will be modified, + * removing bookmarks that have been type swapped and thus don't need to be moved. * * @param bookmarkBridge The BookmarkBridge to perform add/delete operations. * @param bookmarksToMove The List of bookmarks to potentially type swap. @@ -128,10 +132,11 @@ existingBookmark.getTitle(), existingBookmark.getUrl()); } - if (newBookmark != null) { - bookmarkBridge.deleteBookmark(bookmarkId); - outputList.add(newBookmark); + if (newBookmark == null) { + Log.e(TAG, "Null bookmark after typeswapping."); + continue; } + bookmarkBridge.deleteBookmark(bookmarkId); } bookmarksToMove.addAll(outputList);
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/read_later/ReadingListUtilsUnitTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/read_later/ReadingListUtilsUnitTest.java index b9cde46..58cb5bc 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/read_later/ReadingListUtilsUnitTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/read_later/ReadingListUtilsUnitTest.java
@@ -203,6 +203,7 @@ verify(bookmarkBridge) .addToReadingList("Test", JUnitTestGURLs.getGURL(JUnitTestGURLs.NTP_URL)); verify(bookmarkBridge).deleteBookmark(existingBookmarkId); + Assert.assertEquals(0, bookmarks.size()); } @Test @@ -228,6 +229,7 @@ verify(bookmarkBridge) .addBookmark(parentId, 0, "Test", JUnitTestGURLs.getGURL(JUnitTestGURLs.NTP_URL)); verify(bookmarkBridge).deleteBookmark(existingBookmarkId); + Assert.assertEquals(0, bookmarks.size()); } @Test @@ -261,7 +263,7 @@ bookmarks.add(existingBookmarkId1); bookmarks.add(existingBookmarkId2); ReadingListUtils.typeSwapBookmarksIfNecessary(bookmarkBridge, bookmarks, parentId); - Assert.assertEquals(2, bookmarks.size()); + Assert.assertEquals(0, bookmarks.size()); verify(bookmarkBridge) .addBookmark(parentId, 0, "Test1", JUnitTestGURLs.getGURL(JUnitTestGURLs.NTP_URL)); @@ -286,6 +288,7 @@ ArrayList<BookmarkId> bookmarks = new ArrayList<>(); bookmarks.add(existingBookmarkId); ReadingListUtils.typeSwapBookmarksIfNecessary(bookmarkBridge, bookmarks, parentId); + Assert.assertEquals(1, bookmarks.size()); Assert.assertEquals(existingBookmarkId, bookmarks.get(0)); }
diff --git a/chrome/android/profiles/newest.txt b/chrome/android/profiles/newest.txt index ade157a..271ae24 100644 --- a/chrome/android/profiles/newest.txt +++ b/chrome/android/profiles/newest.txt
@@ -1 +1 @@ -chromeos-chrome-amd64-101.0.4930.0_rc-r1-merged.afdo.bz2 +chromeos-chrome-amd64-101.0.4932.0_rc-r1-merged.afdo.bz2
diff --git a/chrome/app/chrome_command_ids.h b/chrome/app/chrome_command_ids.h index b9171643..fc1259fcb 100644 --- a/chrome/app/chrome_command_ids.h +++ b/chrome/app/chrome_command_ids.h
@@ -446,6 +446,11 @@ #define IDC_CONTENT_CONTEXT_QUICK_ANSWERS_INLINE_QUERY 52414 #endif +#if BUILDFLAG(IS_LINUX) +// Screen AI +#define IDC_RUN_SCREEN_AI 52420 +#endif + // Tab Search #define IDC_TAB_SEARCH 52500 #define IDC_TAB_SEARCH_CLOSE 52501
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index 03a4ffc..121ea70b 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd
@@ -12513,6 +12513,18 @@ <message name="IDS_INPUT_OVERLAY_MENU_SEND_FEEDBACK" desc="Entry point to send feedback regarding input-overlay."> Send feedback </message> + <message name="IDS_INPUT_OVERLAY_EDIT_MENU_KEYBOARD_KEY" desc="Entry point to bind action to keyboard key."> + Keyboard key + </message> + <message name="IDS_INPUT_OVERLAY_EDIT_MENU_LEFT_MOUSE_CLICK" desc="Entry point to bind action to left mouse click."> + Left mouse click + </message> + <message name="IDS_INPUT_OVERLAY_EDIT_MENU_RIGHT_MOUSE_CLICK" desc="Entry point to bind action to right mouse click."> + Right mouse click + </message> + <message name="IDS_INPUT_OVERLAY_EDIT_MENU_RESET" desc="Entry point to reset the action binding to original binding."> + Reset + </message> </if> <!-- Privacy Sandbox Dialog strings -->
diff --git a/chrome/app/generated_resources_grd/IDS_INPUT_OVERLAY_EDIT_MENU_KEYBOARD_KEY.png.sha1 b/chrome/app/generated_resources_grd/IDS_INPUT_OVERLAY_EDIT_MENU_KEYBOARD_KEY.png.sha1 new file mode 100644 index 0000000..61dd8df --- /dev/null +++ b/chrome/app/generated_resources_grd/IDS_INPUT_OVERLAY_EDIT_MENU_KEYBOARD_KEY.png.sha1
@@ -0,0 +1 @@ +b96a21600211771ce507ff242ac45b9e1eb32163 \ No newline at end of file
diff --git a/chrome/app/generated_resources_grd/IDS_INPUT_OVERLAY_EDIT_MENU_LEFT_MOUSE_CLICK.png.sha1 b/chrome/app/generated_resources_grd/IDS_INPUT_OVERLAY_EDIT_MENU_LEFT_MOUSE_CLICK.png.sha1 new file mode 100644 index 0000000..35f312d --- /dev/null +++ b/chrome/app/generated_resources_grd/IDS_INPUT_OVERLAY_EDIT_MENU_LEFT_MOUSE_CLICK.png.sha1
@@ -0,0 +1 @@ +6518316cf08b665d60ceb7de4e11285057182dbf \ No newline at end of file
diff --git a/chrome/app/generated_resources_grd/IDS_INPUT_OVERLAY_EDIT_MENU_RESET.png.sha1 b/chrome/app/generated_resources_grd/IDS_INPUT_OVERLAY_EDIT_MENU_RESET.png.sha1 new file mode 100644 index 0000000..d3a0e0b --- /dev/null +++ b/chrome/app/generated_resources_grd/IDS_INPUT_OVERLAY_EDIT_MENU_RESET.png.sha1
@@ -0,0 +1 @@ +d5be5fd232130b123fabc527730d91ea5987bc90 \ No newline at end of file
diff --git a/chrome/app/generated_resources_grd/IDS_INPUT_OVERLAY_EDIT_MENU_RIGHT_MOUSE_CLICK.png.sha1 b/chrome/app/generated_resources_grd/IDS_INPUT_OVERLAY_EDIT_MENU_RIGHT_MOUSE_CLICK.png.sha1 new file mode 100644 index 0000000..84350e33 --- /dev/null +++ b/chrome/app/generated_resources_grd/IDS_INPUT_OVERLAY_EDIT_MENU_RIGHT_MOUSE_CLICK.png.sha1
@@ -0,0 +1 @@ +9267de7fca5ce17793c9c9aaf234b64276ab267d \ No newline at end of file
diff --git a/chrome/app/settings_chromium_strings.grdp b/chrome/app/settings_chromium_strings.grdp index 78d760de..50a6c0cd 100644 --- a/chrome/app/settings_chromium_strings.grdp +++ b/chrome/app/settings_chromium_strings.grdp
@@ -156,6 +156,47 @@ If you also share Chromium usage reports, those reports include the URLs you visit </message> + <!-- Privacy Sandbox --> + <message name="IDS_SETTINGS_PRIVACY_SANDBOX_LEARN_MORE_DIALOG_TOPICS_TITLE" translateable="false" desc="Title of the browser-based interests section of the dialog to learn more about ad personalization."> + Your interests as estimated by Chromium + </message> + <message name="IDS_SETTINGS_PRIVACY_SANDBOX_LEARN_MORE_DIALOG_TOPICS_DATA_TYPES" translateable="false" desc="Description for Topic's data types subsection of the dialog to learn more about ad personalization."> + Your browsing history, a record of sites you've visited using Chromium on this device. + </message> + <message name="IDS_SETTINGS_PRIVACY_SANDBOX_LEARN_MORE_DIALOG_TOPICS_DATA_USAGE" translateable="false" desc="Description for Topic's data usage subsection of the dialog to learn more about ad personalization."> + Chromium can estimate your interests. Later, a site you visit can ask Chromium to see your interests in order to personalize the content and ads you see. + </message> + <message name="IDS_SETTINGS_PRIVACY_SANDBOX_LEARN_MORE_DIALOG_TOPICS_DATA_MANAGEMENT" translateable="false" desc="Description for Topic's data management subsection of the dialog to learn more about ad personalization."> + To protect your privacy, we auto-delete your interests that are older than 3 weeks. Interests can refresh. Or you can remove interests you don't want Chromium to consider. + </message> + <message name="IDS_SETTINGS_PRIVACY_SANDBOX_LEARN_MORE_DIALOG_FLEDGE_DATA_TYPES" translateable="false" desc="Description for Fledge's data types subsection of the dialog to learn more about ad personalization."> + Your browsing history, a record of sites you've visited using Chromium on this device. + </message> + <message name="IDS_SETTINGS_PRIVACY_SANDBOX_LEARN_MORE_DIALOG_FLEDGE_DATA_USAGE" translateable="false" desc="Description for Fledge's data usage subsection of the dialog to learn more about ad personalization."> + Sites can store information with Chromium about your interests. For example, if you visit a site to buy shoes for a marathon, the site might define your interest as running marathons. Later, if you visit a different site to register for a race, that site can see this interest and show you content and ads for running shoes. + </message> + <message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_DESCRIPTION" translateable="false" desc="Description of the main page of the 'ad personalization' dialog."> + Your browsing history affects the ads you see and the interests as estimated below. To protect your privacy, Chromium auto-deletes your interests on a rolling basis each month. Interests can refresh unless you remove them. + </message> + <message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_TOPICS_TITLE" translateable="false" desc="Title of the browser-based interests section of the 'ad personalization' dialog."> + Your interests as estimated by Chromium + </message> + <message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_TOPICS_LEARN_MORE_1" translateable="false" desc="First learn more description of the browser-based interests section of the 'ad personalization' dialog."> + Chromium can estimate your interests based on your browsing history from the last few weeks. This info stays on your device. + </message> + <message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_TOPICS_LEARN_MORE_2" translateable="false" desc="Second learn more description of the browser-based interests section of the 'ad personalization' dialog."> + Later, a site you visit can ask Chromium to see your interests in order to personalize the ads you see. Without identifying who you are, Chromium can share up to 3 interests. + </message> + <message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_TOPICS_LEARN_MORE_3" translateable="false" desc="Third learn more description of the browser-based interests section of the 'ad personalization' dialog."> + Your interests are deleted and refreshed each week. And if Chromium gets it wrong or you don't want to see certain ads, you can remove an interest. + </message> + <message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_FLEDGE_LEARN_MORE_1" translateable="false" desc="First learn more description of the website-based interests section of the 'ad personalization' dialog."> + It's common for sites you visit to remember things you're interested in, to personalize your experience. Sites can also store information with Chromium about your interests. + </message> + <message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_MEASUREMENT_DIALOG_DESCRIPTION" translateable="false" desc="Main description of the 'ad measurement' dialog."> + Ad measurement allows sites you visit to request information from Chromium that helps the site measure the performance of their ads. Ad measurement restricts cross-site tracking by transferring as little information as possible between sites. + </message> + <!-- Safety check --> <message name="IDS_SETTINGS_SAFETY_CHECK_PARENT_PRIMARY_LABEL_BEFORE" desc="This text describes what the safety check is. (It's an area of the Settings page where users can quickly check whether their safety-related settings are fully protecting them.)"> Chromium can help keep you safe from data breaches, bad extensions, and more
diff --git a/chrome/app/settings_google_chrome_strings.grdp b/chrome/app/settings_google_chrome_strings.grdp index 8c0d496..38af87a 100644 --- a/chrome/app/settings_google_chrome_strings.grdp +++ b/chrome/app/settings_google_chrome_strings.grdp
@@ -182,6 +182,47 @@ If you also share Chrome usage reports, those reports include the URLs you visit </message> + <!-- Privacy Sandbox --> + <message name="IDS_SETTINGS_PRIVACY_SANDBOX_LEARN_MORE_DIALOG_TOPICS_TITLE" translateable="false" desc="Title of the browser-based interests section of the dialog to learn more about ad personalization."> + Your interests as estimated by Chrome + </message> + <message name="IDS_SETTINGS_PRIVACY_SANDBOX_LEARN_MORE_DIALOG_TOPICS_DATA_TYPES" translateable="false" desc="Description for Topic's data types subsection of the dialog to learn more about ad personalization."> + Your browsing history, a record of sites you've visited using Chrome on this device. + </message> + <message name="IDS_SETTINGS_PRIVACY_SANDBOX_LEARN_MORE_DIALOG_TOPICS_DATA_USAGE" translateable="false" desc="Description for Topic's data usage subsection of the dialog to learn more about ad personalization."> + Chrome can estimate your interests. Later, a site you visit can ask Chrome to see your interests in order to personalize the content and ads you see. + </message> + <message name="IDS_SETTINGS_PRIVACY_SANDBOX_LEARN_MORE_DIALOG_TOPICS_DATA_MANAGEMENT" translateable="false" desc="Description for Topic's data management subsection of the dialog to learn more about ad personalization."> + To protect your privacy, we auto-delete your interests that are older than 3 weeks. Interests can refresh. Or you can remove interests you don't want Chrome to consider. + </message> + <message name="IDS_SETTINGS_PRIVACY_SANDBOX_LEARN_MORE_DIALOG_FLEDGE_DATA_TYPES" translateable="false" desc="Description for Fledge's data types subsection of the dialog to learn more about ad personalization."> + Your browsing history, a record of sites you've visited using Chrome on this device. + </message> + <message name="IDS_SETTINGS_PRIVACY_SANDBOX_LEARN_MORE_DIALOG_FLEDGE_DATA_USAGE" translateable="false" desc="Description for Fledge's data usage subsection of the dialog to learn more about ad personalization."> + Sites can store information with Chrome about your interests. For example, if you visit a site to buy shoes for a marathon, the site might define your interest as running marathons. Later, if you visit a different site to register for a race, that site can see this interest and show you content and ads for running shoes. + </message> + <message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_DESCRIPTION" translateable="false" desc="Description of the main page of the 'ad personalization' dialog."> + Your browsing history affects the ads you see and the interests as estimated below. To protect your privacy, Chrome auto-deletes your interests on a rolling basis each month. Interests can refresh unless you remove them. + </message> + <message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_TOPICS_TITLE" translateable="false" desc="Title of the browser-based interests section of the 'ad personalization' dialog."> + Your interests as estimated by Chrome + </message> + <message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_TOPICS_LEARN_MORE_1" translateable="false" desc="First learn more description of the browser-based interests section of the 'ad personalization' dialog."> + Chrome can estimate your interests based on your browsing history from the last few weeks. This info stays on your device. + </message> + <message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_TOPICS_LEARN_MORE_2" translateable="false" desc="Second learn more description of the browser-based interests section of the 'ad personalization' dialog."> + Later, a site you visit can ask Chrome to see your interests in order to personalize the ads you see. Without identifying who you are, Chrome can share up to 3 interests. + </message> + <message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_TOPICS_LEARN_MORE_3" translateable="false" desc="Third learn more description of the browser-based interests section of the 'ad personalization' dialog."> + Your interests are deleted and refreshed each week. And if Chrome gets it wrong or you don't want to see certain ads, you can remove an interest. + </message> + <message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_FLEDGE_LEARN_MORE_1" translateable="false" desc="First learn more description of the website-based interests section of the 'ad personalization' dialog."> + It's common for sites you visit to remember things you're interested in, to personalize your experience. Sites can also store information with Chrome about your interests. + </message> + <message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_MEASUREMENT_DIALOG_DESCRIPTION" translateable="false" desc="Main description of the 'ad measurement' dialog."> + Ad measurement allows sites you visit to request information from Chrome that helps the site measure the performance of their ads. Ad measurement restricts cross-site tracking by transferring as little information as possible between sites. + </message> + <!-- Safety check --> <message name="IDS_SETTINGS_SAFETY_CHECK_PARENT_PRIMARY_LABEL_BEFORE" desc="This text describes what the safety check is. (It's an area of the Settings page where users can quickly check whether their safety-related settings are fully protecting them.)"> Chrome can help keep you safe from data breaches, bad extensions, and more
diff --git a/chrome/app/settings_strings.grdp b/chrome/app/settings_strings.grdp index ba89a79..0ce03c4 100644 --- a/chrome/app/settings_strings.grdp +++ b/chrome/app/settings_strings.grdp
@@ -1413,34 +1413,34 @@ Trials </message> <message name="IDS_SETTINGS_PRIVACY_SANDBOX_TRIALS_SUMMARY" translateable="false" desc="Summary of the Trails section of the privacy sandbox settings."> - Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. + With Privacy Sandbox trials, sites can deliver the same browsing experience using less of your info. That means more privacy for you and less cross-site tracking. We'll add new trials as they're ready to test. + </message> + <message name="IDS_SETTINGS_PRIVACY_SANDBOX_TRIALS_SUMMARY_LEARN_MORE" translateable="false" desc="Part of the Trials section summary that can be interacted with to learn more about the Privacy Sandbox Trials."> + About Browser-based ad personalization </message> <message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_TITLE" translateable="false" desc="Title of the Ad Personalization section of the privacy sandbox settings."> Browser-based ad personalization </message> <message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_SUMMARY" translateable="false" desc="Summary of the Ad Personalization section of the privacy sandbox settings."> - Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. + Your browsing history affects the ads you see </message> <message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_MEASUREMENT_TITLE" translateable="false" desc="Title of the Ad Measurement section of the privacy sandbox settings."> Ad measurement </message> <message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_MEASUREMENT_SUMMARY" translateable="false" desc="Summary of the Ad Measurement section of the privacy sandbox settings."> - Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. + Advertisers can understand how ads perform </message> <message name="IDS_SETTINGS_PRIVACY_SANDBOX_SPAM_AND_FRAUD_TITLE" translateable="false" desc="Title of the Spam and Fraud section of the privacy sandbox settings."> Spam & fraud reduction </message> <message name="IDS_SETTINGS_PRIVACY_SANDBOX_SPAM_AND_FRAUD_SUMMARY" translateable="false" desc="Summary of the Spam and Fraud section of the privacy sandbox settings."> - Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. + Help sites fight fraud and distinguish bots from people </message> <message name="IDS_SETTINGS_PRIVACY_SANDBOX_LEARN_MORE_DIALOG_TITLE" translateable="false" desc="Title of the dialog to learn more about ad personalization."> - About Browser-based ad personalization - </message> - <message name="IDS_SETTINGS_PRIVACY_SANDBOX_LEARN_MORE_DIALOG_TOPICS_TITLE" translateable="false" desc="Title of the browser-based interests section of the dialog to learn more about ad personalization."> - Your interests as estimated by your browser + About ad personalization </message> <message name="IDS_SETTINGS_PRIVACY_SANDBOX_LEARN_MORE_DIALOG_FLEDGE_TITLE" translateable="false" desc="Title of the website-based interests section of the dialog to learn more about ad personalization."> - Your interests as defined by sites you visit + Sites you visit that define your interests </message> <message name="IDS_SETTINGS_PRIVACY_SANDBOX_LEARN_MORE_DIALOG_DATA_TYPES" translateable="false" desc="Title of the data types subsection of the dialog to learn more about ad personalization."> What data is used: @@ -1451,77 +1451,65 @@ <message name="IDS_SETTINGS_PRIVACY_SANDBOX_LEARN_MORE_DIALOG_DATA_MANAGEMENT" translateable="false" desc="Title of the data management subsection of the dialog to learn more about ad personalization."> How you can manage your data: </message> + <message name="IDS_SETTINGS_PRIVACY_SANDBOX_LEARN_MORE_DIALOG_FLEDGE_DATA_MANAGEMENT" translateable="false" desc="Description for Fledge's data management subsection of the dialog to learn more about ad personalization."> + To protect your privacy, we auto-delete sites from the list that are older than 4 weeks. A site you visit again might appear on the list again. Or you can remove a site if you don't want that site to ever define interests for you.. + </message> <message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_TITLE" translateable="false" desc="Title of the 'ad personalization' dialog."> Browser-based ad personalization </message> - <message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_DESCRIPTION" translateable="false" desc="Description of the main page of the 'ad personalization' dialog."> - Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. + <message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_REMOVED_DIALOG_TITLE" translateable="false" desc="Title of the removed interests page of the 'ad personalization' dialog."> + Interests you removed </message> - <message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_REMOVED_DESCRIPTION" translateable="false" desc="Description of the removed interests page of the 'ad personalization' dialog."> - Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. - </message> - <message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_TOPICS_TITLE" translateable="false" desc="Title of the browser-based interests section of the 'ad personalization' dialog."> - Your interests as estimated by your browser - </message> - <message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_TOPICS_LEARN_MORE_1" translateable="false" desc="First learn more description of the browser-based interests section of the 'ad personalization' dialog."> - Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. - </message> - <message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_TOPICS_LEARN_MORE_2" translateable="false" desc="Second learn more description of the browser-based interests section of the 'ad personalization' dialog."> - Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. - </message> - <message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_TOPICS_LEARN_MORE_3" translateable="false" desc="Third learn more description of the browser-based interests section of the 'ad personalization' dialog."> - Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. + <message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_REMOVED_DIALOG_DESCRIPTION" translateable="false" desc="Description of the removed interests page of the 'ad personalization' dialog."> + Add an interest or site if you think ads related to the item would be useful to you </message> <message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_TOPICS_EMPTY" translateable="false" desc="Description of the empty state of the browser-based interests section of the 'ad personalization' dialog."> - A list of interests will appear here as you browse the web - </message> - <message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_REMOVED_TOPICS_EMPTY" translateable="false" desc="Description of the empty state of the removed browser-based interests section of the 'ad personalization' dialog."> - You haven’t removed any interests + A list of interests appears here as you browse the web </message> <message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_REMOVED_TOPICS_LABEL" translateable="false" desc="Label of the row to go to the removed browser-based interests section of the 'ad personalization' dialog."> Interests you removed </message> + <message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_REMOVED_TOPICS_EMPTY" translateable="false" desc="Description of the empty state of the removed browser-based interests section of the 'ad personalization' dialog."> + You haven't removed any interests + </message> + <message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_TOPICS_LEARN_MORE_4" translateable="false" desc="Fourth learn more description of the browser-based interests section of the 'ad personalization' dialog."> + Topics represent categories of interest that the browser infers based on the pages you visit. With this new method, sites you've visited are no longer visible to other sites across the web, as they might have been with third-party cookies. + </message> <message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_FLEDGE_TITLE" translateable="false" desc="Title of the website-based interests section of the 'ad personalization' dialog."> Sites you visit that define your interests </message> - <message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_FLEDGE_LEARN_MORE_1" translateable="false" desc="First learn more description of the website-based interests section of the 'ad personalization' dialog."> - Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. - </message> - <message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_FLEDGE_LEARN_MORE_2" translateable="false" desc="Second learn more description of the website-based interests section of the 'ad personalization' dialog."> - Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. - </message> - <message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_FLEDGE_LEARN_MORE_3" translateable="false" desc="Third learn more description of the website-based interests section of the 'ad personalization' dialog."> - Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. - </message> <message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_FLEDGE_EMPTY" translateable="false" desc="Description of the empty state of the website-based interests section of the 'ad personalization' dialog."> - A list of sites you've visited will appear here as you browse the web - </message> - <message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_REMOVED_FLEDGE_EMPTY" translateable="false" desc="Description of the empty state of the removed website-based interests section of the 'ad personalization' dialog."> - You haven’t removed any sites + A list of sites you visit appears here as you browse the web </message> <message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_REMOVED_FLEDGE_LABEL" translateable="false" desc="Label of the row to go to the removed website-based interests section of the 'ad personalization' dialog."> Sites you removed </message> + <message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_REMOVED_FLEDGE_EMPTY" translateable="false" desc="Description of the empty state of the removed website-based interests section of the 'ad personalization' dialog."> + You haven't removed any sites + </message> + <message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_FLEDGE_LEARN_MORE_2" translateable="false" desc="Second learn more description of the website-based interests section of the 'ad personalization' dialog."> + For example, if you visit a site to buy shoes for a marathon, the site might define your interest as running marathons. Later, if you visit a different site to register for a race, that site can see this interest and show you an ad for running shoes. + </message> + <message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_FLEDGE_LEARN_MORE_3" translateable="false" desc="Third learn more description of the website-based interests section of the 'ad personalization' dialog."> + The list of sites that define your interests is deleted and refreshed each month. Or you can remove a site If you don't want that site to ever define interests for you. + </message> <message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_MEASUREMENT_DIALOG_TITLE" translateable="false" desc="Title of the 'ad measurement' dialog."> Ad measurement </message> - <message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_MEASUREMENT_DIALOG_DESCRIPTION" translateable="false" desc="Main description of the 'ad measurement' dialog."> - Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. - </message> <message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_MEASUREMENT_DIALOG_CONTROL_MEASUREMENT" translateable="false" desc="Control measurement description of the 'ad measurement' dialog."> - Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua <ph name="BEGIN_LINK"><a href="$1" target="_blank"></ph>browsing history<ph name="END_LINK"></a></ph>. + You can control measurement information associated with you by accessing <ph name="BEGIN_LINK"><a href="$1" target="_blank"></ph>your browsing history<ph name="END_LINK"></a></ph>. </message> <message name="IDS_SETTINGS_PRIVACY_SANDBOX_SPAM_AND_FRAUD_DIALOG_TITLE" translateable="false" desc="Title of the 'spam and fraud reduction' dialog."> Spam and fraud reduction </message> <message name="IDS_SETTINGS_PRIVACY_SANDBOX_SPAM_AND_FRAUD_DIALOG_DESCRIPTION1" translateable="false" desc="First description of the 'spam and fraud reduction' dialog."> - Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. + Spam & fraud reduction relies on trust tokens to help sites fight fraud and distinguish bots from people. </message> <message name="IDS_SETTINGS_PRIVACY_SANDBOX_SPAM_AND_FRAUD_DIALOG_DESCRIPTION2" translateable="false" desc="Second description of the 'spam and fraud reduction' dialog."> - Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. + Based on your interaction with a site, like regularly signing in to an account, that site can issue a trust token to your browser. Later, if other sites you visit check for and find a valid trust token, they're more likely to treat you like a person and not a bot. </message> <message name="IDS_SETTINGS_PRIVACY_SANDBOX_SPAM_AND_FRAUD_DIALOG_DESCRIPTION3" translateable="false" desc="Third description of the 'spam and fraud reduction' dialog."> - Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. + Trust tokens improve privacy on the web and can't be used to find out who you are. </message> <!-- Privacy Guide -->
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index faebbb3..7948d620 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -4333,6 +4333,9 @@ FEATURE_WITH_PARAMS_VALUE_TYPE(feed::kWebFeed, kWebFeedVariations, "WebFeed")}, + {"web-feed-onboarding", flag_descriptions::kWebFeedOnboardingName, + flag_descriptions::kWebFeedOnboardingDescription, kOsAndroid, + FEATURE_VALUE_TYPE(feed::kWebFeedOnboarding)}, {"web-feed-sort", flag_descriptions::kWebFeedSortName, flag_descriptions::kWebFeedSortDescription, kOsAndroid, FEATURE_VALUE_TYPE(feed::kWebFeedSort)}, @@ -8308,6 +8311,19 @@ flag_descriptions::kAppProvisioningStaticName, flag_descriptions::kAppProvisioningStaticDescription, kOsCrOS, FEATURE_VALUE_TYPE(features::kAppProvisioningStatic)}, + + {"enable-projector", flag_descriptions::kProjectorName, + flag_descriptions::kProjectorDescription, kOsCrOS, + FEATURE_VALUE_TYPE(ash::features::kProjector)}, + + {"enable-projector-annotator", flag_descriptions::kProjectorAnnotatorName, + flag_descriptions::kProjectorAnnotatorDescription, kOsCrOS, + FEATURE_VALUE_TYPE(ash::features::kProjectorAnnotator)}, + + {"enable-projector-exclude-transcript", + flag_descriptions::kProjectorExcludeTranscriptName, + flag_descriptions::kProjectorExcludeTranscriptDescription, kOsCrOS, + FEATURE_VALUE_TYPE(ash::features::kProjectorExcludeTranscript)}, #endif // BUILDFLAG(IS_CHROMEOS_ASH) // NOTE: Adding a new flag requires adding a corresponding entry to enum
diff --git a/chrome/browser/android/webapk/webapk_installer.cc b/chrome/browser/android/webapk/webapk_installer.cc index 5e491d1..78581e7 100644 --- a/chrome/browser/android/webapk/webapk_installer.cc +++ b/chrome/browser/android/webapk/webapk_installer.cc
@@ -141,6 +141,23 @@ } // static +void WebApkInstaller::InstallForServiceAsync( + content::BrowserContext* context, + std::unique_ptr<std::string> serialized_webapk, + const std::u16string& short_name, + webapps::ShortcutInfo::Source source, + const SkBitmap& primary_icon, + bool is_primary_icon_maskable, + GURL& manifest_url, + FinishCallback finish_callback) { + // The installer will delete itself when it is done. + WebApkInstaller* installer = new WebApkInstaller(context); + installer->InstallForServiceAsync( + std::move(serialized_webapk), short_name, source, primary_icon, + is_primary_icon_maskable, manifest_url, std::move(finish_callback)); +} + +// static void WebApkInstaller::UpdateAsync(content::BrowserContext* context, const base::FilePath& update_request_path, FinishCallback finish_callback) { @@ -162,6 +179,21 @@ } // static +void WebApkInstaller::InstallForServiceAsyncForTesting( + WebApkInstaller* installer, + std::unique_ptr<std::string> serialized_webapk, + const std::u16string& short_name, + webapps::ShortcutInfo::Source source, + const SkBitmap& primary_icon, + bool is_primary_icon_maskable, + GURL& manifest_url, + FinishCallback callback) { + installer->InstallForServiceAsync( + std::move(serialized_webapk), short_name, source, primary_icon, + is_primary_icon_maskable, manifest_url, std::move(callback)); +} + +// static void WebApkInstaller::UpdateAsyncForTesting( WebApkInstaller* installer, const base::FilePath& update_request_path, @@ -249,7 +281,7 @@ gfx::ConvertToJavaBitmap(install_primary_icon_); Java_WebApkInstaller_installWebApkAsync( env, java_ref_, java_webapk_package, webapk_version_, java_title, - java_token, install_shortcut_info_->source, java_primary_icon); + java_token, source_, java_primary_icon); } else { Java_WebApkInstaller_updateAsync(env, java_ref_, java_webapk_package, webapk_version_, java_title, java_token); @@ -264,8 +296,7 @@ if (result == WebApkInstallResult::SUCCESS) { webapk::TrackInstallDuration(install_duration_timer_->Elapsed()); webapk::TrackInstallEvent(webapk::INSTALL_COMPLETED); - WebApkUkmRecorder::RecordInstall(install_shortcut_info_->manifest_url, - webapk_version_); + WebApkUkmRecorder::RecordInstall(manifest_url_, webapk_version_); } else { DVLOG(1) << "The WebAPK installation failed."; webapk::TrackInstallEvent(webapk::INSTALL_FAILED); @@ -277,6 +308,7 @@ WebApkInstaller::WebApkInstaller(content::BrowserContext* browser_context) : browser_context_(browser_context), + install_from_webapk_service_(false), webapk_server_timeout_ms_(kWebApkDownloadUrlTimeoutMs), webapk_version_(0), relax_updates_(false), @@ -296,6 +328,7 @@ const SkBitmap& primary_icon, bool is_primary_icon_maskable, FinishCallback finish_callback) { + DCHECK(!install_from_webapk_service_); install_duration_timer_ = std::make_unique<base::ElapsedTimer>(); web_contents_ = web_contents->GetWeakPtr(); @@ -305,6 +338,8 @@ is_primary_icon_maskable_ = is_primary_icon_maskable; short_name_ = shortcut_info.short_name; finish_callback_ = std::move(finish_callback); + source_ = install_shortcut_info_->source; + manifest_url_ = install_shortcut_info_->manifest_url; task_type_ = INSTALL; if (!server_url_.is_valid()) { @@ -315,6 +350,40 @@ CheckFreeSpace(); } +void WebApkInstaller::InstallForServiceAsync( + std::unique_ptr<std::string> serialized_webapk, + const std::u16string& short_name, + webapps::ShortcutInfo::Source source, + const SkBitmap& primary_icon, + bool is_primary_icon_maskable, + GURL& manifest_url, + FinishCallback finish_callback) { + install_duration_timer_ = std::make_unique<base::ElapsedTimer>(); + install_from_webapk_service_ = true; + + short_name_ = short_name; + manifest_url_ = manifest_url; + install_primary_icon_ = primary_icon; + is_primary_icon_maskable_ = is_primary_icon_maskable; + source_ = source; + serialized_webapk_ = std::move(serialized_webapk); + finish_callback_ = std::move(finish_callback); + task_type_ = INSTALL; + + std::unique_ptr<webapk::WebApk> proto(new webapk::WebApk); + if (!proto->ParseFromString(*serialized_webapk_.get())) { + OnResult(WebApkInstallResult::FAILURE); + return; + } + + if (!server_url_.is_valid()) { + OnResult(WebApkInstallResult::FAILURE); + return; + } + + CheckFreeSpace(); +} + void WebApkInstaller::CheckFreeSpace() { JNIEnv* env = base::android::AttachCurrentThread(); Java_WebApkInstaller_checkFreeSpace(env, java_ref_); @@ -342,6 +411,7 @@ void WebApkInstaller::UpdateAsync(const base::FilePath& update_request_path, FinishCallback finish_callback) { + DCHECK(!install_from_webapk_service_); finish_callback_ = std::move(finish_callback); task_type_ = UPDATE; @@ -367,8 +437,7 @@ webapk_package_ = proto->package_name(); short_name_ = base::UTF8ToUTF16(proto->manifest().short_name()); - - net::NetworkTrafficAnnotationTag traffic_annotation = + const net::NetworkTrafficAnnotationTag traffic_annotation_update_request = net::DefineNetworkTrafficAnnotation("webapk_update", R"( semantics { sender: "WebAPK" @@ -414,7 +483,7 @@ } )"); - SendRequest(traffic_annotation, std::move(update_request)); + SendRequest(traffic_annotation_update_request, std::move(update_request)); } void WebApkInstaller::OnURLLoaderComplete( @@ -466,6 +535,61 @@ } void WebApkInstaller::OnHaveSufficientSpaceForInstall() { + if (install_from_webapk_service_) { + DCHECK(!serialized_webapk_.get()->empty()); + // We already have a serialized WebAPK request, so we can skip fetching the + // icons and building the proto. + + const net::NetworkTrafficAnnotationTag + traffic_annotation_install_from_service = + net::DefineNetworkTrafficAnnotation("webapk_create_for_service", R"( + semantics { + sender: "WebAPK" + description: + "At the requesting app's request, Chrome can install supported web " + "apps on Android so that they show up in the user's app drawer and " + "optionally home screen. Web apps installed in this way are called " + "WebAPKs. See " + "https://developers.google.com/web/fundamentals/integration/webapks " + "for more details. WebAPKs are created on a Google server on " + "behalf of the Chrome client and the requesting app. In order for " + "the server to create a WebAPK, it first needs to know metadata " + "about the web app that the user wants to install, as well as some " + "details about the user's device. Upon successful WebAPK creation, " + "the server will return a URL from which the WebAPK can be " + "downloaded along with a few other details about the WebAPK (its " + "size, version, and hash, for example)." + trigger: "Chrome received a WebAPK install request via its install-" + "scheduling service from another app." + data: + "The 'WebApk' message in components/webapk/webapk.proto lists the " + "full contents of a WebAPK request. Note that 'package_name', " + "'version', and 'update_reasons' will not be filled in for initial " + "app installation requests, but only for future app updates. The " + "proto includes:\n" + " * the URL of the web app's Web Application Manifest (see " + "https://www.w3.org/TR/appmanifest/ for details)\n" + " * the parsed contents of the web app's Web Application Manifest " + "(includes things like the app's name and description, URLs to " + "icons, and other app features)\n" + " * the Android package name and version string of the browser " + "from which the user made the request\n" + " * the ABI and Android OS version of the device that made the " + "request" + destination: GOOGLE_OWNED_SERVICE + } + policy { + cookies_allowed: NO + policy_exception_justification: "Not implemented." + setting: "This feature cannot be disabled." + } + )"); + + SendRequest(traffic_annotation_install_from_service, + std::move(serialized_webapk_)); + return; + } + // We need to take the hash of the bitmap at the icon URL prior to any // transformations being applied to the bitmap (such as encoding/decoding // the bitmap). The icon hash is used to determine whether the icon that @@ -476,7 +600,6 @@ // should be fast because the icon should be in the HTTP cache. std::set<GURL> icons = install_shortcut_info_->GetWebApkIcons(); - webapps::WebApkIconHasher::DownloadAndComputeMurmur2Hash( GetURLLoaderFactory(browser_context_), web_contents_, url::Origin::Create(install_shortcut_info_->url), icons, @@ -492,7 +615,10 @@ return; } - net::NetworkTrafficAnnotationTag traffic_annotation = + DCHECK(!install_from_webapk_service_); + DCHECK(install_shortcut_info_); + + net::NetworkTrafficAnnotationTag traffic_annotation_install_from_chrome = net::DefineNetworkTrafficAnnotation("webapk_create", R"( semantics { sender: "WebAPK" @@ -538,14 +664,14 @@ // Using empty string for |primary_icon_data| and |splash_icon_data| here // because in WebApk installs, we are using the icon data from |hashes|. - BuildProto( - *install_shortcut_info_, std::string() /* primary_icon_data */, - is_primary_icon_maskable_, std::string() /* splash_icon_data */, - "" /* package_name */, "" /* version */, std::move(*hashes), - false /* is_manifest_stale */, - false /* is_app_identity_update_supported */, - base::BindOnce(&WebApkInstaller::SendRequest, - weak_ptr_factory_.GetWeakPtr(), traffic_annotation)); + BuildProto(*install_shortcut_info_, std::string() /* primary_icon_data */, + is_primary_icon_maskable_, std::string() /* splash_icon_data */, + "" /* package_name */, "" /* version */, std::move(*hashes), + false /* is_manifest_stale */, + false /* is_app_identity_update_supported */, + base::BindOnce(&WebApkInstaller::SendRequest, + weak_ptr_factory_.GetWeakPtr(), + traffic_annotation_install_from_chrome)); } void WebApkInstaller::SendRequest(
diff --git a/chrome/browser/android/webapk/webapk_installer.h b/chrome/browser/android/webapk/webapk_installer.h index 14171911..32a9b4a 100644 --- a/chrome/browser/android/webapk/webapk_installer.h +++ b/chrome/browser/android/webapk/webapk_installer.h
@@ -16,6 +16,7 @@ #include "base/memory/weak_ptr.h" #include "base/timer/timer.h" #include "chrome/browser/android/webapk/webapk_install_service.h" +#include "components/webapps/browser/android/shortcut_info.h" #include "components/webapps/browser/android/webapk/webapk_icon_hasher.h" #include "components/webapps/browser/android/webapk/webapk_types.h" #include "third_party/abseil-cpp/absl/types/optional.h" @@ -40,10 +41,6 @@ class SimpleURLLoader; } // namespace network -namespace webapps { -struct ShortcutInfo; -} // namespace webapps - // The enum values are persisted to logs |WebApkInstallSpaceStatus| in // enums.xml, therefore they should never be reused nor renumbered. // A Java counterpart will be generated for this enum. @@ -78,6 +75,22 @@ FinishCallback finish_callback); // Creates a self-owned WebApkInstaller instance and talks to the Chrome + // WebAPK server to generate a WebAPK on the server and locally requests the + // APK to be installed. This function is used when the install is scheduled by + // the WebApkInstallSchedulerService as this already receives the + // |serialized_webapk| from the client. Calls |callback| once the install + // completed or failed. + static void InstallForServiceAsync( + content::BrowserContext* context, + std::unique_ptr<std::string> serialized_webapk, + const std::u16string& short_name, + webapps::ShortcutInfo::Source source, + const SkBitmap& primary_icon, + bool is_primary_icon_maskable, + GURL& manifest_url, + FinishCallback finish_callback); + + // Creates a self-owned WebApkInstaller instance and talks to the Chrome // WebAPK server to update a WebAPK on the server and locally requests the // APK to be installed. Calls |callback| once the install completed or failed. // |update_request_path| is the path of the file with the update request. @@ -94,6 +107,18 @@ bool is_primary_icon_maskable, FinishCallback callback); + // Calls the private function |InstallForServiceAsync| for testing. + // Should be used only for testing. + static void InstallForServiceAsyncForTesting( + WebApkInstaller* installer, + std::unique_ptr<std::string> serialized_webapk, + const std::u16string& short_name, + webapps::ShortcutInfo::Source source, + const SkBitmap& primary_icon, + bool is_primary_icon_maskable, + GURL& manifest_url, + FinishCallback callback); + // Calls the private function |UpdateAsync| for testing. // Should be used only for testing. static void UpdateAsyncForTesting(WebApkInstaller* installer, @@ -189,6 +214,17 @@ void UpdateAsync(const base::FilePath& update_request_path, FinishCallback finish_callback); + // Talks to the Chrome WebAPK server to generate a WebAPK on the server and to + // Google Play to install the downloaded WebAPK when the install is requested + // by Weblayer. Calls |finish_callback| once the install completed or failed. + void InstallForServiceAsync(std::unique_ptr<std::string> serialized_webapk, + const std::u16string& short_name, + webapps::ShortcutInfo::Source source, + const SkBitmap& primary_icon, + bool is_primary_icon_maskable, + GURL& manifest_url, + FinishCallback finish_callback); + // Called once there is sufficient space on the user's device to install a // WebAPK. The user may already have had sufficient space on their device // prior to initiating the install process. This method might be called as a @@ -232,9 +268,19 @@ FinishCallback finish_callback_; // Data for installs. - std::unique_ptr<webapps::ShortcutInfo> install_shortcut_info_; - SkBitmap install_primary_icon_; + // True if install was scheduled via WebApkInstallSchedulerService + bool install_from_webapk_service_; + + // Only available if the install was scheduled by the + // WebApkInstallSchedulerService. + std::unique_ptr<std::string> serialized_webapk_; + + // Only available if the install was scheduled directly in chrome and not in + // the WebApkInstallSchedulerService. + std::unique_ptr<webapps::ShortcutInfo> install_shortcut_info_; + + SkBitmap install_primary_icon_; bool is_primary_icon_maskable_; std::u16string short_name_; @@ -242,6 +288,10 @@ // WebAPK server URL. GURL server_url_; + webapps::ShortcutInfo::Source source_; + + GURL manifest_url_; + // The number of milliseconds to wait for the WebAPK server to respond. int webapk_server_timeout_ms_;
diff --git a/chrome/browser/android/webapk/webapk_installer_unittest.cc b/chrome/browser/android/webapk/webapk_installer_unittest.cc index df7faf3..7c26fa5 100644 --- a/chrome/browser/android/webapk/webapk_installer_unittest.cc +++ b/chrome/browser/android/webapk/webapk_installer_unittest.cc
@@ -130,6 +130,25 @@ run_loop.Run(); } + void RunInstallForService(std::unique_ptr<WebApkInstaller> installer, + std::unique_ptr<std::string> serialized_webapk, + const std::u16string& short_name, + webapps::ShortcutInfo::Source source) { + base::RunLoop run_loop; + on_completed_callback_ = run_loop.QuitClosure(); + + GURL manifest_url("httsp://manifest.com"); + + // WebApkInstaller owns itself. + WebApkInstaller::InstallForServiceAsyncForTesting( + installer.release(), std::move(serialized_webapk), short_name, source, + SkBitmap(), false, manifest_url, + base::BindOnce(&WebApkInstallerRunner::OnCompleted, + base::Unretained(this))); + + run_loop.Run(); + } + void RunUpdateWebApk(std::unique_ptr<WebApkInstaller> installer, const base::FilePath& update_request_path) { base::RunLoop run_loop; @@ -256,17 +275,25 @@ webapk::WebApk* GetWebApkRequest() { return webapk_request_.get(); } + std::unique_ptr<std::string> TakeSerializedWebApk() { + return std::move(serialized_webapk_); + } + private: // Called when the |webapk_request_| is populated. void OnBuiltWebApkProto(std::unique_ptr<std::string> serialized_proto) { webapk_request_ = std::make_unique<webapk::WebApk>(); webapk_request_->ParseFromString(*serialized_proto); + serialized_webapk_ = std::move(serialized_proto); std::move(on_completed_callback_).Run(); } // The populated webapk::WebApk. std::unique_ptr<webapk::WebApk> webapk_request_; + // The serialized webapk::WebApk. + std::unique_ptr<std::string> serialized_webapk_; + // Called after the |webapk_request_| is built. base::OnceClosure on_completed_callback_; }; @@ -331,6 +358,26 @@ return info; } + std::unique_ptr<std::string> DefaultSerializedWebApk() { + std::string icon_url_1 = test_server()->GetURL("/icon1.png").spec(); + std::string icon_url_2 = test_server()->GetURL("/icon2.png").spec(); + std::map<std::string, webapps::WebApkIconHasher::Icon> + icon_url_to_murmur2_hash; + icon_url_to_murmur2_hash[icon_url_1] = {"data1", "1"}; + icon_url_to_murmur2_hash[icon_url_2] = {"data2", "2"}; + + std::string primary_icon_data = "data3"; + std::string splash_icon_data = "data4"; + + std::unique_ptr<BuildProtoRunner> runner = CreateBuildProtoRunner(); + runner->BuildSync(GURL(), GURL(), std::move(icon_url_to_murmur2_hash), + primary_icon_data, splash_icon_data, + true /* is_manifest_stale */, + true /* is_app_identity_update_supported */, {}); + + return runner->TakeSerializedWebApk(); + } + // Sets the URL to send the webapk::CreateWebApkRequest to. WebApkInstaller // should fail if the URL is not |kServerUrl|. void SetWebApkServerUrl(const GURL& server_url) { @@ -450,6 +497,53 @@ EXPECT_EQ(WebApkInstallResult::FAILURE, runner.result()); } +// InstallForService tests + +// Test installation for service succeeding +TEST_F(WebApkInstallerTest, ServiceSuccess) { + std::unique_ptr<WebApkInstaller> installer( + new TestWebApkInstaller(profile(), SpaceStatus::ENOUGH_SPACE)); + + webapps::ShortcutInfo shortcut_info = DefaultShortcutInfo(); + + WebApkInstallerRunner runner; + runner.RunInstallForService(std::move(installer), DefaultSerializedWebApk(), + shortcut_info.short_name, shortcut_info.source); + + EXPECT_EQ(WebApkInstallResult::SUCCESS, runner.result()); +} + +// Test installation for service failing if not enough space +TEST_F(WebApkInstallerTest, ServiceFailOnLowSpace) { + std::unique_ptr<WebApkInstaller> installer( + new TestWebApkInstaller(profile(), SpaceStatus::NOT_ENOUGH_SPACE)); + + webapps::ShortcutInfo shortcut_info = DefaultShortcutInfo(); + + WebApkInstallerRunner runner; + runner.RunInstallForService(std::move(installer), DefaultSerializedWebApk(), + shortcut_info.short_name, shortcut_info.source); + + EXPECT_EQ(WebApkInstallResult::FAILURE, runner.result()); +} + +// Test installation for service failing if serialized apk invalid. +TEST_F(WebApkInstallerTest, ServiceFailOnInvalidSerializedWebApk) { + std::unique_ptr<WebApkInstaller> installer( + new TestWebApkInstaller(profile(), SpaceStatus::ENOUGH_SPACE)); + + webapps::ShortcutInfo shortcut_info = DefaultShortcutInfo(); + std::string invalid_serialized_webapk = "😀"; + + WebApkInstallerRunner runner; + runner.RunInstallForService( + std::move(installer), + std::make_unique<std::string>(invalid_serialized_webapk), + shortcut_info.short_name, shortcut_info.source); + + EXPECT_EQ(WebApkInstallResult::FAILURE, runner.result()); +} + namespace { // Returns an HttpResponse which cannot be parsed as a webapk::WebApkResponse.
diff --git a/chrome/browser/apps/app_service/app_service_proxy_ash.cc b/chrome/browser/apps/app_service/app_service_proxy_ash.cc index be88efb4..69f6b1d 100644 --- a/chrome/browser/apps/app_service/app_service_proxy_ash.cc +++ b/chrome/browser/apps/app_service/app_service_proxy_ash.cc
@@ -181,7 +181,8 @@ LoadIconForDialog( update, base::BindOnce(&AppServiceProxyAsh::OnLoadIconForPauseDialog, - weak_ptr_factory_.GetWeakPtr(), update.AppType(), + weak_ptr_factory_.GetWeakPtr(), + ConvertMojomAppTypToAppType(update.AppType()), update.AppId(), update.Name(), data.second)); }); } @@ -296,12 +297,12 @@ const apps::AppUpdate& update) { auto icon_key = update.IconKey(); DCHECK(icon_key.has_value()); + auto app_type = ConvertMojomAppTypToAppType(update.AppType()); auto uninstall_dialog_ptr = std::make_unique<UninstallDialog>( - profile_, update.AppType(), update.AppId(), update.Name(), - parent_window, + profile_, app_type, update.AppId(), update.Name(), parent_window, base::BindOnce(&AppServiceProxyAsh::OnUninstallDialogClosed, - weak_ptr_factory_.GetWeakPtr(), update.AppType(), - update.AppId(), uninstall_source)); + weak_ptr_factory_.GetWeakPtr(), app_type, update.AppId(), + uninstall_source)); UninstallDialog* uninstall_dialog = uninstall_dialog_ptr.get(); uninstall_dialog_ptr->SetDialogCreatedCallbackForTesting( std::move(callback)); @@ -311,7 +312,7 @@ } void AppServiceProxyAsh::OnUninstallDialogClosed( - apps::mojom::AppType app_type, + apps::AppType app_type, const std::string& app_id, apps::mojom::UninstallSource uninstall_source, bool uninstall, @@ -321,8 +322,8 @@ if (uninstall) { app_registry_cache_.ForOneApp(app_id, RecordAppBounce); - app_service_->Uninstall(app_type, app_id, uninstall_source, clear_site_data, - report_abuse); + app_service_->Uninstall(ConvertAppTypeToMojomAppType(app_type), app_id, + uninstall_source, clear_site_data, report_abuse); PerformPostUninstallTasks(app_type, app_id, uninstall_source); } @@ -355,8 +356,8 @@ ash::app_time::AppTimeLimitInterface* app_limit = ash::app_time::AppTimeLimitInterface::Get(profile_); DCHECK(app_limit); - auto time_limit = - app_limit->GetTimeLimitForApp(update.AppId(), update.AppType()); + auto time_limit = app_limit->GetTimeLimitForApp( + update.AppId(), ConvertMojomAppTypToAppType(update.AppType())); if (!time_limit.has_value()) { NOTREACHED(); return true; @@ -366,7 +367,8 @@ pause_data.minutes = time_limit.value().InMinutes() % 60; LoadIconForDialog( update, base::BindOnce(&AppServiceProxyAsh::OnLoadIconForPauseDialog, - weak_ptr_factory_.GetWeakPtr(), update.AppType(), + weak_ptr_factory_.GetWeakPtr(), + ConvertMojomAppTypToAppType(update.AppType()), update.AppId(), update.Name(), pause_data)); return true; } @@ -448,7 +450,7 @@ } } -void AppServiceProxyAsh::OnLoadIconForPauseDialog(apps::mojom::AppType app_type, +void AppServiceProxyAsh::OnLoadIconForPauseDialog(apps::AppType app_type, const std::string& app_id, const std::string& app_name, const PauseData& pause_data, @@ -469,7 +471,7 @@ } } -void AppServiceProxyAsh::OnPauseDialogClosed(apps::mojom::AppType app_type, +void AppServiceProxyAsh::OnPauseDialogClosed(apps::AppType app_type, const std::string& app_id) { bool should_pause_app = pending_pause_requests_.IsPaused(app_id); if (!should_pause_app) { @@ -481,7 +483,7 @@ }); } if (should_pause_app) { - app_service_->PauseApp(app_type, app_id); + app_service_->PauseApp(ConvertAppTypeToMojomAppType(app_type), app_id); } } @@ -515,13 +517,13 @@ } void AppServiceProxyAsh::PerformPostUninstallTasks( - apps::mojom::AppType app_type, + apps::AppType app_type, const std::string& app_id, apps::mojom::UninstallSource uninstall_source) { if (app_platform_metrics_service_ && app_platform_metrics_service_->AppPlatformMetrics()) { app_platform_metrics_service_->AppPlatformMetrics()->RecordAppUninstallUkm( - ConvertMojomAppTypToAppType(app_type), app_id, uninstall_source); + app_type, app_id, uninstall_source); } }
diff --git a/chrome/browser/apps/app_service/app_service_proxy_ash.h b/chrome/browser/apps/app_service/app_service_proxy_ash.h index 8f3932a..dc52e79 100644 --- a/chrome/browser/apps/app_service/app_service_proxy_ash.h +++ b/chrome/browser/apps/app_service/app_service_proxy_ash.h
@@ -127,7 +127,7 @@ const gfx::ImageSkia& image, Profile* profile); - static void CreatePauseDialog(apps::mojom::AppType app_type, + static void CreatePauseDialog(apps::AppType app_type, const std::string& app_name, const gfx::ImageSkia& image, const PauseData& pause_data, @@ -145,7 +145,7 @@ // available for Chrome Apps only. If true, the app will be reported for abuse // to the Web Store. |uninstall_dialog| will be removed from // |uninstall_dialogs_|. - void OnUninstallDialogClosed(apps::mojom::AppType app_type, + void OnUninstallDialogClosed(apps::AppType app_type, const std::string& app_id, apps::mojom::UninstallSource uninstall_source, bool uninstall, @@ -167,7 +167,7 @@ IconValuePtr icon_value); // Callback invoked when the icon is loaded for the pause app dialog. - void OnLoadIconForPauseDialog(apps::mojom::AppType app_type, + void OnLoadIconForPauseDialog(apps::AppType app_type, const std::string& app_id, const std::string& app_name, const PauseData& pause_data, @@ -175,8 +175,7 @@ // Invoked when the user clicks the 'OK' button of the pause app dialog. // AppService stops the running app and applies the paused app icon effect. - void OnPauseDialogClosed(apps::mojom::AppType app_type, - const std::string& app_id); + void OnPauseDialogClosed(apps::AppType app_type, const std::string& app_id); // apps::AppRegistryCache::Observer overrides: void OnAppUpdate(const apps::AppUpdate& update) override; @@ -194,7 +193,7 @@ void InitAppPlatformMetrics(); void PerformPostUninstallTasks( - apps::mojom::AppType app_type, + apps::AppType app_type, const std::string& app_id, apps::mojom::UninstallSource uninstall_source) override;
diff --git a/chrome/browser/apps/app_service/app_service_proxy_base.cc b/chrome/browser/apps/app_service/app_service_proxy_base.cc index e091814..ca36772e 100644 --- a/chrome/browser/apps/app_service/app_service_proxy_base.cc +++ b/chrome/browser/apps/app_service/app_service_proxy_base.cc
@@ -420,7 +420,8 @@ apps::mojom::AppType app_type = app_registry_cache_.GetAppType(app_id); app_service_->Uninstall(app_type, app_id, uninstall_source, /*clear_site_data=*/false, /*report_abuse=*/false); - PerformPostUninstallTasks(app_type, app_id, uninstall_source); + PerformPostUninstallTasks(ConvertMojomAppTypToAppType(app_type), app_id, + uninstall_source); } } @@ -731,7 +732,7 @@ apps::mojom::LaunchContainer container) {} void AppServiceProxyBase::PerformPostUninstallTasks( - apps::mojom::AppType app_type, + apps::AppType app_type, const std::string& app_id, apps::mojom::UninstallSource uninstall_source) {}
diff --git a/chrome/browser/apps/app_service/app_service_proxy_base.h b/chrome/browser/apps/app_service/app_service_proxy_base.h index 4435fcf..94cc186 100644 --- a/chrome/browser/apps/app_service/app_service_proxy_base.h +++ b/chrome/browser/apps/app_service/app_service_proxy_base.h
@@ -371,7 +371,7 @@ apps::mojom::LaunchContainer container); virtual void PerformPostUninstallTasks( - apps::mojom::AppType app_type, + apps::AppType app_type, const std::string& app_id, apps::mojom::UninstallSource uninstall_source);
diff --git a/chrome/browser/apps/app_service/app_service_proxy_lacros.cc b/chrome/browser/apps/app_service/app_service_proxy_lacros.cc index 476bd70e..c726d84 100644 --- a/chrome/browser/apps/app_service/app_service_proxy_lacros.cc +++ b/chrome/browser/apps/app_service/app_service_proxy_lacros.cc
@@ -21,7 +21,7 @@ #include "chrome/browser/apps/app_service/launch_utils.h" #include "chrome/browser/apps/app_service/publishers/extension_apps.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/web_applications/app_service/web_apps_publisher_host.h" +#include "chrome/browser/web_applications/app_service/lacros_web_apps_controller.h" #include "chrome/browser/web_applications/web_app_provider.h" #include "chrome/browser/web_applications/web_app_utils.h" #include "chromeos/lacros/lacros_service.h" @@ -164,9 +164,9 @@ browser_app_launcher_ = std::make_unique<apps::BrowserAppLauncher>(profile_); if (profile_->IsMainProfile()) { - web_apps_publisher_host_ = - std::make_unique<web_app::WebAppsPublisherHost>(profile_); - web_apps_publisher_host_->Init(); + lacros_web_apps_controller_ = + std::make_unique<web_app::LacrosWebAppsController>(profile_); + lacros_web_apps_controller_->Init(); } // Make the chrome://app-icon/ resource available. @@ -593,14 +593,14 @@ crosapi_receiver_.FlushForTesting(); } -web_app::WebAppsPublisherHost* -AppServiceProxyLacros::WebAppsPublisherHostForTesting() { - return web_apps_publisher_host_.get(); +web_app::LacrosWebAppsController* +AppServiceProxyLacros::LacrosWebAppsControllerForTesting() { + return lacros_web_apps_controller_.get(); } void AppServiceProxyLacros::Shutdown() { - if (web_apps_publisher_host_) { - web_apps_publisher_host_->Shutdown(); + if (lacros_web_apps_controller_) { + lacros_web_apps_controller_->Shutdown(); } }
diff --git a/chrome/browser/apps/app_service/app_service_proxy_lacros.h b/chrome/browser/apps/app_service/app_service_proxy_lacros.h index 6c6102b..a35e808a 100644 --- a/chrome/browser/apps/app_service/app_service_proxy_lacros.h +++ b/chrome/browser/apps/app_service/app_service_proxy_lacros.h
@@ -37,7 +37,7 @@ class Profile; namespace web_app { -class WebAppsPublisherHost; +class LacrosWebAppsController; } // namespace web_app namespace apps { @@ -243,7 +243,7 @@ void SetWindowMode(const std::string& app_id, apps::mojom::WindowMode window_mode); - web_app::WebAppsPublisherHost* WebAppsPublisherHostForTesting(); + web_app::LacrosWebAppsController* LacrosWebAppsControllerForTesting(); protected: // An adapter, presenting an IconLoader interface based on the underlying @@ -364,7 +364,7 @@ bool is_using_testing_profile_ = false; base::OnceClosure dialog_created_callback_; - std::unique_ptr<web_app::WebAppsPublisherHost> web_apps_publisher_host_; + std::unique_ptr<web_app::LacrosWebAppsController> lacros_web_apps_controller_; mojo::Receiver<crosapi::mojom::AppServiceSubscriber> crosapi_receiver_{this}; int crosapi_app_service_proxy_version_ = 0;
diff --git a/chrome/browser/apps/app_service/uninstall_dialog.cc b/chrome/browser/apps/app_service/uninstall_dialog.cc index 35388c6..3ae3c20 100644 --- a/chrome/browser/apps/app_service/uninstall_dialog.cc +++ b/chrome/browser/apps/app_service/uninstall_dialog.cc
@@ -22,7 +22,7 @@ namespace apps { UninstallDialog::UninstallDialog(Profile* profile, - apps::mojom::AppType app_type, + apps::AppType app_type, const std::string& app_id, const std::string& app_name, gfx::NativeWindow parent_window, @@ -42,19 +42,19 @@ void UninstallDialog::PrepareToShow(IconKey icon_key, apps::IconLoader* icon_loader) { switch (app_type_) { - case apps::mojom::AppType::kArc: - case apps::mojom::AppType::kBorealis: - case apps::mojom::AppType::kPluginVm: + case apps::AppType::kArc: + case apps::AppType::kBorealis: + case apps::AppType::kPluginVm: break; - case apps::mojom::AppType::kCrostini: + case apps::AppType::kCrostini: // Crostini icons might be a big image, and not fit the size, so add the // resize icon effect, to resize the image. icon_key.icon_effects = static_cast<apps::IconEffects>( icon_key.icon_effects | apps::IconEffects::kMdIconStyle); break; - case apps::mojom::AppType::kChromeApp: - case apps::mojom::AppType::kStandaloneBrowserChromeApp: - case apps::mojom::AppType::kWeb: + case apps::AppType::kChromeApp: + case apps::AppType::kStandaloneBrowserChromeApp: + case apps::AppType::kWeb: UMA_HISTOGRAM_ENUMERATION("Extensions.UninstallSource", extensions::UNINSTALL_SOURCE_APP_LIST, extensions::NUM_UNINSTALL_SOURCES); @@ -70,15 +70,16 @@ if (base::FeatureList::IsEnabled(features::kAppServiceLoadIconWithoutMojom)) { auto icon_type = IconType::kStandard; icon_loader->LoadIconFromIconKey( - ConvertMojomAppTypToAppType(app_type_), app_id_, icon_key, icon_type, - size_hint_in_dip, kAllowPlaceholderIcon, + app_type_, app_id_, icon_key, icon_type, size_hint_in_dip, + kAllowPlaceholderIcon, base::BindOnce(&UninstallDialog::OnLoadIcon, weak_ptr_factory_.GetWeakPtr())); } else { auto mojom_icon_type = apps::mojom::IconType::kStandard; icon_loader->LoadIconFromIconKey( - app_type_, app_id_, ConvertIconKeyToMojomIconKey(icon_key), - mojom_icon_type, size_hint_in_dip, kAllowPlaceholderIcon, + ConvertAppTypeToMojomAppType(app_type_), app_id_, + ConvertIconKeyToMojomIconKey(icon_key), mojom_icon_type, + size_hint_in_dip, kAllowPlaceholderIcon, MojomIconValueToIconValueCallback(base::BindOnce( &UninstallDialog::OnLoadIcon, weak_ptr_factory_.GetWeakPtr()))); }
diff --git a/chrome/browser/apps/app_service/uninstall_dialog.h b/chrome/browser/apps/app_service/uninstall_dialog.h index eae0d8d..5aa2d6c 100644 --- a/chrome/browser/apps/app_service/uninstall_dialog.h +++ b/chrome/browser/apps/app_service/uninstall_dialog.h
@@ -11,8 +11,8 @@ #include "base/callback.h" #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" +#include "components/services/app_service/public/cpp/app_types.h" #include "components/services/app_service/public/cpp/icon_types.h" -#include "components/services/app_service/public/mojom/types.mojom.h" #include "ui/gfx/native_widget_types.h" #include "ui/views/widget/widget.h" @@ -58,7 +58,7 @@ virtual ~UiBase() = default; static views::Widget* Create(Profile* profile, - apps::mojom::AppType app_type, + apps::AppType app_type, const std::string& app_id, const std::string& app_name, gfx::ImageSkia image, @@ -85,7 +85,7 @@ using OnUninstallForTestingCallback = base::OnceCallback<void(bool)>; UninstallDialog(Profile* profile, - apps::mojom::AppType app_type, + apps::AppType app_type, const std::string& app_id, const std::string& app_name, gfx::NativeWindow parent_window, @@ -112,7 +112,7 @@ void OnLoadIcon(IconValuePtr icon_value); const raw_ptr<Profile> profile_; - const apps::mojom::AppType app_type_; + const apps::AppType app_type_; const std::string app_id_; const std::string app_name_; gfx::NativeWindow parent_window_;
diff --git a/chrome/browser/ash/app_restore/app_launch_handler.cc b/chrome/browser/ash/app_restore/app_launch_handler.cc index 901b78f0..db415093 100644 --- a/chrome/browser/ash/app_restore/app_launch_handler.cc +++ b/chrome/browser/ash/app_restore/app_launch_handler.cc
@@ -27,28 +27,28 @@ namespace { // Returns apps::AppTypeName used for metrics. -apps::AppTypeName GetHistogrameAppType(apps::mojom::AppType app_type) { +apps::AppTypeName GetHistogrameAppType(apps::AppType app_type) { switch (app_type) { - case apps::mojom::AppType::kUnknown: + case apps::AppType::kUnknown: return apps::AppTypeName::kUnknown; - case apps::mojom::AppType::kArc: + case apps::AppType::kArc: return apps::AppTypeName::kArc; - case apps::mojom::AppType::kBuiltIn: - case apps::mojom::AppType::kCrostini: + case apps::AppType::kBuiltIn: + case apps::AppType::kCrostini: return apps::AppTypeName::kUnknown; - case apps::mojom::AppType::kChromeApp: + case apps::AppType::kChromeApp: return apps::AppTypeName::kChromeApp; - case apps::mojom::AppType::kWeb: + case apps::AppType::kWeb: return apps::AppTypeName::kWeb; - case apps::mojom::AppType::kMacOs: - case apps::mojom::AppType::kPluginVm: - case apps::mojom::AppType::kStandaloneBrowser: - case apps::mojom::AppType::kStandaloneBrowserChromeApp: - case apps::mojom::AppType::kRemote: - case apps::mojom::AppType::kBorealis: - case apps::mojom::AppType::kExtension: + case apps::AppType::kMacOs: + case apps::AppType::kPluginVm: + case apps::AppType::kStandaloneBrowser: + case apps::AppType::kStandaloneBrowserChromeApp: + case apps::AppType::kRemote: + case apps::AppType::kBorealis: + case apps::AppType::kExtension: return apps::AppTypeName::kUnknown; - case apps::mojom::AppType::kSystemWeb: + case apps::AppType::kSystemWeb: return apps::AppTypeName::kSystemWeb; } } @@ -89,7 +89,8 @@ base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::BindOnce(&AppLaunchHandler::LaunchApp, GetWeakPtrAppLaunchHandler(), - update.AppType(), update.AppId())); + apps::ConvertMojomAppTypToAppType(update.AppType()), + update.AppId())); } void AppLaunchHandler::OnAppTypeInitialized(apps::AppType app_type) { @@ -137,24 +138,25 @@ if (app_id == app_constants::kChromeAppId) continue; + auto app_type = + apps::ConvertMojomAppTypToAppType(cache->GetAppType(app_id)); #if !defined(OFFICIAL_BUILD) // Make shift-click on the launch button launch apps with a delay. This // allows developers to simulate delayed launch behaviors with ARC apps. // TODO(crbug.com/1281685): Remove before feature launch. if (delay_.is_zero()) { - LaunchApp(cache->GetAppType(app_id), app_id); + LaunchApp(app_type, app_id); } else { base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( FROM_HERE, base::BindOnce(&AppLaunchHandler::LaunchApp, - GetWeakPtrAppLaunchHandler(), - cache->GetAppType(app_id), app_id), + GetWeakPtrAppLaunchHandler(), app_type, app_id), current_delay); current_delay += delay_; } #else DCHECK(delay_.is_zero()); - LaunchApp(cache->GetAppType(app_id), app_id); + LaunchApp(app_type, app_id); #endif } } @@ -165,7 +167,7 @@ return true; } -void AppLaunchHandler::LaunchApp(apps::mojom::AppType app_type, +void AppLaunchHandler::LaunchApp(apps::AppType app_type, const std::string& app_id) { DCHECK(restore_data_); DCHECK_NE(app_id, app_constants::kChromeAppId); @@ -178,27 +180,27 @@ } switch (app_type) { - case apps::mojom::AppType::kArc: + case apps::AppType::kArc: // ArcAppLaunchHandler handles ARC apps restoration and ARC apps // restoration could be delayed, so return to preserve the restore data // for ARC apps. return; - case apps::mojom::AppType::kChromeApp: - case apps::mojom::AppType::kWeb: - case apps::mojom::AppType::kSystemWeb: - case apps::mojom::AppType::kStandaloneBrowserChromeApp: + case apps::AppType::kChromeApp: + case apps::AppType::kWeb: + case apps::AppType::kSystemWeb: + case apps::AppType::kStandaloneBrowserChromeApp: if (ShouldLaunchSystemWebAppOrChromeApp(app_id, it->second)) LaunchSystemWebAppOrChromeApp(app_type, app_id, it->second); break; - case apps::mojom::AppType::kBuiltIn: - case apps::mojom::AppType::kCrostini: - case apps::mojom::AppType::kPluginVm: - case apps::mojom::AppType::kUnknown: - case apps::mojom::AppType::kMacOs: - case apps::mojom::AppType::kStandaloneBrowser: - case apps::mojom::AppType::kRemote: - case apps::mojom::AppType::kBorealis: - case apps::mojom::AppType::kExtension: + case apps::AppType::kBuiltIn: + case apps::AppType::kCrostini: + case apps::AppType::kPluginVm: + case apps::AppType::kUnknown: + case apps::AppType::kMacOs: + case apps::AppType::kStandaloneBrowser: + case apps::AppType::kRemote: + case apps::AppType::kBorealis: + case apps::AppType::kExtension: NOTREACHED(); break; } @@ -206,14 +208,14 @@ } void AppLaunchHandler::LaunchSystemWebAppOrChromeApp( - apps::mojom::AppType app_type, + apps::AppType app_type, const std::string& app_id, const app_restore::RestoreData::LaunchList& launch_list) { auto* proxy = apps::AppServiceProxyFactory::GetForProfile(profile_); DCHECK(proxy); - if (app_type == apps::mojom::AppType::kChromeApp || - app_type == apps::mojom::AppType::kStandaloneBrowserChromeApp) { + if (app_type == apps::AppType::kChromeApp || + app_type == apps::AppType::kStandaloneBrowserChromeApp) { OnExtensionLaunching(app_id); }
diff --git a/chrome/browser/ash/app_restore/app_launch_handler.h b/chrome/browser/ash/app_restore/app_launch_handler.h index ee437c5..562a1635 100644 --- a/chrome/browser/ash/app_restore/app_launch_handler.h +++ b/chrome/browser/ash/app_restore/app_launch_handler.h
@@ -9,7 +9,6 @@ #include "components/app_restore/restore_data.h" #include "components/services/app_service/public/cpp/app_registry_cache.h" #include "components/services/app_service/public/cpp/app_types.h" -#include "components/services/app_service/public/mojom/types.mojom.h" namespace apps { class AppUpdate; @@ -74,10 +73,10 @@ } private: - void LaunchApp(apps::mojom::AppType app_type, const std::string& app_id); + void LaunchApp(apps::AppType app_type, const std::string& app_id); virtual void LaunchSystemWebAppOrChromeApp( - apps::mojom::AppType app_type, + apps::AppType app_type, const std::string& app_id, const ::app_restore::RestoreData::LaunchList& launch_list);
diff --git a/chrome/browser/ash/arc/input_overlay/actions/action.h b/chrome/browser/ash/arc/input_overlay/actions/action.h index f7e3e62..7ad6df7 100644 --- a/chrome/browser/ash/arc/input_overlay/actions/action.h +++ b/chrome/browser/ash/arc/input_overlay/actions/action.h
@@ -15,6 +15,7 @@ #include "chrome/browser/ash/arc/input_overlay/actions/input_element.h" #include "chrome/browser/ash/arc/input_overlay/actions/position.h" #include "chrome/browser/ash/arc/input_overlay/constants.h" +#include "chrome/browser/ash/arc/input_overlay/display_overlay_controller.h" #include "chrome/browser/ash/arc/input_overlay/ui/action_label.h" #include "chrome/browser/ash/arc/input_overlay/ui/action_view.h" #include "ui/aura/window.h" @@ -29,6 +30,7 @@ constexpr char kMouse[] = "mouse"; class ActionView; +class DisplayOverlayController; // Parse position from Json. std::unique_ptr<Position> ParsePosition(const base::Value& value); @@ -68,6 +70,7 @@ // Get the UI location in the content view. virtual gfx::PointF GetUICenterPosition(const gfx::RectF& content_bounds) = 0; virtual std::unique_ptr<ActionView> CreateView( + DisplayOverlayController* display_overlay_controller, const gfx::RectF& content_bounds) = 0; bool IsNoneBound();
diff --git a/chrome/browser/ash/arc/input_overlay/actions/action_move.cc b/chrome/browser/ash/arc/input_overlay/actions/action_move.cc index 2d91260..629438ef 100644 --- a/chrome/browser/ash/arc/input_overlay/actions/action_move.cc +++ b/chrome/browser/ash/arc/input_overlay/actions/action_move.cc
@@ -49,8 +49,10 @@ class ActionMove::ActionMoveMouseView : public ActionView { public: - ActionMoveMouseView(Action* action, const gfx::RectF& content_bounds) - : ActionView(action) { + ActionMoveMouseView(Action* action, + DisplayOverlayController* display_overlay_controller, + const gfx::RectF& content_bounds) + : ActionView(action, display_overlay_controller) { auto label = std::make_unique<ActionLabel>(u"mouse cursor lock (esc)"); label->set_editable(false); auto label_size = label->GetPreferredSize(); @@ -68,8 +70,10 @@ class ActionMove::ActionMoveKeyView : public ActionView { public: - ActionMoveKeyView(Action* action, const gfx::RectF& content_bounds) - : ActionView(action) { + ActionMoveKeyView(Action* action, + DisplayOverlayController* display_overlay_controller, + const gfx::RectF& content_bounds) + : ActionView(action, display_overlay_controller) { int radius = std::max(kActionMoveMinRadius, action->GetUIRadius(content_bounds)); auto* action_move = static_cast<ActionMove*>(action); @@ -244,12 +248,15 @@ } std::unique_ptr<ActionView> ActionMove::CreateView( + DisplayOverlayController* display_overlay_controller, const gfx::RectF& content_bounds) { std::unique_ptr<ActionView> view; if (IsMouseBound()) { - view = std::make_unique<ActionMoveMouseView>(this, content_bounds); + view = std::make_unique<ActionMoveMouseView>( + this, display_overlay_controller, content_bounds); } else { - view = std::make_unique<ActionMoveKeyView>(this, content_bounds); + view = std::make_unique<ActionMoveKeyView>(this, display_overlay_controller, + content_bounds); } view->set_editable(false); auto center_pos = GetUICenterPosition(content_bounds);
diff --git a/chrome/browser/ash/arc/input_overlay/actions/action_move.h b/chrome/browser/ash/arc/input_overlay/actions/action_move.h index f409bc1e..5e5cc4d 100644 --- a/chrome/browser/ash/arc/input_overlay/actions/action_move.h +++ b/chrome/browser/ash/arc/input_overlay/actions/action_move.h
@@ -33,6 +33,7 @@ bool& keep_original_event) override; gfx::PointF GetUICenterPosition(const gfx::RectF& content_bounds) override; std::unique_ptr<ActionView> CreateView( + DisplayOverlayController* display_overlay_controller, const gfx::RectF& content_bounds) override; void set_move_distance(int move_distance) { move_distance_ = move_distance; }
diff --git a/chrome/browser/ash/arc/input_overlay/actions/action_tap.cc b/chrome/browser/ash/arc/input_overlay/actions/action_tap.cc index 650a1048..b4e4a56 100644 --- a/chrome/browser/ash/arc/input_overlay/actions/action_tap.cc +++ b/chrome/browser/ash/arc/input_overlay/actions/action_tap.cc
@@ -24,8 +24,10 @@ class ActionTap::ActionTapView : public ActionView { public: - ActionTapView(Action* action, const gfx::RectF& content_bounds) - : ActionView(action) { + ActionTapView(Action* action, + DisplayOverlayController* display_overlay_controller, + const gfx::RectF& content_bounds) + : ActionView(action, display_overlay_controller) { int radius = action->GetUIRadius(content_bounds); auto circle = std::make_unique<ActionCircle>(radius); std::string text; @@ -263,8 +265,10 @@ } std::unique_ptr<ActionView> ActionTap::CreateView( + DisplayOverlayController* display_overlay_controller, const gfx::RectF& content_bounds) { - auto view = std::make_unique<ActionTapView>(this, content_bounds); + auto view = std::make_unique<ActionTapView>(this, display_overlay_controller, + content_bounds); view->set_editable(true); auto center_pos = GetUICenterPosition(content_bounds); view->SetPositionFromCenterPosition(center_pos);
diff --git a/chrome/browser/ash/arc/input_overlay/actions/action_tap.h b/chrome/browser/ash/arc/input_overlay/actions/action_tap.h index 88eacf3..b9c1c5e 100644 --- a/chrome/browser/ash/arc/input_overlay/actions/action_tap.h +++ b/chrome/browser/ash/arc/input_overlay/actions/action_tap.h
@@ -28,6 +28,7 @@ bool& keep_original_event) override; gfx::PointF GetUICenterPosition(const gfx::RectF& content_bounds) override; std::unique_ptr<ActionView> CreateView( + DisplayOverlayController* display_overlay_controller, const gfx::RectF& content_bounds) override; private:
diff --git a/chrome/browser/ash/arc/input_overlay/display_overlay_controller.cc b/chrome/browser/ash/arc/input_overlay/display_overlay_controller.cc index 62f5881..ae0e12c 100644 --- a/chrome/browser/ash/arc/input_overlay/display_overlay_controller.cc +++ b/chrome/browser/ash/arc/input_overlay/display_overlay_controller.cc
@@ -27,58 +27,11 @@ // UI specs. constexpr int kMenuEntrySize = 56; constexpr int kMenuEntrySideMargin = 24; -constexpr SkColor kEditModeBgColor = SkColorSetA(SK_ColorGRAY, 0x99); constexpr SkColor kMenuEntryBgColor = SkColorSetA(SK_ColorWHITE, 0x99); constexpr int kCornerRadius = 8; } // namespace -// TODO(djacobo): Evaluate to move this to its own class for readability. -class DisplayOverlayController::InputMappingView : public views::View { - public: - explicit InputMappingView(DisplayOverlayController* owner) : owner_(owner) { - auto content_bounds = input_overlay::CalculateWindowContentBounds( - owner_->touch_injector_->target_window()); - auto& actions = owner_->touch_injector_->actions(); - SetBounds(content_bounds.x(), content_bounds.y(), content_bounds.width(), - content_bounds.height()); - for (auto& action : actions) { - auto view = action->CreateView(content_bounds); - if (view) - AddChildView(std::move(view)); - } - } - InputMappingView(const InputMappingView&) = delete; - InputMappingView& operator=(const InputMappingView&) = delete; - ~InputMappingView() override = default; - - void SetDisplayMode(const DisplayMode mode) { - if (current_display_mode_ == mode) - return; - switch (mode) { - case DisplayMode::kMenu: - case DisplayMode::kView: - SetBackground(nullptr); - break; - case DisplayMode::kEdit: - SetBackground(views::CreateSolidBackground(kEditModeBgColor)); - break; - default: - NOTREACHED(); - break; - } - for (auto* view : children()) { - auto* action_view = static_cast<ActionView*>(view); - action_view->SetDisplayMode(mode); - } - current_display_mode_ = mode; - } - - private: - DisplayOverlayController* const owner_; - DisplayMode current_display_mode_ = DisplayMode::kNone; -}; - DisplayOverlayController::DisplayOverlayController( TouchInjector* touch_injector) : touch_injector_(touch_injector) { @@ -288,6 +241,28 @@ return absl::optional<gfx::Rect>(menu_entry_->bounds()); } +void DisplayOverlayController::AddActionEditMenu(ActionView* anchor) { + RemoveActionEditMenu(); + auto* overlay_widget = GetOverlayWidget(); + DCHECK(overlay_widget); + if (!overlay_widget) + return; + auto* parent_view = overlay_widget->GetContentsView(); + DCHECK(parent_view); + if (!parent_view) + return; + auto action_edit_menu = ActionEditMenu::BuildActionTapEditMenu(this, anchor); + if (action_edit_menu) + action_edit_menu_ = parent_view->AddChildView(std::move(action_edit_menu)); +} + +void DisplayOverlayController::RemoveActionEditMenu() { + if (!action_edit_menu_) + return; + action_edit_menu_->parent()->RemoveChildViewT(action_edit_menu_); + action_edit_menu_ = nullptr; +} + bool DisplayOverlayController::HasMenuView() const { return input_menu_view_ != nullptr; }
diff --git a/chrome/browser/ash/arc/input_overlay/display_overlay_controller.h b/chrome/browser/ash/arc/input_overlay/display_overlay_controller.h index d91cc15f..89c4986 100644 --- a/chrome/browser/ash/arc/input_overlay/display_overlay_controller.h +++ b/chrome/browser/ash/arc/input_overlay/display_overlay_controller.h
@@ -7,9 +7,12 @@ #include "chrome/browser/ash/arc/input_overlay/actions/action.h" #include "chrome/browser/ash/arc/input_overlay/touch_injector.h" +#include "chrome/browser/ash/arc/input_overlay/ui/action_edit_menu.h" +#include "chrome/browser/ash/arc/input_overlay/ui/input_mapping_view.h" #include "ui/gfx/geometry/point.h" #include "ui/gfx/geometry/rect.h" #include "ui/views/controls/button/image_button.h" +#include "ui/views/layout/layout_types.h" #include "ui/views/widget/widget_observer.h" namespace views { @@ -19,7 +22,9 @@ namespace arc { namespace input_overlay { class TouchInjector; +class InputMappingView; class InputMenuView; +class ActionEditMenu; // DisplayOverlayController manages the input mapping view, view and edit mode, // menu, and educational dialog. @@ -35,15 +40,13 @@ // Get the bounds of |overlay_menu_entry_| in contents view. absl::optional<gfx::Rect> GetOverlayMenuEntryBounds(); - // For test: - gfx::Rect GetInputMappingViewBoundsForTesting(); + void AddActionEditMenu(ActionView* anchor); + void RemoveActionEditMenu(); private: friend class DisplayOverlayControllerTest; friend class InputMenuView; - - // InputMappingView is the whole view of the input mappings. - class InputMappingView; + friend class InputMappingView; void AddOverlay(); void RemoveOverlayIfAny(); @@ -58,7 +61,6 @@ views::Widget* GetOverlayWidget(); gfx::Point CalculateMenuEntryPosition(); - gfx::Rect get_menu_entry_bounds() const { return menu_entry_->bounds(); } bool HasMenuView() const; void SetInputMappingVisible(bool visible); bool GetInputMappingViewVisible() const; @@ -66,6 +68,11 @@ void SetTouchInjectorEnable(bool enable); bool GetTouchInjectorEnable(); + // For test: + gfx::Rect GetInputMappingViewBoundsForTesting(); + + TouchInjector* touch_injector() { return touch_injector_; } + TouchInjector* touch_injector_; // References to UI elements owned by the overlay widget. @@ -73,6 +80,7 @@ DisplayMode display_mode_ = DisplayMode::kNone; InputMenuView* input_menu_view_ = nullptr; views::ImageButton* menu_entry_ = nullptr; + ActionEditMenu* action_edit_menu_ = nullptr; }; } // namespace input_overlay
diff --git a/chrome/browser/ash/arc/input_overlay/display_overlay_controller_unittest.cc b/chrome/browser/ash/arc/input_overlay/display_overlay_controller_unittest.cc index 5b43370..fff8232 100644 --- a/chrome/browser/ash/arc/input_overlay/display_overlay_controller_unittest.cc +++ b/chrome/browser/ash/arc/input_overlay/display_overlay_controller_unittest.cc
@@ -42,6 +42,10 @@ public: DisplayOverlayControllerTest() = default; + gfx::Rect GetInputMappingViewBounds() { + return controller_->GetInputMappingViewBoundsForTesting(); + } + protected: std::unique_ptr<input_overlay::test::ArcTestWindow> arc_test_window_; std::unique_ptr<DisplayOverlayController> controller_; @@ -70,7 +74,7 @@ }; TEST_F(DisplayOverlayControllerTest, TestWindowBoundsChange) { - auto original_bounds = controller_->GetInputMappingViewBoundsForTesting(); + auto original_bounds = GetInputMappingViewBounds(); auto new_bounds = gfx::Rect(original_bounds); new_bounds.set_width(new_bounds.size().width() + 50); new_bounds.set_height(new_bounds.size().height() + 50); @@ -78,8 +82,9 @@ display::Display display = display::Screen::GetScreen()->GetPrimaryDisplay(); arc_test_window_->SetBounds(display, new_bounds); controller_->OnWindowBoundsChanged(); - auto updated_bounds = controller_->GetInputMappingViewBoundsForTesting(); + auto updated_bounds = GetInputMappingViewBounds(); EXPECT_NE(original_bounds, updated_bounds); } + } // namespace input_overlay } // namespace arc
diff --git a/chrome/browser/ash/arc/input_overlay/touch_injector.h b/chrome/browser/ash/arc/input_overlay/touch_injector.h index 83ebeeb..b672012 100644 --- a/chrome/browser/ash/arc/input_overlay/touch_injector.h +++ b/chrome/browser/ash/arc/input_overlay/touch_injector.h
@@ -13,6 +13,7 @@ #include "chrome/browser/ash/arc/input_overlay/constants.h" #include "chrome/browser/ash/arc/input_overlay/display_overlay_controller.h" #include "ui/events/event_rewriter.h" +#include "ui/events/event_source.h" #include "ui/gfx/geometry/rect_f.h" namespace aura { @@ -22,6 +23,7 @@ namespace arc { namespace input_overlay { class DisplayOverlayController; +class Action; // If the following touch move sent immediately, the touch move event is not // processed correctly by apps. This is a delayed time to send touch move @@ -42,7 +44,7 @@ ~TouchInjector() override; aura::Window* target_window() { return target_window_; } - const std::vector<std::unique_ptr<input_overlay::Action>>& actions() const { + const std::vector<std::unique_ptr<Action>>& actions() const { return actions_; } bool is_mouse_locked() const { return is_mouse_locked_; }
diff --git a/chrome/browser/ash/arc/input_overlay/ui/action_edit_button.cc b/chrome/browser/ash/arc/input_overlay/ui/action_edit_button.cc new file mode 100644 index 0000000..c01198c --- /dev/null +++ b/chrome/browser/ash/arc/input_overlay/ui/action_edit_button.cc
@@ -0,0 +1,75 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ash/arc/input_overlay/ui/action_edit_button.h" + +#include "ash/resources/vector_icons/vector_icons.h" +#include "ash/style/ash_color_provider.h" +#include "ash/style/style_util.h" +#include "chrome/browser/ash/arc/input_overlay/ui/action_view.h" +#include "third_party/skia/include/core/SkColor.h" +#include "ui/gfx/canvas.h" +#include "ui/gfx/paint_vector_icon.h" +#include "ui/views/background.h" +#include "ui/views/controls/highlight_path_generator.h" + +namespace arc { +namespace input_overlay { +namespace { +// UI specs. +constexpr SkColor kBackgroundColor = gfx::kGoogleGrey200; +constexpr int kDotsIconSize = 20; +constexpr int kDotsButtonSize = 32; +constexpr SkColor kDotsIconColor = gfx::kGoogleGrey900; +constexpr int kFocusRingStrokeWidth = 4; + +} // namespace + +class ActionEditButton::CircleBackground : public views::Background { + public: + explicit CircleBackground(SkColor color) { SetNativeControlColor(color); } + ~CircleBackground() override = default; + + void Paint(gfx::Canvas* canvas, views::View* view) const override { + int radius = view->bounds().width() / 2; + gfx::PointF center(radius, radius); + cc::PaintFlags flags; + flags.setAntiAlias(true); + flags.setStyle(cc::PaintFlags::kFill_Style); + flags.setColor(get_color()); + canvas->DrawCircle(center, radius, flags); + } +}; + +ActionEditButton::ActionEditButton(PressedCallback callback) + : views::ImageButton(std::move(callback)) { + auto dots_icon = gfx::CreateVectorIcon( + ash::kPersistentDesksBarVerticalDotsIcon, kDotsIconSize, kDotsIconColor); + SetImage(views::Button::STATE_NORMAL, dots_icon); + SetAccessibleName(base::UTF8ToUTF16(GetClassName())); + SetSize(gfx::Size(kDotsButtonSize, kDotsButtonSize)); + SetBackground(std::make_unique<CircleBackground>(kBackgroundColor)); + SetImageHorizontalAlignment(views::ImageButton::ALIGN_CENTER); + SetImageVerticalAlignment(views::ImageButton::ALIGN_MIDDLE); + ash::StyleUtil::SetUpInkDropForButton(this, gfx::Insets(), + /*highlight_on_hover=*/true, + /*highlight_on_focus=*/true); + + views::FocusRing* focus_ring = views::FocusRing::Get(this); + auto* color_provider = ash::AshColorProvider::Get(); + DCHECK(focus_ring); + DCHECK(color_provider); + if (!focus_ring || !color_provider) + return; + focus_ring->SetColor(color_provider->GetControlsLayerColor( + ash::AshColorProvider::ControlsLayerType::kFocusRingColor)); + focus_ring->SetHaloThickness(kFocusRingStrokeWidth); + focus_ring->SetPathGenerator( + std::make_unique<views::CircleHighlightPathGenerator>(gfx::Insets(0))); +} + +ActionEditButton::~ActionEditButton() = default; + +} // namespace input_overlay +} // namespace arc
diff --git a/chrome/browser/ash/arc/input_overlay/ui/action_edit_button.h b/chrome/browser/ash/arc/input_overlay/ui/action_edit_button.h new file mode 100644 index 0000000..47cc6da --- /dev/null +++ b/chrome/browser/ash/arc/input_overlay/ui/action_edit_button.h
@@ -0,0 +1,28 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_ASH_ARC_INPUT_OVERLAY_UI_ACTION_EDIT_BUTTON_H_ +#define CHROME_BROWSER_ASH_ARC_INPUT_OVERLAY_UI_ACTION_EDIT_BUTTON_H_ + +#include "ui/views/controls/button/image_button.h" + +namespace arc { +namespace input_overlay { + +// ActionEditButton is menu entry for editing each action. +class ActionEditButton : public views::ImageButton { + public: + explicit ActionEditButton(PressedCallback callback = PressedCallback()); + ActionEditButton(const ActionEditButton&) = delete; + ActionEditButton& operator=(const ActionEditButton&) = delete; + ~ActionEditButton() override; + + private: + class CircleBackground; +}; + +} // namespace input_overlay +} // namespace arc + +#endif // CHROME_BROWSER_ASH_ARC_INPUT_OVERLAY_UI_ACTION_EDIT_BUTTON_H_
diff --git a/chrome/browser/ash/arc/input_overlay/ui/action_edit_menu.cc b/chrome/browser/ash/arc/input_overlay/ui/action_edit_menu.cc new file mode 100644 index 0000000..7467746 --- /dev/null +++ b/chrome/browser/ash/arc/input_overlay/ui/action_edit_menu.cc
@@ -0,0 +1,176 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ash/arc/input_overlay/ui/action_edit_menu.h" + +#include "ash/resources/vector_icons/vector_icons.h" +#include "ash/style/ash_color_provider.h" +#include "ash/style/style_util.h" +#include "chrome/grit/generated_resources.h" +#include "ui/base/l10n/l10n_util.h" +#include "ui/gfx/paint_vector_icon.h" +#include "ui/views/background.h" +#include "ui/views/layout/box_layout.h" + +namespace arc { +namespace input_overlay { +namespace { +constexpr char kFontSytle[] = "Roboto"; +constexpr int kFontSize = 16; +constexpr int kCornerRadius = 6; +constexpr int kMenuHeight = 192; +constexpr int kMenuWidth = 76; +constexpr int kCheckIconSize = 12; +constexpr int kSpaceCheckLabel = 48; +constexpr int kButtonHeight = 44; +} // namespace + +class ActionEditMenu::BindingButton : public views::LabelButton { + public: + BindingButton(PressedCallback callback, int text_source_id) + : LabelButton(callback, l10n_util::GetStringUTF16(text_source_id)) { + SetAccessibleName(l10n_util::GetStringUTF16(text_source_id)); + SetBorder(views::CreateEmptyBorder(/*top=*/0, /*left=*/16, + /*bottom=*/0, + /*right=*/12)); + SetHorizontalAlignment(gfx::ALIGN_RIGHT); + + auto* color_provider = ash::AshColorProvider::Get(); + DCHECK(color_provider); + if (!color_provider) + return; + SetTextColor( + views::Button::STATE_NORMAL, + color_provider->GetContentLayerColor( + ash::AshColorProvider::ContentLayerType::kTextColorPrimary)); + SetTextColor( + views::Button::STATE_HOVERED, + color_provider->GetContentLayerColor( + ash::AshColorProvider::ContentLayerType::kTextColorPrimary)); + label()->SetFontList(gfx::FontList({kFontSytle}, gfx::Font::NORMAL, + kFontSize, gfx::Font::Weight::NORMAL)); + auto key_size = CalculatePreferredSize(); + SetMinSize(gfx::Size(key_size.width(), kButtonHeight)); + ash::StyleUtil::SetUpInkDropForButton(this, gfx::Insets(), + /*highlight_on_hover=*/true, + /*highlight_on_focus=*/true); + } + + void Layout() override { + LabelButton::Layout(); + label()->SetPosition(gfx::Point(GetInsets().left(), GetInsets().top())); + } + + void OnBinding() { + auto* color_provider = ash::AshColorProvider::Get(); + DCHECK(color_provider); + if (!color_provider) + return; + auto check_icon = gfx::CreateVectorIcon( + ash::kHollowCheckCircleIcon, kCheckIconSize, + color_provider->GetContentLayerColor( + ash::AshColorProvider::ContentLayerType::kIconColorProminent)); + SetImage(views::Button::STATE_NORMAL, check_icon); + SetImageLabelSpacing(kSpaceCheckLabel); + image()->SetHorizontalAlignment(views::ImageView::Alignment::kTrailing); + } + + ~BindingButton() override = default; +}; + +ActionEditMenu::ActionEditMenu( + DisplayOverlayController* display_overlay_controller, + ActionView* anchor) + : display_overlay_controller_(display_overlay_controller), + anchor_(anchor) {} + +ActionEditMenu::~ActionEditMenu() = default; + +// static +std::unique_ptr<ActionEditMenu> ActionEditMenu::BuildActionTapEditMenu( + DisplayOverlayController* display_overlay_controller, + ActionView* anchor) { + if (!display_overlay_controller) + return nullptr; + display_overlay_controller->RemoveActionEditMenu(); + + auto menu = + std::make_unique<ActionEditMenu>(display_overlay_controller, anchor); + menu->InitActionTapEditMenu(); + + return menu; +} + +void ActionEditMenu::InitActionTapEditMenu() { + SetLayoutManager(std::make_unique<views::BoxLayout>( + views::BoxLayout::Orientation::kVertical)); + + auto* color_provider = ash::AshColorProvider::Get(); + DCHECK(color_provider); + if (!color_provider) + return; + auto bg_color = color_provider->GetBackgroundColorInMode( + color_provider->IsDarkModeEnabled()); + SetBackground(views::CreateRoundedRectBackground(bg_color, kCornerRadius)); + + // Add each binding button. + keyboard_key_ = AddChildView(std::make_unique<BindingButton>( + base::BindRepeating(&ActionEditMenu::OnKeyBoardKeyBindingButtonPressed, + base::Unretained(this)), + IDS_INPUT_OVERLAY_EDIT_MENU_KEYBOARD_KEY)); + mouse_left_ = AddChildView(std::make_unique<BindingButton>( + base::BindRepeating(&ActionEditMenu::OnMouseLeftBindingButtonPressed, + base::Unretained(this)), + IDS_INPUT_OVERLAY_EDIT_MENU_LEFT_MOUSE_CLICK)); + mouse_right_ = AddChildView(std::make_unique<BindingButton>( + base::BindRepeating(&ActionEditMenu::OnMouseRightBindingButtonPressed, + base::Unretained(this)), + IDS_INPUT_OVERLAY_EDIT_MENU_RIGHT_MOUSE_CLICK)); + reset_ = AddChildView(std::make_unique<BindingButton>( + base::BindRepeating(&ActionEditMenu::OnResetButtonPressed, + base::Unretained(this)), + IDS_INPUT_OVERLAY_EDIT_MENU_RESET)); + + int additional_width = std::max({keyboard_key_->GetMinSize().width(), + mouse_left_->GetMinSize().width(), + mouse_right_->GetMinSize().width()}); + SetBorder(views::CreateEmptyBorder(/*top=*/8, /*left=*/0, + /*bottom=*/8, /*right=*/0)); + SetSize(gfx::Size(kMenuWidth + additional_width, kMenuHeight)); + SetPosition(anchor_->GetEditMenuPosition(size())); + auto* action = anchor_->action(); + // It is possible that the action has no binding after customizing, such as + // users bind the key to another action. + if (action->IsKeyboardBound()) + keyboard_key_->OnBinding(); + if (action->IsMouseBound()) { + if (action->current_binding()->mouse_action() == kPrimaryClick) + mouse_left_->OnBinding(); + if (action->current_binding()->mouse_action() == kSecondaryClick) + mouse_right_->OnBinding(); + } +} + +void ActionEditMenu::OnKeyBoardKeyBindingButtonPressed() { + // TODO(cuicuiruan): Implement feature here. + display_overlay_controller_->RemoveActionEditMenu(); +} + +void ActionEditMenu::OnMouseLeftBindingButtonPressed() { + // TODO(cuicuiruan): Implement feature here. + display_overlay_controller_->RemoveActionEditMenu(); +} + +void ActionEditMenu::OnMouseRightBindingButtonPressed() { + // TODO(cuicuiruan): Implement feature here. + display_overlay_controller_->RemoveActionEditMenu(); +} + +void ActionEditMenu::OnResetButtonPressed() { + // TODO(cuicuiruan): Implement feature here. + display_overlay_controller_->RemoveActionEditMenu(); +} + +} // namespace input_overlay +} // namespace arc
diff --git a/chrome/browser/ash/arc/input_overlay/ui/action_edit_menu.h b/chrome/browser/ash/arc/input_overlay/ui/action_edit_menu.h new file mode 100644 index 0000000..c5b5194 --- /dev/null +++ b/chrome/browser/ash/arc/input_overlay/ui/action_edit_menu.h
@@ -0,0 +1,58 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_ASH_ARC_INPUT_OVERLAY_UI_ACTION_EDIT_MENU_H_ +#define CHROME_BROWSER_ASH_ARC_INPUT_OVERLAY_UI_ACTION_EDIT_MENU_H_ + +#include <memory> + +#include "chrome/browser/ash/arc/input_overlay/display_overlay_controller.h" +#include "chrome/browser/ash/arc/input_overlay/ui/action_view.h" +#include "ui/views/controls/button/label_button.h" +#include "ui/views/view.h" + +namespace arc { +namespace input_overlay { + +class DisplayOverlayController; +class ActionView; + +// ActionEditMenu shows the rebinding options for each action. Currently, it +// only supports for tap action. +class ActionEditMenu : public views::View { + public: + ActionEditMenu(DisplayOverlayController* display_overlay_controller, + ActionView* anchor); + ActionEditMenu(const ActionEditMenu&) = delete; + ActionEditMenu& operator=(const ActionEditMenu&) = delete; + ~ActionEditMenu() override; + + static std::unique_ptr<ActionEditMenu> BuildActionTapEditMenu( + DisplayOverlayController* display_overlay_controller, + ActionView* anchor); + + private: + class BindingButton; + + void InitActionTapEditMenu(); + void OnKeyBoardKeyBindingButtonPressed(); + void OnMouseLeftBindingButtonPressed(); + void OnMouseRightBindingButtonPressed(); + void OnResetButtonPressed(); + + // Reference to owner class. + DisplayOverlayController* const display_overlay_controller_ = nullptr; + // Reference to position. + ActionView* anchor_ = nullptr; + // Reference to the menu items. + BindingButton* keyboard_key_ = nullptr; + BindingButton* mouse_left_ = nullptr; + BindingButton* mouse_right_ = nullptr; + BindingButton* reset_ = nullptr; +}; + +} // namespace input_overlay +} // namespace arc + +#endif // CHROME_BROWSER_ASH_ARC_INPUT_OVERLAY_UI_ACTION_EDIT_MENU_H_
diff --git a/chrome/browser/ash/arc/input_overlay/ui/action_label.cc b/chrome/browser/ash/arc/input_overlay/ui/action_label.cc index 048ad32..4d0ad3e 100644 --- a/chrome/browser/ash/arc/input_overlay/ui/action_label.cc +++ b/chrome/browser/ash/arc/input_overlay/ui/action_label.cc
@@ -97,6 +97,7 @@ SetToEditFocus(); SelectAll(); Label::OnFocus(); + static_cast<ActionView*>(parent())->RemoveEditMenu(); } void ActionLabel::OnBlur() {
diff --git a/chrome/browser/ash/arc/input_overlay/ui/action_view.cc b/chrome/browser/ash/arc/input_overlay/ui/action_view.cc index e758a83..df488e5d 100644 --- a/chrome/browser/ash/arc/input_overlay/ui/action_view.cc +++ b/chrome/browser/ash/arc/input_overlay/ui/action_view.cc
@@ -4,21 +4,39 @@ #include "chrome/browser/ash/arc/input_overlay/ui/action_view.h" +#include "base/bind.h" #include "chrome/browser/ash/arc/input_overlay/ui/action_label.h" namespace arc { namespace input_overlay { +namespace { +constexpr int kMenuEntryOffset = 4; +} -ActionView::ActionView(Action* action) : views::View(), action_(action) {} +ActionView::ActionView(Action* action, + DisplayOverlayController* display_overlay_controller) + : views::View(), + action_(action), + display_overlay_controller_(display_overlay_controller) {} ActionView::~ActionView() = default; void ActionView::SetDisplayMode(DisplayMode mode) { if ((!editable_ && mode == DisplayMode::kEdit) || mode == DisplayMode::kMenu) return; - if (circle_) - circle_->SetDisplayMode(mode); - for (auto* label : labels_) - label->SetDisplayMode(mode); + if (mode == DisplayMode::kView) { + RemoveEditButton(); + if (menu_entry_) { + RemoveChildViewT(menu_entry_); + menu_entry_ = nullptr; + } + } + if (mode == DisplayMode::kEdit) { + AddEditButton(); + if (circle_) + circle_->SetDisplayMode(mode); + for (auto* label : labels_) + label->SetDisplayMode(mode); + } } void ActionView::SetPositionFromCenterPosition(gfx::PointF& center_position) { @@ -28,5 +46,52 @@ SetPosition(gfx::Point(left, top)); } +void ActionView::OnMenuEntryPressed() { + display_overlay_controller_->AddActionEditMenu(this); + DCHECK(menu_entry_); + if (!menu_entry_) + return; + menu_entry_->RequestFocus(); +} + +gfx::Point ActionView::GetEditMenuPosition(gfx::Size menu_size) { + DCHECK(menu_entry_); + if (!menu_entry_) + return gfx::Point(); + int x = action_->on_left_or_middle_side() + ? bounds().x() + : std::max(0, bounds().right() - menu_size.width()); + int y = bounds().y() <= menu_size.height() + ? bounds().bottom() + : bounds().y() - menu_size.height(); + return gfx::Point(x, y); +} + +void ActionView::RemoveEditMenu() { + display_overlay_controller_->RemoveActionEditMenu(); +} + +void ActionView::AddEditButton() { + if (!editable_ || menu_entry_) + return; + + menu_entry_ = + AddChildView(std::make_unique<ActionEditButton>(base::BindRepeating( + &ActionView::OnMenuEntryPressed, base::Unretained(this)))); + if (action_->on_left_or_middle_side()) { + menu_entry_->SetPosition(gfx::Point(0, kMenuEntryOffset)); + } else { + menu_entry_->SetPosition(gfx::Point( + std::max(0, width() - menu_entry_->width()), kMenuEntryOffset)); + } +} + +void ActionView::RemoveEditButton() { + if (!editable_ || !menu_entry_) + return; + RemoveChildViewT(menu_entry_); + menu_entry_ = nullptr; +} + } // namespace input_overlay } // namespace arc
diff --git a/chrome/browser/ash/arc/input_overlay/ui/action_view.h b/chrome/browser/ash/arc/input_overlay/ui/action_view.h index 2d364898c..fc51ce7a 100644 --- a/chrome/browser/ash/arc/input_overlay/ui/action_view.h +++ b/chrome/browser/ash/arc/input_overlay/ui/action_view.h
@@ -5,9 +5,12 @@ #ifndef CHROME_BROWSER_ASH_ARC_INPUT_OVERLAY_UI_ACTION_VIEW_H_ #define CHROME_BROWSER_ASH_ARC_INPUT_OVERLAY_UI_ACTION_VIEW_H_ +#include "ash/wm/desks/persistent_desks_bar_button.h" #include "chrome/browser/ash/arc/input_overlay/actions/action.h" #include "chrome/browser/ash/arc/input_overlay/constants.h" +#include "chrome/browser/ash/arc/input_overlay/display_overlay_controller.h" #include "chrome/browser/ash/arc/input_overlay/ui/action_circle.h" +#include "chrome/browser/ash/arc/input_overlay/ui/action_edit_button.h" #include "chrome/browser/ash/arc/input_overlay/ui/action_label.h" #include "ui/gfx/geometry/point.h" #include "ui/gfx/geometry/point_f.h" @@ -17,11 +20,14 @@ namespace input_overlay { class Action; +class DisplayOverlayController; +class ActionEditButton; // ActionView is the view for each action. class ActionView : public views::View { public: - explicit ActionView(Action* owner); + explicit ActionView(Action* action, + DisplayOverlayController* display_overlay_controller); ActionView(const ActionView&) = delete; ActionView& operator=(const ActionView&) = delete; ~ActionView() override; @@ -33,14 +39,32 @@ // Set position from its center position. void SetPositionFromCenterPosition(gfx::PointF& center_position); void SetDisplayMode(const DisplayMode mode); + void OnMenuEntryPressed(); + // Get edit menu position in parent's bounds. + gfx::Point GetEditMenuPosition(gfx::Size menu_size); + void RemoveEditMenu(); protected: + // Reference to the action of this UI. Action* action_ = nullptr; + // Reference to the owner class. + DisplayOverlayController* const display_overlay_controller_ = nullptr; + // Some types are not supported to edit. bool editable_ = false; + // Three-dot button to show the |ActionEditMenu|. + ActionEditButton* menu_entry_ = nullptr; + // The circle view shows up for editing the action. ActionCircle* circle_ = nullptr; + // Labels for mapping hints. std::vector<ActionLabel*> labels_; + // Current display mode. DisplayMode current_display_mode_ = DisplayMode::kNone; + // Center position of the circle view. gfx::Point center_; + + private: + void AddEditButton(); + void RemoveEditButton(); }; } // namespace input_overlay
diff --git a/chrome/browser/ash/arc/input_overlay/ui/input_mapping_view.cc b/chrome/browser/ash/arc/input_overlay/ui/input_mapping_view.cc new file mode 100644 index 0000000..0258b6b --- /dev/null +++ b/chrome/browser/ash/arc/input_overlay/ui/input_mapping_view.cc
@@ -0,0 +1,56 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ash/arc/input_overlay/ui/input_mapping_view.h" + +#include "ui/views/background.h" + +namespace arc { +namespace input_overlay { +namespace { +// UI specs. +constexpr SkColor kEditModeBgColor = SkColorSetA(SK_ColorGRAY, 0x99); +} // namespace + +InputMappingView::InputMappingView( + DisplayOverlayController* display_overlay_controller) + : display_overlay_controller_(display_overlay_controller) { + auto content_bounds = input_overlay::CalculateWindowContentBounds( + display_overlay_controller_->touch_injector()->target_window()); + auto& actions = display_overlay_controller_->touch_injector()->actions(); + SetBounds(content_bounds.x(), content_bounds.y(), content_bounds.width(), + content_bounds.height()); + for (auto& action : actions) { + auto view = action->CreateView(display_overlay_controller_, content_bounds); + if (view) + AddChildView(std::move(view)); + } +} + +InputMappingView::~InputMappingView() = default; + +void InputMappingView::SetDisplayMode(const DisplayMode mode) { + if (current_display_mode_ == mode) + return; + switch (mode) { + case DisplayMode::kMenu: + case DisplayMode::kView: + SetBackground(nullptr); + break; + case DisplayMode::kEdit: + SetBackground(views::CreateSolidBackground(kEditModeBgColor)); + break; + default: + NOTREACHED(); + break; + } + for (auto* view : children()) { + auto* action_view = static_cast<ActionView*>(view); + action_view->SetDisplayMode(mode); + } + current_display_mode_ = mode; +} + +} // namespace input_overlay +} // namespace arc
diff --git a/chrome/browser/ash/arc/input_overlay/ui/input_mapping_view.h b/chrome/browser/ash/arc/input_overlay/ui/input_mapping_view.h new file mode 100644 index 0000000..2c1c8d569 --- /dev/null +++ b/chrome/browser/ash/arc/input_overlay/ui/input_mapping_view.h
@@ -0,0 +1,35 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_ASH_ARC_INPUT_OVERLAY_UI_INPUT_MAPPING_VIEW_H_ +#define CHROME_BROWSER_ASH_ARC_INPUT_OVERLAY_UI_INPUT_MAPPING_VIEW_H_ + +#include "chrome/browser/ash/arc/input_overlay/constants.h" +#include "chrome/browser/ash/arc/input_overlay/display_overlay_controller.h" +#include "ui/views/view.h" + +namespace arc { +namespace input_overlay { + +class DisplayOverlayController; +// InputMappingView shows all the input mappings. +class InputMappingView : public views::View { + public: + explicit InputMappingView( + DisplayOverlayController* display_overlay_controller); + InputMappingView(const InputMappingView&) = delete; + InputMappingView& operator=(const InputMappingView&) = delete; + ~InputMappingView() override; + + void SetDisplayMode(const DisplayMode mode); + + private: + DisplayOverlayController* const display_overlay_controller_ = nullptr; + DisplayMode current_display_mode_ = DisplayMode::kNone; +}; + +} // namespace input_overlay +} // namespace arc + +#endif // CHROME_BROWSER_ASH_ARC_INPUT_OVERLAY_UI_INPUT_MAPPING_VIEW_H_
diff --git a/chrome/browser/ash/child_accounts/child_user_service.cc b/chrome/browser/ash/child_accounts/child_user_service.cc index b7d5f8d..b179c228 100644 --- a/chrome/browser/ash/child_accounts/child_user_service.cc +++ b/chrome/browser/ash/child_accounts/child_user_service.cc
@@ -139,7 +139,7 @@ absl::optional<base::TimeDelta> ChildUserService::GetTimeLimitForApp( const std::string& app_service_id, - apps::mojom::AppType app_type) { + apps::AppType app_type) { if (!app_time_controller_) return absl::nullopt;
diff --git a/chrome/browser/ash/child_accounts/child_user_service.h b/chrome/browser/ash/child_accounts/child_user_service.h index c112abd6..85880e18 100644 --- a/chrome/browser/ash/child_accounts/child_user_service.h +++ b/chrome/browser/ash/child_accounts/child_user_service.h
@@ -14,6 +14,7 @@ #include "chrome/browser/ash/child_accounts/website_approval_notifier.h" #include "components/keyed_service/core/keyed_service.h" #include "components/prefs/pref_change_registrar.h" +#include "components/services/app_service/public/cpp/app_types.h" namespace base { class TimeDelta; @@ -93,7 +94,7 @@ void ResumeWebActivity(const std::string& app_service_id) override; absl::optional<base::TimeDelta> GetTimeLimitForApp( const std::string& app_service_id, - apps::mojom::AppType app_type) override; + apps::AppType app_type) override; // app_time::AppActivityReportInterface: app_time::AppActivityReportInterface::ReportParams GenerateAppActivityReport(
diff --git a/chrome/browser/ash/child_accounts/family_user_chrome_activity_metrics_unittest.cc b/chrome/browser/ash/child_accounts/family_user_chrome_activity_metrics_unittest.cc index 944d7e06..37e0d12 100644 --- a/chrome/browser/ash/child_accounts/family_user_chrome_activity_metrics_unittest.cc +++ b/chrome/browser/ash/child_accounts/family_user_chrome_activity_metrics_unittest.cc
@@ -114,15 +114,18 @@ } void PushChromeApp() { + auto mojom_app_type = apps::ConvertAppTypeToMojomAppType( + app_time::GetChromeAppId().app_type()); + std::vector<apps::mojom::AppPtr> deltas; auto app = apps::mojom::App::New(); app->app_id = app_time::GetChromeAppId().app_id(); - app->app_type = app_time::GetChromeAppId().app_type(); + app->app_type = mojom_app_type; deltas.push_back(std::move(app)); apps::AppServiceProxyFactory::GetForProfile(profile()) ->AppRegistryCache() - .OnApps(std::move(deltas), app_time::GetChromeAppId().app_type(), + .OnApps(std::move(deltas), mojom_app_type, false /* should_notify_initialized */); }
diff --git a/chrome/browser/ash/child_accounts/family_user_parental_control_metrics_unittest.cc b/chrome/browser/ash/child_accounts/family_user_parental_control_metrics_unittest.cc index 1f6af32..6d9980a 100644 --- a/chrome/browser/ash/child_accounts/family_user_parental_control_metrics_unittest.cc +++ b/chrome/browser/ash/child_accounts/family_user_parental_control_metrics_unittest.cc
@@ -36,6 +36,7 @@ #include "chrome/common/pref_names.h" #include "chrome/test/base/testing_profile.h" #include "components/prefs/scoped_user_pref_update.h" +#include "components/services/app_service/public/cpp/app_types.h" #include "components/sync_preferences/pref_service_syncable.h" #include "components/sync_preferences/testing_pref_service_syncable.h" #include "content/public/test/browser_task_environment.h" @@ -51,7 +52,7 @@ constexpr char kExampleHost0[] = "http://www.example0.com"; constexpr char kExampleURL1[] = "http://www.example1.com/123"; -const app_time::AppId kArcApp(apps::mojom::AppType::kArc, "packageName"); +const app_time::AppId kArcApp(apps::AppType::kArc, "packageName"); arc::mojom::ArcPackageInfoPtr CreateArcAppPackage( const std::string& package_name) { @@ -260,7 +261,7 @@ arc_test_.SetUp(profile_.get()); arc_test_.app_instance()->set_icon_response_type( arc::FakeAppInstance::IconResponseType::ICON_RESPONSE_SKIP); - EXPECT_EQ(apps::mojom::AppType::kArc, kArcApp.app_type()); + EXPECT_EQ(apps::AppType::kArc, kArcApp.app_type()); std::string package_name = kArcApp.app_id(); arc_test_.AddPackage(CreateArcAppPackage(package_name)->Clone()); std::vector<arc::mojom::AppInfoPtr> apps;
diff --git a/chrome/browser/ash/child_accounts/time_limits/app_activity_registry.cc b/chrome/browser/ash/child_accounts/time_limits/app_activity_registry.cc index ecfcc46..1dddad4 100644 --- a/chrome/browser/ash/child_accounts/time_limits/app_activity_registry.cc +++ b/chrome/browser/ash/child_accounts/time_limits/app_activity_registry.cc
@@ -24,7 +24,7 @@ #include "components/prefs/pref_registry_simple.h" #include "components/prefs/pref_service.h" #include "components/prefs/scoped_user_pref_update.h" -#include "components/services/app_service/public/mojom/types.mojom.h" +#include "components/services/app_service/public/cpp/app_types.h" namespace ash { namespace app_time { @@ -396,7 +396,7 @@ enterprise_management::App* app_info = report->add_hidden_app(); app_info->set_app_id(app_id.app_id()); app_info->set_app_type(AppTypeForReporting(app_id.app_type())); - if (app_id.app_type() == apps::mojom::AppType::kArc) { + if (app_id.app_type() == apps::AppType::kArc) { app_info->add_additional_app_id( app_service_wrapper_->GetAppServiceId(app_id)); } @@ -446,7 +446,7 @@ app_info->set_app_id(app_id.app_id()); app_info->set_app_type(AppTypeForReporting(app_id.app_type())); // AppService is is only different for ARC++ apps. - if (app_id.app_type() == apps::mojom::AppType::kArc) { + if (app_id.app_type() == apps::AppType::kArc) { app_info->add_additional_app_id( app_service_wrapper_->GetAppServiceId(app_id)); }
diff --git a/chrome/browser/ash/child_accounts/time_limits/app_activity_registry_unittest.cc b/chrome/browser/ash/child_accounts/time_limits/app_activity_registry_unittest.cc index c349a71..5b618f9 100644 --- a/chrome/browser/ash/child_accounts/time_limits/app_activity_registry_unittest.cc +++ b/chrome/browser/ash/child_accounts/time_limits/app_activity_registry_unittest.cc
@@ -22,7 +22,7 @@ #include "chrome/test/base/testing_profile.h" #include "chrome/test/views/chrome_views_test_base.h" #include "components/prefs/pref_service.h" -#include "components/services/app_service/public/mojom/types.mojom.h" +#include "components/services/app_service/public/cpp/app_types.h" #include "extensions/common/constants.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -35,9 +35,9 @@ namespace { -const AppId kApp1(apps::mojom::AppType::kArc, "1"); -const AppId kApp2(apps::mojom::AppType::kWeb, "3"); -const AppId kGoogleSlidesApp(apps::mojom::AppType::kChromeApp, +const AppId kApp1(apps::AppType::kArc, "1"); +const AppId kApp2(apps::AppType::kWeb, "3"); +const AppId kGoogleSlidesApp(apps::AppType::kChromeApp, extension_misc::kGoogleSlidesAppId); class AppTimeNotificationDelegateMock : public AppTimeNotificationDelegate { @@ -994,7 +994,7 @@ AppStateObserverMock state_observer_mock; registry().AddAppStateObserver(&state_observer_mock); - const AppId kApp3(apps::mojom::AppType::kWeb, "l"); + const AppId kApp3(apps::AppType::kWeb, "l"); registry().OnAppInstalled(kApp3); registry().OnAppAvailable(kApp3); @@ -1035,7 +1035,7 @@ task_environment()->FastForwardBy(base::Hours(1)); // Now a new application is installed. - const AppId kApp3(apps::mojom::AppType::kWeb, "l"); + const AppId kApp3(apps::AppType::kWeb, "l"); registry().OnAppInstalled(kApp3); registry().OnAppAvailable(kApp3);
diff --git a/chrome/browser/ash/child_accounts/time_limits/app_service_wrapper.cc b/chrome/browser/ash/child_accounts/time_limits/app_service_wrapper.cc index 7a33a15..393a7dc 100644 --- a/chrome/browser/ash/child_accounts/time_limits/app_service_wrapper.cc +++ b/chrome/browser/ash/child_accounts/time_limits/app_service_wrapper.cc
@@ -19,7 +19,6 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/app_list/arc/arc_app_utils.h" #include "chrome/common/chrome_features.h" -#include "components/services/app_service/public/cpp/app_types.h" #include "components/services/app_service/public/cpp/app_update.h" #include "components/services/app_service/public/cpp/icon_types.h" #include "components/services/app_service/public/cpp/instance_update.h" @@ -39,14 +38,14 @@ // Gets AppId from |update|. AppId AppIdFromAppUpdate(const apps::AppUpdate& update) { bool is_arc = update.AppType() == apps::mojom::AppType::kArc; - return AppId(update.AppType(), + return AppId(apps::ConvertMojomAppTypToAppType(update.AppType()), is_arc ? update.PublisherId() : update.AppId()); } // Gets AppId from |update|. AppId AppIdFromInstanceUpdate(const apps::InstanceUpdate& update, apps::AppRegistryCache* app_cache) { - AppId app_id(apps::mojom::AppType::kUnknown, update.AppId()); + AppId app_id(apps::AppType::kUnknown, update.AppId()); app_cache->ForOneApp(update.AppId(), [&app_id](const apps::AppUpdate& update) { @@ -57,7 +56,7 @@ // Gets app service id from |app_id|. std::string AppServiceIdFromAppId(const AppId& app_id, Profile* profile) { - return app_id.app_type() == apps::mojom::AppType::kArc + return app_id.app_type() == apps::AppType::kArc ? arc::ArcPackageNameToAppId(app_id.app_id(), profile) : app_id.app_id(); } @@ -122,7 +121,7 @@ } bool AppServiceWrapper::IsHiddenArcApp(const AppId& app_id) const { - if (app_id.app_type() != apps::mojom::AppType::kArc) + if (app_id.app_type() != apps::AppType::kArc) return false; bool is_hidden = false; @@ -133,7 +132,7 @@ if (!apps_util::IsInstalled(update.Readiness())) return; - is_hidden = !update.ShowInLauncher().value_or(true); + is_hidden = !update.ShowInLauncher().value_or(false); }); return is_hidden; @@ -146,7 +145,7 @@ return; const AppId app_id = AppIdFromAppUpdate(update); - if (app_id.app_type() != apps::mojom::AppType::kArc || + if (app_id.app_type() != apps::AppType::kArc || update.ShowInLauncher().value_or(true)) { return; } @@ -178,8 +177,8 @@ if (base::FeatureList::IsEnabled(features::kAppServiceLoadIconWithoutMojom)) { apps::IconKey icon_key; GetAppProxy()->LoadIconFromIconKey( - apps::ConvertMojomAppTypToAppType(app_id.app_type()), app_service_id, - icon_key, apps::IconType::kStandard, size_hint_in_dp, + app_id.app_type(), app_service_id, icon_key, apps::IconType::kStandard, + size_hint_in_dp, /* allow_placeholder_icon */ false, base::BindOnce( [](base::OnceCallback<void(absl::optional<gfx::ImageSkia>)> @@ -195,8 +194,9 @@ std::move(on_icon_ready))); } else { GetAppProxy()->LoadIconFromIconKey( - app_id.app_type(), app_service_id, apps::mojom::IconKey::New(), - apps::mojom::IconType::kStandard, size_hint_in_dp, + apps::ConvertAppTypeToMojomAppType(app_id.app_type()), app_service_id, + apps::mojom::IconKey::New(), apps::mojom::IconType::kStandard, + size_hint_in_dp, /* allow_placeholder_icon */ false, base::BindOnce( [](base::OnceCallback<void(absl::optional<gfx::ImageSkia>)> @@ -223,7 +223,7 @@ AppId AppServiceWrapper::AppIdFromAppServiceId( const std::string& app_service_id, - apps::mojom::AppType app_type) const { + apps::AppType app_type) const { absl::optional<AppId> app_id; GetAppCache().ForOneApp(app_service_id, [&app_id](const apps::AppUpdate& update) { @@ -331,7 +331,7 @@ if (IsHiddenArcApp(app_id)) return false; - if (app_id.app_type() == apps::mojom::AppType::kChromeApp) { + if (app_id.app_type() == apps::AppType::kChromeApp) { const extensions::Extension* extension = extensions::ExtensionRegistry::Get(profile_)->GetExtensionById( app_id.app_id(), @@ -346,8 +346,8 @@ return extension->is_hosted_app() || extension->is_legacy_packaged_app(); } - return app_id.app_type() == apps::mojom::AppType::kArc || - app_id.app_type() == apps::mojom::AppType::kWeb; + return app_id.app_type() == apps::AppType::kArc || + app_id.app_type() == apps::AppType::kWeb; } } // namespace app_time
diff --git a/chrome/browser/ash/child_accounts/time_limits/app_service_wrapper.h b/chrome/browser/ash/child_accounts/time_limits/app_service_wrapper.h index 1f9c1b33..0a1cad7 100644 --- a/chrome/browser/ash/child_accounts/time_limits/app_service_wrapper.h +++ b/chrome/browser/ash/child_accounts/time_limits/app_service_wrapper.h
@@ -14,6 +14,7 @@ #include "base/time/time.h" #include "chrome/browser/apps/app_service/app_service_proxy_forward.h" #include "components/services/app_service/public/cpp/app_registry_cache.h" +#include "components/services/app_service/public/cpp/app_types.h" #include "components/services/app_service/public/cpp/instance_registry.h" class Profile; @@ -140,7 +141,7 @@ // Returns AppId from |app_service_id| and |app_type|. AppId AppIdFromAppServiceId(const std::string& app_service_id, - apps::mojom::AppType app_type) const; + apps::AppType app_type) const; void AddObserver(EventListener* observer); void RemoveObserver(EventListener* observer);
diff --git a/chrome/browser/ash/child_accounts/time_limits/app_service_wrapper_unittest.cc b/chrome/browser/ash/child_accounts/time_limits/app_service_wrapper_unittest.cc index 1ec2bf9e..8574832 100644 --- a/chrome/browser/ash/child_accounts/time_limits/app_service_wrapper_unittest.cc +++ b/chrome/browser/ash/child_accounts/time_limits/app_service_wrapper_unittest.cc
@@ -38,8 +38,8 @@ #include "chrome/common/chrome_switches.h" #include "chrome/test/base/testing_profile.h" #include "components/app_constants/constants.h" +#include "components/services/app_service/public/cpp/app_types.h" #include "components/services/app_service/public/cpp/app_update.h" -#include "components/services/app_service/public/mojom/types.mojom.h" #include "components/webapps/browser/installable/installable_metrics.h" #include "components/webapps/browser/uninstall_result_code.h" #include "content/public/test/browser_task_environment.h" @@ -138,7 +138,7 @@ void SimulateAppInstalled(const AppId& app_id, const std::string& app_name, absl::optional<std::string> url = absl::nullopt) { - if (app_id.app_type() == apps::mojom::AppType::kArc) { + if (app_id.app_type() == apps::AppType::kArc) { const std::string& package_name = app_id.app_id(); arc_test_.AddPackage(CreateArcAppPackage(package_name)->Clone()); std::vector<arc::mojom::AppInfoPtr> apps; @@ -148,7 +148,7 @@ return; } - if (app_id.app_type() == apps::mojom::AppType::kChromeApp) { + if (app_id.app_type() == apps::AppType::kChromeApp) { scoped_refptr<extensions::Extension> ext = CreateExtension( app_id.app_id(), app_name, url.value(), false /*is_bookmark_app*/); extension_service_->AddExtension(ext.get()); @@ -156,7 +156,7 @@ return; } - if (app_id.app_type() == apps::mojom::AppType::kWeb) { + if (app_id.app_type() == apps::AppType::kWeb) { DCHECK(url.has_value()); const web_app::AppId installed_app_id = web_app::test::InstallDummyWebApp( &profile_, app_name, GURL(url.value())); @@ -165,7 +165,7 @@ return; } - if (app_id.app_type() == apps::mojom::AppType::kWeb) { + if (app_id.app_type() == apps::AppType::kWeb) { scoped_refptr<extensions::Extension> web_app = CreateExtension( app_id.app_id(), app_name, url.value(), true /*is_bookmark_app*/); extension_service_->AddExtension(web_app.get()); @@ -175,14 +175,14 @@ } void SimulateAppUninstalled(const AppId& app_id) { - if (app_id.app_type() == apps::mojom::AppType::kArc) { + if (app_id.app_type() == apps::AppType::kArc) { const std::string& package_name = app_id.app_id(); arc_test_.app_instance()->UninstallPackage(package_name); task_environment_.RunUntilIdle(); return; } - if (app_id.app_type() == apps::mojom::AppType::kWeb) { + if (app_id.app_type() == apps::AppType::kWeb) { base::RunLoop run_loop; WebAppProvider::GetForTest(&profile_) ->install_finalizer() @@ -199,8 +199,8 @@ return; } - if (app_id.app_type() == apps::mojom::AppType::kChromeApp || - app_id.app_type() == apps::mojom::AppType::kWeb) { + if (app_id.app_type() == apps::AppType::kChromeApp || + app_id.app_type() == apps::AppType::kWeb) { extension_service_->UnloadExtension( app_id.app_id(), extensions::UnloadedExtensionReason::UNINSTALL); task_environment_.RunUntilIdle(); @@ -211,7 +211,7 @@ void SimulateAppDisabled(const AppId& app_id, const std::string& app_name, bool disabled) { - if (app_id.app_type() == apps::mojom::AppType::kArc) { + if (app_id.app_type() == apps::AppType::kArc) { const std::string& package_name = app_id.app_id(); std::vector<arc::mojom::AppInfoPtr> apps; apps.emplace_back(CreateArcAppInfo(package_name, app_name))->suspended = @@ -221,15 +221,15 @@ return; } - if (app_id.app_type() == apps::mojom::AppType::kWeb) { + if (app_id.app_type() == apps::AppType::kWeb) { WebAppProvider::GetForTest(&profile_)->sync_bridge().SetAppIsDisabled( app_id.app_id(), disabled); task_environment_.RunUntilIdle(); return; } - if (app_id.app_type() == apps::mojom::AppType::kChromeApp || - app_id.app_type() == apps::mojom::AppType::kWeb) { + if (app_id.app_type() == apps::AppType::kChromeApp || + app_id.app_type() == apps::AppType::kWeb) { if (disabled) { extension_service_->DisableExtension( app_id.app_id(), @@ -260,20 +260,20 @@ TEST_F(AppServiceWrapperTest, GetInstalledApps) { // Chrome is the only 'preinstalled' app. const AppId chrome = - AppId(apps::mojom::AppType::kChromeApp, app_constants::kChromeAppId); + AppId(apps::AppType::kChromeApp, app_constants::kChromeAppId); std::vector<AppId> installed_apps = tested_wrapper().GetInstalledApps(); EXPECT_EQ(1u, installed_apps.size()); EXPECT_TRUE(base::Contains(installed_apps, chrome)); // Add ARC app. - const AppId app1(apps::mojom::AppType::kArc, kArcPackage1); + const AppId app1(apps::AppType::kArc, kArcPackage1); EXPECT_CALL(test_listener(), OnAppInstalled(app1)).Times(1); SimulateAppInstalled(app1, kArcApp1); // Add extension app. It will be ignored, because PATL does not support // extensions (with exception of Chrome) now. const AppId app2( - apps::mojom::AppType::kChromeApp, + apps::AppType::kChromeApp, GenerateAppId(/*manifest_id=*/absl::nullopt, GURL(kExtensionAppUrl))); EXPECT_CALL(test_listener(), OnAppInstalled(app2)).Times(1); @@ -281,7 +281,7 @@ // Add web app. const AppId app3( - apps::mojom::AppType::kWeb, + apps::AppType::kWeb, GenerateAppId(/*manifest_id=*/absl::nullopt, GURL(kWebAppUrl1))); EXPECT_CALL(test_listener(), OnAppInstalled(app3)).Times(1); SimulateAppInstalled(app3, kWebAppName1, kWebAppUrl1); @@ -296,23 +296,22 @@ } TEST_F(AppServiceWrapperTest, GetAppName) { - const AppId chrome(apps::mojom::AppType::kChromeApp, - app_constants::kChromeAppId); + const AppId chrome(apps::AppType::kChromeApp, app_constants::kChromeAppId); EXPECT_EQ(kExtensionNameChrome, tested_wrapper().GetAppName(chrome)); - const AppId app1(apps::mojom::AppType::kArc, kArcPackage1); + const AppId app1(apps::AppType::kArc, kArcPackage1); EXPECT_CALL(test_listener(), OnAppInstalled(app1)).Times(1); SimulateAppInstalled(app1, kArcApp1); const AppId app2( - apps::mojom::AppType::kChromeApp, + apps::AppType::kChromeApp, GenerateAppId(/*manifest_id=*/absl::nullopt, GURL(kExtensionAppUrl))); EXPECT_CALL(test_listener(), OnAppInstalled(app2)).Times(1); SimulateAppInstalled(app2, kExtensionNameA, kExtensionAppUrl); const AppId app3( - apps::mojom::AppType::kWeb, + apps::AppType::kWeb, GenerateAppId(/*manifest_id=*/absl::nullopt, GURL(kWebAppUrl1))); EXPECT_CALL(test_listener(), OnAppInstalled(app3)).Times(1); SimulateAppInstalled(app3, kWebAppName1, kWebAppUrl1); @@ -328,7 +327,7 @@ EXPECT_EQ(1u, tested_wrapper().GetInstalledApps().size()); // Install first ARC app. - const AppId app1(apps::mojom::AppType::kArc, kArcPackage1); + const AppId app1(apps::AppType::kArc, kArcPackage1); EXPECT_CALL(test_listener(), OnAppInstalled(app1)).Times(1); SimulateAppInstalled(app1, kArcApp1); @@ -337,7 +336,7 @@ EXPECT_TRUE(base::Contains(installed_apps, app1)); // Install second ARC app. - const AppId app2(apps::mojom::AppType::kArc, kArcPackage2); + const AppId app2(apps::AppType::kArc, kArcPackage2); EXPECT_CALL(test_listener(), OnAppInstalled(app2)).Times(1); SimulateAppInstalled(app2, kArcApp2); @@ -361,7 +360,7 @@ // Install first web app. const AppId app1( - apps::mojom::AppType::kWeb, + apps::AppType::kWeb, GenerateAppId(/*manifest_id=*/absl::nullopt, GURL(kWebAppUrl1))); EXPECT_CALL(test_listener(), OnAppInstalled(app1)).Times(1); SimulateAppInstalled(app1, kWebAppName1, kWebAppUrl1); @@ -372,7 +371,7 @@ // Install second web app. const AppId app2( - apps::mojom::AppType::kWeb, + apps::AppType::kWeb, GenerateAppId(/*manifest_id=*/absl::nullopt, GURL(kWebAppUrl2))); EXPECT_CALL(test_listener(), OnAppInstalled(app2)).Times(1); SimulateAppInstalled(app2, kWebAppName2, kWebAppUrl2); @@ -392,7 +391,7 @@ TEST_F(AppServiceWrapperTest, ArcAppDisabled) { // Install ARC app. - const AppId app(apps::mojom::AppType::kArc, kArcPackage1); + const AppId app(apps::AppType::kArc, kArcPackage1); EXPECT_CALL(test_listener(), OnAppInstalled(app)).Times(1); SimulateAppInstalled(app, kArcApp1); @@ -408,7 +407,7 @@ TEST_F(AppServiceWrapperTest, WebAppDisabled) { // Install web app. const AppId app( - apps::mojom::AppType::kWeb, + apps::AppType::kWeb, GenerateAppId(/*manifest_id=*/absl::nullopt, GURL(kWebAppUrl1))); EXPECT_CALL(test_listener(), OnAppInstalled(app)).Times(1); SimulateAppInstalled(app, kWebAppName1, kWebAppUrl1); @@ -424,13 +423,12 @@ // PATL v1 does not support 'extensions' other than Chrome. TEST_F(AppServiceWrapperTest, IgnoreOtherExtensions) { - const AppId chrome(apps::mojom::AppType::kChromeApp, - app_constants::kChromeAppId); + const AppId chrome(apps::AppType::kChromeApp, app_constants::kChromeAppId); std::vector<AppId> installed_apps = tested_wrapper().GetInstalledApps(); EXPECT_TRUE(base::Contains(installed_apps, chrome)); const AppId app1( - apps::mojom::AppType::kChromeApp, + apps::AppType::kChromeApp, GenerateAppId(/*manifest_id=*/absl::nullopt, GURL(kExtensionAppUrl))); EXPECT_CALL(test_listener(), OnAppInstalled(app1)).Times(1); SimulateAppInstalled(app1, kExtensionNameA, kExtensionAppUrl);
diff --git a/chrome/browser/ash/child_accounts/time_limits/app_time_browsertest.cc b/chrome/browser/ash/child_accounts/time_limits/app_time_browsertest.cc index f0eb011..c2e361b 100644 --- a/chrome/browser/ash/child_accounts/time_limits/app_time_browsertest.cc +++ b/chrome/browser/ash/child_accounts/time_limits/app_time_browsertest.cc
@@ -32,6 +32,7 @@ #include "chrome/browser/ui/browser.h" #include "chrome/common/chrome_features.h" #include "chrome/test/base/mixin_based_in_process_browser_test.h" +#include "components/services/app_service/public/cpp/app_types.h" #include "components/user_manager/user.h" #include "components/user_manager/user_manager.h" #include "content/public/test/browser_test.h" @@ -152,7 +153,7 @@ } void InstallArcApp(const AppId& app_id) { - EXPECT_EQ(apps::mojom::AppType::kArc, app_id.app_type()); + EXPECT_EQ(apps::AppType::kArc, app_id.app_type()); const std::string& package_name = app_id.app_id(); arc_app_instance_->SendPackageAdded( CreateArcAppPackage(package_name)->Clone()); @@ -195,7 +196,7 @@ }; IN_PROC_BROWSER_TEST_F(AppTimeTest, AppInstallation) { - const AppId app1(apps::mojom::AppType::kArc, "com.example.app1"); + const AppId app1(apps::AppType::kArc, "com.example.app1"); AppActivityRegistry* app_registry = GetAppRegistry(); EXPECT_FALSE(app_registry->IsAppInstalled(app1)); @@ -207,7 +208,7 @@ IN_PROC_BROWSER_TEST_F(AppTimeTest, PerAppTimeLimitsPolicyUpdates) { // Install an app. - const AppId app1(apps::mojom::AppType::kArc, "com.example.app1"); + const AppId app1(apps::AppType::kArc, "com.example.app1"); InstallArcApp(app1); AppActivityRegistry* app_registry = GetAppRegistry(); @@ -271,13 +272,13 @@ IN_PROC_BROWSER_TEST_F(AppTimeTest, PerAppTimeLimitsPolicyMultipleEntries) { // Install apps. - const AppId app1(apps::mojom::AppType::kArc, "com.example.app1"); + const AppId app1(apps::AppType::kArc, "com.example.app1"); InstallArcApp(app1); - const AppId app2(apps::mojom::AppType::kArc, "com.example.app2"); + const AppId app2(apps::AppType::kArc, "com.example.app2"); InstallArcApp(app2); - const AppId app3(apps::mojom::AppType::kArc, "com.example.app3"); + const AppId app3(apps::AppType::kArc, "com.example.app3"); InstallArcApp(app3); - const AppId app4(apps::mojom::AppType::kArc, "com.example.app4"); + const AppId app4(apps::AppType::kArc, "com.example.app4"); InstallArcApp(app4); AppActivityRegistry* app_registry = GetAppRegistry();
diff --git a/chrome/browser/ash/child_accounts/time_limits/app_time_controller.cc b/chrome/browser/ash/child_accounts/time_limits/app_time_controller.cc index 64d8f364..1986e90 100644 --- a/chrome/browser/ash/child_accounts/time_limits/app_time_controller.cc +++ b/chrome/browser/ash/child_accounts/time_limits/app_time_controller.cc
@@ -162,8 +162,8 @@ } bool IsAppOpenedInChrome(const AppId& app_id, Profile* profile) { - if (app_id.app_type() != apps::mojom::AppType::kChromeApp && - app_id.app_type() != apps::mojom::AppType::kWeb) { + if (app_id.app_type() != apps::AppType::kChromeApp && + app_id.app_type() != apps::AppType::kWeb) { return false; } @@ -293,7 +293,7 @@ absl::optional<base::TimeDelta> AppTimeController::GetTimeLimitForApp( const std::string& app_service_id, - apps::mojom::AppType app_type) const { + apps::AppType app_type) const { const app_time::AppId app_id = app_service_wrapper_->AppIdFromAppServiceId(app_service_id, app_type); return app_registry_->GetTimeLimit(app_id);
diff --git a/chrome/browser/ash/child_accounts/time_limits/app_time_controller.h b/chrome/browser/ash/child_accounts/time_limits/app_time_controller.h index f2af03a..d0dd572f 100644 --- a/chrome/browser/ash/child_accounts/time_limits/app_time_controller.h +++ b/chrome/browser/ash/child_accounts/time_limits/app_time_controller.h
@@ -17,7 +17,7 @@ #include "chrome/browser/ash/child_accounts/time_limits/app_activity_registry.h" #include "chrome/browser/ash/child_accounts/time_limits/app_time_notification_delegate.h" #include "chromeos/dbus/system_clock/system_clock_client.h" -#include "components/services/app_service/public/mojom/types.mojom.h" +#include "components/services/app_service/public/cpp/app_types.h" #include "third_party/abseil-cpp/absl/types/optional.h" class Profile; @@ -87,7 +87,7 @@ // tracked. absl::optional<base::TimeDelta> GetTimeLimitForApp( const std::string& app_service_id, - apps::mojom::AppType app_type) const; + apps::AppType app_type) const; // Called by ChildUserService when it is being destructed to save metrics. void RecordMetricsOnShutdown() const;
diff --git a/chrome/browser/ash/child_accounts/time_limits/app_time_controller_unittest.cc b/chrome/browser/ash/child_accounts/time_limits/app_time_controller_unittest.cc index 0eaef38..f7da0c4 100644 --- a/chrome/browser/ash/child_accounts/time_limits/app_time_controller_unittest.cc +++ b/chrome/browser/ash/child_accounts/time_limits/app_time_controller_unittest.cc
@@ -33,6 +33,7 @@ #include "chromeos/dbus/system_clock/system_clock_client.h" #include "components/prefs/pref_service.h" #include "components/prefs/scoped_user_pref_update.h" +#include "components/services/app_service/public/cpp/app_types.h" #include "components/services/app_service/public/cpp/icon_loader.h" #include "content/public/test/browser_task_environment.h" #include "testing/gtest/include/gtest/gtest.h" @@ -53,8 +54,8 @@ constexpr base::TimeDelta kZeroTime = base::Seconds(0); constexpr char kApp1Name[] = "App1"; constexpr char kApp2Name[] = "App2"; -const AppId kApp1(apps::mojom::AppType::kArc, "1"); -const AppId kApp2(apps::mojom::AppType::kArc, "2"); +const AppId kApp1(apps::AppType::kArc, "1"); +const AppId kApp2(apps::AppType::kArc, "2"); // Calculate the previous reset time. base::Time GetLastResetTime(base::Time timestamp) { @@ -554,7 +555,7 @@ { AppTimeLimitsPolicyBuilder builder; - AppId absent_app(apps::mojom::AppType::kArc, "absent_app"); + AppId absent_app(apps::AppType::kArc, "absent_app"); AppLimit app_limit(AppRestriction::kTimeLimit, kOneHour, base::Time::Now()); AppLimit blocked_app(AppRestriction::kBlocked, absl::nullopt, base::Time::Now());
diff --git a/chrome/browser/ash/child_accounts/time_limits/app_time_limit_interface.h b/chrome/browser/ash/child_accounts/time_limits/app_time_limit_interface.h index 9e1674f..5479c02 100644 --- a/chrome/browser/ash/child_accounts/time_limits/app_time_limit_interface.h +++ b/chrome/browser/ash/child_accounts/time_limits/app_time_limit_interface.h
@@ -7,7 +7,7 @@ #include <string> -#include "components/services/app_service/public/mojom/types.mojom.h" +#include "components/services/app_service/public/cpp/app_types.h" #include "third_party/abseil-cpp/absl/types/optional.h" class Profile; @@ -50,7 +50,7 @@ // exist. virtual absl::optional<base::TimeDelta> GetTimeLimitForApp( const std::string& app_service_id, - apps::mojom::AppType app_type) = 0; + apps::AppType app_type) = 0; }; } // namespace app_time
diff --git a/chrome/browser/ash/child_accounts/time_limits/app_time_limit_utils.cc b/chrome/browser/ash/child_accounts/time_limits/app_time_limit_utils.cc index 76d07e3d..721e7c8 100644 --- a/chrome/browser/ash/child_accounts/time_limits/app_time_limit_utils.cc +++ b/chrome/browser/ash/child_accounts/time_limits/app_time_limit_utils.cc
@@ -7,27 +7,26 @@ #include "chrome/browser/ash/child_accounts/time_limits/app_types.h" #include "chrome/common/extensions/extension_constants.h" #include "components/app_constants/constants.h" -#include "components/services/app_service/public/mojom/types.mojom.h" +#include "components/services/app_service/public/cpp/app_types.h" #include "extensions/common/constants.h" #include "url/gurl.h" namespace ash { namespace app_time { -enterprise_management::App::AppType AppTypeForReporting( - apps::mojom::AppType type) { +enterprise_management::App::AppType AppTypeForReporting(apps::AppType type) { switch (type) { - case apps::mojom::AppType::kArc: + case apps::AppType::kArc: return enterprise_management::App::ARC; - case apps::mojom::AppType::kBuiltIn: + case apps::AppType::kBuiltIn: return enterprise_management::App::BUILT_IN; - case apps::mojom::AppType::kCrostini: + case apps::AppType::kCrostini: return enterprise_management::App::CROSTINI; - case apps::mojom::AppType::kChromeApp: + case apps::AppType::kChromeApp: return enterprise_management::App::EXTENSION; - case apps::mojom::AppType::kPluginVm: + case apps::AppType::kPluginVm: return enterprise_management::App::PLUGIN_VM; - case apps::mojom::AppType::kWeb: + case apps::AppType::kWeb: return enterprise_management::App::WEB; default: return enterprise_management::App::UNKNOWN; @@ -35,12 +34,12 @@ } AppId GetChromeAppId() { - return AppId(apps::mojom::AppType::kChromeApp, app_constants::kChromeAppId); + return AppId(apps::AppType::kChromeApp, app_constants::kChromeAppId); } bool IsWebAppOrExtension(const AppId& app_id) { - return app_id.app_type() == apps::mojom::AppType::kWeb || - app_id.app_type() == apps::mojom::AppType::kChromeApp; + return app_id.app_type() == apps::AppType::kWeb || + app_id.app_type() == apps::AppType::kChromeApp; } // Returns true if the application shares chrome's time limit.
diff --git a/chrome/browser/ash/child_accounts/time_limits/app_time_limit_utils.h b/chrome/browser/ash/child_accounts/time_limits/app_time_limit_utils.h index 052df68..b50a8c03 100644 --- a/chrome/browser/ash/child_accounts/time_limits/app_time_limit_utils.h +++ b/chrome/browser/ash/child_accounts/time_limits/app_time_limit_utils.h
@@ -10,9 +10,7 @@ class GURL; namespace apps { -namespace mojom { enum class AppType; -} // namespace mojom } // namespace apps namespace ash { @@ -21,8 +19,7 @@ class AppId; enum class AppState; -enterprise_management::App::AppType AppTypeForReporting( - apps::mojom::AppType type); +enterprise_management::App::AppType AppTypeForReporting(apps::AppType type); AppId GetChromeAppId();
diff --git a/chrome/browser/ash/child_accounts/time_limits/app_time_policy_helpers.cc b/chrome/browser/ash/child_accounts/time_limits/app_time_policy_helpers.cc index fc7ee70..18d97da 100644 --- a/chrome/browser/ash/child_accounts/time_limits/app_time_policy_helpers.cc +++ b/chrome/browser/ash/child_accounts/time_limits/app_time_policy_helpers.cc
@@ -30,41 +30,41 @@ const char kMinInt[] = "minute"; const char kActivityReportingEnabled[] = "activity_reporting_enabled"; -apps::mojom::AppType PolicyStringToAppType(const std::string& app_type) { +apps::AppType PolicyStringToAppType(const std::string& app_type) { if (app_type == "ARC") - return apps::mojom::AppType::kArc; + return apps::AppType::kArc; if (app_type == "BOREALIS") - return apps::mojom::AppType::kBorealis; + return apps::AppType::kBorealis; if (app_type == "BUILT-IN") - return apps::mojom::AppType::kBuiltIn; + return apps::AppType::kBuiltIn; if (app_type == "CROSTINI") - return apps::mojom::AppType::kCrostini; + return apps::AppType::kCrostini; if (app_type == "EXTENSION") - return apps::mojom::AppType::kChromeApp; + return apps::AppType::kChromeApp; if (app_type == "PLUGIN-VM") - return apps::mojom::AppType::kPluginVm; + return apps::AppType::kPluginVm; if (app_type == "WEB") - return apps::mojom::AppType::kWeb; + return apps::AppType::kWeb; NOTREACHED(); - return apps::mojom::AppType::kUnknown; + return apps::AppType::kUnknown; } -std::string AppTypeToPolicyString(apps::mojom::AppType app_type) { +std::string AppTypeToPolicyString(apps::AppType app_type) { switch (app_type) { - case apps::mojom::AppType::kArc: + case apps::AppType::kArc: return "ARC"; - case apps::mojom::AppType::kBorealis: + case apps::AppType::kBorealis: return "BOREALIS"; - case apps::mojom::AppType::kBuiltIn: + case apps::AppType::kBuiltIn: return "BUILT-IN"; - case apps::mojom::AppType::kCrostini: + case apps::AppType::kCrostini: return "CROSTINI"; - case apps::mojom::AppType::kChromeApp: + case apps::AppType::kChromeApp: return "EXTENSION"; - case apps::mojom::AppType::kPluginVm: + case apps::AppType::kPluginVm: return "PLUGIN-VM"; - case apps::mojom::AppType::kWeb: + case apps::AppType::kWeb: return "WEB"; default: NOTREACHED();
diff --git a/chrome/browser/ash/child_accounts/time_limits/app_time_policy_helpers.h b/chrome/browser/ash/child_accounts/time_limits/app_time_policy_helpers.h index 6725413..2ae68c31 100644 --- a/chrome/browser/ash/child_accounts/time_limits/app_time_policy_helpers.h +++ b/chrome/browser/ash/child_accounts/time_limits/app_time_policy_helpers.h
@@ -8,7 +8,7 @@ #include <map> #include <string> -#include "components/services/app_service/public/mojom/types.mojom.h" +#include "components/services/app_service/public/cpp/app_types.h" #include "third_party/abseil-cpp/absl/types/optional.h" namespace base { @@ -40,10 +40,9 @@ extern const char kMinInt[]; extern const char kActivityReportingEnabled[]; -// Converts between apps::mojom::AppType and string used by app time limits -// policies. -apps::mojom::AppType PolicyStringToAppType(const std::string& app_type); -std::string AppTypeToPolicyString(apps::mojom::AppType app_type); +// Converts between apps::AppType and string used by app time limits policies. +apps::AppType PolicyStringToAppType(const std::string& app_type); +std::string AppTypeToPolicyString(apps::AppType app_type); // Converts between AppRestriction and string used by app time limits policies. AppRestriction PolicyStringToAppRestriction(const std::string& restriction);
diff --git a/chrome/browser/ash/child_accounts/time_limits/app_types.cc b/chrome/browser/ash/child_accounts/time_limits/app_types.cc index 4272a464..02d3d81 100644 --- a/chrome/browser/ash/child_accounts/time_limits/app_types.cc +++ b/chrome/browser/ash/child_accounts/time_limits/app_types.cc
@@ -14,33 +14,33 @@ namespace { -std::string AppTypeToString(apps::mojom::AppType app_type) { +std::string AppTypeToString(apps::AppType app_type) { switch (app_type) { - case apps::mojom::AppType::kUnknown: + case apps::AppType::kUnknown: return "Unknown"; - case apps::mojom::AppType::kArc: + case apps::AppType::kArc: return "Arc"; - case apps::mojom::AppType::kWeb: + case apps::AppType::kWeb: return "Web"; - case apps::mojom::AppType::kChromeApp: - case apps::mojom::AppType::kExtension: - case apps::mojom::AppType::kStandaloneBrowserChromeApp: + case apps::AppType::kChromeApp: + case apps::AppType::kExtension: + case apps::AppType::kStandaloneBrowserChromeApp: return "Extension"; - case apps::mojom::AppType::kBuiltIn: + case apps::AppType::kBuiltIn: return "Built in"; - case apps::mojom::AppType::kCrostini: + case apps::AppType::kCrostini: return "Crostini"; - case apps::mojom::AppType::kMacOs: + case apps::AppType::kMacOs: return "Mac OS"; - case apps::mojom::AppType::kPluginVm: + case apps::AppType::kPluginVm: return "Plugin VM"; - case apps::mojom::AppType::kStandaloneBrowser: + case apps::AppType::kStandaloneBrowser: return "LaCrOS"; - case apps::mojom::AppType::kRemote: + case apps::AppType::kRemote: return "Remote"; - case apps::mojom::AppType::kBorealis: + case apps::AppType::kBorealis: return "Borealis"; - case apps::mojom::AppType::kSystemWeb: + case apps::AppType::kSystemWeb: return "SystemWeb"; } NOTREACHED(); @@ -67,7 +67,7 @@ } // namespace -AppId::AppId(apps::mojom::AppType app_type, const std::string& app_id) +AppId::AppId(apps::AppType app_type, const std::string& app_id) : app_type_(app_type), app_id_(app_id) { DCHECK(!app_id.empty()); }
diff --git a/chrome/browser/ash/child_accounts/time_limits/app_types.h b/chrome/browser/ash/child_accounts/time_limits/app_types.h index 4698be9..e47644f 100644 --- a/chrome/browser/ash/child_accounts/time_limits/app_types.h +++ b/chrome/browser/ash/child_accounts/time_limits/app_types.h
@@ -9,7 +9,7 @@ #include <vector> #include "base/time/time.h" -#include "components/services/app_service/public/mojom/types.mojom.h" +#include "components/services/app_service/public/cpp/app_types.h" #include "third_party/abseil-cpp/absl/types/optional.h" namespace ash { @@ -83,14 +83,14 @@ // specific app id. class AppId { public: - AppId(apps::mojom::AppType app_type, const std::string& app_id); + AppId(apps::AppType app_type, const std::string& app_id); AppId(const AppId&); AppId& operator=(const AppId&); AppId(AppId&&); AppId& operator=(AppId&&); ~AppId(); - apps::mojom::AppType app_type() const { return app_type_; } + apps::AppType app_type() const { return app_type_; } const std::string& app_id() const { return app_id_; } bool operator==(const AppId&) const; @@ -99,7 +99,7 @@ friend std::ostream& operator<<(std::ostream&, const AppId&); private: - apps::mojom::AppType app_type_ = apps::mojom::AppType::kUnknown; + apps::AppType app_type_ = apps::AppType::kUnknown; // Package name for |ARC| apps, 32 character long Chrome specific app id // otherwise.
diff --git a/chrome/browser/ash/child_accounts/time_limits/persisted_app_info_unittest.cc b/chrome/browser/ash/child_accounts/time_limits/persisted_app_info_unittest.cc index f963fb5..a3a077b 100644 --- a/chrome/browser/ash/child_accounts/time_limits/persisted_app_info_unittest.cc +++ b/chrome/browser/ash/child_accounts/time_limits/persisted_app_info_unittest.cc
@@ -8,6 +8,7 @@ #include "base/time/time.h" #include "base/values.h" #include "chrome/browser/ash/child_accounts/time_limits/app_types.h" +#include "components/services/app_service/public/cpp/app_types.h" #include "testing/gtest/include/gtest/gtest.h" namespace ash { @@ -16,7 +17,7 @@ using PersistedAppInfoTest = testing::Test; TEST_F(PersistedAppInfoTest, RemoveActiveTimes) { - AppId app = AppId(apps::mojom::AppType::kArc, "1"); + AppId app = AppId(apps::AppType::kArc, "1"); AppState app_state = AppState::kAvailable; base::TimeDelta running_active_time = base::Hours(5); @@ -49,7 +50,7 @@ } TEST_F(PersistedAppInfoTest, UpdateAppActivityPreference) { - AppId app = AppId(apps::mojom::AppType::kArc, "1"); + AppId app = AppId(apps::AppType::kArc, "1"); AppState app_state = AppState::kAvailable; base::TimeDelta running_active_time = base::Hours(5);
diff --git a/chrome/browser/ash/child_accounts/time_limits/web_time_limit_enforcer_browsertest.cc b/chrome/browser/ash/child_accounts/time_limits/web_time_limit_enforcer_browsertest.cc index b3aef34..edaa53d 100644 --- a/chrome/browser/ash/child_accounts/time_limits/web_time_limit_enforcer_browsertest.cc +++ b/chrome/browser/ash/child_accounts/time_limits/web_time_limit_enforcer_browsertest.cc
@@ -33,6 +33,7 @@ #include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/mixin_based_in_process_browser_test.h" #include "chrome/test/base/ui_test_utils.h" +#include "components/services/app_service/public/cpp/app_types.h" #include "components/user_manager/user_manager.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/navigation_handle.h" @@ -188,7 +189,7 @@ std::move(web_app_info)); if (allowlisted_app) - AllowlistApp(app_time::AppId(apps::mojom::AppType::kWeb, app_id)); + AllowlistApp(app_time::AppId(apps::AppType::kWeb, app_id)); base::RunLoop().RunUntilIdle(); // Add a tab to |browser()| and return the newly added WebContents.
diff --git a/chrome/browser/ash/child_accounts/time_limits/web_time_limit_navigation_throttle.cc b/chrome/browser/ash/child_accounts/time_limits/web_time_limit_navigation_throttle.cc index f96a8e0..cc62576d 100644 --- a/chrome/browser/ash/child_accounts/time_limits/web_time_limit_navigation_throttle.cc +++ b/chrome/browser/ash/child_accounts/time_limits/web_time_limit_navigation_throttle.cc
@@ -24,6 +24,7 @@ #include "chrome/browser/ui/web_applications/app_browser_controller.h" #include "chrome/browser/web_applications/web_app_id.h" #include "chrome/browser/web_applications/web_app_tab_helper.h" +#include "components/services/app_service/public/cpp/app_types.h" #include "content/public/browser/navigation_handle.h" #include "content/public/browser/web_contents.h" #include "net/base/registry_controlled_domains/registry_controlled_domain.h" @@ -52,7 +53,7 @@ bool IsWebAppAllowlisted(const std::string& app_id_string, content::BrowserContext* context) { - const app_time::AppId app_id(apps::mojom::AppType::kWeb, app_id_string); + const app_time::AppId app_id(apps::AppType::kWeb, app_id_string); auto* child_user_service = ChildUserServiceFactory::GetForBrowserContext(context); DCHECK(child_user_service);
diff --git a/chrome/browser/ash/crosapi/move_migrator.cc b/chrome/browser/ash/crosapi/move_migrator.cc index 6ca2793..91e608b 100644 --- a/chrome/browser/ash/crosapi/move_migrator.cc +++ b/chrome/browser/ash/crosapi/move_migrator.cc
@@ -86,9 +86,21 @@ base::BindOnce(&MoveMigrator::OnMoveLacrosItemsToNewDir, weak_factory_.GetWeakPtr())); return; + case ResumeStep::kMoveSplitItems: + LOG(ERROR) << "Migration did not complete in the previous attempt. " + "Resuming migration from kMoveSplitItems step."; + base::ThreadPool::PostTaskAndReplyWithResult( + FROM_HERE, + {base::MayBlock(), base::TaskPriority::USER_VISIBLE, + base::TaskShutdownBehavior::BLOCK_SHUTDOWN}, + base::BindOnce(&MoveMigrator::MoveSplitItemsToOriginalDir, + original_profile_dir_), + base::BindOnce(&MoveMigrator::OnMoveSplitItemsToOriginalDir, + weak_factory_.GetWeakPtr())); + return; case ResumeStep::kMoveTmpDir: LOG(ERROR) << "Migration did not complete in the previous attempt. " - "Resuming migration from kMoveDir step."; + "Resuming migration from kMoveTmpDir step."; base::ThreadPool::PostTaskAndReplyWithResult( FROM_HERE, {base::MayBlock(), base::TaskPriority::USER_VISIBLE, @@ -123,6 +135,8 @@ return false; case ResumeStep::kMoveLacrosItems: return true; + case ResumeStep::kMoveSplitItems: + return true; case ResumeStep::kMoveTmpDir: return true; case ResumeStep::kCompleted: @@ -468,6 +482,86 @@ return; } + SetResumeStep(local_state_, user_id_hash_, ResumeStep::kMoveSplitItems); + + base::ThreadPool::PostTaskAndReplyWithResult( + FROM_HERE, + {base::MayBlock(), base::TaskPriority::USER_VISIBLE, + base::TaskShutdownBehavior::BLOCK_SHUTDOWN}, + base::BindOnce(&MoveMigrator::MoveSplitItemsToOriginalDir, + original_profile_dir_), + base::BindOnce(&MoveMigrator::OnMoveSplitItemsToOriginalDir, + weak_factory_.GetWeakPtr())); +} + +// static +bool MoveMigrator::MoveSplitItemsToOriginalDir( + const base::FilePath& original_profile_dir) { + LOG(WARNING) << "Running MoveSplitItemsToOriginalDir()"; + + const base::FilePath tmp_split_dir = + original_profile_dir.Append(browser_data_migrator_util::kSplitTmpDir); + const base::FilePath tmp_profile_dir = + original_profile_dir.Append(browser_data_migrator_util::kMoveTmpDir) + .Append(browser_data_migrator_util::kLacrosProfilePath); + + // Move everything inside tmp_split_dir to Ash's profile directory. + base::FileEnumerator e( + tmp_split_dir, false, + base::FileEnumerator::FILES | base::FileEnumerator::DIRECTORIES); + + for (base::FilePath path = e.Next(); !path.empty(); path = e.Next()) { + base::FilePath ash_path = original_profile_dir.Append(path.BaseName()); + if (!base::Move(path, ash_path)) { + PLOG(ERROR) << "Failed moving " << path.value() << " to " + << ash_path.value(); + return false; + } + } + + // Delete tmp_split_dir. + if (!base::DeleteFile(tmp_split_dir)) { + PLOG(ERROR) << "Failed removing " << tmp_split_dir.value(); + } + + // Move extensions in the keeplist back to Ash's profile directory. + const base::FilePath lacros_extensions_dir = + tmp_profile_dir.Append(browser_data_migrator_util::kExtensionsFilePath); + if (base::PathExists(lacros_extensions_dir)) { + const base::FilePath ash_extensions_dir = original_profile_dir.Append( + browser_data_migrator_util::kExtensionsFilePath); + if (!base::CreateDirectory(ash_extensions_dir)) { + PLOG(ERROR) << "CreateDirectory() failed for " + << ash_extensions_dir.value(); + return false; + } + + for (const char* extension_id : + browser_data_migrator_util::kExtensionKeepList) { + base::FilePath lacros_path = lacros_extensions_dir.Append(extension_id); + if (base::PathExists(lacros_path)) { + base::FilePath ash_path = ash_extensions_dir.Append(extension_id); + if (!base::Move(lacros_path, ash_path)) { + PLOG(ERROR) << "Failed moving " << lacros_path.value() << " to " + << ash_path.value(); + return false; + } + } + } + } + + return true; +} + +void MoveMigrator::OnMoveSplitItemsToOriginalDir(bool success) { + if (!success) { + LOG(ERROR) << "Moving split objects has failed."; + std::move(finished_callback_) + .Run({BrowserDataMigratorImpl::DataWipeResult::kSucceeded, + {BrowserDataMigratorImpl::ResultKind::kFailed}}); + return; + } + SetResumeStep(local_state_, user_id_hash_, ResumeStep::kMoveTmpDir); base::ThreadPool::PostTaskAndReplyWithResult( @@ -514,85 +608,8 @@ return; } - base::ThreadPool::PostTaskAndReplyWithResult( - FROM_HERE, - {base::MayBlock(), base::TaskPriority::USER_VISIBLE, - base::TaskShutdownBehavior::BLOCK_SHUTDOWN}, - base::BindOnce(&MoveMigrator::MoveSplitItemsToOriginalDir, - original_profile_dir_), - base::BindOnce(&MoveMigrator::OnMoveSplitItemsToOriginalDir, - weak_factory_.GetWeakPtr())); -} - -// static -bool MoveMigrator::MoveSplitItemsToOriginalDir( - const base::FilePath& original_profile_dir) { - LOG(WARNING) << "Running MoveSplitItemsToOriginalDir()"; - - const base::FilePath tmp_split_dir = - original_profile_dir.Append(browser_data_migrator_util::kSplitTmpDir); - const base::FilePath lacros_profile_dir = - original_profile_dir.Append(browser_data_migrator_util::kLacrosDir) - .Append(browser_data_migrator_util::kLacrosProfilePath); - - // Move everything inside tmp_split_dir to Ash's profile directory. - base::FileEnumerator e( - tmp_split_dir, false, - base::FileEnumerator::FILES | base::FileEnumerator::DIRECTORIES); - - for (base::FilePath path = e.Next(); !path.empty(); path = e.Next()) { - base::FilePath ash_path = original_profile_dir.Append(path.BaseName()); - if (!base::Move(path, ash_path)) { - PLOG(ERROR) << "Failed moving " << path.value() << " to " - << ash_path.value(); - return false; - } - } - - // Delete tmp_split_dir. - if (!base::DeleteFile(tmp_split_dir)) { - PLOG(ERROR) << "Failed removing " << tmp_split_dir.value(); - } - - // Move extensions in the keeplist back to Ash's profile directory. - const base::FilePath lacros_extensions_dir = lacros_profile_dir.Append( - browser_data_migrator_util::kExtensionsFilePath); - if (base::PathExists(lacros_extensions_dir)) { - const base::FilePath ash_extensions_dir = original_profile_dir.Append( - browser_data_migrator_util::kExtensionsFilePath); - if (!base::CreateDirectory(ash_extensions_dir)) { - PLOG(ERROR) << "CreateDirectory() failed for " - << ash_extensions_dir.value(); - return false; - } - - for (const char* extension_id : - browser_data_migrator_util::kExtensionKeepList) { - base::FilePath lacros_path = lacros_extensions_dir.Append(extension_id); - if (base::PathExists(lacros_path)) { - base::FilePath ash_path = ash_extensions_dir.Append(extension_id); - if (!base::Move(lacros_path, ash_path)) { - PLOG(ERROR) << "Failed moving " << lacros_path.value() << " to " - << ash_path.value(); - return false; - } - } - } - } - - return true; -} - -void MoveMigrator::OnMoveSplitItemsToOriginalDir(bool success) { - if (!success) { - LOG(ERROR) << "Moving split objects has failed."; - std::move(finished_callback_) - .Run({BrowserDataMigratorImpl::DataWipeResult::kSucceeded, - {BrowserDataMigratorImpl::ResultKind::kFailed}}); - return; - } - SetResumeStep(local_state_, user_id_hash_, ResumeStep::kCompleted); + LOG(WARNING) << "Move migration completed successfully."; std::move(finished_callback_) .Run({BrowserDataMigratorImpl::DataWipeResult::kSucceeded,
diff --git a/chrome/browser/ash/crosapi/move_migrator.h b/chrome/browser/ash/crosapi/move_migrator.h index 6c8abd5..79e6a3b 100644 --- a/chrome/browser/ash/crosapi/move_migrator.h +++ b/chrome/browser/ash/crosapi/move_migrator.h
@@ -49,8 +49,11 @@ // 1) Delete any `ItemType::kDeletable` items in <Ash PDD>. // 2) Setup <Ash PDD>/<kMoveTmpDir> by copying `ItemType::kNeedCopy` // items into it. -// 3) Move `ItemType::kLacros` in <Ash PDD> to <lacros PDD>. -// 4) Rename <Ash PDD>/<kMoveTmpDir>/ as <Ash PDD>/lacros/. +// 3) Setup <Ash PDD>/<kSplitTmpDir> by generating split data that will have to +// remain in Ash. +// 4) Move `ItemType::kLacros` in <Ash PDD> to <lacros PDD>. +// 5) Move split items in <Ash PDD>/<kSplitTmpDir> to <Ash PDD>. +// 6) Rename <Ash PDD>/<kMoveTmpDir>/ as <Ash PDD>/lacros/. class MoveMigrator : public BrowserDataMigratorImpl::MigratorDelegate { public: // Indicate which step the migration should be resumed from if left unfinished @@ -58,8 +61,9 @@ enum class ResumeStep { kStart = 0, kMoveLacrosItems = 1, - kMoveTmpDir = 2, - kCompleted = 3, + kMoveSplitItems = 2, + kMoveTmpDir = 3, + kCompleted = 4, }; // Return value of `PreMigrationCleanUp()`. @@ -114,7 +118,10 @@ FRIEND_TEST_ALL_PREFIXES(MoveMigratorTest, MoveLacrosItemsToNewDir); FRIEND_TEST_ALL_PREFIXES(MoveMigratorMigrateTest, MigrateResumeFromMoveLacrosItems); - FRIEND_TEST_ALL_PREFIXES(MoveMigratorMigrateTest, MigrateResumeFromMove); + FRIEND_TEST_ALL_PREFIXES(MoveMigratorMigrateTest, + MigrateResumeFromMoveSplitItems); + FRIEND_TEST_ALL_PREFIXES(MoveMigratorMigrateTest, + MigrateResumeFromMoveTmpDir); friend class BrowserDataMigratorResumeOnSignInTest; friend class BrowserDataMigratorResumeRestartInSession; @@ -182,20 +189,20 @@ // Called as a reply to `MoveLacrosItemsToNewDir()`. void OnMoveLacrosItemsToNewDir(bool success); - // Moves newly created `kMoveTmpDir` to `kLacrosDir`. - static bool MoveTmpDirToLacrosDir(const base::FilePath& original_profile_dir); - - // Called as a reply to `MoveTmpDirToLacrosDir()`. - void OnMoveTmpDirToLacrosDir(bool success); - // Moves newly created split items to the original profile directory. - // Completes the migration. static bool MoveSplitItemsToOriginalDir( const base::FilePath& original_profile_dir); // Called as a reply to `MoveSplitItemsToOriginalDir`. void OnMoveSplitItemsToOriginalDir(bool success); + // Moves newly created `kMoveTmpDir` to `kLacrosDir`. + // Completes the migration. + static bool MoveTmpDirToLacrosDir(const base::FilePath& original_profile_dir); + + // Called as a reply to `MoveTmpDirToLacrosDir()`. + void OnMoveTmpDirToLacrosDir(bool success); + // Path to the original profile data directory, which is directly under the // user data directory. const base::FilePath original_profile_dir_;
diff --git a/chrome/browser/ash/crosapi/move_migrator_unittest.cc b/chrome/browser/ash/crosapi/move_migrator_unittest.cc index 753507c..bf0a32f 100644 --- a/chrome/browser/ash/crosapi/move_migrator_unittest.cc +++ b/chrome/browser/ash/crosapi/move_migrator_unittest.cc
@@ -52,24 +52,34 @@ browser_data_migrator_util::kBuffer * 2; // Setup the `Extensions` folder inside a profile. -void SetUpExtensions(const base::FilePath& profile_path) { +// If `ash_only` is true, it will only generate data associated to extensions +// that have to be kept in Ash. Otherwise, it will generate data for both +// categories of extensions. +void SetUpExtensions(const base::FilePath& profile_path, + bool ash = true, + bool lacros = true) { base::FilePath path = profile_path.Append(browser_data_migrator_util::kExtensionsFilePath); // Generate data for an extension that has to be moved to Lacros. - ASSERT_TRUE(base::CreateDirectory(path.Append(kMoveExtensionId))); - ASSERT_EQ(base::WriteFile(path.Append(kMoveExtensionId).Append(kDataFilePath), - kDataContent, kDataSize), - kDataSize); + if (lacros) { + ASSERT_TRUE(base::CreateDirectory(path.Append(kMoveExtensionId))); + ASSERT_EQ( + base::WriteFile(path.Append(kMoveExtensionId).Append(kDataFilePath), + kDataContent, kDataSize), + kDataSize); + } // Generate data for an extension that has to stay in Ash. - std::string keep_extension_id = - browser_data_migrator_util::kExtensionKeepList[0]; - ASSERT_TRUE(base::CreateDirectory(path.Append(keep_extension_id))); - ASSERT_EQ( - base::WriteFile(path.Append(keep_extension_id).Append(kDataFilePath), - kDataContent, kDataSize), - kDataSize); + if (ash) { + std::string keep_extension_id = + browser_data_migrator_util::kExtensionKeepList[0]; + ASSERT_TRUE(base::CreateDirectory(path.Append(keep_extension_id))); + ASSERT_EQ( + base::WriteFile(path.Append(keep_extension_id).Append(kDataFilePath), + kDataContent, kDataSize), + kDataSize); + } } // Setup the `Local Storage` folder inside a profile. @@ -379,6 +389,10 @@ EXPECT_TRUE(MoveMigrator::ResumeRequired(&pref_service, user_id_hash)); MoveMigrator::SetResumeStep(&pref_service, user_id_hash, + MoveMigrator::ResumeStep::kMoveSplitItems); + EXPECT_TRUE(MoveMigrator::ResumeRequired(&pref_service, user_id_hash)); + + MoveMigrator::SetResumeStep(&pref_service, user_id_hash, MoveMigrator::ResumeStep::kMoveTmpDir); EXPECT_TRUE(MoveMigrator::ResumeRequired(&pref_service, user_id_hash)); @@ -568,11 +582,13 @@ ASSERT_TRUE(base::Move(original_profile_dir_.Append(kBookmarksFilePath), tmp_profile_dir.Append(kBookmarksFilePath))); + // Extensions have been moved to Lacros's tmp dir. ASSERT_TRUE(base::Move( original_profile_dir_.Append( browser_data_migrator_util::kExtensionsFilePath), tmp_profile_dir.Append(browser_data_migrator_util::kExtensionsFilePath))); + // Local Storage has been split. ASSERT_TRUE( base::Move(original_profile_dir_.Append( browser_data_migrator_util::kLocalStorageFilePath), @@ -591,9 +607,9 @@ CheckProfileDirFinalState(); } -TEST_F(MoveMigratorMigrateTest, MigrateResumeFromMove) { +TEST_F(MoveMigratorMigrateTest, MigrateResumeFromMoveSplitItems) { MoveMigrator::SetResumeStep(&pref_service_, user_id_hash_, - MoveMigrator::ResumeStep::kMoveTmpDir); + MoveMigrator::ResumeStep::kMoveSplitItems); // Setup `original_profile_dir_` as below. // |- Downloads @@ -631,11 +647,14 @@ ASSERT_TRUE(base::Move(original_profile_dir_.Append(kCookiesFilePath), tmp_profile_dir.Append(kCookiesFilePath))); + // Extensions have been moved to Lacros's tmp dir, but not yet split and moved + // to Ash profile dir. ASSERT_TRUE(base::Move( original_profile_dir_.Append( browser_data_migrator_util::kExtensionsFilePath), tmp_profile_dir.Append(browser_data_migrator_util::kExtensionsFilePath))); + // Local Storage has been split, but not yet moved to Ash profile dir. ASSERT_TRUE( base::Move(original_profile_dir_.Append( browser_data_migrator_util::kLocalStorageFilePath), @@ -654,6 +673,68 @@ CheckProfileDirFinalState(); } +TEST_F(MoveMigratorMigrateTest, MigrateResumeFromMoveTmpDir) { + MoveMigrator::SetResumeStep(&pref_service_, user_id_hash_, + MoveMigrator::ResumeStep::kMoveTmpDir); + + // Setup `original_profile_dir_` as below. + // |- Downloads + // |- Extensions + // |- Local Storage + // |- Login Data + // |- move_migrator/First Run + // |- move_migrator/Default/ + // |- Bookmarks + // |- Cookies + // |- Extensions + // |- Local Storage + // |- Login Data + + const base::FilePath tmp_user_dir = + original_profile_dir_.Append(browser_data_migrator_util::kMoveTmpDir); + const base::FilePath tmp_profile_dir = + tmp_user_dir.Append(browser_data_migrator_util::kLacrosProfilePath); + ASSERT_TRUE(base::DeletePathRecursively( + original_profile_dir_.Append(kCacheFilePath))); + + ASSERT_TRUE(base::CreateDirectory(tmp_user_dir)); + ASSERT_EQ( + base::WriteFile(tmp_user_dir.Append(chrome::kFirstRunSentinel), "", 0), + 0); + ASSERT_TRUE(base::CreateDirectory(tmp_profile_dir)); + ASSERT_TRUE(base::CopyDirectory( + original_profile_dir_.Append(kLoginDataFilePath), + tmp_profile_dir.Append(kLoginDataFilePath), true /* recursive */)); + ASSERT_TRUE(base::Move(original_profile_dir_.Append(kBookmarksFilePath), + tmp_profile_dir.Append(kBookmarksFilePath))); + ASSERT_TRUE(base::Move(original_profile_dir_.Append(kCookiesFilePath), + tmp_profile_dir.Append(kCookiesFilePath))); + + // Extensions have been split, and Ash's version is in its final place. + ASSERT_TRUE(base::DeletePathRecursively(original_profile_dir_.Append( + browser_data_migrator_util::kExtensionsFilePath))); + SetUpExtensions(tmp_profile_dir, /*ash=*/false, /*lacros=*/true); + SetUpExtensions(original_profile_dir_, /*ash=*/true, /*lacros=*/false); + + // Local Storage has been split, and Ash's version is in its final place. + ASSERT_TRUE( + base::Move(original_profile_dir_.Append( + browser_data_migrator_util::kLocalStorageFilePath), + tmp_profile_dir.Append( + browser_data_migrator_util::kLocalStorageFilePath))); + SetUpLocalStorage(original_profile_dir_, true /* ash_only */); + + migrator_->Migrate(); + run_loop_->Run(); + + EXPECT_EQ(data_wipe_result_, + BrowserDataMigratorImpl::DataWipeResult::kSucceeded); + EXPECT_EQ(data_migration_result_.kind, + BrowserDataMigrator::ResultKind::kSucceeded); + + CheckProfileDirFinalState(); +} + TEST_F(MoveMigratorMigrateTest, MigrateOutOfDisk) { // Emulate the situation of out-of-disk. browser_data_migrator_util::ScopedExtraBytesRequiredToBeFreedForTesting
diff --git a/chrome/browser/ash/file_manager/extract_io_task.cc b/chrome/browser/ash/file_manager/extract_io_task.cc index 0313a68..29d6cf8 100644 --- a/chrome/browser/ash/file_manager/extract_io_task.cc +++ b/chrome/browser/ash/file_manager/extract_io_task.cc
@@ -18,13 +18,27 @@ parent_folder_(std::move(parent_folder)), file_system_context_(std::move(file_system_context)) { progress_.type = OperationType::kExtract; - progress_.state = State::kSuccess; + progress_.state = State::kQueued; + progress_.bytes_transferred = 0; + progress_.total_bytes = 0; + // Store all the ZIP files in the selection so we have + // a proper count of how many need to be extracted. + for (const storage::FileSystemURL& source_url : source_urls_) { + const base::FilePath source_path = source_url.path(); + if (source_path.MatchesExtension(".zip") && + chromeos::FileSystemBackend::CanHandleURL(source_url)) { + progress_.sources.emplace_back(source_url, absl::nullopt); + } + } } ExtractIOTask::~ExtractIOTask() {} void ExtractIOTask::ZipExtractCallback(bool success) { progress_.state = success ? State::kSuccess : State::kError; + progress_callback_.Run(progress_); + // TODO(crbug.com/953256) Track count here and call for last unpack only. + Complete(); } void ExtractIOTask::Execute(IOTask::ProgressCallback progress_callback, @@ -33,28 +47,20 @@ complete_callback_ = std::move(complete_callback); VLOG(1) << "Executing EXTRACT_ARCHIVE IO task"; - for (const auto& source_url : source_urls_) { - base::FilePath source_file = source_url.path(); - if (source_file.MatchesExtension(".zip")) { - if (!chromeos::FileSystemBackend::CanHandleURL(source_url)) { - progress_.state = State::kError; - // TODO(crbug.com/953256) Report progress error. - } else { - // TODO(crbug.com/953256) Perform this check only once. - if (chromeos::FileSystemBackend::CanHandleURL(parent_folder_)) { - base::FilePath destination_directory = parent_folder_.path(); - unzip::Unzip(unzip::LaunchUnzipper(), source_file, - destination_directory, - base::BindOnce(&ExtractIOTask::ZipExtractCallback, - weak_ptr_factory_.GetWeakPtr())); - } else { - progress_.state = State::kError; - } - } + progress_.state = State::kInProgress; + progress_callback_.Run(progress_); + for (const EntryStatus& source : progress_.sources) { + const base::FilePath source_file = source.url.path(); + // TODO(crbug.com/953256) Perform this check only once. + if (chromeos::FileSystemBackend::CanHandleURL(parent_folder_)) { + const base::FilePath destination_directory = parent_folder_.path(); + unzip::Unzip(unzip::LaunchUnzipper(), source_file, destination_directory, + base::BindOnce(&ExtractIOTask::ZipExtractCallback, + weak_ptr_factory_.GetWeakPtr())); + } else { + progress_.state = State::kError; } } - - Complete(); } void ExtractIOTask::Cancel() {
diff --git a/chrome/browser/ash/file_manager/file_manager_string_util.cc b/chrome/browser/ash/file_manager/file_manager_string_util.cc index 7a020f1..ab2acf6d 100644 --- a/chrome/browser/ash/file_manager/file_manager_string_util.cc +++ b/chrome/browser/ash/file_manager/file_manager_string_util.cc
@@ -832,6 +832,9 @@ SET_STRING("EXTERNAL_LINK_MESSAGE", IDS_FILE_BROWSER_EXTERNAL_LINK_MESSAGE); SET_STRING("EXTRACT_ALL_BUTTON_LABEL", IDS_FILE_BROWSER_EXTRACT_ALL_BUTTON_LABEL); + SET_STRING("EXTRACT_FILE_NAME", IDS_FILE_BROWSER_EXTRACT_FILE_NAME); + SET_STRING("EXTRACT_ITEMS_REMAINING", + IDS_FILE_BROWSER_EXTRACT_ITEMS_REMAINING); SET_STRING("SELECTION_ADD_SINGLE_ENTRY", IDS_FILE_BROWSER_SELECTION_ADD_SINGLE_ENTRY); SET_STRING("SELECTION_REMOVE_SINGLE_ENTRY",
diff --git a/chrome/browser/ash/login/reporting/login_logout_reporter.cc b/chrome/browser/ash/login/reporting/login_logout_reporter.cc index 849de275..6b0bcb4 100644 --- a/chrome/browser/ash/login/reporting/login_logout_reporter.cc +++ b/chrome/browser/ash/login/reporting/login_logout_reporter.cc
@@ -5,18 +5,36 @@ #include "chrome/browser/ash/login/reporting/login_logout_reporter.h" #include "base/logging.h" +#include "base/task/bind_post_task.h" #include "chrome/browser/ash/login/existing_user_controller.h" #include "chrome/browser/ash/policy/core/device_local_account.h" #include "chrome/browser/ash/policy/reporting/user_event_reporter_helper.h" #include "chrome/browser/ash/profiles/profile_helper.h" +#include "chrome/browser/browser_process.h" +#include "components/prefs/pref_registry_simple.h" +#include "components/prefs/pref_service.h" +#include "components/prefs/scoped_user_pref_update.h" #include "components/user_manager/user.h" #include "components/user_manager/user_manager.h" #include "components/user_manager/user_names.h" +#include "content/public/browser/browser_thread.h" namespace ash { namespace reporting { namespace { +constexpr char kLoginLogoutReporterDictionary[] = + "reporting.login_logout_reporter_dictionary"; +constexpr char kKioskLoginFailureTimestamp[] = "kiosk_login_failure_timestamp"; + +PrefService* GetLocalState() { + if (!g_browser_process || !g_browser_process->local_state()) { + DVLOG(1) << "Could not get local state."; + return nullptr; + } + return g_browser_process->local_state(); +} + LoginLogoutSessionType GetSessionType(const AccountId& account_id) { if (account_id == user_manager::GuestAccountId()) { return LoginLogoutSessionType::GUEST_SESSION; @@ -94,15 +112,23 @@ ->GetLastLoginAttemptAccountId(); } +// static +void LoginLogoutReporter::RegisterPrefs(PrefRegistrySimple* registry) { + registry->RegisterDictionaryPref(kLoginLogoutReporterDictionary); +} + LoginLogoutReporter::LoginLogoutReporter( std::unique_ptr<::reporting::UserEventReporterHelper> reporter_helper, std::unique_ptr<Delegate> delegate, - policy::ManagedSessionService* managed_session_service) + policy::ManagedSessionService* managed_session_service, + base::Clock* clock) : reporter_helper_(std::move(reporter_helper)), - delegate_(std::move(delegate)) { + delegate_(std::move(delegate)), + clock_(clock) { if (managed_session_service) { managed_session_observation_.Observe(managed_session_service); } + MaybeReportKioskLoginFailure(); } LoginLogoutReporter::~LoginLogoutReporter() = default; @@ -122,10 +148,11 @@ std::unique_ptr<LoginLogoutReporter> LoginLogoutReporter::CreateForTest( std::unique_ptr<::reporting::UserEventReporterHelper> reporter_helper, std::unique_ptr<LoginLogoutReporter::Delegate> delegate, - policy::ManagedSessionService* managed_session_service) { - return base::WrapUnique(new LoginLogoutReporter(std::move(reporter_helper), - std::move(delegate), - managed_session_service)); + policy::ManagedSessionService* managed_session_service, + base::Clock* clock) { + return base::WrapUnique( + new LoginLogoutReporter(std::move(reporter_helper), std::move(delegate), + managed_session_service, clock)); } void LoginLogoutReporter::MaybeReportEvent(LoginLogoutRecord record, @@ -140,7 +167,7 @@ session_type == LoginLogoutSessionType::KIOSK_SESSION)) { return; } - record.set_event_timestamp_sec(base::Time::Now().ToTimeT()); + record.set_event_timestamp_sec(clock_->Now().ToTimeT()); record.set_session_type(session_type); const std::string& user_email = account_id.GetUserEmail(); if (session_type == LoginLogoutSessionType::PUBLIC_ACCOUNT_SESSION || @@ -180,5 +207,70 @@ MaybeReportEvent(std::move(record), account_id); } +void LoginLogoutReporter::OnKioskLoginFailure() { + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); + + if (!base::FeatureList::IsEnabled(kEnableKioskAndGuestLoginLogoutReporting) || + !reporter_helper_->ReportingEnabled(kReportDeviceLoginLogout) || + !GetLocalState()) { + return; + } + + DictionaryPrefUpdate dict_update(GetLocalState(), + kLoginLogoutReporterDictionary); + dict_update->GetDict().Set(kKioskLoginFailureTimestamp, + static_cast<int>(clock_->Now().ToTimeT())); +} + +void LoginLogoutReporter::MaybeReportKioskLoginFailure() { + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); + + if (!base::FeatureList::IsEnabled(kEnableKioskAndGuestLoginLogoutReporting) || + !GetLocalState()) { + return; + } + + const auto* pref = + GetLocalState()->FindPreference(kLoginLogoutReporterDictionary); + if (!pref) { + NOTREACHED() << "Cannot find pref."; + return; + } + + absl::optional<int> last_kiosk_login_failure_timestamp = + pref->GetValue()->GetDict().FindInt(kKioskLoginFailureTimestamp); + if (!last_kiosk_login_failure_timestamp.has_value()) { + // No kiosk login failure to report. + return; + } + + LoginLogoutRecord record; + record.set_event_timestamp_sec(last_kiosk_login_failure_timestamp.value()); + record.set_session_type(LoginLogoutSessionType::KIOSK_SESSION); + record.mutable_login_event()->mutable_failure(); + + auto enqueue_cb = base::BindOnce([](::reporting::Status status) { + if (!status.ok()) { + DVLOG(1) << "Could not enqueue event to reporting queue because of: " + << status; + return; + } + + if (!GetLocalState()) { + return; + } + DictionaryPrefUpdate dict_update(GetLocalState(), + kLoginLogoutReporterDictionary); + dict_update->RemoveKey(kKioskLoginFailureTimestamp); + }); + + // Enqueue callback should run on the UI thread (current thread) to access + // pref service. + reporter_helper_->ReportEvent( + &record, ::reporting::Priority::SECURITY, + base::BindPostTask(base::ThreadTaskRunnerHandle::Get(), + std::move(enqueue_cb))); +} + } // namespace reporting } // namespace ash
diff --git a/chrome/browser/ash/login/reporting/login_logout_reporter.h b/chrome/browser/ash/login/reporting/login_logout_reporter.h index 2e81f96..a21ff34b 100644 --- a/chrome/browser/ash/login/reporting/login_logout_reporter.h +++ b/chrome/browser/ash/login/reporting/login_logout_reporter.h
@@ -5,15 +5,18 @@ #ifndef CHROME_BROWSER_ASH_LOGIN_REPORTING_LOGIN_LOGOUT_REPORTER_H_ #define CHROME_BROWSER_ASH_LOGIN_REPORTING_LOGIN_LOGOUT_REPORTER_H_ +#include <memory> + #include "ash/components/login/auth/auth_status_consumer.h" -#include "base/containers/queue.h" #include "base/feature_list.h" #include "base/scoped_observation.h" +#include "base/time/clock.h" +#include "base/time/default_clock.h" #include "chrome/browser/ash/policy/status_collector/managed_session_service.h" #include "chrome/browser/policy/messaging_layer/proto/synced/login_logout_event.pb.h" #include "chrome/browser/profiles/profile.h" -#include "components/policy/core/common/cloud/dm_token.h" -#include "components/reporting/client/report_queue_provider.h" + +class PrefRegistrySimple; namespace reporting { @@ -51,7 +54,10 @@ static std::unique_ptr<LoginLogoutReporter> CreateForTest( std::unique_ptr<::reporting::UserEventReporterHelper> reporter_helper, std::unique_ptr<Delegate> delegate, - policy::ManagedSessionService* managed_session_service = nullptr); + policy::ManagedSessionService* managed_session_service, + base::Clock* clock = base::DefaultClock::GetInstance()); + + static void RegisterPrefs(PrefRegistrySimple* registry); // Report user device failed login attempt. void OnLoginFailure(const AuthFailure& error) override; @@ -62,16 +68,21 @@ // Report user device logout. void OnSessionTerminationStarted(const user_manager::User* user) override; + void OnKioskLoginFailure() override; + private: static const base::Feature kEnableKioskAndGuestLoginLogoutReporting; LoginLogoutReporter( std::unique_ptr<::reporting::UserEventReporterHelper> reporter_helper, std::unique_ptr<Delegate> delegate, - policy::ManagedSessionService* managed_session_service); + policy::ManagedSessionService* managed_session_service, + base::Clock* clock = base::DefaultClock::GetInstance()); void MaybeReportEvent(LoginLogoutRecord record, const AccountId& account_id); + void MaybeReportKioskLoginFailure(); + std::unique_ptr<::reporting::UserEventReporterHelper> reporter_helper_; std::unique_ptr<Delegate> delegate_; @@ -80,6 +91,8 @@ policy::ManagedSessionService::Observer> managed_session_observation_{this}; + base::Clock* const clock_; + // To be able to access |kEnableKioskAndGuestLoginLogoutReporting| in tests. friend class LoginLogoutTestHelper; };
diff --git a/chrome/browser/ash/login/reporting/login_logout_reporter_unittest.cc b/chrome/browser/ash/login/reporting/login_logout_reporter_unittest.cc index b2c1d6ad..39131b1 100644 --- a/chrome/browser/ash/login/reporting/login_logout_reporter_unittest.cc +++ b/chrome/browser/ash/login/reporting/login_logout_reporter_unittest.cc
@@ -6,11 +6,14 @@ #include "ash/components/login/session/session_termination_manager.h" #include "base/test/scoped_feature_list.h" +#include "base/test/simple_test_clock.h" #include "base/test/task_environment.h" #include "chrome/browser/ash/login/users/fake_chrome_user_manager.h" #include "chrome/browser/ash/policy/core/device_local_account.h" #include "chrome/browser/ash/policy/reporting/user_event_reporter_helper_testing.h" #include "chrome/browser/ash/profiles/profile_helper.h" +#include "chrome/test/base/scoped_testing_local_state.h" +#include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile.h" #include "chromeos/dbus/power/fake_power_manager_client.h" #include "components/policy/core/common/cloud/dm_token.h" @@ -133,19 +136,25 @@ } std::unique_ptr<::reporting::UserEventReporterHelperTesting> - GetReporterHelper(bool reporting_enabled, bool should_report_user) { + GetReporterHelper(bool reporting_enabled, + bool should_report_user, + ::reporting::Status status = ::reporting::Status()) { + record_.Clear(); + report_count_ = 0; auto mock_queue = std::unique_ptr<::reporting::MockReportQueue, base::OnTaskRunnerDeleter>( new testing::NiceMock<::reporting::MockReportQueue>(), base::OnTaskRunnerDeleter(base::SequencedTaskRunnerHandle::Get())); ON_CALL(*mock_queue, AddRecord(_, ::reporting::Priority::SECURITY, _)) - .WillByDefault([&](base::StringPiece record_string, + .WillByDefault([this, status]( + base::StringPiece record_string, ::reporting::Priority event_priority, - ::reporting::ReportQueue::EnqueueCallback) { + ::reporting::ReportQueue::EnqueueCallback cb) { ++report_count_; EXPECT_TRUE(record_.ParseFromArray(record_string.data(), record_string.size())); + std::move(cb).Run(status); }); auto reporter_helper = @@ -177,11 +186,16 @@ class LoginLogoutReporterTest : public ::testing::TestWithParam<LoginLogoutReporterTestCase> { protected: + LoginLogoutReporterTest() + : local_state_(TestingBrowserProcess::GetGlobal()) {} + void SetUp() override { test_helper_.Init(); } void TearDown() override { test_helper_.Shutdown(); } LoginLogoutTestHelper test_helper_; + + ScopedTestingLocalState local_state_; }; TEST_F(LoginLogoutReporterTest, ReportAffiliatedLogin) { @@ -370,11 +384,16 @@ class LoginFailureReporterTest : public ::testing::TestWithParam<AuthFailure> { protected: + LoginFailureReporterTest() + : local_state_(TestingBrowserProcess::GetGlobal()) {} + void SetUp() override { test_helper_.Init(); } void TearDown() override { test_helper_.Shutdown(); } LoginLogoutTestHelper test_helper_; + + ScopedTestingLocalState local_state_; }; TEST_F(LoginFailureReporterTest, ReportAffiliatedLoginFailure_OwnerRequired) { @@ -402,7 +421,7 @@ EXPECT_THAT(record.affiliated_user().user_email(), StrEq(user_email)); ASSERT_TRUE(record.has_session_type()); EXPECT_THAT(record.session_type(), - testing::Eq(LoginLogoutSessionType::REGULAR_USER_SESSION)); + Eq(LoginLogoutSessionType::REGULAR_USER_SESSION)); ASSERT_TRUE(record.has_login_event()); ASSERT_TRUE(record.login_event().has_failure()); ASSERT_THAT(record.login_event().failure().reason(), @@ -435,7 +454,7 @@ EXPECT_THAT(record.affiliated_user().user_email(), StrEq(user_email)); ASSERT_TRUE(record.has_session_type()); EXPECT_THAT(record.session_type(), - testing::Eq(LoginLogoutSessionType::REGULAR_USER_SESSION)); + Eq(LoginLogoutSessionType::REGULAR_USER_SESSION)); ASSERT_TRUE(record.has_login_event()); ASSERT_TRUE(record.login_event().has_failure()); ASSERT_THAT(record.login_event().failure().reason(), @@ -464,7 +483,7 @@ EXPECT_FALSE(record.has_affiliated_user()); ASSERT_TRUE(record.has_session_type()); EXPECT_THAT(record.session_type(), - testing::Eq(LoginLogoutSessionType::REGULAR_USER_SESSION)); + Eq(LoginLogoutSessionType::REGULAR_USER_SESSION)); ASSERT_TRUE(record.has_login_event()); ASSERT_TRUE(record.login_event().has_failure()); ASSERT_THAT(record.login_event().failure().reason(), @@ -497,7 +516,7 @@ EXPECT_FALSE(record.has_affiliated_user()); ASSERT_TRUE(record.has_session_type()); EXPECT_THAT(record.session_type(), - testing::Eq(LoginLogoutSessionType::PUBLIC_ACCOUNT_SESSION)); + Eq(LoginLogoutSessionType::PUBLIC_ACCOUNT_SESSION)); ASSERT_TRUE(record.has_login_event()); ASSERT_TRUE(record.login_event().has_failure()); ASSERT_THAT(record.login_event().failure().reason(), @@ -530,7 +549,7 @@ EXPECT_FALSE(record.has_affiliated_user()); ASSERT_TRUE(record.has_session_type()); EXPECT_THAT(record.session_type(), - testing::Eq(LoginLogoutSessionType::PUBLIC_ACCOUNT_SESSION)); + Eq(LoginLogoutSessionType::PUBLIC_ACCOUNT_SESSION)); ASSERT_TRUE(record.has_login_event()); ASSERT_TRUE(record.login_event().has_failure()); ASSERT_THAT(record.login_event().failure().reason(), @@ -559,8 +578,7 @@ EXPECT_FALSE(record.has_logout_event()); EXPECT_FALSE(record.has_affiliated_user()); ASSERT_TRUE(record.has_session_type()); - EXPECT_THAT(record.session_type(), - testing::Eq(LoginLogoutSessionType::GUEST_SESSION)); + EXPECT_THAT(record.session_type(), Eq(LoginLogoutSessionType::GUEST_SESSION)); ASSERT_TRUE(record.has_login_event()); ASSERT_TRUE(record.login_event().has_failure()); ASSERT_THAT(record.login_event().failure().reason(), @@ -605,6 +623,239 @@ ASSERT_THAT(test_helper_.GetReportCount(), Eq(0)); } +TEST_F(LoginFailureReporterTest, ReportKioskLoginFailure) { + const base::Time failure_time = base::Time::Now(); + // Kiosk login failure session. + { + base::SimpleTestClock test_clock; + test_clock.SetNow(failure_time); + policy::ManagedSessionService managed_session_service; + auto reporter_helper = test_helper_.GetReporterHelper( + /*reporting_enabled=*/true, + /*should_report_user=*/false); + + auto reporter = LoginLogoutReporter::CreateForTest( + std::move(reporter_helper), + std::make_unique<LoginLogoutReporterTestDelegate>(), + &managed_session_service, &test_clock); + base::RunLoop().RunUntilIdle(); + + managed_session_service.OnKioskProfileLoadFailed(); + + ASSERT_THAT(test_helper_.GetReportCount(), Eq(0)); + } + + // Next session after kiosk login failure session. + { + base::SimpleTestClock test_clock; + test_clock.SetNow(failure_time + base::Hours(10)); + policy::ManagedSessionService managed_session_service; + // Only |reporting_enabled| value at the time of kiosk login failure matter. + auto reporter_helper = test_helper_.GetReporterHelper( + /*reporting_enabled=*/false, + /*should_report_user=*/false); + + auto reporter = LoginLogoutReporter::CreateForTest( + std::move(reporter_helper), + std::make_unique<LoginLogoutReporterTestDelegate>(), + &managed_session_service, &test_clock); + base::RunLoop().RunUntilIdle(); + const LoginLogoutRecord& record = test_helper_.GetRecord(); + + ASSERT_THAT(test_helper_.GetReportCount(), Eq(1)); + ASSERT_TRUE(record.has_event_timestamp_sec()); + EXPECT_THAT(record.event_timestamp_sec(), Eq(failure_time.ToTimeT())); + EXPECT_FALSE(record.is_guest_session()); + EXPECT_FALSE(record.has_logout_event()); + EXPECT_FALSE(record.has_affiliated_user()); + ASSERT_TRUE(record.has_session_type()); + EXPECT_THAT(record.session_type(), + Eq(LoginLogoutSessionType::KIOSK_SESSION)); + ASSERT_TRUE(record.has_login_event()); + ASSERT_TRUE(record.login_event().has_failure()); + EXPECT_FALSE(record.login_event().failure().has_reason()); + } + + // Next session after kiosk login failure reporting session. + { + base::SimpleTestClock test_clock; + test_clock.SetNow(failure_time + base::Hours(20)); + policy::ManagedSessionService managed_session_service; + auto reporter_helper = test_helper_.GetReporterHelper( + /*reporting_enabled=*/true, + /*should_report_user=*/false); + + auto reporter = LoginLogoutReporter::CreateForTest( + std::move(reporter_helper), + std::make_unique<LoginLogoutReporterTestDelegate>(), + &managed_session_service, &test_clock); + base::RunLoop().RunUntilIdle(); + + ASSERT_THAT(test_helper_.GetReportCount(), Eq(0)); + } +} + +TEST_F(LoginFailureReporterTest, ReportKioskLoginFailure_ReportingError) { + const base::Time failure_time = base::Time::Now(); + // Kiosk login failure session. + { + base::SimpleTestClock test_clock; + test_clock.SetNow(failure_time); + policy::ManagedSessionService managed_session_service; + auto reporter_helper = test_helper_.GetReporterHelper( + /*reporting_enabled=*/true, + /*should_report_user=*/false); + + auto reporter = LoginLogoutReporter::CreateForTest( + std::move(reporter_helper), + std::make_unique<LoginLogoutReporterTestDelegate>(), + &managed_session_service, &test_clock); + base::RunLoop().RunUntilIdle(); + + managed_session_service.OnKioskProfileLoadFailed(); + + ASSERT_THAT(test_helper_.GetReportCount(), Eq(0)); + } + + // Next session after kiosk login failure session. + // Reporting error. + { + base::SimpleTestClock test_clock; + test_clock.SetNow(failure_time + base::Hours(10)); + policy::ManagedSessionService managed_session_service; + // Only |reporting_enabled| value at the time of kiosk login failure matter. + auto reporter_helper = test_helper_.GetReporterHelper( + /*reporting_enabled=*/true, + /*should_report_user=*/false, + ::reporting::Status(::reporting::error::INTERNAL, "")); + + auto reporter = LoginLogoutReporter::CreateForTest( + std::move(reporter_helper), + std::make_unique<LoginLogoutReporterTestDelegate>(), + &managed_session_service, &test_clock); + base::RunLoop().RunUntilIdle(); + + ASSERT_THAT(test_helper_.GetReportCount(), Eq(1)); + } + + // Next session after reporting error session. + // Report success. + { + base::SimpleTestClock test_clock; + test_clock.SetNow(failure_time + base::Hours(20)); + policy::ManagedSessionService managed_session_service; + auto reporter_helper = test_helper_.GetReporterHelper( + /*reporting_enabled=*/true, + /*should_report_user=*/false); + + auto reporter = LoginLogoutReporter::CreateForTest( + std::move(reporter_helper), + std::make_unique<LoginLogoutReporterTestDelegate>(), + &managed_session_service, &test_clock); + base::RunLoop().RunUntilIdle(); + const LoginLogoutRecord& record = test_helper_.GetRecord(); + + ASSERT_THAT(test_helper_.GetReportCount(), Eq(1)); + ASSERT_TRUE(record.has_event_timestamp_sec()); + EXPECT_THAT(record.event_timestamp_sec(), Eq(failure_time.ToTimeT())); + EXPECT_FALSE(record.is_guest_session()); + EXPECT_FALSE(record.has_logout_event()); + EXPECT_FALSE(record.has_affiliated_user()); + ASSERT_TRUE(record.has_session_type()); + EXPECT_THAT(record.session_type(), + Eq(LoginLogoutSessionType::KIOSK_SESSION)); + ASSERT_TRUE(record.has_login_event()); + ASSERT_TRUE(record.login_event().has_failure()); + EXPECT_FALSE(record.login_event().failure().has_reason()); + } +} + +TEST_F(LoginFailureReporterTest, ReportKioskLoginFailure_ReportingDisabled) { + const base::Time failure_time = base::Time::Now(); + // Kiosk login failure session. + { + base::SimpleTestClock test_clock; + test_clock.SetNow(failure_time); + policy::ManagedSessionService managed_session_service; + auto reporter_helper = test_helper_.GetReporterHelper( + /*reporting_enabled=*/false, + /*should_report_user=*/false); + + auto reporter = LoginLogoutReporter::CreateForTest( + std::move(reporter_helper), + std::make_unique<LoginLogoutReporterTestDelegate>(), + &managed_session_service, &test_clock); + base::RunLoop().RunUntilIdle(); + + managed_session_service.OnKioskProfileLoadFailed(); + + ASSERT_THAT(test_helper_.GetReportCount(), Eq(0)); + } + + // Next session after kiosk login failure session. + { + base::SimpleTestClock test_clock; + test_clock.SetNow(failure_time + base::Hours(10)); + policy::ManagedSessionService managed_session_service; + // Only |reporting_enabled| value at the time of kiosk login failure matter. + auto reporter_helper = test_helper_.GetReporterHelper( + /*reporting_enabled=*/true, + /*should_report_user=*/false); + + auto reporter = LoginLogoutReporter::CreateForTest( + std::move(reporter_helper), + std::make_unique<LoginLogoutReporterTestDelegate>(), + &managed_session_service, &test_clock); + base::RunLoop().RunUntilIdle(); + + ASSERT_THAT(test_helper_.GetReportCount(), Eq(0)); + } +} + +TEST_F(LoginFailureReporterTest, + ReportKioskLoginFailure_KioskLoginLogoutReportingDisabled) { + test_helper_.DisableKioskAndGuestLoginLogoutReporting(); + + const base::Time failure_time = base::Time::Now(); + // Kiosk login failure session. + { + base::SimpleTestClock test_clock; + test_clock.SetNow(failure_time); + policy::ManagedSessionService managed_session_service; + auto reporter_helper = test_helper_.GetReporterHelper( + /*reporting_enabled=*/true, + /*should_report_user=*/false); + + auto reporter = LoginLogoutReporter::CreateForTest( + std::move(reporter_helper), + std::make_unique<LoginLogoutReporterTestDelegate>(), + &managed_session_service, &test_clock); + base::RunLoop().RunUntilIdle(); + + managed_session_service.OnKioskProfileLoadFailed(); + + ASSERT_THAT(test_helper_.GetReportCount(), Eq(0)); + } + + // Next session after kiosk login failure session. + { + base::SimpleTestClock test_clock; + test_clock.SetNow(failure_time + base::Hours(10)); + policy::ManagedSessionService managed_session_service; + auto reporter_helper = test_helper_.GetReporterHelper( + /*reporting_enabled=*/true, + /*should_report_user=*/false); + + auto reporter = LoginLogoutReporter::CreateForTest( + std::move(reporter_helper), + std::make_unique<LoginLogoutReporterTestDelegate>(), + &managed_session_service, &test_clock); + base::RunLoop().RunUntilIdle(); + + ASSERT_THAT(test_helper_.GetReportCount(), Eq(0)); + } +} + TEST_P(LoginFailureReporterTest, ReportUnaffiliatedLoginFailure_AuthenticationError) { policy::ManagedSessionService managed_session_service; @@ -628,7 +879,7 @@ EXPECT_FALSE(record.has_affiliated_user()); ASSERT_TRUE(record.has_session_type()); EXPECT_THAT(record.session_type(), - testing::Eq(LoginLogoutSessionType::REGULAR_USER_SESSION)); + Eq(LoginLogoutSessionType::REGULAR_USER_SESSION)); ASSERT_TRUE(record.has_login_event()); ASSERT_TRUE(record.login_event().has_failure()); ASSERT_THAT(record.login_event().failure().reason(), @@ -660,7 +911,7 @@ EXPECT_FALSE(record.has_affiliated_user()); ASSERT_TRUE(record.has_session_type()); EXPECT_THAT(record.session_type(), - testing::Eq(LoginLogoutSessionType::PUBLIC_ACCOUNT_SESSION)); + Eq(LoginLogoutSessionType::PUBLIC_ACCOUNT_SESSION)); ASSERT_TRUE(record.has_login_event()); ASSERT_TRUE(record.login_event().has_failure()); ASSERT_THAT(record.login_event().failure().reason(), @@ -688,8 +939,7 @@ EXPECT_FALSE(record.has_logout_event()); EXPECT_FALSE(record.has_affiliated_user()); ASSERT_TRUE(record.has_session_type()); - EXPECT_THAT(record.session_type(), - testing::Eq(LoginLogoutSessionType::GUEST_SESSION)); + EXPECT_THAT(record.session_type(), Eq(LoginLogoutSessionType::GUEST_SESSION)); ASSERT_TRUE(record.has_login_event()); ASSERT_TRUE(record.login_event().has_failure()); ASSERT_THAT(record.login_event().failure().reason(),
diff --git a/chrome/browser/ash/login/test/oobe_screens_utils.cc b/chrome/browser/ash/login/test/oobe_screens_utils.cc index e04b68fc..2dd58cbc 100644 --- a/chrome/browser/ash/login/test/oobe_screens_utils.cc +++ b/chrome/browser/ash/login/test/oobe_screens_utils.cc
@@ -121,8 +121,10 @@ WaitForNetworkSelectionScreen(); TapNetworkSelectionNext(); - WaitForEulaScreen(); - TapEulaAccept(); + if (!chromeos::features::IsOobeConsolidatedConsentEnabled()) { + WaitForEulaScreen(); + TapEulaAccept(); + } WaitForUpdateScreen(); ExitUpdateScreenNoUpdate();
diff --git a/chrome/browser/ash/policy/core/browser_policy_connector_ash.cc b/chrome/browser/ash/policy/core/browser_policy_connector_ash.cc index 185a58f..90d1a776 100644 --- a/chrome/browser/ash/policy/core/browser_policy_connector_ash.cc +++ b/chrome/browser/ash/policy/core/browser_policy_connector_ash.cc
@@ -543,6 +543,10 @@ RestartDeviceCloudPolicyInitializer(); } +void BrowserPolicyConnectorAsh::OnDeviceCloudPolicyManagerGotRegistry() { + // Do nothing. +} + bool BrowserPolicyConnectorAsh::IsCommandLineSwitchSupported() const { return true; }
diff --git a/chrome/browser/ash/policy/core/browser_policy_connector_ash.h b/chrome/browser/ash/policy/core/browser_policy_connector_ash.h index b799be7..7167130 100644 --- a/chrome/browser/ash/policy/core/browser_policy_connector_ash.h +++ b/chrome/browser/ash/policy/core/browser_policy_connector_ash.h
@@ -244,6 +244,7 @@ // DeviceCloudPolicyManagerAsh::Observer: void OnDeviceCloudPolicyManagerConnected() override; void OnDeviceCloudPolicyManagerDisconnected() override; + void OnDeviceCloudPolicyManagerGotRegistry() override; // TODO(crbug.com/1187628): Combine the following two functions into one to // simplify the API.
diff --git a/chrome/browser/ash/policy/core/device_cloud_policy_manager_ash.cc b/chrome/browser/ash/policy/core/device_cloud_policy_manager_ash.cc index 4f6b23e..d365365 100644 --- a/chrome/browser/ash/policy/core/device_cloud_policy_manager_ash.cc +++ b/chrome/browser/ash/policy/core/device_cloud_policy_manager_ash.cc
@@ -291,6 +291,7 @@ DCHECK(!signin_profile_forwarding_schema_registry_); signin_profile_forwarding_schema_registry_ = std::make_unique<ForwardingSchemaRegistry>(schema_registry); + NotifyGotRegistry(); } void DeviceCloudPolicyManagerAsh::OnStateKeysUpdated() { @@ -310,6 +311,11 @@ observer.OnDeviceCloudPolicyManagerDisconnected(); } +void DeviceCloudPolicyManagerAsh::NotifyGotRegistry() { + for (auto& observer : observers_) + observer.OnDeviceCloudPolicyManagerGotRegistry(); +} + void DeviceCloudPolicyManagerAsh::CreateStatusUploader( ManagedSessionService* managed_session_service) { std::unique_ptr<StatusCollector> collector;
diff --git a/chrome/browser/ash/policy/core/device_cloud_policy_manager_ash.h b/chrome/browser/ash/policy/core/device_cloud_policy_manager_ash.h index a45bea4..7182ada1 100644 --- a/chrome/browser/ash/policy/core/device_cloud_policy_manager_ash.h +++ b/chrome/browser/ash/policy/core/device_cloud_policy_manager_ash.h
@@ -68,6 +68,8 @@ virtual void OnDeviceCloudPolicyManagerConnected() = 0; // Invoked when the device cloud policy manager disconnects. virtual void OnDeviceCloudPolicyManagerDisconnected() = 0; + // Invoked when the device cloud policy manager obtains schema registry. + virtual void OnDeviceCloudPolicyManagerGotRegistry() = 0; }; using UnregisterCallback = base::OnceCallback<void(bool)>; @@ -122,6 +124,10 @@ bool IsConnected() const { return core()->service() != nullptr; } + bool HasSchemaRegistry() const { + return signin_profile_forwarding_schema_registry_ != nullptr; + } + DeviceCloudPolicyStoreAsh* device_store() { return device_store_.get(); } // Return the StatusUploader used to communicate device status to the @@ -176,6 +182,7 @@ void NotifyConnected(); void NotifyDisconnected(); + void NotifyGotRegistry(); // Factory function to create the StatusUploader. void CreateStatusUploader(ManagedSessionService* managed_session_service);
diff --git a/chrome/browser/ash/policy/core/device_cloud_policy_manager_ash_unittest.cc b/chrome/browser/ash/policy/core/device_cloud_policy_manager_ash_unittest.cc index 1e7218c..9b9e7db3 100644 --- a/chrome/browser/ash/policy/core/device_cloud_policy_manager_ash_unittest.cc +++ b/chrome/browser/ash/policy/core/device_cloud_policy_manager_ash_unittest.cc
@@ -188,6 +188,7 @@ RegisterLocalState(local_state_.registry()); manager_->Init(&schema_registry_); + manager_->SetSigninProfileSchemaRegistry(&schema_registry_); // SharedURLLoaderFactory and LocalState singletons have to be set since // they are accessed by EnrollmentHandler and StartupUtils. @@ -500,6 +501,7 @@ // DeviceCloudPolicyManagerAsh::Observer: MOCK_METHOD0(OnDeviceCloudPolicyManagerConnected, void()); MOCK_METHOD0(OnDeviceCloudPolicyManagerDisconnected, void()); + MOCK_METHOD0(OnDeviceCloudPolicyManagerGotRegistry, void()); }; TEST_F(DeviceCloudPolicyManagerAshObserverTest, ConnectAndDisconnect) { @@ -524,6 +526,19 @@ EXPECT_FALSE(manager_->IsConnected()); } +TEST_F(DeviceCloudPolicyManagerAshObserverTest, GetSchemaRegistry) { + EXPECT_CALL(*this, OnDeviceCloudPolicyManagerGotRegistry()).Times(1); + + manager_->Shutdown(); + manager_->Init(&schema_registry_); + + EXPECT_FALSE(manager_->HasSchemaRegistry()); + + manager_->SetSigninProfileSchemaRegistry(&schema_registry_); + + EXPECT_TRUE(manager_->HasSchemaRegistry()); +} + class DeviceCloudPolicyManagerAshEnrollmentTest : public DeviceCloudPolicyManagerAshTest, public testing::WithParamInterface<bool> {
diff --git a/chrome/browser/ash/policy/enrollment/device_cloud_policy_initializer.cc b/chrome/browser/ash/policy/enrollment/device_cloud_policy_initializer.cc index 2a09930..dd30013 100644 --- a/chrome/browser/ash/policy/enrollment/device_cloud_policy_initializer.cc +++ b/chrome/browser/ash/policy/enrollment/device_cloud_policy_initializer.cc
@@ -74,6 +74,7 @@ state_keys_update_subscription_ = state_keys_broker_->RegisterUpdateCallback( base::BindRepeating(&DeviceCloudPolicyInitializer::TryToStartConnection, base::Unretained(this))); + policy_manager_observer_.Observe(policy_manager_); TryToStartConnection(); } @@ -83,6 +84,7 @@ policy_store_->RemoveObserver(this); state_keys_update_subscription_ = {}; + policy_manager_observer_.Reset(); is_initialized_ = false; } @@ -241,6 +243,20 @@ // Do nothing. } +void DeviceCloudPolicyInitializer::OnDeviceCloudPolicyManagerConnected() { + // Do nothing. +} +void DeviceCloudPolicyInitializer::OnDeviceCloudPolicyManagerDisconnected() { + // Do nothing. +} +void DeviceCloudPolicyInitializer::OnDeviceCloudPolicyManagerGotRegistry() { + // `policy_manager_->HasSchemaRegistry()` is one of requirements for + // StartConnection. Make another attempt when `policy_manager_` gets its + // registry. + policy_manager_observer_.Reset(); + TryToStartConnection(); +} + std::unique_ptr<CloudPolicyClient> DeviceCloudPolicyInitializer::CreateClient( DeviceManagementService* device_management_service) { // DeviceDMToken callback is empty here because for device policies this @@ -268,6 +284,17 @@ policy_manager_->OnPolicyStoreReady(install_attributes_); } + // TODO(crbug.com/1304636): Move this and all other checks from here to a + // separate method. + if (!policy_manager_->HasSchemaRegistry()) { + // crbug.com/1295871: `policy_manager_` might not have schema registry on + // start connection attempt. This may happen on chrome restart when + // `chrome::kInitialProfile` is created after login profile: policy will be + // loaded but `BuildSchemaRegistryServiceForProfile` will not be called for + // non-initial / non-sign-in profile. + return; + } + // Currently reven devices don't support sever-backed state keys, but they // also don't support FRE/AutoRE so don't block initialization of device // policy on state keys being available on reven. @@ -283,6 +310,11 @@ void DeviceCloudPolicyInitializer::StartConnection( std::unique_ptr<CloudPolicyClient> client) { + // This initializer will be deleted once `policy_manager_` is connected. + // Stop observing the manager as there's nothing interesting it can say + // anymore. + policy_manager_observer_.Reset(); + if (!policy_manager_->IsConnected()) { policy_manager_->StartConnection(std::move(client), install_attributes_); }
diff --git a/chrome/browser/ash/policy/enrollment/device_cloud_policy_initializer.h b/chrome/browser/ash/policy/enrollment/device_cloud_policy_initializer.h index 657713f..2737e2a1 100644 --- a/chrome/browser/ash/policy/enrollment/device_cloud_policy_initializer.h +++ b/chrome/browser/ash/policy/enrollment/device_cloud_policy_initializer.h
@@ -10,6 +10,8 @@ #include "base/callback_forward.h" #include "base/memory/ref_counted.h" +#include "base/scoped_observation.h" +#include "chrome/browser/ash/policy/core/device_cloud_policy_manager_ash.h" #include "chrome/browser/ash/policy/server_backed_state/server_backed_state_keys_broker.h" #include "components/policy/core/common/cloud/cloud_policy_client.h" #include "components/policy/core/common/cloud/cloud_policy_constants.h" @@ -29,7 +31,6 @@ } // namespace chromeos namespace policy { -class DeviceCloudPolicyManagerAsh; class DeviceCloudPolicyStoreAsh; class DeviceManagementService; struct EnrollmentConfig; @@ -44,7 +45,9 @@ // It is expected that the |DeviceCloudPolicyInitializer| will be // destroyed soon after it called |StartConnection|, but see // crbug.com/705758 for complications. -class DeviceCloudPolicyInitializer : public CloudPolicyStore::Observer { +class DeviceCloudPolicyInitializer + : public CloudPolicyStore::Observer, + public DeviceCloudPolicyManagerAsh::Observer { public: DeviceCloudPolicyInitializer( PrefService* local_state, @@ -80,6 +83,11 @@ void OnStoreLoaded(CloudPolicyStore* store) override; void OnStoreError(CloudPolicyStore* store) override; + // DeviceCloudPolicyManagerAsh::Observer + void OnDeviceCloudPolicyManagerConnected() override; + void OnDeviceCloudPolicyManagerDisconnected() override; + void OnDeviceCloudPolicyManagerGotRegistry() override; + void SetSystemURLLoaderFactoryForTesting( scoped_refptr<network::SharedURLLoaderFactory> system_url_loader_factory); @@ -106,6 +114,12 @@ bool policy_manager_store_ready_notified_ = false; base::CallbackListSubscription state_keys_update_subscription_; + base::ScopedObservation< + DeviceCloudPolicyManagerAsh, + DeviceCloudPolicyManagerAsh::Observer, + &DeviceCloudPolicyManagerAsh::AddDeviceCloudPolicyManagerObserver, + &DeviceCloudPolicyManagerAsh::RemoveDeviceCloudPolicyManagerObserver> + policy_manager_observer_{this}; // The URLLoaderFactory set in tests. scoped_refptr<network::SharedURLLoaderFactory>
diff --git a/chrome/browser/ash/policy/status_collector/child_status_collector_browsertest.cc b/chrome/browser/ash/policy/status_collector/child_status_collector_browsertest.cc index 2fbd2c2..9b30d9d05 100644 --- a/chrome/browser/ash/policy/status_collector/child_status_collector_browsertest.cc +++ b/chrome/browser/ash/policy/status_collector/child_status_collector_browsertest.cc
@@ -56,7 +56,7 @@ #include "components/prefs/pref_service.h" #include "components/prefs/scoped_user_pref_update.h" #include "components/prefs/testing_pref_service.h" -#include "components/services/app_service/public/mojom/types.mojom.h" +#include "components/services/app_service/public/cpp/app_types.h" #include "components/session_manager/core/session_manager.h" #include "components/user_manager/scoped_user_manager.h" #include "components/user_manager/user_type.h" @@ -704,8 +704,8 @@ status_collector_->OnSubmittedSuccessfully(); // Report activity for two different apps. - const ash::app_time::AppId app1(apps::mojom::AppType::kWeb, "app1"); - const ash::app_time::AppId app2(apps::mojom::AppType::kChromeApp, "app2"); + const ash::app_time::AppId app1(apps::AppType::kWeb, "app1"); + const ash::app_time::AppId app2(apps::AppType::kChromeApp, "app2"); const Time start_time = Time::Now(); const base::TimeDelta app1_interval = base::Minutes(1); const base::TimeDelta app2_interval = base::Minutes(2); @@ -761,8 +761,8 @@ EXPECT_EQ(0, child_status_.app_activity_size()); status_collector_->OnSubmittedSuccessfully(); - const ash::app_time::AppId app1(apps::mojom::AppType::kWeb, "app1"); - const ash::app_time::AppId app2(apps::mojom::AppType::kChromeApp, "app2"); + const ash::app_time::AppId app1(apps::AppType::kWeb, "app1"); + const ash::app_time::AppId app2(apps::AppType::kChromeApp, "app2"); const base::TimeDelta app1_interval = base::Minutes(1); const base::TimeDelta app2_interval = base::Minutes(2); @@ -807,8 +807,8 @@ /*expected_count=*/0); // Report activity for two different apps. - const ash::app_time::AppId app1(apps::mojom::AppType::kWeb, "app1"); - const ash::app_time::AppId app2(apps::mojom::AppType::kChromeApp, "app2"); + const ash::app_time::AppId app1(apps::AppType::kWeb, "app1"); + const ash::app_time::AppId app2(apps::AppType::kChromeApp, "app2"); const base::TimeDelta app1_interval = base::Seconds(1); const base::TimeDelta app2_interval = base::Seconds(2); SimulateAppActivity(app1, app1_interval);
diff --git a/chrome/browser/ash/system_extensions/api/window_management/window_management_impl.cc b/chrome/browser/ash/system_extensions/api/window_management/window_management_impl.cc index b1ac21c..c95a55a 100644 --- a/chrome/browser/ash/system_extensions/api/window_management/window_management_impl.cc +++ b/chrome/browser/ash/system_extensions/api/window_management/window_management_impl.cc
@@ -90,6 +90,14 @@ } } +void WindowManagementImpl::Focus(const base::UnguessableToken& id) { + aura::Window* target = GetWindow(id); + // TODO(b/223320570): Add error handling for stale ids. + if (target) { + target->Focus(); + } +} + aura::Window* WindowManagementImpl::GetWindow( const base::UnguessableToken& id) { aura::Window* target = nullptr;
diff --git a/chrome/browser/ash/system_extensions/api/window_management/window_management_impl.h b/chrome/browser/ash/system_extensions/api/window_management/window_management_impl.h index 72bffe6..6a4c811 100644 --- a/chrome/browser/ash/system_extensions/api/window_management/window_management_impl.h +++ b/chrome/browser/ash/system_extensions/api/window_management/window_management_impl.h
@@ -35,6 +35,8 @@ void Minimize(const base::UnguessableToken& id) override; + void Focus(const base::UnguessableToken& id) override; + private: aura::Window* GetWindow(const base::UnguessableToken& id);
diff --git a/chrome/browser/autofill/autofill_captured_sites_interactive_uitest.cc b/chrome/browser/autofill/autofill_captured_sites_interactive_uitest.cc index 18431f3..9da88508 100644 --- a/chrome/browser/autofill/autofill_captured_sites_interactive_uitest.cc +++ b/chrome/browser/autofill/autofill_captured_sites_interactive_uitest.cc
@@ -23,6 +23,7 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/autofill/chrome_autofill_client.h" #include "chrome/browser/ui/browser_window.h" +#include "chrome/browser/ui/translate/translate_bubble_test_utils.h" #include "chrome/common/chrome_features.h" #include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/interactive_test_utils.h" @@ -97,6 +98,13 @@ int tries = 0; while (tries < attempts) { tries++; + + // Translation bubbles and address-save prompts and others may overlap + // with and thus prevent the Autofill popup, so we preemptively close all + // bubbles. + translate::test_utils::CloseCurrentBubble(browser()); + TryToCloseAllPrompts(web_contents); + autofill_manager->client()->HideAutofillPopup( autofill::PopupHidingReason::kViewDestroyed); @@ -249,10 +257,7 @@ features::kAutofillDisplaceRemovedForms, features::kAutofillShowTypePredictions, features::kAutofillUseUnassociatedListedElements}, - // Disable AutofillAddressProfileSavePrompt to prevent popup from - // interfering with autofill select dialog. - // TODO(crbug.com/1300919) -Add save prompt verification and re-enable. - /*disabled_features=*/{features::kAutofillAddressProfileSavePrompt}); + /*disabled_features=*/{}); command_line->AppendSwitchASCII( variations::switches::kVariationsOverrideCountry, "us"); AutofillUiTest::SetUpCommandLine(command_line); @@ -326,11 +331,13 @@ captured_sites_test_utils::PrintInstructions( "autofill_captured_sites_interactive_uitest"); - // Prints the path of the test to be executed. - if (GetParam().bug_number.empty()) + // Prints the name of the site to be executed. Prints bug number if exists. + if (GetParam().bug_number) { + VLOG(1) << GetParam().site_name << ": crbug.com/" + << GetParam().bug_number.value(); + } else { VLOG(1) << GetParam().site_name; - else - VLOG(1) << GetParam().site_name << ": crbug.com/" << GetParam().bug_number; + } base::FilePath src_dir; ASSERT_TRUE(base::PathService::Get(base::DIR_SOURCE_ROOT, &src_dir));
diff --git a/chrome/browser/autofill/autofill_interactive_uitest.cc b/chrome/browser/autofill/autofill_interactive_uitest.cc index ad0ea1d..6f3f014 100644 --- a/chrome/browser/autofill/autofill_interactive_uitest.cc +++ b/chrome/browser/autofill/autofill_interactive_uitest.cc
@@ -379,9 +379,13 @@ bool field_was_focused_initially = IsFocusedField(e, rfh); for (size_t i = 1; i <= p.max_tries; ++i) { a = a << "Iteration " << i << "/" << p.max_tries << ". "; - // The translate bubble may overlap with the Autofill popup. This causes + // The translate bubble may overlap with the Autofill popup, which causes // flakiness. See crbug.com/1175735#c10. + // Also, the address-save prompts and others may overlap with the Autofill + // popup. So we preemptively close all bubbles, which however is not + // reliable on Windows. translate::test_utils::CloseCurrentBubble(test->browser()); + TryToCloseAllPrompts(test->GetWebContents()); if (i > 1) { test->DoNothingAndWaitAndIgnoreEvents(p.timeout); if (field_was_focused_initially) {
diff --git a/chrome/browser/autofill/autofill_uitest.cc b/chrome/browser/autofill/autofill_uitest.cc index e5b30b3..352a477 100644 --- a/chrome/browser/autofill/autofill_uitest.cc +++ b/chrome/browser/autofill/autofill_uitest.cc
@@ -9,6 +9,7 @@ #include "chrome/browser/autofill/autofill_uitest.h" #include "chrome/browser/autofill/autofill_uitest_util.h" #include "chrome/browser/autofill/personal_data_manager_factory.h" +#include "chrome/browser/platform_util.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/autofill/chrome_autofill_client.h" #include "chrome/browser/ui/browser.h" @@ -24,6 +25,7 @@ #include "content/public/test/browser_test_utils.h" #include "content/public/test/test_utils.h" #include "ui/events/base_event_utils.h" +#include "ui/views/widget/widget.h" namespace autofill { @@ -42,6 +44,27 @@ } } +// Keep in sync with BoundsOverlapWithAnyOpenPrompt() from +// autofill_popup_view_utils.cc. +void TryToCloseAllPrompts(content::WebContents* web_contents) { + gfx::NativeView top_level_view = + platform_util::GetViewForWindow(web_contents->GetTopLevelNativeWindow()); + DCHECK(top_level_view); + + // On Aura-based systems, prompts are siblings to the top level native window, + // and hence we need to go one level up to start searching from the root + // window. + top_level_view = platform_util::GetParent(top_level_view) + ? platform_util::GetParent(top_level_view) + : top_level_view; + views::Widget::Widgets all_widgets; + views::Widget::GetAllChildWidgets(top_level_view, &all_widgets); + for (views::Widget* w : all_widgets) { + if (w->IsDialogBox()) + w->CloseWithReason(views::Widget::ClosedReason::kUnspecified); + } +} + // BrowserAutofillManagerTestDelegateImpl // -------------------------------------------- BrowserAutofillManagerTestDelegateImpl::
diff --git a/chrome/browser/autofill/autofill_uitest.h b/chrome/browser/autofill/autofill_uitest.h index 2ebc97a..20b1c17 100644 --- a/chrome/browser/autofill/autofill_uitest.h +++ b/chrome/browser/autofill/autofill_uitest.h
@@ -37,6 +37,11 @@ std::ostream& operator<<(std::ostream& os, ObservedUiEvents event); +// Attempts to close all open bubbles. +// This is not reliable on Windows because on Windows bubbles are not +// necessarily children of the top-level view. +void TryToCloseAllPrompts(content::WebContents* web_contents); + class BrowserAutofillManagerTestDelegateImpl : public autofill::BrowserAutofillManagerTestDelegate { public: @@ -109,6 +114,11 @@ content::RenderWidgetHost* widget, base::TimeDelta timeout = {}); + void SendKeyToDataListPopup(ui::DomKey key); + void SendKeyToDataListPopup(ui::DomKey key, + ui::DomCode code, + ui::KeyboardCode key_code); + bool HandleKeyPressEvent(const content::NativeWebKeyboardEvent& event); // DoNothingAndWait() violates an assertion if during the time an event
diff --git a/chrome/browser/autofill/captured_sites_test_utils.cc b/chrome/browser/autofill/captured_sites_test_utils.cc index e59383c..c8de5c7 100644 --- a/chrome/browser/autofill/captured_sites_test_utils.cc +++ b/chrome/browser/autofill/captured_sites_test_utils.cc
@@ -343,10 +343,8 @@ if (item.FindKey("scenario_dir")) param.scenario_dir = *(item.FindStringKey("scenario_dir")); param.is_disabled = item.FindBoolKey("disabled").value_or(false); - if (item.FindKey("bug_number")) { - param.bug_number = - base::FormatNumber(item.FindIntKey("bug_number").value()); - } + if (item.FindKey("bug_number")) + param.bug_number = item.FindIntKey("bug_number"); if (param.is_disabled && !also_run_disabled) continue;
diff --git a/chrome/browser/autofill/captured_sites_test_utils.h b/chrome/browser/autofill/captured_sites_test_utils.h index 194924a..3fc325e 100644 --- a/chrome/browser/autofill/captured_sites_test_utils.h +++ b/chrome/browser/autofill/captured_sites_test_utils.h
@@ -62,7 +62,7 @@ struct CapturedSiteParams { std::string scenario_dir; std::string site_name; - std::u16string bug_number; + absl::optional<int> bug_number; ExpectedResult expectation = kPass; bool is_disabled = false; base::FilePath capture_file_path;
diff --git a/chrome/browser/bluetooth/bluetooth_chooser_context_unittest.cc b/chrome/browser/bluetooth/bluetooth_chooser_context_unittest.cc index 873751a7..fb7d9ec 100644 --- a/chrome/browser/bluetooth/bluetooth_chooser_context_unittest.cc +++ b/chrome/browser/bluetooth/bluetooth_chooser_context_unittest.cc
@@ -262,6 +262,44 @@ EXPECT_EQ(0u, all_origin_objects.size()); } +TEST_F(BluetoothChooserContextTest, RevokeDevicePermissionWebInitiated) { + const std::vector<BluetoothUUID> services{kGlucoseUUID, kBloodPressureUUID}; + WebBluetoothRequestDeviceOptionsPtr options = + CreateOptionsForServices(services); + + BluetoothChooserContext* context = GetChooserContext(profile()); + + blink::WebBluetoothDeviceId device_id = context->GrantServiceAccessPermission( + foo_origin_, fake_device1_.get(), options.get()); + + EXPECT_TRUE(context->HasDevicePermission(foo_origin_, device_id)); + + std::vector<std::unique_ptr<BluetoothChooserContext::Object>> origin_objects = + context->GetGrantedObjects(foo_origin_); + ASSERT_EQ(1u, origin_objects.size()); + + std::vector<std::unique_ptr<BluetoothChooserContext::Object>> + all_origin_objects = context->GetAllGrantedObjects(); + ASSERT_EQ(1u, all_origin_objects.size()); + EXPECT_EQ(foo_origin_.GetURL(), all_origin_objects[0]->origin); + + EXPECT_CALL(mock_permission_observer_, + OnObjectPermissionChanged( + absl::make_optional(ContentSettingsType::BLUETOOTH_GUARD), + ContentSettingsType::BLUETOOTH_CHOOSER_DATA)); + EXPECT_CALL(mock_permission_observer_, OnPermissionRevoked(foo_origin_)); + + context->RevokeDevicePermissionWebInitiated(foo_origin_, device_id); + + EXPECT_FALSE(context->HasDevicePermission(foo_origin_, device_id)); + + origin_objects = context->GetGrantedObjects(foo_origin_); + EXPECT_EQ(0u, origin_objects.size()); + + all_origin_objects = context->GetAllGrantedObjects(); + EXPECT_EQ(0u, all_origin_objects.size()); +} + // Check that Web Bluetooth permissions granted in incognito mode remain only // in the incognito session. TEST_F(BluetoothChooserContextTest, GrantPermissionInIncognito) {
diff --git a/chrome/browser/chromeos/BUILD.gn b/chrome/browser/chromeos/BUILD.gn index 11ce077..b85422ff 100644 --- a/chrome/browser/chromeos/BUILD.gn +++ b/chrome/browser/chromeos/BUILD.gn
@@ -898,10 +898,16 @@ "../ash/arc/input_overlay/touch_injector.h", "../ash/arc/input_overlay/ui/action_circle.cc", "../ash/arc/input_overlay/ui/action_circle.h", + "../ash/arc/input_overlay/ui/action_edit_button.cc", + "../ash/arc/input_overlay/ui/action_edit_button.h", + "../ash/arc/input_overlay/ui/action_edit_menu.cc", + "../ash/arc/input_overlay/ui/action_edit_menu.h", "../ash/arc/input_overlay/ui/action_label.cc", "../ash/arc/input_overlay/ui/action_label.h", "../ash/arc/input_overlay/ui/action_view.cc", "../ash/arc/input_overlay/ui/action_view.h", + "../ash/arc/input_overlay/ui/input_mapping_view.cc", + "../ash/arc/input_overlay/ui/input_mapping_view.h", "../ash/arc/input_overlay/ui/input_menu_view.cc", "../ash/arc/input_overlay/ui/input_menu_view.h", "../ash/arc/instance_throttle/arc_active_window_throttle_observer.cc",
diff --git a/chrome/browser/content_creation/reactions/internal/android/java/res/layout/reactions_loading_view.xml b/chrome/browser/content_creation/reactions/internal/android/java/res/layout/reactions_loading_view.xml index cba56e4..3a483f7 100644 --- a/chrome/browser/content_creation/reactions/internal/android/java/res/layout/reactions_loading_view.xml +++ b/chrome/browser/content_creation/reactions/internal/android/java/res/layout/reactions_loading_view.xml
@@ -3,7 +3,9 @@ Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. --> -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" +<LinearLayout + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" @@ -31,6 +33,7 @@ android:layout_gravity="center_horizontal" android:layout_marginTop="16dp" android:textAppearance="@style/TextAppearance.Button.Text.Blue.Dark" - style="@style/TextButton" /> + style="@style/TextButton" + app:buttonTextColor="@color/blue_when_enabled_dark" /> </LinearLayout> \ No newline at end of file
diff --git a/chrome/browser/content_creation/reactions/internal/android/java/src/org/chromium/chrome/browser/content_creation/reactions/scene/ReactionLayout.java b/chrome/browser/content_creation/reactions/internal/android/java/src/org/chromium/chrome/browser/content_creation/reactions/scene/ReactionLayout.java index 7e5b969..f8d27e7 100644 --- a/chrome/browser/content_creation/reactions/internal/android/java/src/org/chromium/chrome/browser/content_creation/reactions/scene/ReactionLayout.java +++ b/chrome/browser/content_creation/reactions/internal/android/java/src/org/chromium/chrome/browser/content_creation/reactions/scene/ReactionLayout.java
@@ -227,6 +227,10 @@ private void setUpDeleteButton() { mDeleteButton = findViewById(R.id.delete_button); - mDeleteButton.setOnClickListener(view -> mSceneEditorDelegate.removeReaction(this)); + mDeleteButton.setOnClickListener(view -> { + view.announceForAccessibility(mContext.getString( + R.string.lightweight_reactions_reaction_deleted_announcement)); + mSceneEditorDelegate.removeReaction(this); + }); } }
diff --git a/chrome/browser/extensions/api/virtual_keyboard_private/chrome_virtual_keyboard_delegate.cc b/chrome/browser/extensions/api/virtual_keyboard_private/chrome_virtual_keyboard_delegate.cc index d149d02b..44ff579 100644 --- a/chrome/browser/extensions/api/virtual_keyboard_private/chrome_virtual_keyboard_delegate.cc +++ b/chrome/browser/extensions/api/virtual_keyboard_private/chrome_virtual_keyboard_delegate.cc
@@ -354,10 +354,19 @@ void ChromeVirtualKeyboardDelegate::GetClipboardHistory( const std::set<std::string>& item_ids_filter, OnGetClipboardHistoryCallback get_history_callback) { + // Do not leak clipboard history items if the screen is locked. + if (ash::ScreenLocker::default_screen_locker() && + ash::ScreenLocker::default_screen_locker()->locked()) { + std::move(get_history_callback).Run(base::Value(base::Value::Type::LIST)); + return; + } + ash::ClipboardHistoryController* clipboard_history_controller = ash::ClipboardHistoryController::Get(); - if (!clipboard_history_controller) + if (!clipboard_history_controller) { + std::move(get_history_callback).Run(base::Value(base::Value::Type::LIST)); return; + } // Begin renderng all items in the clipboard history. Current items will // render even if Deactivate() is called on the ClipboardImageModelFactory.
diff --git a/chrome/browser/extensions/api/virtual_keyboard_private/virtual_keyboard_private_apitest.cc b/chrome/browser/extensions/api/virtual_keyboard_private/virtual_keyboard_private_apitest.cc index 199212a..0ad00574 100644 --- a/chrome/browser/extensions/api/virtual_keyboard_private/virtual_keyboard_private_apitest.cc +++ b/chrome/browser/extensions/api/virtual_keyboard_private/virtual_keyboard_private_apitest.cc
@@ -4,6 +4,7 @@ #include "ash/public/cpp/clipboard_history_controller.h" #include "base/path_service.h" +#include "chrome/browser/ash/login/lock/screen_locker_tester.h" #include "chrome/browser/extensions/extension_apitest.h" #include "chrome/test/base/ui_test_utils.h" #include "content/public/test/browser_test.h" @@ -87,3 +88,20 @@ {.load_as_component = true})) << message_; } + +IN_PROC_BROWSER_TEST_F(VirtualKeyboardPrivateApiTest, MultipasteLockedScreen) { + // Copy to the clipboard an item of each display format type. + CopyHtmlItem(); + CopyTextItem(); + CopyBitmapItem(); + CopyFileItem(); + + // Verify that no clipboard items are returned when the screen is locked. + ash::ScreenLockerTester tester; + tester.Lock(); + + ASSERT_TRUE(RunExtensionTest("virtual_keyboard_private", + {.custom_arg = "locked"}, + {.load_as_component = true})) + << message_; +}
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json index 6ed5e810..b8d2d4a4 100644 --- a/chrome/browser/flag-metadata.json +++ b/chrome/browser/flag-metadata.json
@@ -2278,8 +2278,8 @@ }, { "name": "enable-idle-inhibit", - "owners": [ "aswolfers" ], - "expiry_milestone": 100 + "owners": [ "aswolfers", "chromeos-gfx-compositor@google.com" ], + "expiry_milestone": 103 }, { "name": "enable-ikev2-vpn", @@ -2658,6 +2658,21 @@ "expiry_milestone": 104 }, { + "name": "enable-projector", + "owners": [ "llin", "cros-projector@google.com" ], + "expiry_milestone": 105 + }, + { + "name": "enable-projector-annotator", + "owners": [ "llin", "cros-projector@google.com" ], + "expiry_milestone": 105 + }, + { + "name": "enable-projector-exclude-transcript", + "owners": [ "llin", "cros-projector@google.com" ], + "expiry_milestone": 105 + }, + { "name": "enable-quic", "owners": [ "//net/quic/OWNERS" ], // This flag is used by network administrators to debug @@ -3208,7 +3223,7 @@ { "name": "esim-policy", "owners": [ "azeemarshad", "jiajunz@google.com", "cros-connectivity@google.com" ], - "expiry_milestone": 100 + "expiry_milestone": 103 }, { "name": "ev-details-in-page-info", @@ -5450,7 +5465,7 @@ { "name": "shopping-list", "owners": [ "mdjones", "chrome-shopping-eng@google.com" ], - "expiry_milestone": 100 + "expiry_milestone": 103 }, { "name": "show-autofill-type-predictions", @@ -6123,6 +6138,11 @@ "expiry_milestone": 105 }, { + "name": "web-feed-onboarding", + "owners": ["//chrome/android/feed/OWNERS", "feed@chromium.org" ], + "expiry_milestone": 110 + }, + { "name": "web-feed-sort", "owners": ["//chrome/android/feed/OWNERS", "feed@chromium.org" ], "expiry_milestone": 110
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc index f9497a3..f9e61d64 100644 --- a/chrome/browser/flag_descriptions.cc +++ b/chrome/browser/flag_descriptions.cc
@@ -3687,6 +3687,10 @@ const char kWebFeedDescription[] = "Allows users to keep up with and consume web content."; +const char kWebFeedOnboardingName[] = "Web Feed Onboarding"; +const char kWebFeedOnboardingDescription[] = + "Helps the user discover and use the web feed."; + const char kWebFeedSortName[] = "Web Feed Sort"; const char kWebFeedSortDescription[] = "Allows users to sort their web content in the web feed. " @@ -5238,6 +5242,19 @@ "To evaluate an enhanced Launcher experience that aims to improve app " "workflows by optimizing access to apps, app content, and app actions."; +const char kProjectorName[] = "Enable Projector"; +const char kProjectorDescription[] = + "Enables Projects SWA and associated recording tools"; + +const char kProjectorAnnotatorName[] = "Enable Projector annotator"; +const char kProjectorAnnotatorDescription[] = + "Turns on annotator tools when recording a screen capture using projector"; + +const char kProjectorExcludeTranscriptName[] = + "Enable Projector exclude transcript feature"; +const char kProjectorExcludeTranscriptDescription[] = + "Support excluding segment of Projector recording by excluding transcript"; + const char kForceShowContinueSectionName[] = "App Launcher: Force Continue Section Suggestions"; const char kForceShowContinueSectionDescription[] =
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h index f93fb2f..6a7f8e4 100644 --- a/chrome/browser/flag_descriptions.h +++ b/chrome/browser/flag_descriptions.h
@@ -2104,6 +2104,9 @@ extern const char kWebFeedName[]; extern const char kWebFeedDescription[]; +extern const char kWebFeedOnboardingName[]; +extern const char kWebFeedOnboardingDescription[]; + extern const char kWebFeedSortName[]; extern const char kWebFeedSortDescription[]; @@ -3011,6 +3014,15 @@ extern const char kProductivityLauncherName[]; extern const char kProductivityLauncherDescription[]; +extern const char kProjectorName[]; +extern const char kProjectorDescription[]; + +extern const char kProjectorAnnotatorName[]; +extern const char kProjectorAnnotatorDescription[]; + +extern const char kProjectorExcludeTranscriptName[]; +extern const char kProjectorExcludeTranscriptDescription[]; + extern const char kForceShowContinueSectionName[]; extern const char kForceShowContinueSectionDescription[];
diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browser/flags/android/chrome_feature_list.cc index 55f4b1a..12bb25b 100644 --- a/chrome/browser/flags/android/chrome_feature_list.cc +++ b/chrome/browser/flags/android/chrome_feature_list.cc
@@ -152,6 +152,7 @@ &feed::kInterestFeedV2Hearts, &feed::kReliabilityLogging, &feed::kWebFeed, + &feed::kWebFeedOnboarding, &feed::kWebFeedSort, &feed::kXsurfaceMetricsReporting, &history_clusters::internal::kJourneys,
diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java index 02bddac5..381eb45 100644 --- a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java +++ b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java
@@ -553,6 +553,7 @@ public static final String VR_BROWSING_FEEDBACK = "VrBrowsingFeedback"; public static final String WEB_AUTH_PHONE_SUPPORT = "WebAuthenticationPhoneSupport"; public static final String WEB_FEED = "WebFeed"; + public static final String WEB_FEED_ONBOARDING = "WebFeedOnboarding"; public static final String WEB_FEED_SORT = "WebFeedSort"; public static final String WEBNOTES_STYLIZE = "WebNotesStylize"; public static final String WEB_APK_INSTALL_COMPLETE_NOTIFICATION =
diff --git a/chrome/browser/idle/idle_browsertest.cc b/chrome/browser/idle/idle_browsertest.cc index d823db67..0a8d6e9 100644 --- a/chrome/browser/idle/idle_browsertest.cc +++ b/chrome/browser/idle/idle_browsertest.cc
@@ -9,6 +9,8 @@ #include "chrome/test/base/ui_test_utils.h" #include "components/content_settings/core/browser/host_content_settings_map.h" #include "components/content_settings/core/common/content_settings_types.h" +#include "components/network_session_configurator/common/network_switches.h" +#include "components/permissions/permission_request_manager.h" #include "content/public/browser/content_browser_client.h" #include "content/public/browser/idle_time_provider.h" #include "content/public/browser/storage_partition.h" @@ -18,6 +20,7 @@ #include "content/public/test/content_browser_test.h" #include "content/public/test/content_browser_test_utils.h" #include "content/public/test/idle_test_utils.h" +#include "net/dns/mock_host_resolver.h" #include "net/test/embedded_test_server/embedded_test_server.h" #include "testing/gmock/include/gmock/gmock.h" @@ -40,24 +43,61 @@ class IdleBrowserTest : public InProcessBrowserTest { public: - IdleBrowserTest() = default; + IdleBrowserTest() : https_server_(net::EmbeddedTestServer::TYPE_HTTPS) {} ~IdleBrowserTest() override = default; void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitchASCII(switches::kEnableBlinkFeatures, "IdleDetection"); + command_line->AppendSwitch(switches::kIgnoreCertificateErrors); command_line->AppendSwitch( switches::kEnableExperimentalWebPlatformFeatures); } void SetUpOnMainThread() override { - embedded_test_server()->ServeFilesFromSourceDirectory("content/test/data"); - ASSERT_TRUE(embedded_test_server()->Start()); + host_resolver()->AddRule("*", "127.0.0.1"); + https_server()->ServeFilesFromSourceDirectory("content/test/data"); + https_server()->SetSSLConfig(net::EmbeddedTestServer::CERT_OK); + ASSERT_TRUE(https_server()->Start()); } + + content::WebContents* web_contents() const { + return browser()->tab_strip_model()->GetActiveWebContents(); + } + + net::EmbeddedTestServer* https_server() { return &https_server_; } + + void TestSubframePermissionPolicy(bool positive_test) { + GURL subframe_url = https_server()->GetURL("b.com", "/simple_page.html"); + GURL url = https_server()->GetURL( + "a.com", "/cross_site_iframe_factory.html?a(" + subframe_url.spec() + + (positive_test ? "{allow-idle-detection})" : ")")); + ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), url)); + + auto* map = + HostContentSettingsMapFactory::GetForProfile(browser()->profile()); + map->SetContentSettingDefaultScope( + url, url, ContentSettingsType::IDLE_DETECTION, CONTENT_SETTING_ASK); + + auto* manager = + permissions::PermissionRequestManager::FromWebContents(web_contents()); + manager->set_auto_response_for_test( + permissions::PermissionRequestManager::ACCEPT_ALL); + + std::string script = "IdleDetector.requestPermission();"; + + content::RenderFrameHost* child = + ChildFrameAt(web_contents()->GetMainFrame(), 0); + + EXPECT_EQ(positive_test ? "granted" : "denied", EvalJs(child, script)); + } + + private: + net::EmbeddedTestServer https_server_; }; IN_PROC_BROWSER_TEST_F(IdleBrowserTest, Start) { - GURL url = embedded_test_server()->GetURL("localhost", "/simple_page.html"); + GURL url = https_server()->GetURL("a.com", "/simple_page.html"); auto* map = HostContentSettingsMapFactory::GetForProfile(browser()->profile()); map->SetContentSettingDefaultScope( @@ -104,15 +144,16 @@ content::ScopedIdleProviderForTest scoped_idle_provider( std::move(mock_time_provider)); - std::string result = - EvalJs(browser()->tab_strip_model()->GetActiveWebContents(), script) - .ExtractString(); - std::vector<std::string> states = base::SplitString( - result, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); + EXPECT_EQ("idle-unlocked,idle-locked,active-unlocked", + EvalJs(web_contents(), script)); +} - EXPECT_EQ("idle-unlocked", states.at(0)); - EXPECT_EQ("idle-locked", states.at(1)); - EXPECT_EQ("active-unlocked", states.at(2)); +IN_PROC_BROWSER_TEST_F(IdleBrowserTest, SubframeWithoutPolicy) { + TestSubframePermissionPolicy(false); +} + +IN_PROC_BROWSER_TEST_F(IdleBrowserTest, SubframeWithPolicy) { + TestSubframePermissionPolicy(true); } } // namespace
diff --git a/chrome/browser/idle/idle_detection_permission_context.cc b/chrome/browser/idle/idle_detection_permission_context.cc index 10f25bfe..193eba7 100644 --- a/chrome/browser/idle/idle_detection_permission_context.cc +++ b/chrome/browser/idle/idle_detection_permission_context.cc
@@ -16,10 +16,10 @@ IdleDetectionPermissionContext::IdleDetectionPermissionContext( content::BrowserContext* browser_context) - : PermissionContextBase(browser_context, - ContentSettingsType::IDLE_DETECTION, - blink::mojom::PermissionsPolicyFeature::kNotFound) { -} + : PermissionContextBase( + browser_context, + ContentSettingsType::IDLE_DETECTION, + blink::mojom::PermissionsPolicyFeature::kIdleDetection) {} IdleDetectionPermissionContext::~IdleDetectionPermissionContext() = default;
diff --git a/chrome/browser/incognito/BUILD.gn b/chrome/browser/incognito/BUILD.gn index 8c5c2090..f815860 100644 --- a/chrome/browser/incognito/BUILD.gn +++ b/chrome/browser/incognito/BUILD.gn
@@ -13,9 +13,13 @@ "android/java/src/org/chromium/chrome/browser/incognito/reauth/IncognitoReauthController.java", "android/java/src/org/chromium/chrome/browser/incognito/reauth/IncognitoReauthCoordinator.java", "android/java/src/org/chromium/chrome/browser/incognito/reauth/IncognitoReauthCoordinatorFactory.java", + "android/java/src/org/chromium/chrome/browser/incognito/reauth/IncognitoReauthDialog.java", "android/java/src/org/chromium/chrome/browser/incognito/reauth/IncognitoReauthManager.java", + "android/java/src/org/chromium/chrome/browser/incognito/reauth/IncognitoReauthMediator.java", + "android/java/src/org/chromium/chrome/browser/incognito/reauth/IncognitoReauthProperties.java", "android/java/src/org/chromium/chrome/browser/incognito/reauth/IncognitoReauthSettingSwitchPreference.java", "android/java/src/org/chromium/chrome/browser/incognito/reauth/IncognitoReauthSettingUtils.java", + "android/java/src/org/chromium/chrome/browser/incognito/reauth/IncognitoReauthViewBinder.java", ] deps = [ ":java_resources", @@ -89,6 +93,7 @@ "//third_party/junit:junit", "//third_party/mockito:mockito_java", "//ui/android:ui_java_test_support", + "//ui/android:ui_no_recycler_view_java", ] }
diff --git a/chrome/browser/incognito/android/java/res/layout/incognito_reauth_view.xml b/chrome/browser/incognito/android/java/res/layout/incognito_reauth_view.xml index fc522f94..4190bc7 100644 --- a/chrome/browser/incognito/android/java/res/layout/incognito_reauth_view.xml +++ b/chrome/browser/incognito/android/java/res/layout/incognito_reauth_view.xml
@@ -22,6 +22,7 @@ android:layout_gravity="top" android:layout_height="48dp" android:layout_width="48dp" + android:visibility="gone" app:srcCompat="@drawable/ic_more_vert_24dp_on_dark_bg" app:menuMaxWidth="@dimen/list_menu_width" style="@style/ToolbarButton"/> @@ -60,7 +61,9 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="32dp" + android:visibility="gone" android:text="@string/incognito_reauth_page_see_other_tabs_label" - android:textAppearance="@style/TextAppearance.TextMedium.Blue.Baseline.Light" /> + android:textAppearance="@style/TextAppearance.TextMedium.Blue.Baseline.Light" + app:buttonTextColor="@color/default_icon_color_blue_light" /> </LinearLayout> </RelativeLayout>
diff --git a/chrome/browser/incognito/android/java/src/org/chromium/chrome/browser/incognito/reauth/IncognitoReauthCoordinator.java b/chrome/browser/incognito/android/java/src/org/chromium/chrome/browser/incognito/reauth/IncognitoReauthCoordinator.java index b05818e..95081da 100644 --- a/chrome/browser/incognito/android/java/src/org/chromium/chrome/browser/incognito/reauth/IncognitoReauthCoordinator.java +++ b/chrome/browser/incognito/android/java/src/org/chromium/chrome/browser/incognito/reauth/IncognitoReauthCoordinator.java
@@ -4,25 +4,39 @@ package org.chromium.chrome.browser.incognito.reauth; +import static org.chromium.chrome.browser.incognito.reauth.IncognitoReauthProperties.createPropertyModel; + import android.content.Context; +import android.view.LayoutInflater; +import android.view.View; import androidx.annotation.NonNull; +import org.chromium.chrome.browser.incognito.R; import org.chromium.chrome.browser.tabmodel.TabModelSelector; import org.chromium.ui.modaldialog.DialogDismissalCause; import org.chromium.ui.modaldialog.ModalDialogManager; +import org.chromium.ui.modelutil.PropertyModel; +import org.chromium.ui.modelutil.PropertyModelChangeProcessor; /** * The coordinator which is responsible for showing the Incognito re-authentication page. * - * TODO(crbug.com/1227656): Add View inflation and set up the re-auth dialog. + * TODO(crbug.com/1227656): Add support to disable/enable certain UI elements in the Toolbar when + * the re-auth dialog is shown/hidden in the Incognito tab switcher. */ class IncognitoReauthCoordinator { private final @NonNull Context mContext; private final @NonNull ModalDialogManager mModalDialogManager; - private final @NonNull IncognitoReauthManager.IncognitoReauthCallback mIncognitoReauthCallback; private final boolean mShowFullScreen; + private final IncognitoReauthMediator mIncognitoReauthMediator; + + private View mIncognitoReauthView; + private IncognitoReauthDialog mIncognitoReauthDialog; + private PropertyModel mPropertyModel; + private PropertyModelChangeProcessor mModelChangeProcessor; + /** * @param context The {@link Context} to use for inflating the Incognito re-auth view. * @param tabModelSelector The {@link TabModelSelector} which will be passed to the mediator in @@ -40,15 +54,33 @@ boolean showFullScreen) { mContext = context; mModalDialogManager = modalDialogManager; - mIncognitoReauthCallback = incognitoReauthCallback; mShowFullScreen = showFullScreen; + mIncognitoReauthMediator = + new IncognitoReauthMediator(tabModelSelector, incognitoReauthCallback); } - void showDialog() {} + private void destroy() { + mModelChangeProcessor.destroy(); + } + + void showDialog() { + mIncognitoReauthView = + LayoutInflater.from(mContext).inflate(R.layout.incognito_reauth_view, null); + mPropertyModel = + createPropertyModel(mIncognitoReauthMediator::onUnlockIncognitoButtonClicked, + mIncognitoReauthMediator::onSeeOtherTabsButtonClicked, mShowFullScreen); + mModelChangeProcessor = PropertyModelChangeProcessor.create( + mPropertyModel, mIncognitoReauthView, IncognitoReauthViewBinder::bind); + + // TODO(crbug.com/1227656): Add implementation for R.id.incognito_reauth_menu_button + mIncognitoReauthDialog = + new IncognitoReauthDialog(mModalDialogManager, mIncognitoReauthView); + mIncognitoReauthDialog.showIncognitoReauthDialog(mShowFullScreen); + } void hideDialogAndDestroy(@DialogDismissalCause int dismissalCause) { + assert mIncognitoReauthDialog != null : "Incognito re-auth dialog doesn't exists."; + mIncognitoReauthDialog.dismissIncognitoReauthDialog(dismissalCause); destroy(); } - - private void destroy() {} }
diff --git a/chrome/browser/incognito/android/java/src/org/chromium/chrome/browser/incognito/reauth/IncognitoReauthDialog.java b/chrome/browser/incognito/android/java/src/org/chromium/chrome/browser/incognito/reauth/IncognitoReauthDialog.java new file mode 100644 index 0000000..5609aa93 --- /dev/null +++ b/chrome/browser/incognito/android/java/src/org/chromium/chrome/browser/incognito/reauth/IncognitoReauthDialog.java
@@ -0,0 +1,56 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.incognito.reauth; + +import android.view.View; + +import androidx.annotation.NonNull; + +import org.chromium.ui.modaldialog.DialogDismissalCause; +import org.chromium.ui.modaldialog.ModalDialogManager; +import org.chromium.ui.modaldialog.ModalDialogProperties; +import org.chromium.ui.modelutil.PropertyModel; + +/** + * This class is responsible for managing the Incognito re-auth dialog. It handles creation, + * showing and hiding of the re-auth dialog. + */ +class IncognitoReauthDialog { + @NonNull + private final ModalDialogManager mModalDialogManager; + + private final PropertyModel mModalDialogModel; + private final ModalDialogProperties.Controller mController = + new ModalDialogProperties.Controller() { + @Override + public void onClick(PropertyModel model, int buttonType) {} + @Override + public void onDismiss(PropertyModel model, int dismissalCause) {} + }; + + IncognitoReauthDialog( + @NonNull ModalDialogManager modalDialogManager, @NonNull View incognitoReauthView) { + mModalDialogManager = modalDialogManager; + // TODO(crbug.com/1227656): Add support for high dialog priority and dialog styling. + mModalDialogModel = new PropertyModel.Builder(ModalDialogProperties.ALL_KEYS) + .with(ModalDialogProperties.CONTROLLER, mController) + .with(ModalDialogProperties.CUSTOM_VIEW, incognitoReauthView) + .with(ModalDialogProperties.CANCEL_ON_TOUCH_OUTSIDE, false) + .with(ModalDialogProperties.FULLSCREEN_DIALOG, true) + .build(); + } + + void showIncognitoReauthDialog(boolean showFullScreen) { + // TODO(crbug.com/1227656): Tab based re-auth dialog doesn't work as they + // get dismissed by {@link TabModalLifetimeHandler}. + mModalDialogManager.showDialog(mModalDialogModel, + (showFullScreen) ? ModalDialogManager.ModalDialogType.APP + : ModalDialogManager.ModalDialogType.TAB); + } + + void dismissIncognitoReauthDialog(@DialogDismissalCause int dismissalCause) { + mModalDialogManager.dismissDialog(mModalDialogModel, dismissalCause); + } +}
diff --git a/chrome/browser/incognito/android/java/src/org/chromium/chrome/browser/incognito/reauth/IncognitoReauthManager.java b/chrome/browser/incognito/android/java/src/org/chromium/chrome/browser/incognito/reauth/IncognitoReauthManager.java index 18c5a9b..b646d33 100644 --- a/chrome/browser/incognito/android/java/src/org/chromium/chrome/browser/incognito/reauth/IncognitoReauthManager.java +++ b/chrome/browser/incognito/android/java/src/org/chromium/chrome/browser/incognito/reauth/IncognitoReauthManager.java
@@ -38,13 +38,11 @@ } /** - * Constructor for {@link IncognitoReauthManager}. Initialises |mReauthenticatorBridge|. + * Constructor for {@link IncognitoReauthManager}. */ - public IncognitoReauthManager() { - mReauthenticatorBridge = - new ReauthenticatorBridge(BiometricAuthRequester.INCOGNITO_REAUTH_PAGE); - } + public IncognitoReauthManager() {} + // This is strictly meant to be called for testing purposes. @VisibleForTesting public IncognitoReauthManager(ReauthenticatorBridge reauthenticatorBridge) { mReauthenticatorBridge = reauthenticatorBridge; @@ -59,6 +57,11 @@ */ public void startReauthenticationFlow( @NonNull IncognitoReauthCallback incognitoReauthCallback) { + if (mReauthenticatorBridge == null) { + mReauthenticatorBridge = + new ReauthenticatorBridge(BiometricAuthRequester.INCOGNITO_REAUTH_PAGE); + } + if (!mReauthenticatorBridge.canUseAuthentication() || !isIncognitoReauthFeatureAvailable()) { incognitoReauthCallback.onIncognitoReauthNotPossible();
diff --git a/chrome/browser/incognito/android/java/src/org/chromium/chrome/browser/incognito/reauth/IncognitoReauthMediator.java b/chrome/browser/incognito/android/java/src/org/chromium/chrome/browser/incognito/reauth/IncognitoReauthMediator.java new file mode 100644 index 0000000..34c9460 --- /dev/null +++ b/chrome/browser/incognito/android/java/src/org/chromium/chrome/browser/incognito/reauth/IncognitoReauthMediator.java
@@ -0,0 +1,41 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +package org.chromium.chrome.browser.incognito.reauth; + +import androidx.annotation.NonNull; + +import org.chromium.chrome.browser.incognito.reauth.IncognitoReauthManager.IncognitoReauthCallback; +import org.chromium.chrome.browser.tabmodel.TabModelSelector; + +/** + * The mediator responsible for handling the interactions with the incognito re-auth view. + */ +class IncognitoReauthMediator { + private final TabModelSelector mTabModelSelector; + // The entity responsible for actually calling the underlying system re-authentication. + private final IncognitoReauthManager mIncognitoReauthManager = new IncognitoReauthManager(); + // The callback that would be fired after an authentication attempt. + private IncognitoReauthCallback mIncognitoReauthCallback; + + /** + * @param tabModelSelector The {@link TabModelSelector} which helps to switch to regular + * {@link TabModel}. + */ + IncognitoReauthMediator(@NonNull TabModelSelector tabModelSelector, + @NonNull IncognitoReauthCallback incognitoReauthCallback) { + mTabModelSelector = tabModelSelector; + mIncognitoReauthCallback = incognitoReauthCallback; + } + + void onUnlockIncognitoButtonClicked() { + mIncognitoReauthManager.startReauthenticationFlow(mIncognitoReauthCallback); + } + + void onSeeOtherTabsButtonClicked() { + // We observe {@link TabModel} changes in {@link IncognitoReauthController} and when we + // will change to regular {@link TabModel} the controller will detect that and hide + // the dialog. + mTabModelSelector.selectModel(/*incognito=*/false); + } +}
diff --git a/chrome/browser/incognito/android/java/src/org/chromium/chrome/browser/incognito/reauth/IncognitoReauthProperties.java b/chrome/browser/incognito/android/java/src/org/chromium/chrome/browser/incognito/reauth/IncognitoReauthProperties.java new file mode 100644 index 0000000..47299d0 --- /dev/null +++ b/chrome/browser/incognito/android/java/src/org/chromium/chrome/browser/incognito/reauth/IncognitoReauthProperties.java
@@ -0,0 +1,44 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.incognito.reauth; + +import org.chromium.ui.modelutil.PropertyKey; +import org.chromium.ui.modelutil.PropertyModel; +import org.chromium.ui.modelutil.PropertyModel.ReadableBooleanPropertyKey; +import org.chromium.ui.modelutil.PropertyModel.ReadableObjectPropertyKey; + +class IncognitoReauthProperties { + public static final ReadableObjectPropertyKey<Runnable> ON_UNLOCK_INCOGNITO_CLICKED = + new ReadableObjectPropertyKey<>("on_unlock_incognito_clicked"); + public static final ReadableObjectPropertyKey<Runnable> ON_SEE_OTHER_TABS_CLICKED = + new ReadableObjectPropertyKey<>("on_see_other_tabs_clicked"); + public static final ReadableBooleanPropertyKey IS_FULL_SCREEN = + new ReadableBooleanPropertyKey(); + public static final PropertyKey[] ALL_KEYS = { + ON_UNLOCK_INCOGNITO_CLICKED, ON_SEE_OTHER_TABS_CLICKED, IS_FULL_SCREEN}; + + /** + * Creates an instance of {@link PropertyModel} for the incognito re-auth view. + * + * @param unlockIncognitoRunnable The runnable that would be run when the user clicks on the + * "Unlock Incognito" button. + * @param seeOtherTabsRunnable The runnable that would be run when the user clicks on the "See + * other tabs" button. + * @param fullscreen A boolean indicating whether the incognito re-auth view needs to be shown + * fullscreen style or tab-switcher style. + * + * @return A {@link PropertyModel} instance for the incognito re-auth view with the above + * attributes. + */ + public static PropertyModel createPropertyModel( + Runnable unlockIncognitoRunnable, Runnable seeOtherTabsRunnable, boolean fullscreen) { + return new PropertyModel.Builder(IncognitoReauthProperties.ALL_KEYS) + .with(IncognitoReauthProperties.ON_UNLOCK_INCOGNITO_CLICKED, + unlockIncognitoRunnable) + .with(IncognitoReauthProperties.ON_SEE_OTHER_TABS_CLICKED, seeOtherTabsRunnable) + .with(IncognitoReauthProperties.IS_FULL_SCREEN, fullscreen) + .build(); + } +}
diff --git a/chrome/browser/incognito/android/java/src/org/chromium/chrome/browser/incognito/reauth/IncognitoReauthViewBinder.java b/chrome/browser/incognito/android/java/src/org/chromium/chrome/browser/incognito/reauth/IncognitoReauthViewBinder.java new file mode 100644 index 0000000..865f19387 --- /dev/null +++ b/chrome/browser/incognito/android/java/src/org/chromium/chrome/browser/incognito/reauth/IncognitoReauthViewBinder.java
@@ -0,0 +1,42 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.incognito.reauth; + +import android.view.View; + +import org.chromium.chrome.browser.incognito.R; +import org.chromium.ui.modelutil.PropertyKey; +import org.chromium.ui.modelutil.PropertyModel; + +class IncognitoReauthViewBinder { + public static void bind( + PropertyModel model, View incognitoReauthView, PropertyKey propertyKey) { + if (IncognitoReauthProperties.ON_UNLOCK_INCOGNITO_CLICKED == propertyKey) { + Runnable unlockIncognito = + model.get(IncognitoReauthProperties.ON_UNLOCK_INCOGNITO_CLICKED); + assert unlockIncognito != null : "Unlock Incognito runnable can't be null."; + incognitoReauthView.findViewById(R.id.incognito_reauth_unlock_incognito_button) + .setOnClickListener(view -> unlockIncognito.run()); + } else if (IncognitoReauthProperties.ON_SEE_OTHER_TABS_CLICKED == propertyKey) { + Runnable seeOtherTabs = model.get(IncognitoReauthProperties.ON_SEE_OTHER_TABS_CLICKED); + assert seeOtherTabs != null : "See other tabs runnable can't be null."; + incognitoReauthView.findViewById(R.id.incognito_reauth_see_other_tabs_label) + .setOnClickListener(view -> seeOtherTabs.run()); + } else if (IncognitoReauthProperties.IS_FULL_SCREEN == propertyKey) { + boolean isFullScreen = model.get(IncognitoReauthProperties.IS_FULL_SCREEN); + if (isFullScreen) { + incognitoReauthView.findViewById(R.id.incognito_reauth_see_other_tabs_label) + .setVisibility(View.VISIBLE); + incognitoReauthView.findViewById(R.id.incognito_reauth_menu_button) + .setVisibility(View.VISIBLE); + } else { + // For non-full screen we have a slight modification on top of the default + // to remove the incognito icon only for small screen size. + // TODO(crbug.com/1227656): Add logic to remove Incognito icon for + // small screen. + } + } + } +}
diff --git a/chrome/browser/incognito/android/javatests/src/org/chromium/chrome/browser/incognito/reauth/IncognitoReauthViewTest.java b/chrome/browser/incognito/android/javatests/src/org/chromium/chrome/browser/incognito/reauth/IncognitoReauthViewTest.java index 541a9bc..563fc7b0 100644 --- a/chrome/browser/incognito/android/javatests/src/org/chromium/chrome/browser/incognito/reauth/IncognitoReauthViewTest.java +++ b/chrome/browser/incognito/android/javatests/src/org/chromium/chrome/browser/incognito/reauth/IncognitoReauthViewTest.java
@@ -5,19 +5,23 @@ package org.chromium.chrome.browser.incognito.reauth; import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.assertion.ViewAssertions.matches; import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; +import static org.hamcrest.core.IsNot.not; +import static org.mockito.Mockito.verify; + import android.view.View; import androidx.test.filters.MediumTest; -import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; +import org.mockito.Mock; import org.mockito.MockitoAnnotations; import org.chromium.base.test.util.CommandLineFlags; @@ -27,6 +31,8 @@ import org.chromium.chrome.test.ChromeJUnit4ClassRunner; import org.chromium.chrome.test.util.ChromeRenderTestRule; import org.chromium.content_public.browser.test.util.TestThreadUtils; +import org.chromium.ui.modelutil.PropertyModel; +import org.chromium.ui.modelutil.PropertyModelChangeProcessor; import org.chromium.ui.test.util.BlankUiTestActivityTestCase; import java.io.IOException; @@ -38,13 +44,20 @@ @CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE}) public class IncognitoReauthViewTest extends BlankUiTestActivityTestCase { private View mView; + private PropertyModel mPropertyModel; + private PropertyModelChangeProcessor mModelChangeProcessor; + @Mock + private Runnable mUnlockIncognitoRunnableMock; + @Mock + private Runnable mSeeOtherTabsRunnableMock; @Rule public ChromeRenderTestRule mRenderTestRule = ChromeRenderTestRule.Builder.withPublicCorpus().build(); - @Before - public void setUp() { + @Override + public void setUpTest() throws Exception { + super.setUpTest(); MockitoAnnotations.initMocks(this); TestThreadUtils.runOnUiThreadBlocking(() -> { getActivity().setContentView(R.layout.incognito_reauth_view); @@ -54,7 +67,8 @@ @Test @MediumTest - public void testIncognitoReauthViewPageCorrectlyDisplayed() { + public void testIncognitoReauthView_FullScreen() { + buildPropertyModelAndBindProcessor(/*isFullScreen=*/true); onView(withId(R.id.incognito_reauth_menu_button)).check(matches(isDisplayed())); onView(withId(R.id.incognito_reauth_unlock_incognito_button)).check(matches(isDisplayed())); onView(withText(R.string.incognito_reauth_page_unlock_incognito_button_label)) @@ -63,12 +77,54 @@ onView(withId(R.id.incognito_reauth_see_other_tabs_label)).check(matches(isDisplayed())); onView(withText(R.string.incognito_reauth_page_see_other_tabs_label)) .check(matches(isDisplayed())); + + onView(withId(R.id.incognito_reauth_unlock_incognito_button)).perform(click()); + verify(mUnlockIncognitoRunnableMock).run(); + + onView(withId(R.id.incognito_reauth_see_other_tabs_label)).perform(click()); + verify(mSeeOtherTabsRunnableMock).run(); + } + + @Test + @MediumTest + public void testIncognitoReauthView_TabSwitcherView() { + buildPropertyModelAndBindProcessor(/*isFullScreen=*/false); + onView(withId(R.id.incognito_reauth_menu_button)).check(matches(not(isDisplayed()))); + onView(withId(R.id.incognito_reauth_unlock_incognito_button)).check(matches(isDisplayed())); + onView(withText(R.string.incognito_reauth_page_unlock_incognito_button_label)) + .check(matches(isDisplayed())); + + onView(withId(R.id.incognito_reauth_see_other_tabs_label)) + .check(matches(not(isDisplayed()))); + onView(withText(R.string.incognito_reauth_page_see_other_tabs_label)) + .check(matches(not(isDisplayed()))); + + onView(withId(R.id.incognito_reauth_unlock_incognito_button)).perform(click()); + verify(mUnlockIncognitoRunnableMock).run(); } @Test @MediumTest @Feature("RenderTest") public void testIncongitoReauthViewRenderTest() throws IOException { + buildPropertyModelAndBindProcessor(/*isFullScreen=*/true); mRenderTestRule.render(mView, "incognito_reauth_view"); } + + @Test + @MediumTest + @Feature("RenderTest") + public void testIncongitoReauthViewTabSwitcherRenderTest() throws IOException { + buildPropertyModelAndBindProcessor(/*isFullScreen=*/false); + mRenderTestRule.render(mView, "incognito_reauth_view_tab_switcher"); + } + + private void buildPropertyModelAndBindProcessor(boolean isFullScreen) { + TestThreadUtils.runOnUiThreadBlocking(() -> { + mPropertyModel = IncognitoReauthProperties.createPropertyModel( + mUnlockIncognitoRunnableMock, mSeeOtherTabsRunnableMock, isFullScreen); + mModelChangeProcessor = PropertyModelChangeProcessor.create( + mPropertyModel, mView, IncognitoReauthViewBinder::bind); + }); + } }
diff --git a/chrome/browser/optimization_guide/page_content_annotations_service_browsertest.cc b/chrome/browser/optimization_guide/page_content_annotations_service_browsertest.cc index f6f8252..d4c2a256 100644 --- a/chrome/browser/optimization_guide/page_content_annotations_service_browsertest.cc +++ b/chrome/browser/optimization_guide/page_content_annotations_service_browsertest.cc
@@ -360,6 +360,29 @@ #if BUILDFLAG(BUILD_WITH_TFLITE_LIB) IN_PROC_BROWSER_TEST_F(PageContentAnnotationsServiceBrowserTest, + PageTopicsDomainPreProcessing) { + PageContentAnnotationsService* service = + PageContentAnnotationsServiceFactory::GetForProfile(browser()->profile()); + + base::RunLoop run_loop; + service->BatchAnnotatePageTopics( + base::BindOnce( + [](base::RunLoop* run_loop, + const std::vector<BatchAnnotationResult>& results) { + ASSERT_EQ(results.size(), 1U); + EXPECT_EQ(results[0].input(), "www.chromium.org"); + EXPECT_EQ(results[0].type(), AnnotationType::kPageTopics); + // Intentionally does not test model execution, since that is well + // covered in the unittests for PageContentAnnotationsModelManager. + run_loop->Quit(); + }, + &run_loop), + std::vector<GURL>{GURL("https://www.chromium.org")}); + + run_loop.Run(); +} + +IN_PROC_BROWSER_TEST_F(PageContentAnnotationsServiceBrowserTest, NoVisitsForUrlInHistory) { HistoryVisit history_visit; history_visit.url = GURL("https://probablynotarealurl.com/");
diff --git a/chrome/browser/password_manager/password_manager_browsertest.cc b/chrome/browser/password_manager/password_manager_browsertest.cc index 13b1a26..5173376 100644 --- a/chrome/browser/password_manager/password_manager_browsertest.cc +++ b/chrome/browser/password_manager/password_manager_browsertest.cc
@@ -2949,14 +2949,13 @@ } // Check that the internals page contains logs from the renderer. -// Flaky on linux-bfcache-rel crbug.com/1276313. -#if BUILDFLAG(IS_LINUX) -#define MAYBE_InternalsPage_Renderer DISABLED_InternalsPage_Renderer -#else -#define MAYBE_InternalsPage_Renderer InternalsPage_Renderer -#endif -IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTest, - MAYBE_InternalsPage_Renderer) { +IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTest, InternalsPage_Renderer) { + // The test is flaky with same-site back/forward cache (which is enabled by + // default). + // TODO(https://crbug.com/1276313): Investigate and fix this. + content::DisableBackForwardCacheForTesting( + WebContents(), content::BackForwardCache::TEST_REQUIRES_NO_CACHING); + // Open the internals page. ui_test_utils::NavigateToURLWithDisposition( browser(), GURL("chrome://password-manager-internals"),
diff --git a/chrome/browser/platform_util_android.cc b/chrome/browser/platform_util_android.cc index e1ecaf66..8b073d5 100644 --- a/chrome/browser/platform_util_android.cc +++ b/chrome/browser/platform_util_android.cc
@@ -10,6 +10,7 @@ #include "chrome/browser/platform_util.h" #include "chrome/browser/util/jni_headers/PlatformUtil_jni.h" #include "ui/android/view_android.h" +#include "ui/android/window_android.h" #include "url/gurl.h" using base::android::ScopedJavaLocalRef;
diff --git a/chrome/browser/prefetch/search_prefetch/field_trial_settings.cc b/chrome/browser/prefetch/search_prefetch/field_trial_settings.cc index df3728b..fa4d3be 100644 --- a/chrome/browser/prefetch/search_prefetch/field_trial_settings.cc +++ b/chrome/browser/prefetch/search_prefetch/field_trial_settings.cc
@@ -50,3 +50,8 @@ return base::GetFieldTrialParamByFeatureAsInt( kSearchPrefetchServicePrefetching, "cache_size", 10); } + +base::TimeDelta SearchPrefetchBlockHeadStart() { + return base::Milliseconds(base::GetFieldTrialParamByFeatureAsInt( + kSearchPrefetchBlockBeforeHeaders, "block_head_start_ms", 0)); +}
diff --git a/chrome/browser/prefetch/search_prefetch/field_trial_settings.h b/chrome/browser/prefetch/search_prefetch/field_trial_settings.h index 53321851..d66bd5e 100644 --- a/chrome/browser/prefetch/search_prefetch/field_trial_settings.h +++ b/chrome/browser/prefetch/search_prefetch/field_trial_settings.h
@@ -34,4 +34,8 @@ // of navigation URLs to prefetch URLs. size_t SearchPrefetchMaxCacheEntries(); +// The amount of time that needs to have elapsed before we consider a prefetch +// eligible to be served. +base::TimeDelta SearchPrefetchBlockHeadStart(); + #endif // CHROME_BROWSER_PREFETCH_SEARCH_PREFETCH_FIELD_TRIAL_SETTINGS_H_
diff --git a/chrome/browser/prefetch/search_prefetch/search_prefetch_service_browsertest.cc b/chrome/browser/prefetch/search_prefetch/search_prefetch_service_browsertest.cc index cf59836..4abf0fd 100644 --- a/chrome/browser/prefetch/search_prefetch/search_prefetch_service_browsertest.cc +++ b/chrome/browser/prefetch/search_prefetch/search_prefetch_service_browsertest.cc
@@ -2563,6 +2563,124 @@ SearchPrefetchServiceEnabledBrowserTest, testing::Bool()); +class SearchPrefetchServiceHeadStartTooLongTest + : public SearchPrefetchBaseBrowserTest { + public: + SearchPrefetchServiceHeadStartTooLongTest() { + feature_list_.InitWithFeaturesAndParameters( + {{kSearchPrefetchServicePrefetching, + {{"max_attempts_per_caching_duration", "3"}, + {"cache_size", "1"}, + {"device_memory_threshold_MB", "0"}}}, + {kSearchPrefetchBlockBeforeHeaders, + {{"block_head_start_ms", "100000"}}}}, + {}); + } + + private: + base::test::ScopedFeatureList feature_list_; +}; + +IN_PROC_BROWSER_TEST_F(SearchPrefetchServiceHeadStartTooLongTest, + HungRequestNotServedBeforeHeadStart) { + set_should_hang_requests(true); + auto* search_prefetch_service = + SearchPrefetchServiceFactory::GetForProfile(browser()->profile()); + std::string search_terms = kOmniboxSuggestPrefetchQuery; + + // Trigger an omnibox suggest fetch that has a prefetch hint. + AutocompleteInput input( + base::ASCIIToUTF16(search_terms), metrics::OmniboxEventProto::BLANK, + ChromeAutocompleteSchemeClassifier(browser()->profile())); + LocationBar* location_bar = browser()->window()->GetLocationBar(); + OmniboxView* omnibox = location_bar->GetOmniboxView(); + AutocompleteController* autocomplete_controller = + omnibox->model()->autocomplete_controller(); + + // Prevent the stop timer from killing the hints fetch early. + autocomplete_controller->SetStartStopTimerDurationForTesting( + base::Seconds(10)); + autocomplete_controller->Start(input); + + ui_test_utils::WaitForAutocompleteDone(browser()); + EXPECT_TRUE(autocomplete_controller->done()); + + auto prefetch_status = + search_prefetch_service->GetSearchPrefetchStatusForTesting( + base::ASCIIToUTF16(search_terms)); + ASSERT_TRUE(prefetch_status.has_value()); + EXPECT_EQ(SearchPrefetchStatus::kInFlight, prefetch_status.value()); + + omnibox->model()->AcceptInput(WindowOpenDisposition::CURRENT_TAB); + + WaitUntilStatusChangesTo(base::ASCIIToUTF16(search_terms), + SearchPrefetchStatus::kRequestCancelled); + + prefetch_status = search_prefetch_service->GetSearchPrefetchStatusForTesting( + base::ASCIIToUTF16(search_terms)); + ASSERT_TRUE(prefetch_status.has_value()); + EXPECT_EQ(SearchPrefetchStatus::kRequestCancelled, prefetch_status.value()); +} + +class SearchPrefetchServiceHeadStartTest + : public SearchPrefetchBaseBrowserTest { + public: + SearchPrefetchServiceHeadStartTest() { + feature_list_.InitWithFeaturesAndParameters( + {{kSearchPrefetchServicePrefetching, + {{"max_attempts_per_caching_duration", "3"}, + {"cache_size", "1"}, + {"device_memory_threshold_MB", "0"}}}, + {kSearchPrefetchBlockBeforeHeaders, {{"block_head_start_ms", "10"}}}}, + {}); + } + + private: + base::test::ScopedFeatureList feature_list_; +}; + +IN_PROC_BROWSER_TEST_F(SearchPrefetchServiceHeadStartTest, + HungRequestServedAfterHeadStart) { + set_should_hang_requests(true); + auto* search_prefetch_service = + SearchPrefetchServiceFactory::GetForProfile(browser()->profile()); + std::string search_terms = kOmniboxSuggestPrefetchQuery; + + // Trigger an omnibox suggest fetch that has a prefetch hint. + AutocompleteInput input( + base::ASCIIToUTF16(search_terms), metrics::OmniboxEventProto::BLANK, + ChromeAutocompleteSchemeClassifier(browser()->profile())); + LocationBar* location_bar = browser()->window()->GetLocationBar(); + OmniboxView* omnibox = location_bar->GetOmniboxView(); + AutocompleteController* autocomplete_controller = + omnibox->model()->autocomplete_controller(); + + // Prevent the stop timer from killing the hints fetch early. + autocomplete_controller->SetStartStopTimerDurationForTesting( + base::Seconds(10)); + autocomplete_controller->Start(input); + + ui_test_utils::WaitForAutocompleteDone(browser()); + EXPECT_TRUE(autocomplete_controller->done()); + + auto prefetch_status = + search_prefetch_service->GetSearchPrefetchStatusForTesting( + base::ASCIIToUTF16(search_terms)); + ASSERT_TRUE(prefetch_status.has_value()); + EXPECT_EQ(SearchPrefetchStatus::kInFlight, prefetch_status.value()); + + WaitUntilStatusChangesTo(base::ASCIIToUTF16(search_terms), + SearchPrefetchStatus::kCanBeServed); + + omnibox->model()->AcceptInput(WindowOpenDisposition::CURRENT_TAB); + + WaitUntilStatusChangesTo(base::ASCIIToUTF16(search_terms), absl::nullopt); + + prefetch_status = search_prefetch_service->GetSearchPrefetchStatusForTesting( + base::ASCIIToUTF16(search_terms)); + ASSERT_FALSE(prefetch_status.has_value()); +} + class SearchPrefetchServiceBFCacheTest : public SearchPrefetchBaseBrowserTest { public: SearchPrefetchServiceBFCacheTest() {
diff --git a/chrome/browser/prefetch/search_prefetch/streaming_search_prefetch_url_loader.cc b/chrome/browser/prefetch/search_prefetch/streaming_search_prefetch_url_loader.cc index 3cb48cb..b23d489 100644 --- a/chrome/browser/prefetch/search_prefetch/streaming_search_prefetch_url_loader.cc +++ b/chrome/browser/prefetch/search_prefetch/streaming_search_prefetch_url_loader.cc
@@ -60,8 +60,18 @@ profile_(profile), network_traffic_annotation_(network_traffic_annotation) { DCHECK(streaming_prefetch_request_); - if (SearchPrefetchBlockBeforeHeadersIsEnabled()) - streaming_prefetch_request_->MarkPrefetchAsServable(); + if (SearchPrefetchBlockBeforeHeadersIsEnabled()) { + if (SearchPrefetchBlockHeadStart() > base::TimeDelta()) { + base::SequencedTaskRunnerHandle::Get()->PostDelayedTask( + FROM_HERE, + base::BindOnce( + &StreamingSearchPrefetchURLLoader::MarkPrefetchAsServable, + weak_factory_.GetWeakPtr()), + SearchPrefetchBlockHeadStart()); + } else { + MarkPrefetchAsServable(); + } + } auto url_loader_factory = profile->GetDefaultStoragePartition() ->GetURLLoaderFactoryForBrowserProcess(); @@ -79,6 +89,14 @@ StreamingSearchPrefetchURLLoader::~StreamingSearchPrefetchURLLoader() = default; +void StreamingSearchPrefetchURLLoader::MarkPrefetchAsServable() { + if (marked_as_servable_) + return; + DCHECK(streaming_prefetch_request_); + marked_as_servable_ = true; + streaming_prefetch_request_->MarkPrefetchAsServable(); +} + SearchPrefetchURLLoader::RequestHandler StreamingSearchPrefetchURLLoader::ServingResponseHandler( std::unique_ptr<SearchPrefetchURLLoader> loader) { @@ -127,8 +145,9 @@ // Headers have not been received yet, we can forward the response if // we receive it without error. - if (!resource_response_) + if (!resource_response_) { return; + } // We are serving, so if the request is complete before serving, mark the // request completion time as now. @@ -182,8 +201,7 @@ return; } - if (!SearchPrefetchBlockBeforeHeadersIsEnabled()) - streaming_prefetch_request_->MarkPrefetchAsServable(); + MarkPrefetchAsServable(); // Store head and pause new messages until the forwarding client is set up. resource_response_ = std::move(head);
diff --git a/chrome/browser/prefetch/search_prefetch/streaming_search_prefetch_url_loader.h b/chrome/browser/prefetch/search_prefetch/streaming_search_prefetch_url_loader.h index fa9ada9..e57152e 100644 --- a/chrome/browser/prefetch/search_prefetch/streaming_search_prefetch_url_loader.h +++ b/chrome/browser/prefetch/search_prefetch/streaming_search_prefetch_url_loader.h
@@ -133,6 +133,9 @@ // Forwards all queued events to |forwarding_client_|. void RunEventQueue(); + // Marks the parent prefetch request as servable. Called as delayed task. + void MarkPrefetchAsServable(); + // The network URLLoader that fetches the prefetch URL and its receiver. mojo::Remote<network::mojom::URLLoader> network_url_loader_; mojo::Receiver<network::mojom::URLLoaderClient> url_loader_receiver_{this}; @@ -197,6 +200,10 @@ // this callback. base::OnceClosure report_error_callback_; + // Track if the request has already been marked as servable, and if so, don't + // report it again. + bool marked_as_servable_ = false; + raw_ptr<Profile> profile_; net::NetworkTrafficAnnotationTag network_traffic_annotation_;
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc index 254086e1..0daa4ee5 100644 --- a/chrome/browser/prefs/browser_prefs.cc +++ b/chrome/browser/prefs/browser_prefs.cc
@@ -325,6 +325,7 @@ #include "chrome/browser/ash/login/quick_unlock/fingerprint_storage.h" #include "chrome/browser/ash/login/quick_unlock/pin_storage_prefs.h" #include "chrome/browser/ash/login/quick_unlock/quick_unlock_utils.h" +#include "chrome/browser/ash/login/reporting/login_logout_reporter.h" #include "chrome/browser/ash/login/saml/saml_profile_prefs.h" #include "chrome/browser/ash/login/screens/enable_adb_sideloading_screen.h" #include "chrome/browser/ash/login/screens/reset_screen.h" @@ -1075,6 +1076,7 @@ chromeos::local_search_service::SearchMetricsReporter:: RegisterLocalStatePrefs(registry); ash::login::SecurityTokenSessionController::RegisterLocalStatePrefs(registry); + ash::reporting::LoginLogoutReporter::RegisterPrefs(registry); ash::MultiProfileUserController::RegisterPrefs(registry); chromeos::NetworkMetadataStore::RegisterPrefs(registry); ash::NetworkThrottlingObserver::RegisterPrefs(registry);
diff --git a/chrome/browser/prerender/prerender_browsertest.cc b/chrome/browser/prerender/prerender_browsertest.cc index e50ce7b..0e1f51b 100644 --- a/chrome/browser/prerender/prerender_browsertest.cc +++ b/chrome/browser/prerender/prerender_browsertest.cc
@@ -88,14 +88,13 @@ prerender_helper().AddPrerender(prerender_url); // Activate. - content::TestNavigationManager navigation_manager(GetActiveWebContents(), + content::TestActivationManager activation_manager(GetActiveWebContents(), prerender_url); ASSERT_TRUE( content::ExecJs(GetActiveWebContents()->GetMainFrame(), content::JsReplace("location = $1", prerender_url))); - navigation_manager.WaitForNavigationFinished(); - EXPECT_TRUE(navigation_manager.was_prerendered_page_activation()); - EXPECT_TRUE(navigation_manager.was_successful()); + activation_manager.WaitForNavigationFinished(); + EXPECT_TRUE(activation_manager.was_activated()); histogram_tester.ExpectUniqueSample( "Prerender.Experimental.PrerenderHostFinalStatus.SpeculationRule", @@ -124,7 +123,7 @@ *GetActiveWebContents(), prerender_url); // Activate. - content::TestNavigationManager navigation_manager(GetActiveWebContents(), + content::TestActivationManager activation_manager(GetActiveWebContents(), prerender_url); // Simulate a browser-initiated navigation. GetActiveWebContents()->OpenURL(content::OpenURLParams( @@ -132,9 +131,8 @@ ui::PageTransitionFromInt(ui::PAGE_TRANSITION_TYPED | ui::PAGE_TRANSITION_FROM_ADDRESS_BAR), /*is_renderer_initiated=*/false)); - navigation_manager.WaitForNavigationFinished(); - EXPECT_TRUE(navigation_manager.was_prerendered_page_activation()); - EXPECT_TRUE(navigation_manager.was_successful()); + activation_manager.WaitForNavigationFinished(); + EXPECT_TRUE(activation_manager.was_activated()); histogram_tester.ExpectUniqueSample( "Prerender.Experimental.PrerenderHostFinalStatus.Embedder_DirectURLInput",
diff --git a/chrome/browser/privacy_sandbox/privacy_sandbox_service.cc b/chrome/browser/privacy_sandbox/privacy_sandbox_service.cc index b898080c..43a0069c 100644 --- a/chrome/browser/privacy_sandbox/privacy_sandbox_service.cc +++ b/chrome/browser/privacy_sandbox/privacy_sandbox_service.cc
@@ -15,6 +15,7 @@ #include "base/ranges/algorithm.h" #include "base/strings/string_number_conversions.h" #include "base/time/time.h" +#include "chrome/common/webui_url_constants.h" #include "components/content_settings/core/browser/cookie_settings.h" #include "components/content_settings/core/common/pref_names.h" #include "components/prefs/pref_service.h" @@ -33,6 +34,8 @@ namespace { +bool g_dialog_diabled_for_tests = false; + // Returns true iff based on |cookies_settings| & |prefs| third party cookies // are disabled by policy. This includes disabling third party cookies via // disabling all cookies. @@ -200,6 +203,39 @@ } } +// static +bool PrivacySandboxService::IsUrlSuitableForDialog(const GURL& url) { + // about:blank is valid. + if (url.IsAboutBlank()) + return true; + + // Other than about:blank, only chrome:// urls are valid. This check is early + // in processing to immediately exclude most URLs. + if (!url.SchemeIs(content::kChromeUIScheme)) + return false; + + // The welcome page is never valid. + if (url.host() == chrome::kChromeUIWelcomeHost) + return false; + + // The generic new tab is never valid, only NTPs known to be Chrome controlled + // are valid. + if (url.host() == chrome::kChromeUINewTabHost) + return false; + + // All remaining chrome:// pages are considered valid. + return true; +} + +void PrivacySandboxService::DialogOpenedForBrowser(Browser* browser) { + // TODO(crbug.com/1286276): Implement logic to record this and make available + // to the Privacy Sandbox helper. +} + +void PrivacySandboxService::SetDialogDisabledForTests(bool disabled) { + g_dialog_diabled_for_tests = disabled; +} + std::u16string PrivacySandboxService::GetFlocDescriptionForDisplay() const { // TODO(crbug.com/1299720): Remove this and all the UI code which uses it. return l10n_util::GetPluralStringFUTF16( @@ -600,6 +636,10 @@ PrefService* pref_service, profile_metrics::BrowserProfileType profile_type, privacy_sandbox::PrivacySandboxSettings* privacy_sandbox_settings) { + // If the dialog is disabled for testing, never show it. + if (g_dialog_diabled_for_tests) + return DialogType::kNone; + // If the profile isn't a regular profile, no dialog should ever be shown. if (profile_type != profile_metrics::BrowserProfileType::kRegular) return DialogType::kNone;
diff --git a/chrome/browser/privacy_sandbox/privacy_sandbox_service.h b/chrome/browser/privacy_sandbox/privacy_sandbox_service.h index 652b993..0a2d890 100644 --- a/chrome/browser/privacy_sandbox/privacy_sandbox_service.h +++ b/chrome/browser/privacy_sandbox/privacy_sandbox_service.h
@@ -20,6 +20,7 @@ #include "components/sync/driver/sync_service.h" #include "components/sync/driver/sync_service_observer.h" +class Browser; class PrefService; namespace content { @@ -96,7 +97,8 @@ // state of the Privacy Sandbox settings, and the current location of the // user, to determine the appropriate type. This is expected to be called by // UI code locations determining whether a dialog should be shown on startup. - DialogType GetRequiredDialogType(); + // Virtual to allow mocking in tests. + virtual DialogType GetRequiredDialogType(); // Informs the service that |action| occurred with the dialog. This allows // the service to record this information in preferences such that future @@ -106,6 +108,23 @@ // This method is virtual for mocking in tests. virtual void DialogActionOccurred(DialogAction action); + // Returns whether |url| is suitable to display the Privacy Sandbox dialog + // over. Only about:blank and certain chrome:// URLs are considered suitable. + static bool IsUrlSuitableForDialog(const GURL& url); + + // Informs the service that a Privacy Sandbox dialog has been opened for + // |browser|. + // Virtual to allow mocking in tests. + virtual void DialogOpenedForBrowser(Browser* browser); + + // Disables the display of the Privacy Sandbox dialog for testing. When + // |disabled| is true, GetRequiredDialogType() will only ever return that no + // dialog is required. + // NOTE: This is set to true in InProcessBrowserTest::SetUp, disabling the + // dialog for those tests. If you set this outside of that context, you should + // ensure it is reset at the end of your test. + static void SetDialogDisabledForTests(bool disabled); + // Returns a description of FLoC ready for display to the user. Correctly // takes into account the FLoC feature parameters when determining the number // of days between cohort calculations.
diff --git a/chrome/browser/resources/chromeos/accessibility/chromevox/BUILD.gn b/chrome/browser/resources/chromeos/accessibility/chromevox/BUILD.gn index e2837a3..aa8efd4 100644 --- a/chrome/browser/resources/chromeos/accessibility/chromevox/BUILD.gn +++ b/chrome/browser/resources/chromeos/accessibility/chromevox/BUILD.gn
@@ -96,7 +96,6 @@ "injected/loader.js", "injected/script_installer.js", "learn_mode/kbexplorer.js", - "options/options.js", "panel/i_search.js", "panel/panel.js", "panel/panel_menu.js", @@ -133,6 +132,7 @@ "background/pointer_handler.js", "background/smart_sticky_mode.js", "background/logging/log.js", + "options/options.js", ] # Closure library modules needed by chromevox. @@ -194,10 +194,6 @@ "background/earcons/static.wav", "background/logging/log.css", "background/logging/log.html", - "images/chromevox-128.png", - "images/chromevox-16.png", - "images/chromevox-19.png", - "images/chromevox-48.png", "images/chromevox.svg", "images/close-36.png", "images/close-hover-36.png",
diff --git a/chrome/browser/resources/chromeos/accessibility/chromevox/background/background_test.js b/chrome/browser/resources/chromeos/accessibility/chromevox/background/background_test.js index 7339558d2..93b9fbc 100644 --- a/chrome/browser/resources/chromeos/accessibility/chromevox/background/background_test.js +++ b/chrome/browser/resources/chromeos/accessibility/chromevox/background/background_test.js
@@ -4109,3 +4109,20 @@ .replay(); }); }); + +TEST_F('ChromeVoxBackgroundTest', 'GestureOnPopUpButton', function() { + const mockFeedback = this.createMockFeedback(); + const site = ` + <select><option>apple</option><option>banana</option></select> + `; + this.runWithLoadedTree(site, function(root) { + mockFeedback.expectSpeech('Button', 'has pop up') + .call(doGesture(Gesture.CLICK)) + .expectSpeech('Button', 'has pop up', 'Expanded') + .call(doGesture(Gesture.SWIPE_DOWN1)) + .expectSpeech('banana') + .call(doGesture(Gesture.SWIPE_UP1)) + .expectSpeech('apple') + .replay(); + }); +});
diff --git a/chrome/browser/resources/chromeos/accessibility/chromevox/background/gesture_command_handler.js b/chrome/browser/resources/chromeos/accessibility/chromevox/background/gesture_command_handler.js index 66110e0..0bef325e 100644 --- a/chrome/browser/resources/chromeos/accessibility/chromevox/background/gesture_command_handler.js +++ b/chrome/browser/resources/chromeos/accessibility/chromevox/background/gesture_command_handler.js
@@ -90,7 +90,8 @@ let inMenu = false; let node = range.start.node; while (node) { - if (AutomationPredicate.menuItem(node)) { + if (AutomationPredicate.menuItem(node) || + (node.role === RoleType.POP_UP_BUTTON && node.state.expanded)) { inMenu = true; break; }
diff --git a/chrome/browser/resources/chromeos/accessibility/chromevox/images/chromevox-128.png b/chrome/browser/resources/chromeos/accessibility/chromevox/images/chromevox-128.png deleted file mode 100644 index c0b8566..0000000 --- a/chrome/browser/resources/chromeos/accessibility/chromevox/images/chromevox-128.png +++ /dev/null Binary files differ
diff --git a/chrome/browser/resources/chromeos/accessibility/chromevox/images/chromevox-16.png b/chrome/browser/resources/chromeos/accessibility/chromevox/images/chromevox-16.png deleted file mode 100644 index 96239db..0000000 --- a/chrome/browser/resources/chromeos/accessibility/chromevox/images/chromevox-16.png +++ /dev/null Binary files differ
diff --git a/chrome/browser/resources/chromeos/accessibility/chromevox/images/chromevox-19.png b/chrome/browser/resources/chromeos/accessibility/chromevox/images/chromevox-19.png deleted file mode 100644 index 24c8803..0000000 --- a/chrome/browser/resources/chromeos/accessibility/chromevox/images/chromevox-19.png +++ /dev/null Binary files differ
diff --git a/chrome/browser/resources/chromeos/accessibility/chromevox/images/chromevox-48.png b/chrome/browser/resources/chromeos/accessibility/chromevox/images/chromevox-48.png deleted file mode 100644 index a5528c1..0000000 --- a/chrome/browser/resources/chromeos/accessibility/chromevox/images/chromevox-48.png +++ /dev/null Binary files differ
diff --git a/chrome/browser/resources/chromeos/accessibility/chromevox/images/chromevox.svg b/chrome/browser/resources/chromeos/accessibility/chromevox/images/chromevox.svg index 4bd61163..c9eb3aa 100644 --- a/chrome/browser/resources/chromeos/accessibility/chromevox/images/chromevox.svg +++ b/chrome/browser/resources/chromeos/accessibility/chromevox/images/chromevox.svg
@@ -1 +1 @@ -<svg width="96" height="96" viewBox="0 0 96 96" xmlns="http://www.w3.org/2000/svg"><path fill="#f79439" d="M10 0h76q10 0 10 10v76q0 10-10 10H10Q0 96 0 86V10Q0 0 10 0z"/><path fill="#fff" d="M10.11 8.9c8.93-.37 17.87-.35 26.81-.03 3.57 5.7 6.13 11.94 9.32 17.84 1.91 3.52 3.61 7.16 4.93 10.95-3.16 1.96-6.28 3.99-9.39 6.05-.24 3.13-.41 6.26-.63 9.39-4.99 1.4-10.11 2.23-15.18 3.22 4.38 2.25 8.87 4.3 13.12 6.79-.31 6.57-1.05 13.11-2.3 19.56-8.84 1.93-17.79 3.35-26.7 4.92-.11-26.22-.27-52.46.02-78.69zm58.23 7.08c14.49 9.59 19.97 29.57 14.3 45.69-2.66 7.88-8 14.67-14.69 19.54-1.43-1.94-2.81-3.9-4.16-5.89 3.56-3.63 7.36-7.19 9.76-11.73 5.27-9.68 4.96-22.07-.6-31.56-2.33-3.95-5.75-7.09-8.88-10.4 1.41-1.89 2.83-3.77 4.27-5.65z"/><path fill="#fff" d="M55.94 30.88c1.52-1.65 3.05-3.28 4.62-4.88 6.36 5.18 11.08 12.76 11.2 21.14.61 9.27-4.12 18.39-11.75 23.58-1.33-1.76-2.65-3.52-3.96-5.29 4.63-4.65 9.11-10.38 8.7-17.35.33-6.96-4.53-12.34-8.81-17.2z"/></svg> \ No newline at end of file +<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M18 10C18 14.4183 14.4183 18 10 18C5.58172 18 2 14.4183 2 10C2 5.58172 5.58172 2 10 2C14.4183 2 18 5.58172 18 10ZM12.6649 6.45129C12.4061 6.70997 12.1539 6.97349 11.9034 7.24024L11.9419 7.28316C12.6377 8.05766 13.4089 8.9162 13.3555 10.021C13.4231 11.1478 12.6847 12.0742 11.9215 12.826C12.1374 13.1121 12.355 13.3966 12.5742 13.6812C13.8318 12.8421 14.6115 11.3677 14.5109 9.869C14.4912 8.51421 13.7132 7.28875 12.6649 6.45129ZM16.4369 11.8007C16.0199 13.2587 15.1013 14.5109 13.8751 15.3668C13.6422 15.0565 13.4173 14.7431 13.1973 14.4249C13.265 14.3572 13.3332 14.2896 13.4016 14.222C13.9255 13.7031 14.456 13.1778 14.806 12.5285C15.6746 10.9636 15.6235 8.96048 14.7071 7.42623C14.398 6.91226 13.9725 6.48312 13.5492 6.05621C13.4466 5.9527 13.3441 5.84928 13.2434 5.74486C13.4758 5.4393 13.7099 5.13536 13.9472 4.83142C16.2095 6.30004 17.1394 9.27583 16.4369 11.8007ZM8.76834 3.6819C8.65865 3.67805 8.54334 3.67287 8.42323 3.66663C5.50187 4.36467 3.33331 6.94817 3.33331 10.0285C3.33331 12.686 4.94749 14.9738 7.26665 16C7.81355 15.8425 8.32371 15.7038 8.74691 15.6132C8.95295 14.5704 9.07492 13.5131 9.12601 12.4509C8.64468 12.1743 8.14468 11.9313 7.64471 11.6883C7.41704 11.5776 7.18938 11.467 6.96349 11.3532C7.14882 11.3177 7.33455 11.2834 7.52037 11.2492C8.17242 11.129 8.82547 11.0087 9.46555 10.8326C9.48066 10.6217 9.49434 10.4109 9.50802 10.2001C9.52717 9.90487 9.54632 9.60968 9.5694 9.31449C10.082 8.98145 10.5963 8.65326 11.1171 8.33638C10.8995 7.72365 10.6193 7.13517 10.3045 6.56609C10.1023 6.19924 9.91543 5.82425 9.72855 5.44922C9.42953 4.84915 9.13046 4.24899 8.76834 3.6819Z" fill="white"/></svg>
diff --git a/chrome/browser/resources/chromeos/accessibility/chromevox/options/options.html b/chrome/browser/resources/chromeos/accessibility/chromevox/options/options.html index d4ddd28..033c15d2 100644 --- a/chrome/browser/resources/chromeos/accessibility/chromevox/options/options.html +++ b/chrome/browser/resources/chromeos/accessibility/chromevox/options/options.html
@@ -12,6 +12,8 @@ <script type="text/javascript" src="options_loader.js"></script> <script type="text/javascript" src="../chromeVoxChromeOptionsScript.js"> </script> +<script type="module" src="options.js"></script> + <script type="module" src="chrome://resources/cr_elements/cr_expand_button/cr_expand_button.m.js"> </script>
diff --git a/chrome/browser/resources/chromeos/accessibility/chromevox/options/options.js b/chrome/browser/resources/chromeos/accessibility/chromevox/options/options.js index fc073e0..b0ff81db 100644 --- a/chrome/browser/resources/chromeos/accessibility/chromevox/options/options.js +++ b/chrome/browser/resources/chromeos/accessibility/chromevox/options/options.js
@@ -7,21 +7,6 @@ * */ -goog.provide('OptionsPage'); - -goog.require('AbstractTts'); -goog.require('BluetoothBrailleDisplayUI'); -goog.require('ConsoleTts'); -goog.require('Msgs'); -goog.require('PanelCommand'); -goog.require('TtsBackground'); -goog.require('BrailleTable'); -goog.require('BrailleTranslatorManager'); -goog.require('ChromeVox'); -goog.require('ChromeVoxKbHandler'); -goog.require('ChromeVoxPrefs'); -goog.require('ExtensionBridge'); - /** @const {string} */ const GOOGLE_TTS_EXTENSION_ID = 'gjjabgpgjpampikjhjpfhneeoapjbjaf'; @@ -31,9 +16,7 @@ /** * Class to manage the options page. */ -OptionsPage = class { - constructor() {} - +export class OptionsPage { /** * Initialize the options page by setting the current value of all prefs, and * adding event listeners. @@ -517,7 +500,7 @@ static getBrailleTranslatorManager() { return chrome.extension.getBackgroundPage()['braille_translator_manager']; } -}; +} /** * The ChromeVoxPrefs object.
diff --git a/chrome/browser/resources/chromeos/accessibility/chromevox/options/options_loader.js b/chrome/browser/resources/chromeos/accessibility/chromevox/options/options_loader.js index 0f7c5f58..0c70d878 100644 --- a/chrome/browser/resources/chromeos/accessibility/chromevox/options/options_loader.js +++ b/chrome/browser/resources/chromeos/accessibility/chromevox/options/options_loader.js
@@ -6,4 +6,15 @@ * @fileoverview Loads the options script. */ -goog.require('OptionsPage'); +goog.require('AbstractTts'); +goog.require('BluetoothBrailleDisplayUI'); +goog.require('ConsoleTts'); +goog.require('Msgs'); +goog.require('PanelCommand'); +goog.require('TtsBackground'); +goog.require('BrailleTable'); +goog.require('BrailleTranslatorManager'); +goog.require('ChromeVox'); +goog.require('ChromeVoxKbHandler'); +goog.require('ChromeVoxPrefs'); +goog.require('ExtensionBridge');
diff --git a/chrome/browser/resources/chromeos/accessibility/chromevox/panel/panel.css b/chrome/browser/resources/chromeos/accessibility/chromevox/panel/panel.css index 8d40832..b2d217cd 100644 --- a/chrome/browser/resources/chromeos/accessibility/chromevox/panel/panel.css +++ b/chrome/browser/resources/chromeos/accessibility/chromevox/panel/panel.css
@@ -261,7 +261,7 @@ .menu-item.hover, .menu-item:focus { background-color: rgb(246, 145, 57); - color: #fff; + color: black; } .menu-item-title {
diff --git a/chrome/browser/resources/chromeos/accessibility/chromevox/panel/panel.html b/chrome/browser/resources/chromeos/accessibility/chromevox/panel/panel.html index e28b65c..14b649b 100644 --- a/chrome/browser/resources/chromeos/accessibility/chromevox/panel/panel.html +++ b/chrome/browser/resources/chromeos/accessibility/chromevox/panel/panel.html
@@ -15,7 +15,7 @@ <div id="main"> <div hidden id="menus_title" class="i18n" msgid="menus_title"></div> <button id="menus_button" aria-labelledby="menus_title"> - <img id="chromevox" src="/chromevox/images/chromevox-19.png"> + <img id="chromevox" src="/chromevox/images/chromevox.svg"> <img id="triangle" src="/chromevox/images/triangle-6.png"> </button> <div id="caption">
diff --git a/chrome/browser/resources/chromeos/accessibility/chromevox_manifest.json.jinja2 b/chrome/browser/resources/chromeos/accessibility/chromevox_manifest.json.jinja2 index 9df4557d..58b74dd0 100644 --- a/chrome/browser/resources/chromeos/accessibility/chromevox_manifest.json.jinja2 +++ b/chrome/browser/resources/chromeos/accessibility/chromevox_manifest.json.jinja2
@@ -61,11 +61,6 @@ }, "options_page": "chromevox/options/options.html", "default_locale": "en", - "icons": { - "16": "chromevox/images/chromevox-16.png", - "48": "chromevox/images/chromevox-48.png", - "128": "chromevox/images/chromevox-128.png" - }, "content_security_policy": "default-src 'none'; script-src 'self' 'wasm-eval' chrome://resources; style-src 'unsafe-inline' chrome://resources;", "externally_connectable": { "ids": [
diff --git a/chrome/browser/resources/chromeos/accessibility/strings/accessibility_strings.gni b/chrome/browser/resources/chromeos/accessibility/strings/accessibility_strings.gni index a8a4e3e..ffe1932 100644 --- a/chrome/browser/resources/chromeos/accessibility/strings/accessibility_strings.gni +++ b/chrome/browser/resources/chromeos/accessibility/strings/accessibility_strings.gni
@@ -8,7 +8,7 @@ # Same as the locales list but in the format the extension system expects: # it uses underscores instead of hyphens, and "en" instead of "en-US". -# Very similar to locales_as_mac_outputs, except pseudolocales are not included. +# Very similar to locales_as_apple_outputs, except pseudolocales are not included. accessibility_locales = [] foreach(locale, locales_without_pseudolocales) { if (locale == "en-US") {
diff --git a/chrome/browser/resources/history/history.gni b/chrome/browser/resources/history/history.gni index a92d056..635bde3 100644 --- a/chrome/browser/resources/history/history.gni +++ b/chrome/browser/resources/history/history.gni
@@ -9,7 +9,6 @@ "history_clusters/clusters.ts", "history_clusters/page_favicon.ts", "history_clusters/search_query.ts", - "history_clusters/top_visit.ts", "history_clusters/url_visit.ts", "history_item.ts", "history_list.ts",
diff --git a/chrome/browser/resources/history/history_clusters/cluster.html b/chrome/browser/resources/history/history_clusters/cluster.html index a56c1ee..646a2f05 100644 --- a/chrome/browser/resources/history/history_clusters/cluster.html +++ b/chrome/browser/resources/history/history_clusters/cluster.html
@@ -1,18 +1,133 @@ -<style> +<style include="history-clusters-shared-style cr-icons"> :host { + --indentation: 52px; + --search-query-margin: 10px; display: block; - outline: none; + /* Implements the spacing between containers. */ padding-bottom: var(--cluster-padding-vertical); } - /* Puts the blue ring around the card itself instead of the whole host. */ - :host-context(.focus-outline-visible):host(:focus) top-visit { + :host-context(.focus-outline-visible):host(:focus) #container { box-shadow: inset 0 0 0 2px var(--cr-focus-outline-color); } + + :host([has-hidden-related-visits_]) #container { + /* For containers with a "Show More" button, add some additional spacing for + the pill button by adding a margin on the container. */ + margin-bottom: var(--cluster-padding-vertical); + } + + /* We need an inner container div to apply spacing between clusters. This is + because iron-list ignores the margin on the host element. */ + #container { + background-color: var(--cr-card-background-color); + border-radius: var(--cr-card-border-radius); + box-shadow: var(--cr-card-shadow); + padding: var(--cluster-padding-vertical) 0; + } + + #cluster-label { + color: var(--cr-secondary-text-color); + font-weight: 500; + padding: 4px var(--cluster-padding-horizontal); + } + + #related-searches { + padding: var(--cluster-padding-vertical) var(--cluster-padding-horizontal); + } + + #related-searches-label { + color: var(--cr-secondary-text-color); + font-weight: 500; + } + + #search-queries { + display: flex; + flex-wrap: wrap; + min-width: 0; + } + + search-query { + margin-top: var(--search-query-margin); + } + + search-query:not(:last-of-type) { + margin-inline-end: var(--search-query-margin); + } + + #visibility-toggle { + align-items: center; + display: flex; + flex-direction: column; + margin-top: var(--cluster-padding-vertical); + position: relative; + } + + #toggle-button { + --pill-padding-icon: 60px; + --pill-padding-text: 64px; + align-items: center; + background-color: var(--grey-fill-color); + cursor: pointer; + display: flex; + outline: none; + position: absolute; + top: calc(var(--cluster-padding-vertical) - var(--pill-height) / 2); + } + + :host-context(.focus-outline-visible) #toggle-button:focus { + box-shadow: inset 0 0 0 2px var(--cr-focus-outline-color); + } + + #toggle-button .icon { + --cr-icon-button-margin-start: 0; + --cr-icon-color: var(--icon-color); + --cr-icon-ripple-margin: 0; + --cr-icon-ripple-size: 20px; + transition: transform 300ms; + } + + :host([expanded_]) #toggle-button .icon { + transform: rotate(180deg); + } </style> -<top-visit visit="[[cluster.visit]]" cluster-index="[[index]]" - cluster-label="[[cluster.label]]" - on-related-search-clicked="onRelatedSearchClicked_" - on-related-visits-visibility-toggled="onRelatedVisitsVisibilityToggled_" - on-visit-clicked="onVisitClicked_"> -</top-visit> +<div id="container" on-visit-clicked="onVisitClicked_"> + <div id="cluster-label">[[cluster.label]]</div> + <url-visit visit="[[cluster.visit]]" cluster-index="[[index]]" index="0" + is-top-visit$="[[!cluster.label]]" show-menu> + </url-visit> + <template is="dom-repeat" items="[[visibleRelatedVisits_]]"> + <url-visit visit="[[item]]" cluster-index="[[index]]" + index="[[getVisitIndex_(item, cluster.visit.relatedVisits.*)]]" + indented$="[[!cluster.label]]"> + </url-visit> + </template> + <!-- Disable animation on iron-collapse, as the parent iron-list can't + easily handle it. --> + <iron-collapse opened="[[expanded_]]" no-animation> + <template is="dom-repeat" items="[[hiddenRelatedVisits_]]"> + <url-visit visit="[[item]]" cluster-index="[[index]]" + index="[[getVisitIndex_(item, cluster.visit.relatedVisits.*)]]" + indented$="[[!cluster.label]]"> + </url-visit> + </template> + </iron-collapse> + <div id="related-searches" hidden="[[!cluster.visit.relatedSearches.length]]"> + <div id="related-searches-label">$i18n{relatedSearchesHeader}</div> + <div id="search-queries" role="list" + aria-labelledby="related-searches-label" + on-related-search-clicked="onRelatedSearchClicked_"> + <template is="dom-repeat" items="[[cluster.visit.relatedSearches]]"> + <search-query search-query="[[item]]" index="[[index]]" role="listitem"> + </search-query> + </template> + </div> + </div> + <div id="visibility-toggle" hidden="[[!hasHiddenRelatedVisits_]]"> + <div id="toggle-button" class="pill pill-icon-end" tabindex="0" + on-click="onToggleButtonClick_" on-keydown="onToggleButtonKeyDown_"> + <span>[[getToggleButtonLabel_(expanded_)]]</span> + <span id="toggle-icon" class="icon cr-icon icon-expand-more"></span> + </div> + </div> +</div>
diff --git a/chrome/browser/resources/history/history_clusters/cluster.ts b/chrome/browser/resources/history/history_clusters/cluster.ts index b41aea5..75d7d88 100644 --- a/chrome/browser/resources/history/history_clusters/cluster.ts +++ b/chrome/browser/resources/history/history_clusters/cluster.ts
@@ -2,11 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import './page_favicon.js'; +import './search_query.js'; +import './shared_style.js'; import './shared_vars.js'; -import './top_visit.js'; +import './url_visit.js'; +import 'chrome://resources/cr_elements/cr_icons_css.m.js'; +import 'chrome://resources/polymer/v3_0/iron-collapse/iron-collapse.js'; import {assert} from 'chrome://resources/js/assert_ts.js'; +import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js'; import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import {BrowserProxyImpl} from './browser_proxy.js'; @@ -47,6 +51,40 @@ * The cluster displayed by this element. */ cluster: Object, + + /** + * Whether the default-hidden related visits are visible. + */ + expanded_: { + type: Boolean, + reflectToAttribute: true, + value: false, + }, + + /** + * Whether there are default-hidden related visits. + */ + hasHiddenRelatedVisits_: { + type: Boolean, + computed: `computeHasHiddenRelatedVisits_(hiddenRelatedVisits_)`, + reflectToAttribute: true, + }, + + /** + * The default-hidden related visits. + */ + hiddenRelatedVisits_: { + type: Object, + computed: `computeHiddenRelatedVisits_(cluster.visit.relatedVisits.*)`, + }, + + /** + * The always-visible related visits. + */ + visibleRelatedVisits_: { + type: Object, + computed: `computeVisibleRelatedVisits_(cluster.visit.relatedVisits.*)`, + }, }; } @@ -58,6 +96,8 @@ index: number; private callbackRouter_: PageCallbackRouter; private onVisitsRemovedListenerId_: number|null = null; + private expanded_: boolean; + private hiddenRelatedVisits_: Array<URLVisit>; //============================================================================ // Overridden methods @@ -96,16 +136,37 @@ ClusterAction.RELATED_SEARCH_CLICKED, this.index); } - private onRelatedVisitsVisibilityToggled_() { - MetricsProxyImpl.getInstance().recordClusterAction( - ClusterAction.RELATED_VISITS_VISIBILITY_TOGGLED, this.index); - } - private onVisitClicked_() { MetricsProxyImpl.getInstance().recordClusterAction( ClusterAction.VISIT_CLICKED, this.index); } + private onToggleButtonKeyDown_(e: KeyboardEvent) { + if (e.key !== 'Enter' && e.key !== ' ') { + return; + } + + e.stopPropagation(); + e.preventDefault(); + + this.onToggleButtonClick_(); + } + + private onToggleButtonClick_() { + this.expanded_ = !this.expanded_; + + MetricsProxyImpl.getInstance().recordClusterAction( + ClusterAction.RELATED_VISITS_VISIBILITY_TOGGLED, this.index); + + // Dispatch an event to notify the parent elements of a resize. Note that + // this simple solution only works because the child iron-collapse has + // animations disabled. Otherwise, it gets an incorrect mid-animation size. + this.dispatchEvent(new CustomEvent('iron-resize', { + bubbles: true, + composed: true, + })); + } + //============================================================================ // Helper methods //============================================================================ @@ -155,6 +216,39 @@ composed: true, })); } + + private computeHasHiddenRelatedVisits_(): boolean { + return this.hiddenRelatedVisits_.length > 0; + } + + private computeHiddenRelatedVisits_(): Array<URLVisit> { + return this.cluster.visit.relatedVisits.filter((visit: URLVisit) => { + return visit.belowTheFold; + }); + } + + private computeVisibleRelatedVisits_(): Array<URLVisit> { + return this.cluster.visit.relatedVisits.filter((visit: URLVisit) => { + return !visit.belowTheFold; + }); + } + + /** + * Returns the label of the toggle button based on whether the default-hidden + * related visits are visible. + */ + private getToggleButtonLabel_(_expanded: boolean): string { + return loadTimeData.getString( + this.expanded_ ? 'toggleButtonLabelLess' : 'toggleButtonLabelMore'); + } + + /** + * Returns the index of `relatedVisit` among the visits in the cluster. + */ + private getVisitIndex_(relatedVisit: URLVisit): number { + // Index 0 represents the top visit. + return this.cluster.visit.relatedVisits.indexOf(relatedVisit) + 1; + } } customElements.define(HistoryClusterElement.is, HistoryClusterElement);
diff --git a/chrome/browser/resources/history/history_clusters/top_visit.html b/chrome/browser/resources/history/history_clusters/top_visit.html deleted file mode 100644 index eee78d0..0000000 --- a/chrome/browser/resources/history/history_clusters/top_visit.html +++ /dev/null
@@ -1,116 +0,0 @@ -<style include="history-clusters-shared-style cr-icons"> - :host { - --indentation: 52px; - --search-query-margin: 10px; - background-color: var(--cr-card-background-color); - border-radius: var(--cr-card-border-radius); - box-shadow: var(--cr-card-shadow); - display: block; - padding: var(--cluster-padding-vertical) 0; - } - - :host([has-hidden-related-visits_]) { - margin-bottom: var(--cluster-padding-vertical); - } - - #cluster-label { - color: var(--cr-secondary-text-color); - font-weight: 500; - padding: 4px var(--cluster-padding-horizontal); - } - - #related-searches { - padding: var(--cluster-padding-vertical) var(--cluster-padding-horizontal); - } - - #related-searches-label { - color: var(--cr-secondary-text-color); - font-weight: 500; - } - - #search-queries { - display: flex; - flex-wrap: wrap; - min-width: 0; - } - - search-query { - margin-top: var(--search-query-margin); - } - - search-query:not(:last-of-type) { - margin-inline-end: var(--search-query-margin); - } - - #visibility-toggle { - align-items: center; - display: flex; - flex-direction: column; - margin-top: var(--cluster-padding-vertical); - position: relative; - } - - #toggle-button { - --pill-padding-icon: 60px; - --pill-padding-text: 64px; - align-items: center; - background-color: var(--grey-fill-color); - cursor: pointer; - display: flex; - outline: none; - position: absolute; - top: calc(var(--cluster-padding-vertical) - var(--pill-height) / 2); - } - - :host-context(.focus-outline-visible) #toggle-button:focus { - box-shadow: inset 0 0 0 2px var(--cr-focus-outline-color); - } - - #toggle-button .icon { - --cr-icon-button-margin-start: 0; - --cr-icon-color: var(--icon-color); - --cr-icon-ripple-margin: 0; - --cr-icon-ripple-size: 20px; - transition: transform 300ms; - } - - :host([expanded_]) #toggle-button .icon { - transform: rotate(180deg); - } -</style> -<div id="cluster-label">[[clusterLabel]]</div> -<url-visit visit="[[visit]]" cluster-index="[[clusterIndex]]" index="0" - is-top-visit$="[[!clusterLabel]]" show-menu> -</url-visit> -<template is="dom-repeat" items="[[visibleRelatedVisits_]]"> - <url-visit visit="[[item]]" cluster-index="[[clusterIndex]]" - index="[[getVisitIndex_(item, visit.relatedVisits.*)]]" - indented$="[[!clusterLabel]]"> - </url-visit> -</template> -<!-- Disable animation on iron-collapse, as the parent iron-list can't - easily handle it. --> -<iron-collapse opened="[[expanded_]]" no-animation> - <template is="dom-repeat" items="[[hiddenRelatedVisits_]]"> - <url-visit visit="[[item]]" cluster-index="[[clusterIndex]]" - index="[[getVisitIndex_(item, visit.relatedVisits.*)]]" - indented$="[[!clusterLabel]]"> - </url-visit> - </template> -</iron-collapse> -<div id="related-searches" hidden="[[!visit.relatedSearches.length]]"> - <div id="related-searches-label">$i18n{relatedSearchesHeader}</div> - <div id="search-queries" role="list" aria-labelledby="related-searches-label"> - <template is="dom-repeat" items="[[visit.relatedSearches]]"> - <search-query search-query="[[item]]" index="[[index]]" role="listitem"> - </search-query> - </template> - </div> -</div> -<div id="visibility-toggle" hidden="[[!hasHiddenRelatedVisits_]]"> - <div id="toggle-button" class="pill pill-icon-end" tabindex="0" - on-click="onToggleButtonClick_" on-keydown="onToggleButtonKeyDown_"> - <span>[[getToggleButtonLabel_(expanded_)]]</span> - <span id="toggle-icon" class="icon cr-icon icon-expand-more"></span> - </div> -</div>
diff --git a/chrome/browser/resources/history/history_clusters/top_visit.ts b/chrome/browser/resources/history/history_clusters/top_visit.ts deleted file mode 100644 index 36f19bd..0000000 --- a/chrome/browser/resources/history/history_clusters/top_visit.ts +++ /dev/null
@@ -1,174 +0,0 @@ -// Copyright 2021 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import './search_query.js'; -import './shared_style.js'; -import './url_visit.js'; -import 'chrome://resources/cr_elements/cr_icons_css.m.js'; -import 'chrome://resources/polymer/v3_0/iron-collapse/iron-collapse.js'; - -import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js'; -import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; - -import {URLVisit} from './history_clusters.mojom-webui.js'; -import {getTemplate} from './top_visit.html.js'; - -/** - * @fileoverview This file provides a custom element displaying a top visit - * within a cluster. A top visit is a featured, i.e., visible, visit with an - * optional set of related visits which are not visible by default. - */ - -declare global { - interface HTMLElementTagNameMap { - 'top-visit': TopVisitElement; - } -} - -class TopVisitElement extends PolymerElement { - static get is() { - return 'top-visit'; - } - - static get template() { - return getTemplate(); - } - - static get properties() { - return { - /** - * The index of the cluster this visit belongs to. - */ - clusterIndex: { - type: Number, - value: -1, // Initialized to an invalid value. - }, - - /** - * The top visit to display - */ - visit: Object, - - /** - * The label for the whole cluster to display above this top-visit. - * It's in this element because <top-visit> is actually the card element. - */ - clusterLabel: String, - - /** - * Whether the default-hidden related visits are visible. - */ - expanded_: { - type: Boolean, - reflectToAttribute: true, - value: false, - }, - - /** - * Whether there are default-hidden related visits. - */ - hasHiddenRelatedVisits_: { - type: Boolean, - computed: `computeHasHiddenRelatedVisits_(hiddenRelatedVisits_)`, - reflectToAttribute: true, - }, - - /** - * The default-hidden related visits. - */ - hiddenRelatedVisits_: { - type: Object, - computed: `computeHiddenRelatedVisits_(visit.relatedVisits.*)`, - }, - - /** - * The always-visible related visits. - */ - visibleRelatedVisits_: { - type: Object, - computed: `computeVisibleRelatedVisits_(visit.relatedVisits.*)`, - }, - }; - } - - //============================================================================ - // Properties - //============================================================================ - - visit: URLVisit; - private expanded_: boolean; - private hiddenRelatedVisits_: Array<URLVisit>; - - //============================================================================ - // Event handlers - //============================================================================ - - private onToggleButtonKeyDown_(e: KeyboardEvent) { - if (e.key !== 'Enter' && e.key !== ' ') { - return; - } - - e.stopPropagation(); - e.preventDefault(); - - this.onToggleButtonClick_(); - } - - private onToggleButtonClick_() { - this.expanded_ = !this.expanded_; - - // Notify the parent <history-cluster> element of this event. - this.dispatchEvent(new CustomEvent('related-visits-visibility-toggled', { - bubbles: true, - composed: true, - })); - - // Dispatch an event to notify the parent elements of a resize. Note that - // this simple solution only works because the child iron-collapse has - // animations disabled. Otherwise, it gets an incorrect mid-animation size. - this.dispatchEvent(new CustomEvent('iron-resize', { - bubbles: true, - composed: true, - })); - } - - //============================================================================ - // Helper methods - //============================================================================ - - private computeHasHiddenRelatedVisits_(): boolean { - return this.hiddenRelatedVisits_.length > 0; - } - - private computeHiddenRelatedVisits_(): Array<URLVisit> { - return this.visit.relatedVisits.filter((visit: URLVisit) => { - return visit.belowTheFold; - }); - } - - private computeVisibleRelatedVisits_(): Array<URLVisit> { - return this.visit.relatedVisits.filter((visit: URLVisit) => { - return !visit.belowTheFold; - }); - } - - /** - * Returns the label of the toggle button based on whether the default-hidden - * related visits are visible. - */ - private getToggleButtonLabel_(_expanded: boolean): string { - return loadTimeData.getString( - this.expanded_ ? 'toggleButtonLabelLess' : 'toggleButtonLabelMore'); - } - - /** - * Returns the index of `relatedVisit` among the visits in the cluster. - */ - private getVisitIndex_(relatedVisit: URLVisit): number { - // Index 0 represents the top visit. - return this.visit.relatedVisits.indexOf(relatedVisit) + 1; - } -} - -customElements.define(TopVisitElement.is, TopVisitElement);
diff --git a/chrome/browser/resources/pdf/browser_api.ts b/chrome/browser/resources/pdf/browser_api.ts index 1d5eb7a..70ae97f 100644 --- a/chrome/browser/resources/pdf/browser_api.ts +++ b/chrome/browser/resources/pdf/browser_api.ts
@@ -116,9 +116,9 @@ /** * Sets the browser zoom. - * @param {number} zoom The zoom factor to send to the browser. - * @return {Promise} A promise that will be resolved when the browser zoom - * has been updated. + * @param zoom The zoom factor to send to the browser. + * @return A promise that will be resolved when the browser zoom has been + * updated. */ setZoom(zoom: number): Promise<void> { assert( @@ -243,10 +243,9 @@ } /** - * @return {!Promise<!BrowserApi>} A promise to a BrowserApi instance for the - * current environment. + * @return A promise to a BrowserApi instance for the current environment. */ -export function createBrowserApi() { +export function createBrowserApi(): Promise<BrowserApi> { if (location.origin === 'chrome://print') { return createBrowserApiForPrintPreview(); }
diff --git a/chrome/browser/resources/pdf/constants.ts b/chrome/browser/resources/pdf/constants.ts index 9cbf6b5..925f2fc 100644 --- a/chrome/browser/resources/pdf/constants.ts +++ b/chrome/browser/resources/pdf/constants.ts
@@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {MessageData} from './controller.js'; - export type Attachment = { name: string, size: number, @@ -60,10 +58,6 @@ y: number, }; -// TODO(crbug.com/1260303): Move this to controller.js when it is migrtaed to -// TypeScript. -export type KeyEventData = MessageData&{keyEvent: Object}; - export type ExtendedKeyEvent = KeyboardEvent&{ fromScriptingAPI?: boolean, fromPlugin?: boolean,
diff --git a/chrome/browser/resources/pdf/controller.js b/chrome/browser/resources/pdf/controller.js deleted file mode 100644 index c4a9dcb..0000000 --- a/chrome/browser/resources/pdf/controller.js +++ /dev/null
@@ -1,654 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import {assert} from 'chrome://resources/js/assert.m.js'; -import {NativeEventTarget as EventTarget} from 'chrome://resources/js/cr/event_target.m.js'; -import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js'; -import {PromiseResolver} from 'chrome://resources/js/promise_resolver.m.js'; - -import {NamedDestinationMessageData, Point, SaveRequestType} from './constants.js'; -import {Gesture} from './gesture_detector.js'; -import {UnseasonedPdfPluginElement} from './internal_plugin.js'; -import {PartialPoint, PinchPhase, Viewport} from './viewport.js'; - -/** @typedef {{type: string, messageId: (string|undefined)}} */ -export let MessageData; - -/** - * @typedef {{ - * type: string, - * dataToSave: ArrayBuffer, - * messageId: string, - * }} - */ -let SaveAttachmentMessageData; - -/** - * @typedef {{ - * dataToSave: Array, - * token: string, - * fileName: string - * }} - */ -let SaveDataMessageData; - -/** - * @typedef {{ - * type: string, - * url: string, - * grayscale: boolean, - * modifiable: boolean, - * pageNumbers: !Array<number> - * }} - */ -export let PrintPreviewParams; - -/** - * @typedef {{ - * imageData: !ArrayBuffer, - * width: number, - * height: number, - * }} - */ -let ThumbnailMessageData; - -/** - * Creates a cryptographically secure pseudorandom 128-bit token. - * @return {string} The generated token as a hex string. - */ -function createToken() { - const randomBytes = new Uint8Array(16); - window.crypto.getRandomValues(randomBytes); - return Array.from(randomBytes, b => b.toString(16).padStart(2, '0')).join(''); -} - -/** @interface */ -export class ContentController { - constructor() {} - - /** @return {!EventTarget} */ - getEventTarget() {} - - /** @return {boolean} */ - get isActive() {} - - /** @param {boolean} isActive */ - set isActive(isActive) {} - - beforeZoom() {} - - afterZoom() {} - - viewportChanged() {} - - rotateClockwise() {} - - rotateCounterclockwise() {} - - /** @param {boolean} displayAnnotations */ - setDisplayAnnotations(displayAnnotations) {} - - /** @param {boolean} enableTwoUpView */ - setTwoUpView(enableTwoUpView) {} - - /** Triggers printing of the current document. */ - print() {} - - /** Undo an edit action. */ - undo() {} - - /** Redo an edit action. */ - redo() {} - - /** - * Requests that the current document be saved. - * @param {!SaveRequestType} requestType The type of save request. If - * ANNOTATION, a response is required, otherwise the controller may save - * the document to disk internally. - * @return {!Promise<!{fileName: string, dataToSave: !ArrayBuffer}>} - */ - save(requestType) {} - - /** - * Requests that the attachment at a certain index be saved. - * @param {number} index The index of the attachment to be saved. - * @return {!Promise<!SaveAttachmentMessageData>} - * @abstract - */ - saveAttachment(index) {} - - /** - * Loads PDF document from `data` activates UI. - * @param {string} fileName - * @param {!ArrayBuffer} data - * @return {!Promise<void>} - */ - load(fileName, data) {} - - /** Unloads the current document and removes the UI. */ - unload() {} -} - -/** - * Event types dispatched by the plugin controller. - * @enum {string} - */ -export const PluginControllerEventType = { - IS_ACTIVE_CHANGED: 'PluginControllerEventType.IS_ACTIVE_CHANGED', - PLUGIN_MESSAGE: 'PluginControllerEventType.PLUGIN_MESSAGE', -}; - -/** - * PDF plugin controller singleton, responsible for communicating with the - * embedded plugin element. Dispatches a - * `PluginControllerEventType.PLUGIN_MESSAGE` event containing the message from - * the plugin, if a message type not handled by this controller is received. - * @implements {ContentController} - */ -export class PluginController { - constructor() { - /** @private {!EventTarget} */ - this.eventTarget_ = new EventTarget(); - - /** @private {boolean} */ - this.isActive_ = false; - - /** @private {!HTMLEmbedElement} */ - this.plugin_; - - /** @private {?UnseasonedPdfPluginElement} */ - this.unseasonedPlugin_ = null; - - /** @private {?Array} */ - this.unseasonedDelayedMessages_ = null; - - /** @private {!Viewport} */ - this.viewport_; - - /** @private {!function():boolean} */ - this.getIsUserInitiatedCallback_; - - /** @private {!function():?Promise} */ - this.getLoadedCallback_; - - /** @private {!Map<string, PromiseResolver>} */ - this.pendingTokens_; - - /** @private {!Map<string, !PromiseResolver>} */ - this.requestResolverMap_; - - /** - * Counter for use with createUid - * @private {number} - */ - this.uidCounter_ = 1; - } - - /** - * @param {!HTMLEmbedElement} plugin - * @param {!Viewport} viewport - * @param {function():boolean} getIsUserInitiatedCallback - * @param {function():?Promise} getLoadedCallback - */ - init(plugin, viewport, getIsUserInitiatedCallback, getLoadedCallback) { - this.plugin_ = plugin; - this.viewport_ = viewport; - this.getIsUserInitiatedCallback_ = getIsUserInitiatedCallback; - this.getLoadedCallback_ = getLoadedCallback; - this.pendingTokens_ = new Map(); - this.requestResolverMap_ = new Map(); - - this.viewport_.setContent(this.plugin_); - this.plugin_.addEventListener( - 'message', e => this.handlePluginMessage_(e), false); - if (!this.plugin_.postMessage) { - this.unseasonedPlugin_ = - /** @type {!UnseasonedPdfPluginElement} */ (this.plugin_); - this.unseasonedDelayedMessages_ = []; - - this.unseasonedPlugin_.postMessage = - /** - * @param {*} message - * @param {!Array<!Transferable>=} transfer - */ - (message, transfer) => { - this.unseasonedDelayedMessages_.push({message, transfer}); - }; - - this.viewport_.setRemoteContent(this.unseasonedPlugin_); - } - } - - /** - * override - * Note: Not using @override because it breaks TypeScript. - * @return {boolean} - */ - get isActive() { - // Check whether `plugin_` is defined as a signal that `init()` was called. - return !!this.plugin_ && this.isActive_; - } - - /** - * override - * @param {boolean} isActive - */ - set isActive(isActive) { - const wasActive = this.isActive; - this.isActive_ = isActive; - if (this.isActive === wasActive) { - return; - } - - this.eventTarget_.dispatchEvent(new CustomEvent( - PluginControllerEventType.IS_ACTIVE_CHANGED, {detail: this.isActive})); - } - - /** - * @return {number} A new unique ID. - * @private - */ - createUid_() { - return this.uidCounter_++; - } - - /** - * override - * @return {!EventTarget} - */ - getEventTarget() { - return this.eventTarget_; - } - - /** - * @param {number} x - * @param {number} y - */ - updateScroll(x, y) { - if (this.unseasonedPlugin_) { - // Ignore "local" scroll events in unseasoned mode, as these are synthetic - // events generated by the remote scrolling implementation. - return; - } - - this.postMessage_({type: 'updateScroll', x, y}); - } - - viewportChanged() {} - - redo() {} - - undo() {} - - /** - * Notify the plugin to stop reacting to scroll events while zoom is taking - * place to avoid flickering. - * - * override - */ - beforeZoom() { - this.postMessage_({type: 'stopScrolling'}); - - if (this.viewport_.pinchPhase === PinchPhase.START) { - const position = this.viewport_.position; - const zoom = this.viewport_.getZoom(); - const pinchPhase = this.viewport_.pinchPhase; - const layoutOptions = this.viewport_.getLayoutOptions(); - this.postMessage_({ - type: 'viewport', - userInitiated: true, - zoom: zoom, - layoutOptions: layoutOptions, - xOffset: position.x, - yOffset: position.y, - pinchPhase: pinchPhase - }); - } - } - - /** - * Notify the plugin of the zoom change and to continue reacting to scroll - * events. - * - * override - */ - afterZoom() { - const position = this.viewport_.position; - const zoom = this.viewport_.getZoom(); - const layoutOptions = this.viewport_.getLayoutOptions(); - const pinchVector = this.viewport_.pinchPanVector || {x: 0, y: 0}; - const pinchCenter = this.viewport_.pinchCenter || {x: 0, y: 0}; - const pinchPhase = this.viewport_.pinchPhase; - - this.postMessage_({ - type: 'viewport', - userInitiated: this.getIsUserInitiatedCallback_(), - zoom: zoom, - layoutOptions: layoutOptions, - xOffset: position.x, - yOffset: position.y, - pinchPhase: pinchPhase, - pinchX: pinchCenter.x, - pinchY: pinchCenter.y, - pinchVectorX: pinchVector.x, - pinchVectorY: pinchVector.y - }); - } - - /** - * Post a message to the PPAPI plugin. Some messages will cause an async reply - * to be received through handlePluginMessage_(). - * @param {!MessageData} message Message to post. - * @private - */ - postMessage_(message) { - this.plugin_.postMessage(message); - } - - /** - * Post a message to the PPAPI plugin, for cases where direct response is - * expected from the PPAPI plugin. - * @param {!MessageData} message - * @return {!Promise} A promise holding the response from the PPAPI plugin. - * @private - */ - postMessageWithReply_(message) { - const promiseResolver = new PromiseResolver(); - message.messageId = `${message.type}_${this.createUid_()}`; - this.requestResolverMap_.set(message.messageId, promiseResolver); - this.postMessage_(message); - return promiseResolver.promise; - } - - - // override - rotateClockwise() { - this.postMessage_({type: 'rotateClockwise'}); - } - - // override - rotateCounterclockwise() { - this.postMessage_({type: 'rotateCounterclockwise'}); - } - - // override - setDisplayAnnotations(displayAnnotations) { - this.postMessage_({ - type: 'displayAnnotations', - display: displayAnnotations, - }); - } - - // override - setTwoUpView(enableTwoUpView) { - this.postMessage_({ - type: 'setTwoUpView', - enableTwoUpView: enableTwoUpView, - }); - } - - // override - print() { - this.postMessage_({type: 'print'}); - } - - selectAll() { - this.postMessage_({type: 'selectAll'}); - } - - getSelectedText() { - return this.postMessageWithReply_({type: 'getSelectedText'}); - } - - /** - * Post a thumbnail request message to the plugin. - * @param {number} page - * @return {!Promise<!ThumbnailMessageData>} A promise holding the thumbnail - * response from the plugin. - */ - requestThumbnail(page) { - return this.postMessageWithReply_({ - type: 'getThumbnail', - // The plugin references pages using zero-based indices. - page: page - 1, - }); - } - - /** @param {!PrintPreviewParams} printPreviewParams */ - resetPrintPreviewMode(printPreviewParams) { - this.postMessage_({ - type: 'resetPrintPreviewMode', - url: printPreviewParams.url, - grayscale: printPreviewParams.grayscale, - // If the PDF isn't modifiable we send 0 as the page count so that no - // blank placeholder pages get appended to the PDF. - pageCount: - (printPreviewParams.modifiable ? - printPreviewParams.pageNumbers.length : - 0) - }); - } - - /** - * @param {number} color New color, as a 32-bit integer, of the PDF plugin - * background. - */ - setBackgroundColor(color) { - this.postMessage_({ - type: 'setBackgroundColor', - color: color, - }); - } - - /** - * @param {string} url - * @param {number} index - */ - loadPreviewPage(url, index) { - this.postMessage_({type: 'loadPreviewPage', url: url, index: index}); - } - - /** @param {string} password */ - getPasswordComplete(password) { - this.postMessage_({type: 'getPasswordComplete', password: password}); - } - - /** - * @param {string} destination - * @return {!Promise<!NamedDestinationMessageData>} - * A promise holding the named destination information from the plugin. - */ - getNamedDestination(destination) { - return this.postMessageWithReply_({ - type: 'getNamedDestination', - namedDestination: destination, - }); - } - - /** @param {boolean} enableReadOnly */ - setReadOnly(enableReadOnly) { - this.postMessage_({ - type: 'setReadOnly', - enableReadOnly: enableReadOnly, - }); - } - - // override - save(requestType) { - const resolver = new PromiseResolver(); - const newToken = createToken(); - this.pendingTokens_.set(newToken, resolver); - this.postMessage_({ - type: 'save', - token: newToken, - saveRequestType: requestType, - }); - return resolver.promise; - } - - // override - saveAttachment(index) { - return this.postMessageWithReply_({ - type: 'saveAttachment', - attachmentIndex: index, - }); - } - - // override - async load(fileName, data) { - // Load `data` into the PDF plugin. The unseasoned plugin transfers the data - // to be loaded within the inner frame, while the Pepper plugin updates - // `src` directly. - let url; - if (this.unseasonedPlugin_) { - assert(this.unseasonedPlugin_ === this.plugin_); - this.viewport_.setRemoteContent(this.unseasonedPlugin_); - this.unseasonedPlugin_.postMessage( - {type: 'loadArray', dataToLoad: data}, [data]); - } else { - this.viewport_.setContent(this.plugin_); - url = URL.createObjectURL(new Blob([data])); - this.plugin_.setAttribute('src', url); - this.plugin_.setAttribute('has-edits', ''); - } - - this.plugin_.style.display = 'block'; - try { - await this.getLoadedCallback_(); - this.isActive = true; - } finally { - if (url) { - URL.revokeObjectURL(url); - } - } - } - - // override - unload() { - this.plugin_.style.display = 'none'; - this.isActive = false; - } - - /** - * Binds an event handler for messages received from the unseasoned plugin. - * - * TODO(crbug.com/1228987): Remove this method when a permanent postMessage() - * bridge is implemented for the Unseasoned viewer. - * - * @param {!MessagePort} port The message port to bind to. - */ - bindUnseasonedMessageHandler(port) { - assert(this.unseasonedDelayedMessages_ !== null); - const delayedMessages = this.unseasonedDelayedMessages_; - this.unseasonedDelayedMessages_ = null; - - this.unseasonedPlugin_.postMessage = port.postMessage.bind(port); - port.onmessage = e => this.handlePluginMessage_(e); - - for (const {message, transfer} of delayedMessages) { - this.unseasonedPlugin_.postMessage(message, transfer); - } - } - - /** - * An event handler for handling message events received from the plugin. - * @param {!Event} messageEvent a message event. - * @private - */ - handlePluginMessage_(messageEvent) { - const messageData = /** @type {!MessageData} */ (messageEvent.data); - - // Handle case where this Plugin->Page message is a direct response - // to a previous Page->Plugin message - if (messageData.messageId !== undefined) { - const resolver = - this.requestResolverMap_.get(messageData.messageId) || null; - assert(resolver !== null); - this.requestResolverMap_.delete(messageData.messageId); - resolver.resolve(messageData); - return; - } - - switch (messageData.type) { - case 'gesture': - this.viewport_.dispatchGesture( - /** @type {{ gesture: !Gesture }} */ (messageData).gesture); - break; - case 'goToPage': - this.viewport_.goToPage( - /** @type {{type: string, page: number}} */ (messageData).page); - break; - case 'setScrollPosition': - this.viewport_.scrollTo(/** @type {!PartialPoint} */ (messageData)); - break; - case 'scrollBy': - this.viewport_.scrollBy(/** @type {!Point} */ (messageData)); - break; - case 'syncScrollFromRemote': - this.viewport_.syncScrollFromRemote( - /** @type {!Point} */ (messageData)); - break; - case 'ackScrollToRemote': - this.viewport_.ackScrollToRemote( - /** @type {!Point} */ (messageData)); - break; - case 'saveData': - this.saveData_(/** @type {!SaveDataMessageData} */ (messageData)); - break; - case 'consumeSaveToken': - const saveTokenData = - /** @type {{ type: string, token: string }} */ (messageData); - const resolver = this.pendingTokens_.get(saveTokenData.token); - assert(this.pendingTokens_.delete(saveTokenData.token)); - resolver.resolve(null); - break; - default: - this.eventTarget_.dispatchEvent(new CustomEvent( - PluginControllerEventType.PLUGIN_MESSAGE, {detail: messageData})); - } - } - - /** - * Handles the pdf file buffer received from the plugin. - * @param {!SaveDataMessageData} messageData data of the message event. - * @private - */ - saveData_(messageData) { - // Verify a token that was created by this instance is included to avoid - // being spammed. - const resolver = this.pendingTokens_.get(messageData.token); - assert(this.pendingTokens_.delete(messageData.token)); - - if (!messageData.dataToSave) { - resolver.reject(); - return; - } - - // Verify the file size and the first bytes to make sure it's a PDF. Cap at - // 100 MB. This cap should be kept in sync with and is also enforced in - // pdf/out_of_process_instance.cc. - const MIN_FILE_SIZE = '%PDF1.0'.length; - const MAX_FILE_SIZE = 100 * 1000 * 1000; - - const buffer = messageData.dataToSave; - const bufView = new Uint8Array(buffer); - assert( - bufView.length <= MAX_FILE_SIZE, - `File too large to be saved: ${bufView.length} bytes.`); - assert(bufView.length >= MIN_FILE_SIZE); - assert( - String.fromCharCode(bufView[0], bufView[1], bufView[2], bufView[3]) === - '%PDF'); - - resolver.resolve(messageData); - } - - /** @return {!PluginController} */ - static getInstance() { - return instance || (instance = new PluginController()); - } -} - -/** @type {?PluginController} */ -let instance = null;
diff --git a/chrome/browser/resources/pdf/controller.ts b/chrome/browser/resources/pdf/controller.ts new file mode 100644 index 0000000..f32d60b --- /dev/null +++ b/chrome/browser/resources/pdf/controller.ts
@@ -0,0 +1,523 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import {assert} from 'chrome://resources/js/assert_ts.js'; +import {NativeEventTarget as EventTarget} from 'chrome://resources/js/cr/event_target.m.js'; +import {PromiseResolver} from 'chrome://resources/js/promise_resolver.m.js'; + +import {NamedDestinationMessageData, SaveRequestType} from './constants.js'; +import {UnseasonedPdfPluginElement} from './internal_plugin.js'; +import {PinchPhase, Viewport} from './viewport.js'; + +export type MessageData = { + type: string, + messageId?: string, +}; + +export type SaveAttachmentMessageData = { + type: string, + dataToSave: ArrayBuffer, + messageId: string, +} + +type SaveDataMessageData = { + dataToSave: ArrayBuffer, + token: string, + fileName: string, +}; + +export type PrintPreviewParams = { + type: string, + url: string, + grayscale: boolean, + modifiable: boolean, + pageNumbers: number[], +}; + +type ThumbnailMessageData = { + imageData: ArrayBuffer, + width: number, + height: number, +}; + +/** + * Creates a cryptographically secure pseudorandom 128-bit token. + * @return The generated token as a hex string. + */ +function createToken(): string { + const randomBytes = new Uint8Array(16); + window.crypto.getRandomValues(randomBytes); + return Array.from(randomBytes, b => b.toString(16).padStart(2, '0')).join(''); +} + +export interface ContentController { + isActive: boolean; + + getEventTarget(): EventTarget; + beforeZoom(): void; + afterZoom(): void; + viewportChanged(): void; + rotateClockwise(): void; + rotateCounterclockwise(): void; + setDisplayAnnotations(displayAnnotations: boolean): void; + setTwoUpView(enableTwoUpView: boolean): void; + + /** Triggers printing of the current document. */ + print(): void; + + /** Undo an edit action. */ + undo(): void; + + /** Redo an edit action. */ + redo(): void; + + /** + * Requests that the current document be saved. + * @param requestType The type of save request. If ANNOTATION, a response is + * required, otherwise the controller may save the document to disk + * internally. + */ + save(requestType: SaveRequestType): + Promise<{fileName: string, dataToSave: ArrayBuffer}>; + + /** + * Requests that the attachment at a certain index be saved. + * @param index The index of the attachment to be saved. + */ + saveAttachment(index: number): Promise<SaveAttachmentMessageData>; + + /** Loads PDF document from `data` activates UI. */ + load(fileName: string, data: ArrayBuffer): Promise<void>; + + /** Unloads the current document and removes the UI. */ + unload(): void; +} + +/** Event types dispatched by the plugin controller. */ +export enum PluginControllerEventType { + IS_ACTIVE_CHANGED = 'PluginControllerEventType.IS_ACTIVE_CHANGED', + PLUGIN_MESSAGE = 'PluginControllerEventType.PLUGIN_MESSAGE', +} + +/** + * PDF plugin controller singleton, responsible for communicating with the + * embedded plugin element. Dispatches a + * `PluginControllerEventType.PLUGIN_MESSAGE` event containing the message from + * the plugin, if a message type not handled by this controller is received. + */ +export class PluginController implements ContentController { + private eventTarget_: EventTarget = new EventTarget(); + private isActive_: boolean = false; + private plugin_: HTMLEmbedElement; + private unseasonedPlugin_: UnseasonedPdfPluginElement|null = null; + private unseasonedDelayedMessages_: + Array<{message: any, transfer?: Transferable[]}>|null = null; + private viewport_: Viewport; + private getIsUserInitiatedCallback_: () => boolean; + private getLoadedCallback_: () => Promise<void>| null; + private pendingTokens_: + Map<string, + PromiseResolver<{fileName: string, dataToSave: ArrayBuffer}|null>>; + private requestResolverMap_: Map<string, PromiseResolver<any>>; + private uidCounter_: number = 1; + + init( + plugin: HTMLEmbedElement, viewport: Viewport, + getIsUserInitiatedCallback: () => boolean, + getLoadedCallback: () => Promise<void>| null) { + this.plugin_ = plugin; + this.viewport_ = viewport; + this.getIsUserInitiatedCallback_ = getIsUserInitiatedCallback; + this.getLoadedCallback_ = getLoadedCallback; + this.pendingTokens_ = new Map(); + this.requestResolverMap_ = new Map(); + + this.viewport_.setContent(this.plugin_); + this.plugin_.addEventListener( + 'message', e => this.handlePluginMessage_(e as MessageEvent), false); + if (!(this.plugin_ as UnseasonedPdfPluginElement).postMessage) { + this.unseasonedPlugin_ = this.plugin_ as UnseasonedPdfPluginElement; + this.unseasonedDelayedMessages_ = []; + + this.unseasonedPlugin_.postMessage = (message, transfer) => { + this.unseasonedDelayedMessages_!.push({message, transfer}); + }; + + this.viewport_.setRemoteContent(this.unseasonedPlugin_); + } + } + + get isActive(): boolean { + // Check whether `plugin_` is defined as a signal that `init()` was called. + return !!this.plugin_ && this.isActive_; + } + + set isActive(isActive: boolean) { + const wasActive = this.isActive; + this.isActive_ = isActive; + if (this.isActive === wasActive) { + return; + } + + this.eventTarget_.dispatchEvent(new CustomEvent( + PluginControllerEventType.IS_ACTIVE_CHANGED, {detail: this.isActive})); + } + + private createUid_(): number { + return this.uidCounter_++; + } + + getEventTarget() { + return this.eventTarget_; + } + + updateScroll(x: number, y: number) { + if (this.unseasonedPlugin_) { + // Ignore "local" scroll events in unseasoned mode, as these are synthetic + // events generated by the remote scrolling implementation. + return; + } + + this.postMessage_({type: 'updateScroll', x, y}); + } + + viewportChanged() {} + + redo() {} + + undo() {} + + /** + * Notify the plugin to stop reacting to scroll events while zoom is taking + * place to avoid flickering. + */ + beforeZoom() { + this.postMessage_({type: 'stopScrolling'}); + + if (this.viewport_.pinchPhase === PinchPhase.START) { + const position = this.viewport_.position; + const zoom = this.viewport_.getZoom(); + const pinchPhase = this.viewport_.pinchPhase; + const layoutOptions = this.viewport_.getLayoutOptions(); + this.postMessage_({ + type: 'viewport', + userInitiated: true, + zoom: zoom, + layoutOptions: layoutOptions, + xOffset: position.x, + yOffset: position.y, + pinchPhase: pinchPhase + }); + } + } + + /** + * Notify the plugin of the zoom change and to continue reacting to scroll + * events. + */ + afterZoom() { + const position = this.viewport_.position; + const zoom = this.viewport_.getZoom(); + const layoutOptions = this.viewport_.getLayoutOptions(); + const pinchVector = this.viewport_.pinchPanVector || {x: 0, y: 0}; + const pinchCenter = this.viewport_.pinchCenter || {x: 0, y: 0}; + const pinchPhase = this.viewport_.pinchPhase; + + this.postMessage_({ + type: 'viewport', + userInitiated: this.getIsUserInitiatedCallback_(), + zoom: zoom, + layoutOptions: layoutOptions, + xOffset: position.x, + yOffset: position.y, + pinchPhase: pinchPhase, + pinchX: pinchCenter.x, + pinchY: pinchCenter.y, + pinchVectorX: pinchVector.x, + pinchVectorY: pinchVector.y + }); + } + + /** + * Post a message to the PPAPI plugin. Some messages will cause an async reply + * to be received through handlePluginMessage_(). + */ + private postMessage_<M extends MessageData>(message: M) { + (this.plugin_ as UnseasonedPdfPluginElement).postMessage(message); + } + + /** + * Post a message to the PPAPI plugin, for cases where direct response is + * expected from the PPAPI plugin. + * @return A promise holding the response from the PPAPI plugin. + */ + private postMessageWithReply_<T, M extends MessageData>(message: M): + Promise<T> { + const promiseResolver = new PromiseResolver<T>(); + message.messageId = `${message.type}_${this.createUid_()}`; + this.requestResolverMap_.set(message.messageId, promiseResolver); + this.postMessage_(message); + return promiseResolver.promise; + } + + rotateClockwise() { + this.postMessage_({type: 'rotateClockwise'}); + } + + rotateCounterclockwise() { + this.postMessage_({type: 'rotateCounterclockwise'}); + } + + setDisplayAnnotations(displayAnnotations: boolean) { + this.postMessage_({ + type: 'displayAnnotations', + display: displayAnnotations, + }); + } + + setTwoUpView(enableTwoUpView: boolean) { + this.postMessage_({ + type: 'setTwoUpView', + enableTwoUpView: enableTwoUpView, + }); + } + + print() { + this.postMessage_({type: 'print'}); + } + + selectAll() { + this.postMessage_({type: 'selectAll'}); + } + + getSelectedText(): Promise<{selectedText: string}> { + return this.postMessageWithReply_({type: 'getSelectedText'}); + } + + /** + * Post a thumbnail request message to the plugin. + * @return A promise holding the thumbnail response from the plugin. + */ + requestThumbnail(page: number): Promise<ThumbnailMessageData> { + return this.postMessageWithReply_({ + type: 'getThumbnail', + // The plugin references pages using zero-based indices. + page: page - 1, + }); + } + + resetPrintPreviewMode(printPreviewParams: PrintPreviewParams) { + this.postMessage_({ + type: 'resetPrintPreviewMode', + url: printPreviewParams.url, + grayscale: printPreviewParams.grayscale, + // If the PDF isn't modifiable we send 0 as the page count so that no + // blank placeholder pages get appended to the PDF. + pageCount: + (printPreviewParams.modifiable ? + printPreviewParams.pageNumbers.length : + 0) + }); + } + + /** + * @param color New color, as a 32-bit integer, of the PDF plugin + * background. + */ + setBackgroundColor(color: number) { + this.postMessage_({ + type: 'setBackgroundColor', + color: color, + }); + } + + loadPreviewPage(url: string, index: number) { + this.postMessage_({type: 'loadPreviewPage', url: url, index: index}); + } + + getPasswordComplete(password: string) { + this.postMessage_({type: 'getPasswordComplete', password: password}); + } + + /** + * @return A promise holding the named destination information from the + * plugin. + */ + getNamedDestination(destination: string): + Promise<NamedDestinationMessageData> { + return this.postMessageWithReply_({ + type: 'getNamedDestination', + namedDestination: destination, + }); + } + + setReadOnly(enableReadOnly: boolean) { + this.postMessage_({ + type: 'setReadOnly', + enableReadOnly: enableReadOnly, + }); + } + + save(requestType: SaveRequestType) { + const resolver = + new PromiseResolver<{fileName: string, dataToSave: ArrayBuffer}>(); + const newToken = createToken(); + this.pendingTokens_.set(newToken, resolver); + this.postMessage_({ + type: 'save', + token: newToken, + saveRequestType: requestType, + }); + return resolver.promise; + } + + saveAttachment(index: number): Promise<SaveAttachmentMessageData> { + return this.postMessageWithReply_({ + type: 'saveAttachment', + attachmentIndex: index, + }); + } + + async load(_fileName: string, data: ArrayBuffer) { + // Load `data` into the PDF plugin. The unseasoned plugin transfers the data + // to be loaded within the inner frame, while the Pepper plugin updates + // `src` directly. + let url; + if (this.unseasonedPlugin_) { + assert(this.unseasonedPlugin_ === this.plugin_); + this.viewport_.setRemoteContent(this.unseasonedPlugin_); + this.unseasonedPlugin_.postMessage( + {type: 'loadArray', dataToLoad: data}, [data]); + } else { + this.viewport_.setContent(this.plugin_); + url = URL.createObjectURL(new Blob([data])); + this.plugin_.setAttribute('src', url); + this.plugin_.setAttribute('has-edits', ''); + } + + this.plugin_.style.display = 'block'; + try { + await this.getLoadedCallback_(); + this.isActive = true; + } finally { + if (url) { + URL.revokeObjectURL(url); + } + } + } + + unload() { + this.plugin_.style.display = 'none'; + this.isActive = false; + } + + /** + * Binds an event handler for messages received from the unseasoned plugin. + * + * TODO(crbug.com/1228987): Remove this method when a permanent postMessage() + * bridge is implemented for the Unseasoned viewer. + */ + bindUnseasonedMessageHandler(port: MessagePort) { + assert(this.unseasonedDelayedMessages_ !== null); + assert(this.unseasonedPlugin_); + const delayedMessages = this.unseasonedDelayedMessages_; + this.unseasonedDelayedMessages_ = null; + + this.unseasonedPlugin_.postMessage = port.postMessage.bind(port); + port.onmessage = e => this.handlePluginMessage_(e); + + for (const {message, transfer} of delayedMessages) { + this.unseasonedPlugin_.postMessage(message, transfer); + } + } + + /** + * An event handler for handling message events received from the plugin. + */ + private handlePluginMessage_(messageEvent: MessageEvent) { + const messageData = messageEvent.data; + + // Handle case where this Plugin->Page message is a direct response + // to a previous Page->Plugin message + if (messageData.messageId !== undefined) { + const resolver = + this.requestResolverMap_.get(messageData.messageId) || null; + assert(resolver !== null); + this.requestResolverMap_.delete(messageData.messageId); + resolver.resolve(messageData); + return; + } + + switch (messageData.type) { + case 'gesture': + this.viewport_.dispatchGesture(messageData.gesture); + break; + case 'goToPage': + this.viewport_.goToPage(messageData.page); + break; + case 'setScrollPosition': + this.viewport_.scrollTo(messageData); + break; + case 'scrollBy': + this.viewport_.scrollBy(messageData); + break; + case 'syncScrollFromRemote': + this.viewport_.syncScrollFromRemote(messageData); + break; + case 'ackScrollToRemote': + this.viewport_.ackScrollToRemote(messageData); + break; + case 'saveData': + this.saveData_(messageData); + break; + case 'consumeSaveToken': + const resolver = this.pendingTokens_.get(messageData.token); + assert(resolver); + assert(this.pendingTokens_.delete(messageData.token)); + resolver.resolve(null); + break; + default: + this.eventTarget_.dispatchEvent(new CustomEvent( + PluginControllerEventType.PLUGIN_MESSAGE, {detail: messageData})); + } + } + + /** Handles the pdf file buffer received from the plugin. */ + private saveData_(messageData: SaveDataMessageData) { + // Verify a token that was created by this instance is included to avoid + // being spammed. + const resolver = this.pendingTokens_.get(messageData.token); + assert(resolver); + assert(this.pendingTokens_.delete(messageData.token)); + + if (!messageData.dataToSave) { + resolver.reject(); + return; + } + + // Verify the file size and the first bytes to make sure it's a PDF. Cap at + // 100 MB. This cap should be kept in sync with and is also enforced in + // pdf/out_of_process_instance.cc. + const MIN_FILE_SIZE = '%PDF1.0'.length; + const MAX_FILE_SIZE = 100 * 1000 * 1000; + + const buffer = messageData.dataToSave; + const bufView = new Uint8Array(buffer); + assert( + bufView.length <= MAX_FILE_SIZE, + `File too large to be saved: ${bufView.length} bytes.`); + assert(bufView.length >= MIN_FILE_SIZE); + assert( + String.fromCharCode(bufView[0], bufView[1], bufView[2], bufView[3]) === + '%PDF'); + + resolver.resolve(messageData); + } + + static getInstance(): PluginController { + return instance || (instance = new PluginController()); + } +} + +let instance: PluginController|null = null;
diff --git a/chrome/browser/resources/pdf/elements/viewer-bookmark.ts b/chrome/browser/resources/pdf/elements/viewer-bookmark.ts index 47d0121..df05716 100644 --- a/chrome/browser/resources/pdf/elements/viewer-bookmark.ts +++ b/chrome/browser/resources/pdf/elements/viewer-bookmark.ts
@@ -26,6 +26,7 @@ declare global { interface HTMLElementEventMap { 'change-page-and-xy': ChangePageAndXyEvent; + 'change-zoom': CustomEvent<{zoom: number}>; } }
diff --git a/chrome/browser/resources/pdf/elements/viewer-ink-host.ts b/chrome/browser/resources/pdf/elements/viewer-ink-host.ts index 636eaa9..4108de9 100644 --- a/chrome/browser/resources/pdf/elements/viewer-ink-host.ts +++ b/chrome/browser/resources/pdf/elements/viewer-ink-host.ts
@@ -17,11 +17,17 @@ const BACKGROUND_COLOR: string = '#525659'; +declare global { + interface HTMLElementEventMap { + 'undo-state-changed': CustomEvent<drawings.UndoState>; + } +} + /** * Hosts the Ink component which is responsible for both PDF rendering and * annotation when in annotation mode. */ -class ViewerInkHostElement extends PolymerElement { +export class ViewerInkHostElement extends PolymerElement { static get is() { return 'viewer-ink-host'; }
diff --git a/chrome/browser/resources/pdf/ink/ink_api.ts b/chrome/browser/resources/pdf/ink/ink_api.ts index 81940d8..54508943c 100644 --- a/chrome/browser/resources/pdf/ink/ink_api.ts +++ b/chrome/browser/resources/pdf/ink/ink_api.ts
@@ -78,7 +78,6 @@ } } -/** @return {Promise<InkAPI>} */ window.initInk = async function() { const canvas = await drawings.Canvas.execute(document.body); return new InkAPI(canvas);
diff --git a/chrome/browser/resources/pdf/ink_controller.js b/chrome/browser/resources/pdf/ink_controller.js deleted file mode 100644 index 854c397..0000000 --- a/chrome/browser/resources/pdf/ink_controller.js +++ /dev/null
@@ -1,198 +0,0 @@ -// Copyright 2020 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import {assertNotReached} from 'chrome://resources/js/assert.m.js'; -import {NativeEventTarget as EventTarget} from 'chrome://resources/js/cr/event_target.m.js'; - -import {ContentController} from './controller.js'; -import {Viewport} from './viewport.js'; - -// Note: Redefining this type here, to work around the fact that ink externs -// are only available on Chrome OS, so the targets that contain them cannot be -// built on other platforms. - -/** - * @typedef {{ - * setAnnotationTool: function(AnnotationTool):void, - * viewportChanged: function():void, - * saveDocument: function():!Promise, - * undo: function():void, - * redo: function():void, - * load: function(string, !ArrayBuffer):!Promise, - * viewport: !Viewport, - * }} - */ -let ViewerInkHostElement; - -/** - * Event types dispatched by the ink controller. - * @enum {string} - */ -export const InkControllerEventType = { - HAS_UNSAVED_CHANGES: 'InkControllerEventType.HAS_UNSAVED_CHANGES', - LOADED: 'InkControllerEventType.LOADED', - SET_ANNOTATION_UNDO_STATE: 'InkControllerEventType.SET_ANNOTATION_UNDO_STATE', -}; - -/** - * Controller for annotation mode, on Chrome OS only. Fires the following events - * from its event target: - * InkControllerEventType.HAS_UNSAVED_CHANGES: Fired to indicate there are ink - * annotations that have not been saved. - * InkControllerEventType.SET_ANNOTATION_UNDO_STATE: Contains information - * about whether undo or redo options are available. - * @implements {ContentController} - */ -export class InkController { - constructor() { - /** @private {!EventTarget} */ - this.eventTarget_ = new EventTarget(); - - /** @private {boolean} */ - this.isActive_ = false; - - /** @private {!Viewport} */ - this.viewport_; - - /** @private {?ViewerInkHostElement} */ - this.inkHost_ = null; - - /** @private {?AnnotationTool} */ - this.tool_ = null; - } - - /** - * @param {!Viewport} viewport - */ - init(viewport) { - this.viewport_ = viewport; - } - - /** - * @return {boolean} - * @override - */ - get isActive() { - // Check whether `viewport_` is defined as a signal that `init()` was - // called. - return !!this.viewport_ && this.isActive_; - } - - /** - * @param {boolean} isActive - * @override - */ - set isActive(isActive) { - this.isActive_ = isActive; - } - - /** - * @return {!EventTarget} - * @override - */ - getEventTarget() { - return this.eventTarget_; - } - - /** @param {AnnotationTool} tool */ - setAnnotationTool(tool) { - this.tool_ = tool; - if (this.inkHost_) { - this.inkHost_.setAnnotationTool(tool); - } - } - - beforeZoom() {} - - afterZoom() {} - - print() {} - - /** @override */ - rotateClockwise() { - // TODO(dstockwell): implement rotation - } - - /** @override */ - rotateCounterclockwise() { - // TODO(dstockwell): implement rotation - } - - /** @override */ - setDisplayAnnotations(displayAnnotations) {} - - /** @override */ - setTwoUpView(enableTwoUpView) { - // TODO(dstockwell): Implement two up view. - } - - /** @override */ - viewportChanged() { - this.inkHost_.viewportChanged(); - } - - /** @override */ - save(requestType) { - return this.inkHost_.saveDocument(); - } - - /** @override */ - saveAttachment(index) { - assertNotReached(); - // TODO(crbug.com/1260303): Dummy return to please the TS Compiler. Remove - // when this file is migrated to TS. - return new Promise( - resolve => - resolve({type: '', dataToSave: new ArrayBuffer(0), messageId: ''})); - } - - /** @override */ - undo() { - this.inkHost_.undo(); - } - - /** @override */ - redo() { - this.inkHost_.redo(); - } - - /** @override */ - load(filename, data) { - if (!this.inkHost_) { - const inkHost = document.createElement('viewer-ink-host'); - this.viewport_.setContent(inkHost); - this.inkHost_ = /** @type {!ViewerInkHostElement} */ (inkHost); - this.inkHost_.viewport = this.viewport_; - inkHost.addEventListener('stroke-added', e => { - this.eventTarget_.dispatchEvent( - new CustomEvent(InkControllerEventType.HAS_UNSAVED_CHANGES)); - }); - inkHost.addEventListener('undo-state-changed', e => { - this.eventTarget_.dispatchEvent(new CustomEvent( - InkControllerEventType.SET_ANNOTATION_UNDO_STATE, - {detail: e.detail})); - }); - this.isActive = true; - } - return this.inkHost_.load(filename, data).then(() => { - this.eventTarget_.dispatchEvent( - new CustomEvent(InkControllerEventType.LOADED)); - }); - } - - /** @override */ - unload() { - this.inkHost_.remove(); - this.inkHost_ = null; - this.isActive = false; - } - - /** @return {!InkController} */ - static getInstance() { - return instance || (instance = new InkController()); - } -} - -/** @type {?InkController} */ -let instance = null;
diff --git a/chrome/browser/resources/pdf/ink_controller.ts b/chrome/browser/resources/pdf/ink_controller.ts new file mode 100644 index 0000000..da21b0b1 --- /dev/null +++ b/chrome/browser/resources/pdf/ink_controller.ts
@@ -0,0 +1,136 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import {assertNotReached} from 'chrome://resources/js/assert_ts.js'; +import {NativeEventTarget as EventTarget} from 'chrome://resources/js/cr/event_target.m.js'; + +import {AnnotationTool} from './annotation_tool.js'; +import {SaveRequestType} from './constants.js'; +import {ContentController, SaveAttachmentMessageData} from './controller.js'; +import {ViewerInkHostElement} from './elements/viewer-ink-host.js'; +import {Viewport} from './viewport.js'; + +/** Event types dispatched by the ink controller. */ +export enum InkControllerEventType { + HAS_UNSAVED_CHANGES = 'InkControllerEventType.HAS_UNSAVED_CHANGES', + LOADED = 'InkControllerEventType.LOADED', + SET_ANNOTATION_UNDO_STATE = + 'InkControllerEventType.SET_ANNOTATION_UNDO_STATE', +} + +/** + * Controller for annotation mode, on Chrome OS only. Fires the following events + * from its event target: + * InkControllerEventType.HAS_UNSAVED_CHANGES: Fired to indicate there are ink + * annotations that have not been saved. + * InkControllerEventType.SET_ANNOTATION_UNDO_STATE: Contains information + * about whether undo or redo options are available. + */ +export class InkController implements ContentController { + private eventTarget_: EventTarget = new EventTarget(); + private isActive_: boolean = false; + private viewport_: Viewport; + private inkHost_: ViewerInkHostElement|null = null; + private tool_: AnnotationTool|null = null; + + init(viewport: Viewport) { + this.viewport_ = viewport; + } + + get isActive(): boolean { + // Check whether `viewport_` is defined as a signal that `init()` was + // called. + return !!this.viewport_ && this.isActive_; + } + + set isActive(isActive: boolean) { + this.isActive_ = isActive; + } + + getEventTarget(): EventTarget { + return this.eventTarget_; + } + + setAnnotationTool(tool: AnnotationTool) { + this.tool_ = tool; + if (this.inkHost_) { + this.inkHost_.setAnnotationTool(tool); + } + } + + beforeZoom() {} + + afterZoom() {} + + print() {} + + rotateClockwise() { + // TODO(dstockwell): implement rotation + } + + rotateCounterclockwise() { + // TODO(dstockwell): implement rotation + } + + setDisplayAnnotations(_displayAnnotations: boolean) {} + + setTwoUpView(_enableTwoUpView: boolean) { + // TODO(dstockwell): Implement two up view. + } + + viewportChanged() { + this.inkHost_!.viewportChanged(); + } + + save(_requestType: SaveRequestType) { + return this.inkHost_!.saveDocument(); + } + + saveAttachment(_index: number): Promise<SaveAttachmentMessageData> { + assertNotReached(); + } + + undo() { + this.inkHost_!.undo(); + } + + redo() { + this.inkHost_!.redo(); + } + + load(filename: string, data: ArrayBuffer) { + if (!this.inkHost_) { + const inkHost = document.createElement('viewer-ink-host'); + this.viewport_.setContent(inkHost); + this.inkHost_ = inkHost; + this.inkHost_.viewport = this.viewport_; + inkHost.addEventListener('stroke-added', _e => { + this.eventTarget_.dispatchEvent( + new CustomEvent(InkControllerEventType.HAS_UNSAVED_CHANGES)); + }); + inkHost.addEventListener('undo-state-changed', e => { + this.eventTarget_.dispatchEvent(new CustomEvent( + InkControllerEventType.SET_ANNOTATION_UNDO_STATE, + {detail: e.detail})); + }); + this.isActive = true; + } + return this.inkHost_.load(filename, data).then(() => { + this.eventTarget_.dispatchEvent( + new CustomEvent(InkControllerEventType.LOADED)); + }); + } + + unload() { + this.inkHost_!.remove(); + this.inkHost_ = null; + this.isActive = false; + } + + static getInstance(): InkController { + return instance || (instance = new InkController()); + } +} + +let instance: InkController|null = null;
diff --git a/chrome/browser/resources/pdf/pdf.gni b/chrome/browser/resources/pdf/pdf.gni index 7b7b5f39..67ca098 100644 --- a/chrome/browser/resources/pdf/pdf.gni +++ b/chrome/browser/resources/pdf/pdf.gni
@@ -17,7 +17,7 @@ if (enable_ink) { pdf_non_webcomponents_files += [ "annotation_tool.ts", - "ink_controller.js", + "ink_controller.ts", "ink/ink_api.ts", ] } @@ -66,16 +66,16 @@ shared_non_webcomponents_files = [ "browser_api.ts", "constants.ts", - "controller.js", + "controller.ts", "gesture_detector.ts", "internal_plugin.ts", "main.ts", "metrics.ts", "open_pdf_params_parser.ts", - "pdf_scripting_api.js", + "pdf_scripting_api.ts", "pdf_viewer_base.ts", "pdf_viewer_utils.ts", - "viewport.js", + "viewport.ts", "viewport_scroller.ts", "zoom_manager.ts", ]
diff --git a/chrome/browser/resources/pdf/pdf_scripting_api.js b/chrome/browser/resources/pdf/pdf_scripting_api.ts similarity index 60% rename from chrome/browser/resources/pdf/pdf_scripting_api.js rename to chrome/browser/resources/pdf/pdf_scripting_api.ts index f19372d..dbcb261 100644 --- a/chrome/browser/resources/pdf/pdf_scripting_api.js +++ b/chrome/browser/resources/pdf/pdf_scripting_api.ts
@@ -2,59 +2,44 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -/** @interface */ -export class PDFPlugin extends HTMLIFrameElement { - /** @param {boolean} darkMode */ - darkModeChanged(darkMode) {} +type ViewportChangedCallback = + (pageX: number, pageY: number, pageWidth: number, viewportWidth: number, + viewportHeight: number) => void; - hideToolbar() {} - /** - * @param {string} url - * @param {number} index - */ - loadPreviewPage(url, index) {} - - /** - * @param {string} url - * @param {boolean} color - * @param {Array<number>} pages - * @param {boolean} modifiable - */ - resetPrintPreviewMode(url, color, pages, modifiable) {} - - /** - * @param {number} x - * @param {number} y - */ - scrollPosition(x, y) {} - - /** - * @param {!KeyboardEvent} e - */ - sendKeyEvent(e) {} - - /** - * @param {function(KeyboardEvent): void} callback - */ - setKeyEventCallback(callback) {} - - /** - * @param {function(boolean): void} callback - */ - setLoadCompleteCallback(callback) {} - - /** - * @param {function(number, number, number, number, number): void} callback - */ - setViewportChangedCallback(callback) {} +export interface PDFPlugin extends HTMLIFrameElement { + darkModeChanged(darkMode: boolean): void; + hideToolbar(): void; + loadPreviewPage(url: string, index: number): void; + resetPrintPreviewMode( + url: string, color: boolean, pages: number[], modifiable: boolean): void; + scrollPosition(x: number, y: number): void; + sendKeyEvent(e: KeyboardEvent): void; + setKeyEventCallback(callback: (e: KeyboardEvent) => void): void; + setLoadCompleteCallback(callback: (loaded: boolean) => void): void; + setViewportChangedCallback(callback: ViewportChangedCallback): void; } +export type SerializedKeyEvent = { + keyCode: number, + code: string, + key: string, + shiftKey: boolean, + ctrlKey: boolean, + altKey: boolean, + metaKey: boolean, +}; + +type ThumbnailData = { + imageData: ArrayBuffer, + width: number, + height: number, +}; + /** * Turn a dictionary received from postMessage into a key event. - * @param {Object} dict A dictionary representing the key event. - * @return {!KeyboardEvent} A key event. + * @param dict A dictionary representing the key event. */ -export function DeserializeKeyEvent(dict) { +export function DeserializeKeyEvent(dict: SerializedKeyEvent): KeyboardEvent { const e = new KeyboardEvent('keydown', { bubbles: true, cancelable: true, @@ -71,10 +56,9 @@ /** * Turn a key event into a dictionary which can be sent over postMessage. - * @param {Event} event A key event. - * @return {Object} A dictionary representing the key event. + * @return A dictionary representing the key event. */ -export function SerializeKeyEvent(event) { +export function SerializeKeyEvent(event: KeyboardEvent): SerializedKeyEvent { return { keyCode: event.keyCode, code: event.code, @@ -89,44 +73,34 @@ /** * An enum containing a value specifying whether the PDF is currently loading, * has finished loading or failed to load. - * @enum {string} */ -export const LoadState = { - LOADING: 'loading', - SUCCESS: 'success', - FAILED: 'failed' -}; +export enum LoadState { + LOADING = 'loading', + SUCCESS = 'success', + FAILED = 'failed', +} // Provides a scripting interface to the PDF viewer so that it can be customized // by things like print preview. export class PDFScriptingAPI { + private loadState_: LoadState = LoadState.LOADING; + private pendingScriptingMessages_: Array<{type: string}> = []; + + private viewportChangedCallback_: ViewportChangedCallback; + private loadCompleteCallback_: (completed: boolean) => void; + private selectedTextCallback_: ((text: string) => void)|null; + private thumbnailCallback_: ((data: ThumbnailData) => void)|null; + private keyEventCallback_: (e: KeyboardEvent) => void; + + private plugin_: Window|null; + /** - * @param {Window} window the window of the page containing the pdf viewer. - * @param {Object} plugin the plugin element containing the pdf viewer. + * @param window the window of the page containing the pdf viewer. + * @param plugin the plugin element containing the pdf viewer. */ - constructor(window, plugin) { - this.loadState_ = LoadState.LOADING; - this.pendingScriptingMessages_ = []; + constructor(window: Window, plugin: Window|null) { this.setPlugin(plugin); - /** @private {Function} */ - this.viewportChangedCallback_; - - /** @private {Function} */ - this.loadCompleteCallback_; - - /** @private {Function} */ - this.selectedTextCallback_; - - /** @private {Function} */ - this.thumbnailCallback_; - - /** @private {Function} */ - this.keyEventCallback_; - - /** @private {Object} */ - this.plugin_; - window.addEventListener('message', event => { if (event.origin !== 'chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai' && @@ -137,15 +111,6 @@ } switch (event.data.type) { case 'viewport': - /** - * @type {{ - * pageX: number, - * pageY: number, - * pageWidth: number, - * viewportWidth: number, - * viewportHeight: number - * }} - */ const viewportData = event.data; if (this.viewportChangedCallback_) { this.viewportChangedCallback_( @@ -154,7 +119,7 @@ } break; case 'documentLoaded': { - const data = /** @type {{load_state: LoadState}} */ (event.data); + const data = event.data; this.loadState_ = data.load_state; if (this.loadCompleteCallback_) { this.loadCompleteCallback_(this.loadState_ === LoadState.SUCCESS); @@ -162,7 +127,7 @@ break; } case 'getSelectedTextReply': { - const data = /** @type {{selectedText: string}} */ (event.data); + const data = event.data; if (this.selectedTextCallback_) { this.selectedTextCallback_(data.selectedText); this.selectedTextCallback_ = null; @@ -170,14 +135,8 @@ break; } case 'getThumbnailReply': { - const data = - /** - * @type {{imageData: !ArrayBuffer, width: number, - * height: number}} - */ - (event.data); if (this.thumbnailCallback_) { - this.thumbnailCallback_(data); + this.thumbnailCallback_(event.data as ThumbnailData); this.thumbnailCallback_ = null; } break; @@ -195,10 +154,8 @@ * Send a message to the extension. If messages try to get sent before there * is a plugin element set, then we queue them up and send them later (this * can happen in print preview). - * @param {Object} message The message to send. - * @private */ - sendMessage_(message) { + private sendMessage_<M extends {type: string}>(message: M) { if (this.plugin_) { this.plugin_.postMessage(message, '*'); } else { @@ -209,9 +166,9 @@ /** * Sets the plugin element containing the PDF viewer. The element will usually * be passed into the PDFScriptingAPI constructor but may also be set later. - * @param {Object} plugin the plugin element containing the PDF viewer. + * @param plugin the plugin element containing the PDF viewer. */ - setPlugin(plugin) { + setPlugin(plugin: Window|null) { this.plugin_ = plugin; if (this.plugin_) { @@ -220,26 +177,23 @@ this.sendMessage_({type: 'initialize'}); // Flush pending messages. while (this.pendingScriptingMessages_.length > 0) { - this.sendMessage_(this.pendingScriptingMessages_.shift()); + this.sendMessage_(this.pendingScriptingMessages_.shift()!); } } } /** * Sets the callback which will be run when the PDF viewport changes. - * @param {Function} callback the callback to be called. */ - setViewportChangedCallback(callback) { + setViewportChangedCallback(callback: ViewportChangedCallback) { this.viewportChangedCallback_ = callback; } /** * Sets the callback which will be run when the PDF document has finished * loading. If the document is already loaded, it will be run immediately. - * - * @param {Function} callback the callback to be called. */ - setLoadCompleteCallback(callback) { + setLoadCompleteCallback(callback: (loaded: boolean) => void) { this.loadCompleteCallback_ = callback; if (this.loadState_ !== LoadState.LOADING && this.loadCompleteCallback_) { this.loadCompleteCallback_(this.loadState_ === LoadState.SUCCESS); @@ -248,20 +202,21 @@ /** * Sets a callback that gets run when a key event is fired in the PDF viewer. - * @param {Function} callback the callback to be called with a key event. */ - setKeyEventCallback(callback) { + setKeyEventCallback(callback: (e: KeyboardEvent) => void) { this.keyEventCallback_ = callback; } /** * Resets the PDF viewer into print preview mode. - * @param {string} url the url of the PDF to load. - * @param {boolean} grayscale whether or not to display the PDF in grayscale. - * @param {Array<number>} pageNumbers an array of the page numbers. - * @param {boolean} modifiable whether or not the document is modifiable. + * @param url the url of the PDF to load. + * @param grayscale whether or not to display the PDF in grayscale. + * @param pageNumbers an array of the page numbers. + * @param modifiable whether or not the document is modifiable. */ - resetPrintPreviewMode(url, grayscale, pageNumbers, modifiable) { + resetPrintPreviewMode( + url: string, grayscale: boolean, pageNumbers: number[], + modifiable: boolean) { this.loadState_ = LoadState.LOADING; this.sendMessage_({ type: 'resetPrintPreviewMode', @@ -279,15 +234,15 @@ /** * Load a page into the document while in print preview mode. - * @param {string} url the url of the pdf page to load. - * @param {number} index the index of the page to load. + * @param url the url of the pdf page to load. + * @param index the index of the page to load. */ - loadPreviewPage(url, index) { + loadPreviewPage(url: string, index: number) { this.sendMessage_({type: 'loadPreviewPage', url: url, index: index}); } - /** @param {boolean} darkMode Whether the page is in dark mode. */ - darkModeChanged(darkMode) { + /** @param darkMode Whether the page is in dark mode. */ + darkModeChanged(darkMode: boolean) { this.sendMessage_({type: 'darkModeChanged', darkMode: darkMode}); } @@ -302,11 +257,11 @@ /** * Get the selected text in the document. The callback will be called with the * text that is selected. May only be called after document load. - * @param {Function} callback a callback to be called with the selected text. - * @return {boolean} true if the function is successful, false if there is an + * @param callback a callback to be called with the selected text. + * @return Whether the function is successful, false if there is an * outstanding request for selected text that has not been answered. */ - getSelectedText(callback) { + getSelectedText(callback: (text: string) => void): boolean { if (this.selectedTextCallback_) { return false; } @@ -318,12 +273,12 @@ /** * Get the thumbnail data for a page. The data will be passed to a callback. * May only be called after document loaded. - * @param {number} page the page number. - * @param {Function} callback a callback to be called with the thumbnail data. - * @return {boolean} true if the function is successful, false if there is an + * @param page the page number. + * @param callback a callback to be called with the thumbnail data. + * @return Whether the function is successful, false if there is an * outstanding request for thumbnail data that has not been answered. */ - getThumbnail(page, callback) { + getThumbnail(page: number, callback: (data: ThumbnailData) => void): boolean { if (this.thumbnailCallback_) { return false; } @@ -342,18 +297,18 @@ /** * Send a key event to the extension. - * @param {Event} keyEvent the key event to send to the extension. + * @param keyEvent the key event to send to the extension. */ - sendKeyEvent(keyEvent) { + sendKeyEvent(keyEvent: KeyboardEvent) { this.sendMessage_( {type: 'sendKeyEvent', keyEvent: SerializeKeyEvent(keyEvent)}); } /** - * @param {number} scrollX The amount to horizontally scroll in pixels. - * @param {number} scrollY The amount to vertically scroll in pixels. + * @param scrollX The amount to horizontally scroll in pixels. + * @param scrollY The amount to vertically scroll in pixels. */ - scrollPosition(scrollX, scrollY) { + scrollPosition(scrollX: number, scrollY: number) { this.sendMessage_({type: 'scrollPosition', x: scrollX, y: scrollY}); } } @@ -363,14 +318,14 @@ * iframe which is navigated to the PDF viewer extension and 2) a scripting * interface which provides access to various features of the viewer for use * by print preview and accessibility. - * @param {string} src the source URL of the PDF to load initially. - * @param {string} baseUrl the base URL of the PDF viewer - * @return {!PDFPlugin} the iframe element containing the PDF viewer. + * @param src the source URL of the PDF to load initially. + * @param baseUrl the base URL of the PDF viewer + * @return The iframe element containing the PDF viewer. */ -export function PDFCreateOutOfProcessPlugin(src, baseUrl) { +export function PDFCreateOutOfProcessPlugin( + src: string, baseUrl: string): PDFPlugin { const client = new PDFScriptingAPI(window, null); - const iframe = /** @type {!HTMLIFrameElement} */ ( - window.document.createElement('iframe')); + const iframe = window.document.createElement('iframe') as PDFPlugin; iframe.setAttribute('src', baseUrl + '/index.html?' + src); iframe.onload = function() { @@ -388,5 +343,5 @@ iframe.setLoadCompleteCallback = client.setLoadCompleteCallback.bind(client); iframe.setViewportChangedCallback = client.setViewportChangedCallback.bind(client); - return /** @type {!PDFPlugin} */ (iframe); + return iframe; }
diff --git a/chrome/browser/resources/pdf/pdf_viewer.ts b/chrome/browser/resources/pdf/pdf_viewer.ts index 07aa14f..73b368e 100644 --- a/chrome/browser/resources/pdf/pdf_viewer.ts +++ b/chrome/browser/resources/pdf/pdf_viewer.ts
@@ -22,7 +22,7 @@ import {Bookmark} from './bookmark_type.js'; import {BrowserApi} from './browser_api.js'; -import {Attachment, DocumentMetadata, ExtendedKeyEvent, FittingType, KeyEventData, Point, SaveRequestType} from './constants.js'; +import {Attachment, DocumentMetadata, ExtendedKeyEvent, FittingType, Point, SaveRequestType} from './constants.js'; import {ContentController, MessageData, PluginController} from './controller.js'; import {ViewerErrorDialogElement} from './elements/viewer-error-dialog.js'; import {ViewerPasswordDialogElement} from './elements/viewer-password-dialog.js'; @@ -35,7 +35,7 @@ import {record, UserAction} from './metrics.js'; import {NavigatorDelegateImpl, PdfNavigator, WindowOpenDisposition} from './navigator.js'; import {DeserializeKeyEvent, LoadState} from './pdf_scripting_api.js'; -import {PDFViewerBaseElement} from './pdf_viewer_base.js'; +import {KeyEventData, PDFViewerBaseElement} from './pdf_viewer_base.js'; import {DestinationMessageData, DocumentDimensionsMessageData, hasCtrlModifier, shouldIgnoreKeyEvents} from './pdf_viewer_utils.js'; type EmailMessageData = {
diff --git a/chrome/browser/resources/pdf/pdf_viewer_base.ts b/chrome/browser/resources/pdf/pdf_viewer_base.ts index fc516fd..f0d19bc 100644 --- a/chrome/browser/resources/pdf/pdf_viewer_base.ts +++ b/chrome/browser/resources/pdf/pdf_viewer_base.ts
@@ -13,7 +13,7 @@ import {ContentController, MessageData, PluginController, PluginControllerEventType} from './controller.js'; import {record, recordFitTo, UserAction} from './metrics.js'; import {OpenPdfParams, OpenPdfParamsParser} from './open_pdf_params_parser.js'; -import {LoadState} from './pdf_scripting_api.js'; +import {LoadState, SerializedKeyEvent} from './pdf_scripting_api.js'; import {DocumentDimensionsMessageData} from './pdf_viewer_utils.js'; import {Viewport} from './viewport.js'; import {ViewportScroller} from './viewport_scroller.js'; @@ -33,6 +33,8 @@ return result; } +export type KeyEventData = MessageData&{keyEvent: SerializedKeyEvent}; + export abstract class PDFViewerBaseElement extends PolymerElement { static get is() { return 'pdf-viewer-base'; @@ -354,10 +356,6 @@ DocumentDimensionsMessageData) { this.documentDimensions = documentDimensions; this.isUserInitiatedEvent = false; - - // TODO(crbug.com/1260303): Remove suppression once viewport.js is migrated - // to TypeScript. - // @ts-ignore:next-line this.viewport_!.setDocumentDimensions(this.documentDimensions); this.paramsParser!.setViewportDimensions(this.viewport_!.size); this.isUserInitiatedEvent = true;
diff --git a/chrome/browser/resources/pdf/pdf_viewer_pp.ts b/chrome/browser/resources/pdf/pdf_viewer_pp.ts index 87d8bb2..18860bd4 100644 --- a/chrome/browser/resources/pdf/pdf_viewer_pp.ts +++ b/chrome/browser/resources/pdf/pdf_viewer_pp.ts
@@ -13,12 +13,12 @@ import {html} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import {BrowserApi} from './browser_api.js'; -import {ExtendedKeyEvent, FittingType, KeyEventData} from './constants.js'; +import {ExtendedKeyEvent, FittingType} from './constants.js'; import {MessageData, PluginController, PrintPreviewParams} from './controller.js'; import {ViewerPageIndicatorElement} from './elements/viewer-page-indicator.js'; import {ViewerZoomToolbarElement} from './elements/viewer-zoom-toolbar.js'; import {DeserializeKeyEvent, LoadState, SerializeKeyEvent} from './pdf_scripting_api.js'; -import {PDFViewerBaseElement} from './pdf_viewer_base.js'; +import {KeyEventData, PDFViewerBaseElement} from './pdf_viewer_base.js'; import {DestinationMessageData, DocumentDimensionsMessageData, hasCtrlModifier, shouldIgnoreKeyEvents} from './pdf_viewer_utils.js'; import {ToolbarManager} from './toolbar_manager.js';
diff --git a/chrome/browser/resources/pdf/pdf_viewer_utils.ts b/chrome/browser/resources/pdf/pdf_viewer_utils.ts index e4859c1..8a3e3af 100644 --- a/chrome/browser/resources/pdf/pdf_viewer_utils.ts +++ b/chrome/browser/resources/pdf/pdf_viewer_utils.ts
@@ -5,16 +5,7 @@ import {assert} from 'chrome://resources/js/assert_ts.js'; import {getDeepActiveElement} from 'chrome://resources/js/util.m.js'; -import {LayoutOptions} from './viewport.js'; - -// TODO(crbug.com/1260303): Move this to viewport.js once it is migrated to -// TypeScript. -type ViewportRect = { - x: number, - y: number, - width: number, - height: number, -}; +import {LayoutOptions, ViewportRect} from './viewport.js'; export type DocumentDimensionsMessageData = { type: string,
diff --git a/chrome/browser/resources/pdf/tsconfig_base.json b/chrome/browser/resources/pdf/tsconfig_base.json index 3e71f763..afa07315 100644 --- a/chrome/browser/resources/pdf/tsconfig_base.json +++ b/chrome/browser/resources/pdf/tsconfig_base.json
@@ -1,7 +1,6 @@ { "extends": "../../../../tools/typescript/tsconfig_base.json", "compilerOptions": { - "allowJs": true, "noUncheckedIndexedAccess": false, "noUnusedLocals": false, "strictPropertyInitialization": false
diff --git a/chrome/browser/resources/pdf/viewport.js b/chrome/browser/resources/pdf/viewport.ts similarity index 69% rename from chrome/browser/resources/pdf/viewport.js rename to chrome/browser/resources/pdf/viewport.ts index 5957848..41e3673 100644 --- a/chrome/browser/resources/pdf/viewport.js +++ b/chrome/browser/resources/pdf/viewport.ts
@@ -2,49 +2,43 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {assert, assertNotReached} from 'chrome://resources/js/assert.m.js'; +import {assert, assertNotReached} from 'chrome://resources/js/assert_ts.js'; import {EventTracker} from 'chrome://resources/js/event_tracker.m.js'; -import {$, hasKeyModifiers, isRTL} from 'chrome://resources/js/util.m.js'; +import {hasKeyModifiers, isRTL} from 'chrome://resources/js/util.m.js'; -import {FittingType, Point} from './constants.js'; +import {ExtendedKeyEvent, FittingType, Point} from './constants.js'; import {Gesture, GestureDetector, PinchEventDetail} from './gesture_detector.js'; import {UnseasonedPdfPluginElement} from './internal_plugin.js'; +import {ViewportInterface} from './viewport_scroller.js'; import {InactiveZoomManager, ZoomManager} from './zoom_manager.js'; -/** - * @typedef {{ - * width: number, - * height: number, - * layoutOptions: (!LayoutOptions|undefined), - * pageDimensions: Array<ViewportRect>, - * }} - */ -let DocumentDimensions; +export type ViewportRect = { + x: number, + y: number, + width: number, + height: number +}; -/** - * @typedef {{ - * direction: number, - * defaultPageOrientation: number, - * twoUpViewEnabled: boolean, - * }} - */ -export let LayoutOptions; +type DocumentDimensions = { + width: number, + height: number, + pageDimensions: ViewportRect[], + layoutOptions?: LayoutOptions, +}; -/** @typedef {{x: (number|undefined), y: (number|undefined)}} */ -export let PartialPoint; +export type LayoutOptions = { + direction: number, + defaultPageOrientation: number, + twoUpViewEnabled: boolean, +}; -/** @typedef {{width: number, height: number}} */ -export let Size; +export type Size = { + width: number, + height: number +}; -/** @typedef {{x: number, y: number, width: number, height: number}} */ -let ViewportRect; - -/** - * @param {!ViewportRect} rect1 - * @param {!ViewportRect} rect2 - * @return {number} The area of the intersection of the rects - */ -function getIntersectionArea(rect1, rect2) { +/** @return The area of the intersection of the rects */ +function getIntersectionArea(rect1: ViewportRect, rect2: ViewportRect): number { const left = Math.max(rect1.x, rect2.x); const top = Math.max(rect1.y, rect2.y); const right = Math.min(rect1.x + rect1.width, rect2.x + rect2.width); @@ -57,124 +51,87 @@ return (right - left) * (bottom - top); } -/** - * @param {!Point} p1 - * @param {!Point} p2 - * @return {!Point} The vector between the two points. - */ -function vectorDelta(p1, p2) { +/** @return The vector between the two points. */ +function vectorDelta(p1: Point, p2: Point): Point { return {x: p2.x - p1.x, y: p2.y - p1.y}; } +type HTMLElementWithExtras = HTMLElement&{ + scrollCallback(): void; + resizeCallback(): void; +}; + // TODO(crbug.com/1276456): Would Viewport be better as a Polymer element? -export class Viewport { +export class Viewport implements ViewportInterface { + private window_: HTMLElement; + private scrollContent_: ScrollContent; + private defaultZoom_: number; + + private viewportChangedCallback_: () => void; + private beforeZoomCallback_: () => void; + private afterZoomCallback_: () => void; + private userInitiatedCallback_: (userInitiated: boolean) => void; + + private allowedToChangeZoom_: boolean = false; + private internalZoom_: number = 1; + /** - * @param {!HTMLElement} container The element which contains the scrollable - * content. - * @param {!HTMLElement} sizer The element which represents the size of the - * scrollable content in the viewport - * @param {!HTMLElement} content The element which is the parent of the - * plugin in the viewer. - * @param {number} scrollbarWidth The width of scrollbars on the page - * @param {number} defaultZoom The default zoom level. + * Predefined zoom factors to be used when zooming in/out. These are in + * ascending order. */ - constructor(container, sizer, content, scrollbarWidth, defaultZoom) { - /** @private {!HTMLElement} */ + private presetZoomFactors_: number[] = []; + + private zoomManager_: ZoomManager|null = null; + private documentDimensions_: DocumentDimensions|null = null; + private pageDimensions_: ViewportRect[] = []; + private fittingType_: FittingType = FittingType.NONE; + private prevScale_: number = 1; + private smoothScrolling_: boolean = false; + private pinchPhase_: PinchPhase = PinchPhase.NONE; + private pinchPanVector_: Point|null = null; + private pinchCenter_: Point|null = null; + private firstPinchCenterInFrame_: Point|null = null; + private oldCenterInContent_: Point|null = null; + private keepContentCentered_: boolean = false; + private tracker_: EventTracker = new EventTracker(); + private gestureDetector_: GestureDetector; + private sentPinchEvent_: boolean = false; + + /** + * @param container The element which contains the scrollable content. + * @param sizer The element which represents the size of the scrollable + * content in the viewport + * @param content The element which is the parent of the plugin in the viewer. + * @param scrollbarWidth The width of scrollbars on the page + * @param defaultZoom The default zoom level. + */ + constructor( + container: HTMLElement, sizer: HTMLElement, content: HTMLElement, + scrollbarWidth: number, defaultZoom: number) { this.window_ = container; - /** @private {!ScrollContent} */ this.scrollContent_ = new ScrollContent(this.window_, sizer, content, scrollbarWidth); - /** @private {number} */ this.defaultZoom_ = defaultZoom; - /** @private {function():void} */ this.viewportChangedCallback_ = function() {}; - - /** @private {function():void} */ this.beforeZoomCallback_ = function() {}; - - /** @private {function():void} */ this.afterZoomCallback_ = function() {}; - - /** @private {function(boolean):void} */ this.userInitiatedCallback_ = function() {}; - /** @private {boolean} */ - this.allowedToChangeZoom_ = false; - - /** @private {number} */ - this.internalZoom_ = 1; - - /** - * Predefined zoom factors to be used when zooming in/out. These are in - * ascending order. - * @private {!Array<number>} - */ - this.presetZoomFactors_ = []; - - /** @private {?ZoomManager} */ - this.zoomManager_ = null; - - /** @private {?DocumentDimensions} */ - this.documentDimensions_ = null; - - /** @private {Array<ViewportRect>} */ - this.pageDimensions_ = []; - - /** @private {!FittingType} */ - this.fittingType_ = FittingType.NONE; - - /** @private {number} */ - this.prevScale_ = 1; - - /** @private {boolean} */ - this.smoothScrolling_ = false; - - /** @private {!PinchPhase} */ - this.pinchPhase_ = PinchPhase.NONE; - - /** @private {?Point} */ - this.pinchPanVector_ = null; - - /** @private {?Point} */ - this.pinchCenter_ = null; - - /** @private {?Point} */ - this.firstPinchCenterInFrame_ = null; - - /** @private {?Point} */ - this.oldCenterInContent_ = null; - - /** @private {boolean} */ - this.keepContentCentered_ = false; - - /** @private {!EventTracker} */ - this.tracker_ = new EventTracker(); - - /** @private {!GestureDetector} */ this.gestureDetector_ = new GestureDetector(content); - /** @private {boolean} */ - this.sentPinchEvent_ = false; - this.gestureDetector_.getEventTarget().addEventListener( 'pinchstart', - e => this.onPinchStart_( - /** @type {!CustomEvent<!PinchEventDetail>} */ (e))); + e => this.onPinchStart_(e as CustomEvent<PinchEventDetail>)); this.gestureDetector_.getEventTarget().addEventListener( 'pinchupdate', - e => this.onPinchUpdate_( - /** @type {!CustomEvent<!PinchEventDetail>} */ (e))); + e => this.onPinchUpdate_(e as CustomEvent<PinchEventDetail>)); this.gestureDetector_.getEventTarget().addEventListener( - 'pinchend', - e => this.onPinchEnd_( - /** @type {!CustomEvent<!PinchEventDetail>} */ (e))); + 'pinchend', e => this.onPinchEnd_(e as CustomEvent<PinchEventDetail>)); this.gestureDetector_.getEventTarget().addEventListener( - 'wheel', - e => this.onWheel_( - /** @type {!CustomEvent<!PinchEventDetail>} */ (e))); + 'wheel', e => this.onWheel_(e as CustomEvent<PinchEventDetail>)); // Set to a default zoom manager - used in tests. this.setZoomManager(new InactiveZoomManager(this.getZoom.bind(this), 1)); @@ -187,19 +144,21 @@ this.scrollContent_.setEventTarget(window); // The following line is only used in tests, since they expect // |scrollCallback| to be called on the mock |window_| object (legacy). - this.window_.scrollCallback = this.updateViewport_.bind(this); + (this.window_ as HTMLElementWithExtras).scrollCallback = + this.updateViewport_.bind(this); window.addEventListener('resize', this.resizeWrapper_.bind(this)); // The following line is only used in tests, since they expect // |resizeCallback| to be called on the mock |window_| object (legacy). - this.window_.resizeCallback = this.resizeWrapper_.bind(this); + (this.window_ as HTMLElementWithExtras).resizeCallback = + this.resizeWrapper_.bind(this); } else { // Standard PDF viewer this.window_.addEventListener('scroll', this.updateViewport_.bind(this)); this.scrollContent_.setEventTarget(this.window_); const resizeObserver = new ResizeObserver(_ => this.resizeWrapper_()); const target = this.window_.parentElement; - assert(target.id === 'main'); - resizeObserver.observe(target); + assert(target!.id === 'main'); + resizeObserver.observe(target!); } document.body.addEventListener( @@ -208,88 +167,79 @@ /** * Sets whether the viewport is in Presentation mode. - * @param {boolean} enabled */ - setPresentationMode(enabled) { + setPresentationMode(enabled: boolean) { assert((document.fullscreenElement !== null) === enabled); this.gestureDetector_.setPresentationMode(enabled); } /** * Sets the contents of the viewport, scrolling within the viewport's window. - * @param {?Node} content The new viewport contents, or null to clear the - * viewport. + * @param content The new viewport contents, or null to clear the viewport. */ - setContent(content) { + setContent(content: Node|null) { this.scrollContent_.setContent(content); } /** * Sets the contents of the viewport, scrolling within the content's window. - * @param {!UnseasonedPdfPluginElement} content The new viewport contents. + * @param content The new viewport contents. */ - setRemoteContent(content) { + setRemoteContent(content: UnseasonedPdfPluginElement) { this.scrollContent_.setRemoteContent(content); } /** * Synchronizes scroll position from remote content. - * @param {!Point} position */ - syncScrollFromRemote(position) { + syncScrollFromRemote(position: Point) { this.scrollContent_.syncScrollFromRemote(position); } /** * Receives acknowledgment of scroll position synchronized to remote content. - * @param {!Point} position */ - ackScrollToRemote(position) { + ackScrollToRemote(position: Point) { this.scrollContent_.ackScrollToRemote(position); } - /** @param {function():void} viewportChangedCallback */ - setViewportChangedCallback(viewportChangedCallback) { + setViewportChangedCallback(viewportChangedCallback: () => void) { this.viewportChangedCallback_ = viewportChangedCallback; } - /** @param {function():void} beforeZoomCallback */ - setBeforeZoomCallback(beforeZoomCallback) { + setBeforeZoomCallback(beforeZoomCallback: () => void) { this.beforeZoomCallback_ = beforeZoomCallback; } - /** @param {function():void} afterZoomCallback */ - setAfterZoomCallback(afterZoomCallback) { + setAfterZoomCallback(afterZoomCallback: () => void) { this.afterZoomCallback_ = afterZoomCallback; } - /** @param {function(boolean):void} userInitiatedCallback */ - setUserInitiatedCallback(userInitiatedCallback) { + setUserInitiatedCallback( + userInitiatedCallback: (userInitiated: boolean) => void) { this.userInitiatedCallback_ = userInitiatedCallback; } /** - * @return {number} The number of clockwise 90-degree rotations that have been - * applied. + * @return The number of clockwise 90-degree rotations that have been applied. */ - getClockwiseRotations() { + getClockwiseRotations(): number { const options = this.getLayoutOptions(); return options ? options.defaultPageOrientation : 0; } - /** @return {boolean} Whether viewport is in two-up view mode. */ - twoUpViewEnabled() { + /** @return Whether viewport is in two-up view mode. */ + twoUpViewEnabled(): boolean { const options = this.getLayoutOptions(); return !!options && options.twoUpViewEnabled; } /** * Clamps the zoom factor (or page scale factor) to be within the limits. - * @param {number} factor The zoom/scale factor. - * @return {number} The factor clamped within the limits. - * @private + * @param factor The zoom/scale factor. + * @return The factor clamped within the limits. */ - clampZoom_(factor) { + private clampZoom_(factor: number): number { return Math.max( this.presetZoomFactors_[0], Math.min( @@ -297,10 +247,8 @@ this.presetZoomFactors_[this.presetZoomFactors_.length - 1])); } - /** - * @param {!Array<number>} factors Array containing zoom/scale factors. - */ - setZoomFactorRange(factors) { + /** @param factors Array containing zoom/scale factors. */ + setZoomFactorRange(factors: number[]) { assert(factors.length !== 0); this.presetZoomFactors_ = factors; } @@ -308,20 +256,17 @@ /** * Converts a page position (e.g. the location of a bookmark) to a screen * position. - * @param {number} page - * @param {!Point} point The position on `page`. - * @return {!Point} The screen position. + * @param point The position on `page`. + * @return The screen position. */ - convertPageToScreen(page, point) { + convertPageToScreen(page: number, point: Point): Point { const dimensions = this.getPageInsetDimensions(page); // width & height are already rotated. const height = dimensions.height; const width = dimensions.width; - // TODO(dpapad): Use the no-arg constructor when - // https://github.com/google/closure-compiler/issues/3768 is fixed. - const matrix = new DOMMatrix([1, 0, 0, 1, 0, 0]); + const matrix = new DOMMatrix(); const rotation = this.getClockwiseRotations() * 90; // Set origin for rotation. @@ -354,11 +299,10 @@ * Rounding is necessary when interacting with the renderer which tends to * operate in integral values (for example for determining if scrollbars * should be shown). - * @param {number} zoom The zoom to use to compute the scaled dimensions. - * @return {?Size} Scaled 'width' and 'height' of the document. - * @private + * @param zoom The zoom to use to compute the scaled dimensions. + * @return Scaled 'width' and 'height' of the document. */ - getZoomedDocumentDimensions_(zoom) { + private getZoomedDocumentDimensions_(zoom: number): Size|null { if (!this.documentDimensions_) { return null; } @@ -368,28 +312,22 @@ }; } - /** @return {!Size} A dictionary with the 'width'/'height' of the document. */ - getDocumentDimensions() { + /** @return A dictionary with the 'width'/'height' of the document. */ + getDocumentDimensions(): Size { return { - width: this.documentDimensions_.width, - height: this.documentDimensions_.height + width: this.documentDimensions_!.width, + height: this.documentDimensions_!.height }; } - /** - * @return {!LayoutOptions|undefined} A dictionary carrying layout options - * from the plugin. - */ - getLayoutOptions() { + /** @return A dictionary carrying layout options from the plugin. */ + getLayoutOptions(): LayoutOptions|undefined { return this.documentDimensions_ ? this.documentDimensions_.layoutOptions : undefined; } - /** - * @return {!ViewportRect} ViewportRect for the viewport given current zoom. - * @private - */ - getViewportRect_() { + /** @return ViewportRect for the viewport given current zoom. */ + private getViewportRect_(): ViewportRect { const zoom = this.getZoom(); // Zoom can be 0 in the case of a PDF that is in a hidden iframe. Avoid // returning undefined values in this case. See https://crbug.com/1202725. @@ -410,12 +348,12 @@ } /** - * @param {number} zoom Zoom to compute scrollbars for - * @return {{horizontal: boolean, vertical: boolean}} Whether horizontal or - * vertical scrollbars are needed. + * @param zoom Zoom to compute scrollbars for + * @return Whether horizontal or vertical scrollbars are needed. * Public so tests can call it directly. */ - documentNeedsScrollbars(zoom) { + documentNeedsScrollbars(zoom: number): + {horizontal: boolean, vertical: boolean} { const zoomedDimensions = this.getZoomedDocumentDimensions_(zoom); if (!zoomedDimensions) { return {horizontal: false, vertical: false}; @@ -428,19 +366,17 @@ } /** - * @return {!{horizontal: boolean, vertical: boolean}} Whether horizontal and - * vertical scrollbars are needed. + * @return Whether horizontal and vertical scrollbars are needed. */ - documentHasScrollbars() { + documentHasScrollbars(): {horizontal: boolean, vertical: boolean} { return this.documentNeedsScrollbars(this.getZoom()); } /** * Helper function called when the zoomed document size changes. Updates the * sizer's width and height. - * @private */ - contentSizeChanged_() { + private contentSizeChanged_() { const zoomedDimensions = this.getZoomedDocumentDimensions_(this.getZoom()); if (zoomedDimensions) { this.scrollContent_.setSize( @@ -448,29 +384,20 @@ } } - /** - * Called when the viewport should be updated. - * @private - */ - updateViewport_() { + /** Called when the viewport should be updated. */ + private updateViewport_() { this.viewportChangedCallback_(); } - /** - * Called when the browser window size changes. - * @private - */ - resizeWrapper_() { + /** Called when the browser window size changes. */ + private resizeWrapper_() { this.userInitiatedCallback_(false); this.resize_(); this.userInitiatedCallback_(true); } - /** - * Called when the viewport size changes. - * @private - */ - resize_() { + /** Called when the viewport size changes. */ + private resize_() { // Force fit-to-height when resizing happens as a result of entering full // screen mode. if (document.fullscreenElement !== null) { @@ -492,8 +419,8 @@ } } - /** @return {!Point} The scroll position of the viewport. */ - get position() { + /** @return The scroll position of the viewport. */ + get position(): Point { return { x: this.scrollContent_.scrollLeft, y: this.scrollContent_.scrollTop, @@ -502,72 +429,66 @@ /** * Scroll the viewport to the specified position. - * @param {!Point} position The position to scroll to. - * @param {boolean} isSmooth Whether to scroll smoothly. + * @param position The position to scroll to. + * @param isSmooth Whether to scroll smoothly. */ - setPosition(position, isSmooth = false) { + setPosition(position: Point, isSmooth: boolean = false) { this.scrollContent_.scrollTo(position.x, position.y, isSmooth); } - /** @return {!Size} The size of the viewport. */ - get size() { + /** @return The size of the viewport. */ + get size(): Size { return { width: this.window_.offsetWidth, height: this.window_.offsetHeight, }; } - /** - * Gets the content size. - * @return {!Size} - */ - get contentSize() { + /** Gets the content size. */ + get contentSize(): Size { return this.scrollContent_.size; } - /** @return {number} The current zoom. */ - getZoom() { - return this.zoomManager_.applyBrowserZoom(this.internalZoom_); + /** @return The current zoom. */ + getZoom(): number { + return this.zoomManager_!.applyBrowserZoom(this.internalZoom_); } - /** @return {!Array<number>} The preset zoom factors. */ - get presetZoomFactors() { + /** @return The preset zoom factors. */ + get presetZoomFactors(): number[] { return this.presetZoomFactors_; } - /** @param {!ZoomManager} manager */ - setZoomManager(manager) { + setZoomManager(manager: ZoomManager) { this.resetTracker(); this.zoomManager_ = manager; this.tracker_.add( - this.zoomManager_.getEventTarget(), 'set-zoom', - e => this.setZoom(e.detail)); + this.zoomManager_!.getEventTarget(), 'set-zoom', + (e: CustomEvent<number>) => this.setZoom(e.detail)); this.tracker_.add( - this.zoomManager_.getEventTarget(), 'update-zoom-from-browser', + this.zoomManager_!.getEventTarget(), 'update-zoom-from-browser', this.updateZoomFromBrowserChange_.bind(this)); } /** - * @return {!PinchPhase} The phase of the current pinch gesture for - * the viewport. + * @return The phase of the current pinch gesture for the viewport. */ - get pinchPhase() { + get pinchPhase(): PinchPhase { return this.pinchPhase_; } /** - * @return {?Point} The panning caused by the current pinch gesture (as - * the deltas of the x and y coordinates). + * @return The panning caused by the current pinch gesture (as the deltas of + * the x and y coordinates). */ - get pinchPanVector() { + get pinchPanVector(): Point|null { return this.pinchPanVector_; } /** - * @return {?Point} The coordinates of the center of the current pinch - * gesture. + * @return The coordinates of the center of the current pinch gesture. */ - get pinchCenter() { + get pinchCenter(): Point|null { return this.pinchCenter_; } @@ -576,23 +497,17 @@ * required so that we can notify the plugin that zooming is in progress * so that while zooming is taking place it can stop reacting to scroll events * from the viewport. This is to avoid flickering. - * @param {function():void} f Function to wrap - * @private */ - mightZoom_(f) { + private mightZoom_(f: () => void) { this.beforeZoomCallback_(); this.allowedToChangeZoom_ = true; f(); this.allowedToChangeZoom_ = false; this.afterZoomCallback_(); - this.zoomManager_.onPdfZoomChange(); + this.zoomManager_!.onPdfZoomChange(); } - /** - * @param {number} newZoom The zoom level to set. - * @private - */ - setZoomInternal_(newZoom) { + private setZoomInternal_(newZoom: number) { assert( this.allowedToChangeZoom_, 'Called Viewport.setZoomInternal_ without calling ' + @@ -617,11 +532,10 @@ /** * Sets the zoom of the viewport. * Same as setZoomInternal_ but for pinch zoom we have some more operations. - * @param {number} scaleDelta The zoom delta. - * @param {!Point} center The pinch center in plugin coordinates. - * @private + * @param scaleDelta The zoom delta. + * @param center The pinch center in plugin coordinates. */ - setPinchZoomInternal_(scaleDelta, center) { + private setPinchZoomInternal_(scaleDelta: number, center: Point) { assert( this.allowedToChangeZoom_, 'Called Viewport.setPinchZoomInternal_ without calling ' + @@ -629,9 +543,8 @@ this.internalZoom_ = this.clampZoom_(this.internalZoom_ * scaleDelta); assert(this.oldCenterInContent_); - const delta = vectorDelta( - /** @type {!Point} */ (this.oldCenterInContent_), - this.pluginToContent_(center)); + const delta = + vectorDelta(this.oldCenterInContent_, this.pluginToContent_(center)); // Record the scroll position (relative to the pinch center). const zoom = this.getZoom(); @@ -647,11 +560,10 @@ /** * Converts a point from plugin to content coordinates. - * @param {!Point} pluginPoint The plugin coordinates. - * @return {!Point} The content coordinates. - * @private + * @param pluginPoint The plugin coordinates. + * @return The content coordinates. */ - pluginToContent_(pluginPoint) { + private pluginToContent_(pluginPoint: Point): Point { // TODO(mcnee) Add a helper Point class to avoid duplicating operations // on plain {x,y} objects. const zoom = this.getZoom(); @@ -661,8 +573,8 @@ }; } - /** @param {number} newZoom The zoom level to zoom to. */ - setZoom(newZoom) { + /** @param newZoom The zoom level to zoom to. */ + setZoom(newZoom: number) { this.fittingType_ = FittingType.NONE; this.mightZoom_(() => { this.setZoomInternal_(this.clampZoom_(newZoom)); @@ -670,11 +582,8 @@ }); } - /** - * @param {!CustomEvent<number>} e Event containing the old browser zoom. - * @private - */ - updateZoomFromBrowserChange_(e) { + /** @param e Event containing the old browser zoom. */ + private updateZoomFromBrowserChange_(e: CustomEvent<number>) { const oldBrowserZoom = e.detail; this.mightZoom_(() => { // Record the scroll position (relative to the top-left of the window). @@ -696,32 +605,26 @@ /** * Gets the width of scrollbars in the viewport in pixels. - * @return {number} */ - get scrollbarWidth() { + get scrollbarWidth(): number { return this.scrollContent_.scrollbarWidth; } /** * Gets the width of overlay scrollbars in the viewport in pixels, or 0 if not * using overlay scrollbars. - * @return {number} */ - get overlayScrollbarWidth() { + get overlayScrollbarWidth(): number { return this.scrollContent_.overlayScrollbarWidth; } - /** @return {FittingType} The fitting type the viewport is currently in. */ - get fittingType() { + /** @return The fitting type the viewport is currently in. */ + get fittingType(): FittingType { return this.fittingType_; } - /** - * @param {number} index - * @return {number} The y coordinate of the bottom of the given page. - * @private - */ - getPageBottom_(index) { + /** @return The y coordinate of the bottom of the given page. */ + private getPageBottom_(index: number): number { return this.pageDimensions_[index].y + this.pageDimensions_[index].height; } @@ -729,11 +632,10 @@ * Get the page at a given y position. If there are multiple pages * overlapping the given y-coordinate, return the page with the smallest * index. - * @param {number} y The y-coordinate to get the page at. - * @return {number} The index of a page overlapping the given y-coordinate. - * @private + * @param y The y-coordinate to get the page at. + * @return The index of a page overlapping the given y-coordinate. */ - getPageAtY_(y) { + private getPageAtY_(y: number): number { assert(y >= 0); // Drop decimal part of |y| otherwise it can appear as larger than the @@ -775,17 +677,14 @@ // Should always return within the while loop above. assertNotReached('Could not find page for Y position: ' + y); - return -1; } /** * Return the last page visible in the viewport. Returns the last index of the * document if the viewport is below the document. - * @param {!ViewportRect} viewportRect - * @return {number} The highest index of the pages visible in the viewport. - * @private + * @return The highest index of the pages visible in the viewport. */ - getLastPageInViewport_(viewportRect) { + private getLastPageInViewport_(viewportRect: ViewportRect): number { const pageAtY = this.getPageAtY_(viewportRect.y + viewportRect.height); if (!this.twoUpViewEnabled() || pageAtY % 2 === 1 || @@ -798,11 +697,8 @@ pageAtY; } - /** - * @param {!Point} point - * @return {boolean} Whether |point| (in screen coordinates) is inside a page - */ - isPointInsidePage(point) { + /** @return Whether |point| (in screen coordinates) is inside a page. */ + isPointInsidePage(point: Point): boolean { const zoom = this.getZoom(); const size = this.size; const position = this.position; @@ -824,10 +720,10 @@ } /** - * @return {number} The index of the page with the greatest proportion of its - * area in the current viewport. + * @return The index of the page with the greatest proportion of its area in + * the current viewport. */ - getMostVisiblePage() { + getMostVisiblePage(): number { const viewportRect = this.getViewportRect_(); const firstVisiblePage = this.getPageAtY_(viewportRect.y); @@ -864,15 +760,14 @@ /** * Compute the zoom level for fit-to-page, fit-to-width or fit-to-height. * At least one of {fitWidth, fitHeight} must be true. - * @param {!Size} pageDimensions The dimensions of a given page in px. - * @param {boolean} fitWidth Whether the whole width of the page needs to be - * in the viewport. - * @param {boolean} fitHeight Whether the whole height of the page needs to be - * in the viewport. - * @return {number} The internal zoom to set - * @private + * @param pageDimensions The dimensions of a given page in px. + * @param fitWidth Whether the whole width of the page needs to be in the + * viewport. + * @param fitHeight Whether the whole height of the page needs to be in the + * viewport. */ - computeFittingZoom_(pageDimensions, fitWidth, fitHeight) { + private computeFittingZoom_( + pageDimensions: Size, fitWidth: boolean, fitHeight: boolean): number { assert( fitWidth || fitHeight, 'Invalid parameters. At least one of fitWidth and fitHeight must be ' + @@ -892,6 +787,7 @@ } const zoomedDimensions = this.getZoomedDocumentDimensions_(zoom); + assert(zoomedDimensions !== null); // Check if adding a scrollbar will result in needing the other scrollbar. const scrollbarWidth = this.scrollContent_.scrollbarWidth; @@ -922,28 +818,25 @@ windowWithScrollbars.height, pageDimensions.width, pageDimensions.height); - return this.zoomManager_.internalZoomComponent(zoom); + return this.zoomManager_!.internalZoomComponent(zoom); } /** * Compute a zoom level given the dimensions to fit and the actual numbers * in those dimensions. - * @param {boolean} fitWidth Whether to constrain the page width to the - * window. - * @param {boolean} fitHeight Whether to constrain the page height to the - * window. - * @param {number} windowWidth Width of the window in px. - * @param {number} windowHeight Height of the window in px. - * @param {number} pageWidth Width of the page in px. - * @param {number} pageHeight Height of the page in px. - * @return {number} The internal zoom to set - * @private + * @param fitWidth Whether to constrain the page width to the window. + * @param fitHeight Whether to constrain the page height to the window. + * @param windowWidth Width of the window in px. + * @param windowHeight Height of the window in px. + * @param pageWidth Width of the page in px. + * @param pageHeight Height of the page in px. */ - computeFittingZoomGivenDimensions_( - fitWidth, fitHeight, windowWidth, windowHeight, pageWidth, pageHeight) { + private computeFittingZoomGivenDimensions_( + fitWidth: boolean, fitHeight: boolean, windowWidth: number, + windowHeight: number, pageWidth: number, pageHeight: number): number { // Assumes at least one of {fitWidth, fitHeight} is set. - let zoomWidth; - let zoomHeight; + let zoomWidth: number|null = null; + let zoomHeight: number|null = null; if (fitWidth) { zoomWidth = windowWidth / pageWidth; @@ -953,14 +846,14 @@ zoomHeight = windowHeight / pageHeight; } - let zoom; + let zoom: number; if (!fitWidth && fitHeight) { - zoom = zoomHeight; + zoom = zoomHeight!; } else if (fitWidth && !fitHeight) { - zoom = zoomWidth; + zoom = zoomWidth!; } else { // Assume fitWidth && fitHeight - zoom = Math.min(zoomWidth, zoomHeight); + zoom = Math.min(zoomWidth!, zoomHeight!); } return Math.max(zoom, 0); @@ -983,12 +876,11 @@ /** * Zoom the viewport so that the page height consumes the entire viewport. - * @param {boolean} scrollToTopOfPage Set to true if the viewport should be - * scrolled to the top of the current page. Set to false if the viewport - * should remain at the current scroll position. - * @private + * @param scrollToTopOfPage Set to true if the viewport should be scrolled to + * the top of the current page. Set to false if the viewport should remain + * at the current scroll position. */ - fitToHeightInternal_(scrollToTopOfPage) { + private fitToHeightInternal_(scrollToTopOfPage: boolean) { this.mightZoom_(() => { this.fittingType_ = FittingType.FIT_TO_HEIGHT; if (!this.documentDimensions_) { @@ -1019,12 +911,11 @@ /** * Zoom the viewport so that a page consumes as much as possible of the it. - * @param {boolean} scrollToTopOfPage Whether the viewport should be scrolled - * to the top of the current page. If false, the viewport will remain at - * the current scroll position. - * @private + * @param scrollToTopOfPage Whether the viewport should be scrolled to the top + * of the current page. If false, the viewport will remain at the current + * scroll position. */ - fitToPageInternal_(scrollToTopOfPage) { + private fitToPageInternal_(scrollToTopOfPage: boolean) { this.mightZoom_(() => { this.fittingType_ = FittingType.FIT_TO_PAGE; if (!this.documentDimensions_) { @@ -1100,12 +991,7 @@ }); } - /** - * @param {!KeyboardEvent} e - * @param {boolean} formFieldFocused - * @private - */ - pageUpDownSpaceHandler_(e, formFieldFocused) { + private pageUpDownSpaceHandler_(e: KeyboardEvent, formFieldFocused: boolean) { // Avoid scrolling if the space key is down while a form field is focused // on since the user might be typing space into the field. if (formFieldFocused && e.key === ' ') { @@ -1137,12 +1023,7 @@ this.window_.dispatchEvent(new CustomEvent('scroll-proceeded-for-testing')); } - /** - * @param {!KeyboardEvent} e - * @param {boolean} formFieldFocused - * @private - */ - arrowLeftRightHandler_(e, formFieldFocused) { + private arrowLeftRightHandler_(e: KeyboardEvent, formFieldFocused: boolean) { if (formFieldFocused || hasKeyModifiers(e)) { return; } @@ -1164,12 +1045,7 @@ } } - /** - * @param {!KeyboardEvent} e - * @param {boolean} formFieldFocused - * @private - */ - arrowUpDownHandler_(e, formFieldFocused) { + private arrowUpDownHandler_(e: KeyboardEvent, formFieldFocused: boolean) { if (formFieldFocused || hasKeyModifiers(e)) { return; } @@ -1190,12 +1066,11 @@ /** * Handle certain directional key events. - * @param {!KeyboardEvent} e the event to handle. - * @param {boolean} formFieldFocused Whether a form field is currently - * focused. - * @return {boolean} Whether the event was handled. + * @param formFieldFocused Whether a form field is currently focused. + * @return Whether the event was handled. */ - handleDirectionalKeyEvent(e, formFieldFocused) { + handleDirectionalKeyEvent(e: KeyboardEvent, formFieldFocused: boolean): + boolean { switch (e.key) { case ' ': this.pageUpDownSpaceHandler_(e, formFieldFocused); @@ -1248,19 +1123,17 @@ /** * Go to the given page index. - * @param {number} page the index of the page to go to. zero-based. + * @param page the index of the page to go to. zero-based. */ - goToPage(page) { + goToPage(page: number) { this.goToPageAndXY(page, 0, 0); } /** * Go to the given y position in the given page index. - * @param {number} page the index of the page to go to. zero-based. - * @param {number|undefined} x the x position in the page to go to. - * @param {number|undefined} y the y position in the page to go to. + * @param page the index of the page to go to. zero-based. */ - goToPageAndXY(page, x, y) { + goToPageAndXY(page: number, x: number|undefined, y: number|undefined) { this.mightZoom_(() => { if (this.pageDimensions_.length === 0) { return; @@ -1275,8 +1148,7 @@ // If `x` or `y` is not a valid number or specified, then that // coordinate of the current viewport position should be retained. - const currentCoords = - /** @type {!Point} */ (this.retrieveCurrentScreenCoordinates_()); + const currentCoords = this.retrieveCurrentScreenCoordinates_(); if (x === undefined || Number.isNaN(x)) { x = currentCoords.x; } @@ -1292,11 +1164,7 @@ }); } - /** - * @param {DocumentDimensions} documentDimensions The dimensions of the - * document - */ - setDocumentDimensions(documentDimensions) { + setDocumentDimensions(documentDimensions: DocumentDimensions) { this.mightZoom_(() => { const initialDimensions = !this.documentDimensions_; this.documentDimensions_ = documentDimensions; @@ -1324,11 +1192,8 @@ }); } - /** - * @param {number} page - * @return {ViewportRect} The bounds for page `page` minus the shadows. - */ - getPageInsetDimensions(page) { + /** @return The bounds for page `page` minus the shadows. */ + getPageInsetDimensions(page: number): ViewportRect { const pageDimensions = this.pageDimensions_[page]; const shadow = PAGE_SHADOW; return { @@ -1342,10 +1207,10 @@ /** * Get the coordinates of the page contents (excluding the page shadow) * relative to the screen. - * @param {number} page The index of the page to get the rect for. - * @return {!ViewportRect} A rect representing the page in screen coordinates. + * @param page The index of the page to get the rect for. + * @return A rect representing the page in screen coordinates. */ - getPageScreenRect(page) { + getPageScreenRect(page: number): ViewportRect { if (!this.documentDimensions_) { return {x: 0, y: 0, width: 0, height: 0}; } @@ -1382,10 +1247,9 @@ * Check if the current fitting type is a paged mode. * In a paged mode, page up and page down scroll to the top of the * previous/next page and part of the page is under the toolbar. - * @return {boolean} Whether the current fitting type is a paged mode. - * @private + * @return Whether the current fitting type is a paged mode. */ - isPagedMode_() { + private isPagedMode_(): boolean { return ( this.fittingType_ === FittingType.FIT_TO_PAGE || this.fittingType_ === FittingType.FIT_TO_HEIGHT); @@ -1393,10 +1257,8 @@ /** * Retrieves the in-screen coordinates of the current viewport position. - * @return {!Point} The current viewport position. - * @private */ - retrieveCurrentScreenCoordinates_() { + private retrieveCurrentScreenCoordinates_(): Point { const currentPage = this.getMostVisiblePage(); const dimension = this.pageDimensions_[currentPage]; const x = this.position.x / this.getZoom() - dimension.x; @@ -1406,31 +1268,25 @@ /** * Handles a navigation request to a destination from the current controller. - * @param {number} page - * @param {number|undefined} x The in-screen x coordinate for the destination. + * @param x The in-screen x coordinate for the destination. * If `x` is undefined, retain current x coordinate value. - * @param {number|undefined} y The in-screen y coordinate for the destination. + * @param y The in-screen y coordinate for the destination. * If `y` is undefined, retain current y coordinate value. - * @param {number} zoom */ - handleNavigateToDestination(page, x, y, zoom) { + handleNavigateToDestination( + page: number, x: number|undefined, y: number|undefined, zoom: number) { if (zoom) { this.setZoom(zoom); } this.goToPageAndXY(page, x, y); } - /** - * @param {boolean} isSmooth - */ - setSmoothScrolling(isSmooth) { + setSmoothScrolling(isSmooth: boolean) { this.smoothScrolling_ = isSmooth; } - /** - * @param {!PartialPoint} point The position to which to scroll the viewport. - */ - scrollTo(point) { + /** @param point The position to which to scroll the viewport. */ + scrollTo(point: Partial<Point>) { let changed = false; const newPosition = this.position; if (point.x !== undefined && point.x !== newPosition.x) { @@ -1447,8 +1303,8 @@ } } - /** @param {!Point} delta The delta by which to scroll the viewport. */ - scrollBy(delta) { + /** @param delta The delta by which to scroll the viewport. */ + scrollBy(delta: Point) { const newPosition = this.position; newPosition.x += delta.x; newPosition.y += delta.y; @@ -1464,19 +1320,16 @@ /** * Dispatches a gesture external to this viewport. - * @param {!Gesture} gesture The gesture to dispatch. */ - dispatchGesture(gesture) { + dispatchGesture(gesture: Gesture) { this.gestureDetector_.getEventTarget().dispatchEvent( new CustomEvent(gesture.type, {detail: gesture.detail})); } /** * A callback that's called when an update to a pinch zoom is detected. - * @param {!CustomEvent<!PinchEventDetail>} e the pinch event. - * @private */ - onPinchUpdate_(e) { + private onPinchUpdate_(e: CustomEvent<PinchEventDetail>) { // Throttle number of pinch events to one per frame. if (this.sentPinchEvent_) { return; @@ -1490,14 +1343,14 @@ this.pinchPhase_ = direction === 'out' ? PinchPhase.UPDATE_ZOOM_OUT : PinchPhase.UPDATE_ZOOM_IN; - const scaleDelta = startScaleRatio / this.prevScale_; + const scaleDelta = startScaleRatio! / this.prevScale_; if (this.firstPinchCenterInFrame_ != null) { this.pinchPanVector_ = vectorDelta(center, this.firstPinchCenterInFrame_); } const needsScrollbars = - this.documentNeedsScrollbars(this.zoomManager_.applyBrowserZoom( + this.documentNeedsScrollbars(this.zoomManager_!.applyBrowserZoom( this.clampZoom_(this.internalZoom_ * scaleDelta))); this.pinchCenter_ = center; @@ -1522,24 +1375,22 @@ this.setPinchZoomInternal_(scaleDelta, center); this.updateViewport_(); - this.prevScale_ = /** @type {number} */ (startScaleRatio); + this.prevScale_ = startScaleRatio!; }); }); } /** * A callback that's called when the end of a pinch zoom is detected. - * @param {!CustomEvent<!PinchEventDetail>} e the pinch event. - * @private */ - onPinchEnd_(e) { + private onPinchEnd_(e: CustomEvent<PinchEventDetail>) { // Using rAF for pinch end prevents pinch updates scheduled by rAF getting // sent after the pinch end. window.requestAnimationFrame(() => { this.mightZoom_(() => { const {center, startScaleRatio} = e.detail; this.pinchPhase_ = PinchPhase.END; - const scaleDelta = startScaleRatio / this.prevScale_; + const scaleDelta = startScaleRatio! / this.prevScale_; this.pinchCenter_ = center; this.setPinchZoomInternal_(scaleDelta, this.pinchCenter_); @@ -1555,10 +1406,8 @@ /** * A callback that's called when the start of a pinch zoom is detected. - * @param {!CustomEvent<!PinchEventDetail>} e the pinch event. - * @private */ - onPinchStart_(e) { + private onPinchStart_(e: CustomEvent<PinchEventDetail>) { // Disable pinch gestures in Presentation mode. if (document.fullscreenElement !== null) { return; @@ -1581,10 +1430,8 @@ /** * A callback that's called when a Presentation mode wheel event is detected. - * @param {!CustomEvent<!PinchEventDetail>} e the pinch event. - * @private */ - onWheel_(e) { + private onWheel_(e: CustomEvent<PinchEventDetail>) { if (e.detail.direction === 'down') { this.goToNextPage(); } else { @@ -1592,8 +1439,7 @@ } } - /** @return {!GestureDetector} */ - getGestureDetectorForTesting() { + getGestureDetectorForTesting(): GestureDetector { return this.gestureDetector_; } } @@ -1601,109 +1447,78 @@ /** * Enumeration of pinch states. * This should match PinchPhase enum in pdf/pdf_view_plugin_base.cc. - * @enum {number} */ -export const PinchPhase = { - NONE: 0, - START: 1, - UPDATE_ZOOM_OUT: 2, - UPDATE_ZOOM_IN: 3, - END: 4, -}; +export enum PinchPhase { + NONE = 0, + START = 1, + UPDATE_ZOOM_OUT = 2, + UPDATE_ZOOM_IN = 3, + END = 4, +} /** * The increment to scroll a page by in pixels when up/down/left/right arrow * keys are pressed. Usually we just let the browser handle scrolling on the * window when these keys are pressed but in certain cases we need to simulate * these events. - * @type {number} */ -const SCROLL_INCREMENT = 40; +const SCROLL_INCREMENT: number = 40; /** * Returns whether a keyboard event came from another frame. - * @param {!KeyboardEvent} keyEvent - * @return {boolean} */ -function isCrossFrameKeyEvent(keyEvent) { - // TODO(crbug.com/1279516): Consider moving these properties to a custom - // KeyboardEvent subtype, if it doesn't become obsolete entirely. - const custom = - /** - * @type {!{ - * fromPlugin: (boolean|undefined), - * fromScriptingAPI: (boolean|undefined), - * }} - */ - (keyEvent); - return !!custom.fromPlugin || !!custom.fromScriptingAPI; +function isCrossFrameKeyEvent(keyEvent: ExtendedKeyEvent): boolean { + return !!keyEvent.fromPlugin || !!keyEvent.fromScriptingAPI; } /** * The width of the page shadow around pages in pixels. - * @type {!{top: number, bottom: number, left: number, right: number}} */ -export const PAGE_SHADOW = { - top: 3, - bottom: 7, - left: 5, - right: 5 -}; +export const PAGE_SHADOW: + {top: number, bottom: number, left: number, right: number} = { + top: 3, + bottom: 7, + left: 5, + right: 5, + }; /** * A wrapper around the viewport's scrollable content. This abstraction isolates * details concerning internal vs. external scrolling behavior. */ class ScrollContent { + private readonly container_: HTMLElement; + private readonly sizer_: HTMLElement; + private target_: EventTarget|null = null; + private readonly content_: HTMLElement; + private readonly scrollbarWidth_: number; + private unseasonedPlugin_: UnseasonedPdfPluginElement|null = null; + private width_: number = 0; + private height_: number = 0; + private scrollLeft_: number = 0; + private scrollTop_: number = 0; + private unackedScrollsToRemote_: number = 0; + /** - * @param {!Element} container The element which contains the scrollable + * @param container The element which contains the scrollable content. + * @param sizer The element which represents the size of the scrollable * content. - * @param {!Element} sizer The element which represents the size of the - * scrollable content. - * @param {!Element} content The element which is the parent of the scrollable - * content. - * @param {number} scrollbarWidth The width of any scrollbars. + * @param content The element which is the parent of the scrollable content. + * @param scrollbarWidth The width of any scrollbars. */ - constructor(container, sizer, content, scrollbarWidth) { - /** @private @const {!Element} */ + constructor( + container: HTMLElement, sizer: HTMLElement, content: HTMLElement, + scrollbarWidth: number) { this.container_ = container; - - /** @private @const {!Element} */ this.sizer_ = sizer; - - /** @private {?EventTarget} */ - this.target_ = null; - - /** @private @const {!Element} */ this.content_ = content; - - /** @private @const {number} */ this.scrollbarWidth_ = scrollbarWidth; - - /** @private {?UnseasonedPdfPluginElement} */ - this.unseasonedPlugin_ = null; - - /** @private {number} */ - this.width_ = 0; - - /** @private {number} */ - this.height_ = 0; - - /** @private {number} */ - this.scrollLeft_ = 0; - - /** @private {number} */ - this.scrollTop_ = 0; - - /** @private {number} */ - this.unackedScrollsToRemote_ = 0; } /** * Sets the target for dispatching "scroll" events. - * @param {!EventTarget} target */ - setEventTarget(target) { + setEventTarget(target: EventTarget) { this.target_ = target; } @@ -1716,9 +1531,9 @@ /** * Sets the contents, switching to scrolling locally. - * @param {?Node} content The new contents, or null to clear. + * @param content The new contents, or null to clear. */ - setContent(content) { + setContent(content: Node|null) { if (content === null) { this.sizer_.style.display = 'none'; return; @@ -1739,9 +1554,9 @@ /** * Sets the contents, switching to scrolling remotely. - * @param {!UnseasonedPdfPluginElement} content The new contents. + * @param content The new contents. */ - setRemoteContent(content) { + setRemoteContent(content: UnseasonedPdfPluginElement) { this.attachContent_(content); // Switch to remote content. @@ -1758,10 +1573,9 @@ /** * Attaches the contents to the DOM. - * @param {!Node} content The new contents. - * @private + * @param content The new contents. */ - attachContent_(content) { + private attachContent_(content: Node) { // We don't actually replace the content in the DOM, as the controller // implementations take care of "removal" in controller-specific ways: // @@ -1775,9 +1589,8 @@ /** * Synchronizes scroll position from remote content. - * @param {!Point} position */ - syncScrollFromRemote(position) { + syncScrollFromRemote(position: Point) { if (this.unackedScrollsToRemote_ > 0) { // Don't overwrite scroll position while scrolls-to-remote are pending. // TODO(crbug.com/1246398): Don't need this if we make this synchronous @@ -1797,9 +1610,8 @@ /** * Receives acknowledgment of scroll position synchronized to remote content. - * @param {!Point} position */ - ackScrollToRemote(position) { + ackScrollToRemote(position: Point) { assert(this.unackedScrollsToRemote_ > 0); if (--this.unackedScrollsToRemote_ === 0) { @@ -1811,13 +1623,11 @@ this.dispatchScroll_(); } - /** @return {number} */ - get scrollbarWidth() { + get scrollbarWidth(): number { return this.scrollbarWidth_; } - /** @return {number} */ - get overlayScrollbarWidth() { + get overlayScrollbarWidth(): number { let overlayScrollbarWidth = 0; // TODO(crbug.com/1286009): Support overlay scrollbars on all platforms. @@ -1833,30 +1643,22 @@ return overlayScrollbarWidth; } - /** - * Gets the content size. - * @return {!Size} - */ - get size() { + /** Gets the content size. */ + get size(): Size { return { width: this.width_, height: this.height_, }; } - /** - * Sets the content size. - * @param {number} width - * @param {number} height - */ - setSize(width, height) { + /** Sets the content size. */ + setSize(width: number, height: number) { this.width_ = width; this.height_ = height; this.updateSize_(); } - /** @private */ - updateSize_() { + private updateSize_() { if (this.unseasonedPlugin_) { this.unseasonedPlugin_.postMessage({ type: 'updateSize', @@ -1871,28 +1673,24 @@ /** * Gets the scroll offset from the left edge. - * @return {number} */ - get scrollLeft() { + get scrollLeft(): number { return this.unseasonedPlugin_ ? this.scrollLeft_ : this.container_.scrollLeft; } /** * Gets the scroll offset from the top edge. - * @return {number} */ - get scrollTop() { + get scrollTop(): number { return this.unseasonedPlugin_ ? this.scrollTop_ : this.container_.scrollTop; } /** * Scrolls to the given coordinates. - * @param {number} x - * @param {number} y - * @param {boolean} isSmooth Whether to scroll smoothly. + * @param isSmooth Whether to scroll smoothly. */ - scrollTo(x, y, isSmooth = false) { + scrollTo(x: number, y: number, isSmooth: boolean = false) { if (this.unseasonedPlugin_) { // TODO(crbug.com/1277228): Can get NaN if zoom calculations divide by 0. x = Number.isNaN(x) ? 0 : x; @@ -1937,13 +1735,12 @@ /** * Computes maximum scroll position. - * @param {number} maxContent The maximum content dimension. - * @param {number} maxContainer The maximum container dimension. - * @param {boolean} hasScrollbar Whether to compensate for a scrollbar. - * @return {number} - * @private + * @param maxContent The maximum content dimension. + * @param maxContainer The maximum container dimension. + * @param hasScrollbar Whether to compensate for a scrollbar. */ - maxScroll_(maxContent, maxContainer, hasScrollbar) { + private maxScroll_( + maxContent: number, maxContainer: number, hasScrollbar: boolean): number { if (hasScrollbar) { maxContainer -= this.scrollbarWidth_; }
diff --git a/chrome/browser/resources/pdf/viewport_scroller.ts b/chrome/browser/resources/pdf/viewport_scroller.ts index 76a545b..bc4c35e 100644 --- a/chrome/browser/resources/pdf/viewport_scroller.ts +++ b/chrome/browser/resources/pdf/viewport_scroller.ts
@@ -9,8 +9,6 @@ y: number, }; -// TODO(crbug.com/1260303): Move this to viewport.js once it is migrated to -// TypeScript, or constants.ts? export interface ViewportInterface { position: Point; setPosition(point: Point): void;
diff --git a/chrome/browser/resources/settings/chromeos/multidevice_page/multidevice_page.html b/chrome/browser/resources/settings/chromeos/multidevice_page/multidevice_page.html index 3524a05..077d679 100644 --- a/chrome/browser/resources/settings/chromeos/multidevice_page/multidevice_page.html +++ b/chrome/browser/resources/settings/chromeos/multidevice_page/multidevice_page.html
@@ -120,9 +120,10 @@ on-click="nearbyShareClick_"> <iron-icon icon="os-settings:nearby-share"> </iron-icon> - <div id="nearbyShareLabel" class="middle settings-box-text" - aria-hidden="true"> - $i18n{nearbyShareTitle} + <div id="nearbyShareLabel" class="middle settings-box-text"> + <div aria-hidden="true"> + $i18n{nearbyShareTitle} + </div> <template is="dom-if" if="[[showNearbyShareOnOffString_( prefs.nearby_sharing.onboarding_complete.value, pageContentData)]]" restamp>
diff --git a/chrome/browser/resources/settings/privacy_sandbox/app.html b/chrome/browser/resources/settings/privacy_sandbox/app.html index 7fa9f91d..edbba59 100644 --- a/chrome/browser/resources/settings/privacy_sandbox/app.html +++ b/chrome/browser/resources/settings/privacy_sandbox/app.html
@@ -124,8 +124,12 @@ padding: 0 0 8px 16px; } - #trialsCardSettings3 > *:not(:last-child) { - border-bottom: var(--cr-separator-line); + #trialsCardSettings3 > cr-link-row { + border-top: var(--cr-separator-line); + } + + #trialsDescription { + padding-bottom: var(--cr-section-vertical-padding); } #adPersonalizationBackButton { @@ -177,19 +181,21 @@ <settings-toggle-button id="trialsToggle" pref="{{prefs.privacy_sandbox.apis_enabled_v2}}" label="$i18n{privacySandboxTrialsTitle}" - sub-label="$i18n{privacySandboxTrialsSummary}" on-change="onApiToggleButtonChange_"> </settings-toggle-button> + <div id="trialsDescription" class="cr-row continuation"> + <div class="secondary"> + $i18n{privacySandboxTrialsSummary} + <a id="learnMoreLink" on-click="onLearnMoreClick_"> + $i18n{privacySandboxTrialsSummaryLearnMore} + </a> + </div> + </div> <cr-link-row id="adPersonalizationRow" start-icon="privacy-sandbox:ads-click" label="$i18n{privacySandboxAdPersonalizationTitle}" + sub-label="$i18n{privacySandboxAdPersonalizationSummary}" on-click="onAdPersonalizationRowClick_"> - <div slot="sub-label"> - $i18n{privacySandboxAdPersonalizationSummary} - <a id="learnMoreLink" on-click="onLearnMoreClick_"> - $i18n{learnMore} - </a> - </div> </cr-link-row> <cr-link-row id="adMeasurementRow" start-icon="privacy-sandbox:insert-chart" @@ -221,22 +227,19 @@ <span class="learn-more-section-subtitle"> $i18n{privacySandboxLearnMoreDialogDataTypes} </span> - <!-- TODO(crbug/1286276): Replace this with real string. --> - $i18n{privacySandboxAdMeasurementSummary} + $i18n{privacySandboxLearnMoreDialogTopicsDataTypes} </li> <li> <span class="learn-more-section-subtitle"> $i18n{privacySandboxLearnMoreDialogDataUsage} </span> - <!-- TODO(crbug/1286276): Replace this with real string. --> - $i18n{privacySandboxAdMeasurementSummary} + $i18n{privacySandboxLearnMoreDialogTopicsDataUsage} </li> <li> <span class="learn-more-section-subtitle"> $i18n{privacySandboxLearnMoreDialogDataManagement} </span> - <!-- TODO(crbug/1286276): Replace this with real string. --> - $i18n{privacySandboxAdMeasurementSummary} + $i18n{privacySandboxLearnMoreDialogTopicsDataManagement} </li> </ul> </div> @@ -249,22 +252,19 @@ <span class="learn-more-section-subtitle"> $i18n{privacySandboxLearnMoreDialogDataTypes} </span> - <!-- TODO(crbug/1286276): Replace this with real string. --> - $i18n{privacySandboxAdMeasurementSummary} + $i18n{privacySandboxLearnMoreDialogFledgeDataTypes} </li> <li> <span class="learn-more-section-subtitle"> $i18n{privacySandboxLearnMoreDialogDataUsage} </span> - <!-- TODO(crbug/1286276): Replace this with real string. --> - $i18n{privacySandboxAdMeasurementSummary} + $i18n{privacySandboxLearnMoreDialogFledgeDataUsage} </li> <li> <span class="learn-more-section-subtitle"> $i18n{privacySandboxLearnMoreDialogDataManagement} </span> - <!-- TODO(crbug/1286276): Replace this with real string. --> - $i18n{privacySandboxAdMeasurementSummary} + $i18n{privacySandboxLearnMoreDialogFledgeDataManagement} </li> </ul> </div> @@ -299,6 +299,9 @@ <div class="dialog-description"> $i18n{privacySandboxAdPersonalizationDialogTopicsLearnMore3} </div> + <div class="dialog-description"> + $i18n{privacySandboxAdPersonalizationDialogTopicsLearnMore4} + </div> </paper-tooltip> </div> <div id="topTopicsSection" class="ad-personalization-section"> @@ -369,12 +372,12 @@ on-click="onAdPersonalizationBackButtonClick_"> </cr-icon-button> <span class="flex"> - $i18n{privacySandboxAdPersonalizationDialogTitle} + $i18n{privacySandboxAdPersonalizationRemovedDialogTitle} </span> </div> <div slot="body"> <div class="dialog-description"> - $i18n{privacySandboxAdPersonalizationDialogRemovedDescription} + $i18n{privacySandboxAdPersonalizationRemovedDialogDescription} </div> <div class="ad-personalization-section-title"> $i18n{privacySandboxAdPersonalizationDialogTopicsTitle}
diff --git a/chrome/browser/resources/signin/profile_picker/profile_creation_flow/shared_css.html b/chrome/browser/resources/signin/profile_picker/profile_creation_flow/shared_css.html index 77be5b2a..3a5efd3c 100644 --- a/chrome/browser/resources/signin/profile_picker/profile_creation_flow/shared_css.html +++ b/chrome/browser/resources/signin/profile_picker/profile_creation_flow/shared_css.html
@@ -37,14 +37,15 @@ --cr-icon-button-icon-size: 22px; --cr-icon-button-margin-start: 4px; --cr-icon-button-size: 36px; - margin-top: 4px; + margin-inline-start: 16px; + margin-top: 0; position: relative; z-index: 1; } @media (forced-colors: none) { #backButton { - --cr-icon-button-fill-color: var(--theme-text-color); + --cr-icon-button-fill-color: var(--cr-secondary-text-color); } }
diff --git a/chrome/browser/resources/usb_internals/devices_page.js b/chrome/browser/resources/usb_internals/devices_page.js index 5712fffe..657549c 100644 --- a/chrome/browser/resources/usb_internals/devices_page.js +++ b/chrome/browser/resources/usb_internals/devices_page.js
@@ -125,7 +125,7 @@ const tabClone = document.importNode(tabTemplate.content, true); const tab = tabClone.querySelector('tab'); - if (device.productName) { + if (device.productName && device.productName.data.length > 0) { tab.textContent = decodeString16(device.productName); } else { const vendorId = toHex(device.vendorId).slice(2);
diff --git a/chrome/browser/segmentation_platform/segmentation_platform_service_factory.cc b/chrome/browser/segmentation_platform/segmentation_platform_service_factory.cc index 77281e1..07f91141 100644 --- a/chrome/browser/segmentation_platform/segmentation_platform_service_factory.cc +++ b/chrome/browser/segmentation_platform/segmentation_platform_service_factory.cc
@@ -10,6 +10,7 @@ #include "base/task/thread_pool.h" #include "base/time/default_clock.h" #include "chrome/browser/browser_process.h" +#include "chrome/browser/history/history_service_factory.h" #include "chrome/browser/optimization_guide/optimization_guide_keyed_service.h" #include "chrome/browser/optimization_guide/optimization_guide_keyed_service_factory.h" #include "chrome/browser/profiles/profile.h" @@ -50,6 +51,7 @@ "SegmentationPlatformService", BrowserContextDependencyManager::GetInstance()) { DependsOn(OptimizationGuideKeyedServiceFactory::GetInstance()); + DependsOn(HistoryServiceFactory::GetInstance()); } SegmentationPlatformServiceFactory::~SegmentationPlatformServiceFactory() = @@ -63,6 +65,9 @@ Profile* profile = Profile::FromBrowserContext(context); OptimizationGuideKeyedService* optimization_guide = OptimizationGuideKeyedServiceFactory::GetForProfile(profile); + history::HistoryService* history_service = + HistoryServiceFactory::GetForProfile(profile, + ServiceAccessType::IMPLICIT_ACCESS); // If optimization guide feature is disabled, then disable segmentation. if (!optimization_guide) return new DummySegmentationPlatformService(); @@ -79,7 +84,7 @@ auto* service = new SegmentationPlatformServiceImpl( optimization_guide, db_provider, storage_dir, UkmDatabaseClient::GetInstance().GetUkmDataManager(), profile->GetPrefs(), - task_runner, clock, GetSegmentationPlatformConfig()); + history_service, task_runner, clock, GetSegmentationPlatformConfig()); service->SetUserData(kSegmentationPlatformProfileObserverKey, std::make_unique<SegmentationPlatformProfileObserver>(
diff --git a/chrome/browser/sync/test/integration/ash_lacros_sync_test.cc b/chrome/browser/sync/test/integration/ash_lacros_sync_test.cc new file mode 100644 index 0000000..145156d --- /dev/null +++ b/chrome/browser/sync/test/integration/ash_lacros_sync_test.cc
@@ -0,0 +1,140 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "ash/constants/ash_features.h" +#include "chrome/browser/ash/crosapi/browser_util.h" +#include "chrome/browser/sync/test/integration/sync_test.h" +#include "components/sync/driver/sync_service.h" +#include "components/sync/driver/sync_service_impl.h" +#include "components/sync/driver/sync_user_settings.h" +#include "content/public/test/browser_test.h" + +namespace { + +// Test fixture running in Ash, with LacrosPrimary enabled. +class LacrosPrimaryAshSyncTest : public SyncTest { + public: + LacrosPrimaryAshSyncTest() : SyncTest(SINGLE_CLIENT) { + feature_list_.InitWithFeatures({ash::features::kSyncSettingsCategorization, + chromeos::features::kLacrosSupport, + chromeos::features::kLacrosPrimary}, + {}); + } + ~LacrosPrimaryAshSyncTest() override = default; + + private: + base::test::ScopedFeatureList feature_list_; +}; + +// Test fixture running in Ash, with LacrosOnly enabled. +class LacrosOnlyAshSyncTest : public SyncTest { + public: + LacrosOnlyAshSyncTest() : SyncTest(SINGLE_CLIENT) { + feature_list_.InitWithFeatures( + {ash::features::kSyncSettingsCategorization, + chromeos::features::kLacrosSupport, chromeos::features::kLacrosPrimary, + chromeos::features::kLacrosOnly}, + {}); + } + ~LacrosOnlyAshSyncTest() override = default; + + private: + base::test::ScopedFeatureList feature_list_; +}; + +IN_PROC_BROWSER_TEST_F(LacrosPrimaryAshSyncTest, AshSyncsAllTypes) { + // With LacrosPrimary (but not LacrosOnly), Sync in the Ash browser is still + // enabled. + ASSERT_TRUE(crosapi::browser_util::IsAshBrowserSyncEnabled()); + + ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; + + syncer::SyncService* sync_service = GetSyncService(0); + syncer::SyncUserSettings* user_settings = sync_service->GetUserSettings(); + + // Both browser types and OS types should be selectable in Ash. + // NOTE: For now, while Lacros is in development, we check the full set + // equality here. Longer term, it's probably sufficient (and more robust) to + // just spot-check a few "representative" types. + + // All the browser types should be selectable in Ash, except for Apps and + // WifiConfigurations which are part of the selectable *OS* types. + EXPECT_EQ( + user_settings->GetRegisteredSelectableTypes(), + syncer::UserSelectableTypeSet(syncer::UserSelectableType::kBookmarks, + syncer::UserSelectableType::kPreferences, + syncer::UserSelectableType::kPasswords, + syncer::UserSelectableType::kAutofill, + syncer::UserSelectableType::kThemes, + syncer::UserSelectableType::kHistory, + syncer::UserSelectableType::kExtensions, + syncer::UserSelectableType::kReadingList, + syncer::UserSelectableType::kTabs)) + << "Actual: " + << syncer::UserSelectableTypeSetToString( + user_settings->GetRegisteredSelectableTypes()); + + // All the OS types should be selectable in Ash too. + EXPECT_EQ(user_settings->GetRegisteredSelectableOsTypes(), + syncer::UserSelectableOsTypeSet( + syncer::UserSelectableOsType::kOsApps, + syncer::UserSelectableOsType::kOsPreferences, + syncer::UserSelectableOsType::kOsWifiConfigurations)) + << "Actual: " + << syncer::UserSelectableOsTypeSetToString( + user_settings->GetRegisteredSelectableOsTypes()); + + // All of the model types, both browser and OS, should be active. + EXPECT_EQ( + sync_service->GetActiveDataTypes(), + syncer::ModelTypeSet( + syncer::BOOKMARKS, syncer::PREFERENCES, syncer::PASSWORDS, + syncer::AUTOFILL_PROFILE, syncer::AUTOFILL, + syncer::AUTOFILL_WALLET_DATA, syncer::AUTOFILL_WALLET_METADATA, + syncer::AUTOFILL_WALLET_OFFER, syncer::THEMES, syncer::TYPED_URLS, + syncer::EXTENSIONS, syncer::SEARCH_ENGINES, syncer::SESSIONS, + syncer::APPS, syncer::APP_SETTINGS, syncer::EXTENSION_SETTINGS, + syncer::HISTORY_DELETE_DIRECTIVES, syncer::DICTIONARY, + syncer::DEVICE_INFO, syncer::PRIORITY_PREFERENCES, syncer::APP_LIST, + syncer::ARC_PACKAGE, syncer::PRINTERS, syncer::READING_LIST, + syncer::USER_EVENTS, syncer::USER_CONSENTS, syncer::SEND_TAB_TO_SELF, + syncer::SECURITY_EVENTS, syncer::WIFI_CONFIGURATIONS, + syncer::OS_PREFERENCES, syncer::OS_PRIORITY_PREFERENCES, + syncer::SHARING_MESSAGE, syncer::WORKSPACE_DESK, syncer::PROXY_TABS, + syncer::NIGORI)); +} + +IN_PROC_BROWSER_TEST_F(LacrosOnlyAshSyncTest, AshSyncsOnlyOSTypes) { + // With LacrosOnly, Sync in the Ash browser is not enabled anymore. + ASSERT_FALSE(crosapi::browser_util::IsAshBrowserSyncEnabled()); + + ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; + + syncer::SyncService* sync_service = GetSyncService(0); + syncer::SyncUserSettings* user_settings = sync_service->GetUserSettings(); + + // No browser types should be selectable in Ash now. + EXPECT_TRUE(user_settings->GetRegisteredSelectableTypes().Empty()); + + // But all the OS types should be selectable. + EXPECT_EQ(user_settings->GetRegisteredSelectableOsTypes(), + syncer::UserSelectableOsTypeSet( + syncer::UserSelectableOsType::kOsApps, + syncer::UserSelectableOsType::kOsPreferences, + syncer::UserSelectableOsType::kOsWifiConfigurations)) + << "Actual: " + << syncer::UserSelectableOsTypeSetToString( + user_settings->GetRegisteredSelectableOsTypes()); + + // Only OS ModelTypes should be active + EXPECT_EQ( + sync_service->GetActiveDataTypes(), + syncer::ModelTypeSet( + syncer::DEVICE_INFO, syncer::APP_LIST, syncer::ARC_PACKAGE, + syncer::PRINTERS, syncer::USER_CONSENTS, syncer::WIFI_CONFIGURATIONS, + syncer::OS_PREFERENCES, syncer::OS_PRIORITY_PREFERENCES, + syncer::WORKSPACE_DESK, syncer::NIGORI)); +} + +} // namespace
diff --git a/chrome/browser/sync/test/integration/enable_disable_test.cc b/chrome/browser/sync/test/integration/enable_disable_test.cc index 65fd819..b6f43ea 100644 --- a/chrome/browser/sync/test/integration/enable_disable_test.cc +++ b/chrome/browser/sync/test/integration/enable_disable_test.cc
@@ -19,7 +19,6 @@ #include "components/sync/base/user_selectable_type.h" #include "components/sync/driver/glue/sync_transport_data_prefs.h" #include "components/sync/driver/sync_service_impl.h" -#include "components/sync/driver/sync_user_settings_impl.h" #include "components/sync/test/fake_server/bookmark_entity_builder.h" #include "components/sync/test/fake_server/entity_builder_factory.h" #include "content/public/test/browser_test.h" @@ -47,7 +46,7 @@ ModelTypeSet multi; for (UserSelectableType type : UserSelectableTypeSet::All()) { const ModelTypeSet grouped_types = - syncer::SyncUserSettingsImpl::ResolvePreferredTypesForTesting({type}); + syncer::UserSelectableTypeToAllModelTypes(type); for (ModelType grouped_type : grouped_types) { if (seen.Has(grouped_type)) { multi.Put(grouped_type); @@ -111,7 +110,7 @@ ModelTypeSet ResolveGroup(UserSelectableType type) { ModelTypeSet grouped_types = - syncer::SyncUserSettingsImpl::ResolvePreferredTypesForTesting({type}); + syncer::UserSelectableTypeToAllModelTypes(type); grouped_types.RetainAll(registered_data_types_); return grouped_types; }
diff --git a/chrome/browser/sync/test/integration/sync_test.cc b/chrome/browser/sync/test/integration/sync_test.cc index a8525a3..83493ab 100644 --- a/chrome/browser/sync/test/integration/sync_test.cc +++ b/chrome/browser/sync/test/integration/sync_test.cc
@@ -367,6 +367,7 @@ #if BUILDFLAG(IS_CHROMEOS_ASH) cl->AppendSwitch(ash::switches::kIgnoreUserProfileMappingForTests); cl->AppendSwitch(ash::switches::kDisableArcOptInVerification); + cl->AppendSwitch(ash::switches::kDisableLacrosKeepAliveForTesting); arc::SetArcAvailableCommandLineForTesting(cl); #endif }
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd index 35b9954c..81e77f4 100644 --- a/chrome/browser/ui/android/strings/android_chrome_strings.grd +++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
@@ -5141,6 +5141,10 @@ Reaction moved </message> + <message name="IDS_LIGHTWEIGHT_REACTIONS_REACTION_DELETED_ANNOUNCEMENT" is_accessibility_with_no_ui="true" desc="The accessibility text to read when a reaction is deleted."> + Reaction deleted + </message> + <message name="IDS_LIGHTWEIGHT_REACTIONS_TOOLBAR_ANNOUNCEMENT" is_accessibility_with_no_ui="true" desc="The accessibility text to read when the lightweight reactions toolbar is selected. The user can then select a reaction from the toolbar to place on the screen."> Choose an emotion </message>
diff --git a/chrome/browser/ui/app_list/app_list_sort_browsertest.cc b/chrome/browser/ui/app_list/app_list_sort_browsertest.cc index 3aca17e..fd39a14 100644 --- a/chrome/browser/ui/app_list/app_list_sort_browsertest.cc +++ b/chrome/browser/ui/app_list/app_list_sort_browsertest.cc
@@ -1155,7 +1155,7 @@ // Verify that switching to tablet mode when the fade out animation in clamshell // mode is running works as expected. IN_PROC_BROWSER_TEST_F(AppListSortBrowserTest, - TransitionToTabletModeDuringFadeOutAnimation) { + DISABLED_TransitionToTabletModeDuringFadeOutAnimation) { ash::ShellTestApi().SetTabletModeEnabledForTest(false); ash::AcceleratorController::Get()->PerformActionIfEnabled( ash::TOGGLE_APP_LIST_FULLSCREEN, {}); @@ -1193,8 +1193,9 @@ // Verify that switching to clamshell mode when the fade out animation in tablet // mode is running works as expected. // TODO(crbug.com/1302924): Flaky. -IN_PROC_BROWSER_TEST_F(AppListSortBrowserTest, - TransitionToClamshellModeDuringFadeOutAnimation) { +IN_PROC_BROWSER_TEST_F( + AppListSortBrowserTest, + DISABLED_TransitionToClamshellModeDuringFadeOutAnimation) { ash::ShellTestApi().SetTabletModeEnabledForTest(true); ash::AcceleratorController::Get()->PerformActionIfEnabled(
diff --git a/chrome/browser/ui/ash/desks_templates/desks_templates_client_browsertest.cc b/chrome/browser/ui/ash/desks_templates/desks_templates_client_browsertest.cc index 6eccc71..3a6efb96 100644 --- a/chrome/browser/ui/ash/desks_templates/desks_templates_client_browsertest.cc +++ b/chrome/browser/ui/ash/desks_templates/desks_templates_client_browsertest.cc
@@ -66,6 +66,7 @@ #include "components/keep_alive_registry/keep_alive_types.h" #include "components/keep_alive_registry/scoped_keep_alive.h" #include "components/policy/policy_constants.h" +#include "components/services/app_service/public/cpp/app_types.h" #include "content/public/test/browser_test.h" #include "content/public/test/test_navigation_observer.h" #include "content/public/test/test_utils.h" @@ -301,7 +302,7 @@ MOCK_METHOD(void, LaunchSystemWebAppOrChromeApp, - (apps::mojom::AppType, + (apps::AppType, const std::string&, const app_restore::RestoreData::LaunchList&), (override));
diff --git a/chrome/browser/ui/browser_command_controller.cc b/chrome/browser/ui/browser_command_controller.cc index 73c2fc4..f9d291e 100644 --- a/chrome/browser/ui/browser_command_controller.cc +++ b/chrome/browser/ui/browser_command_controller.cc
@@ -70,6 +70,10 @@ #include "ui/base/ui_base_features.h" #include "ui/events/keycodes/keyboard_codes.h" +#if BUILDFLAG(IS_LINUX) +#include "ui/accessibility/accessibility_features.h" +#endif + #if BUILDFLAG(IS_MAC) #include "chrome/browser/ui/browser_commands_mac.h" #endif @@ -884,6 +888,12 @@ ExecuteUIDebugCommand(id, browser_); break; +#if BUILDFLAG(IS_LINUX) + case IDC_RUN_SCREEN_AI: + RunScreenAi(browser_); + break; +#endif + default: LOG(WARNING) << "Received Unimplemented Command: " << id; break; @@ -1421,6 +1431,11 @@ command_updater_.UpdateCommandEnabled( IDC_FOCUS_INACTIVE_POPUP_FOR_ACCESSIBILITY, main_not_fullscreen); +#if BUILDFLAG(IS_LINUX) + command_updater_.UpdateCommandEnabled(IDC_RUN_SCREEN_AI, + features::IsScreenAIEnabled()); +#endif + // Show various bits of UI command_updater_.UpdateCommandEnabled(IDC_DEVELOPER_MENU, show_main_ui); #if BUILDFLAG(GOOGLE_CHROME_BRANDING)
diff --git a/chrome/browser/ui/browser_commands.cc b/chrome/browser/ui/browser_commands.cc index 137d7124..8194cfc 100644 --- a/chrome/browser/ui/browser_commands.cc +++ b/chrome/browser/ui/browser_commands.cc
@@ -176,6 +176,11 @@ #include "chromeos/lacros/lacros_service.h" #endif +#if BUILDFLAG(IS_LINUX) +#include "ui/accessibility/ax_action_data.h" +#include "ui/accessibility/ax_enums.mojom.h" +#endif + namespace { const char kOsOverrideForTabletSite[] = "Linux; Android 9; Chrome tablet"; @@ -1868,4 +1873,15 @@ feed::FollowSite(web_contents); } +#if BUILDFLAG(IS_LINUX) +void RunScreenAi(Browser* browser) { + ui::AXActionData ad; + ad.action = ax::mojom::Action::kRunScreenAi; + browser->tab_strip_model() + ->GetActiveWebContents() + ->GetMainFrame() + ->AccessibilityPerformAction(ad); +} +#endif // BUILDFLAG(IS_LINUX) + } // namespace chrome
diff --git a/chrome/browser/ui/browser_commands.h b/chrome/browser/ui/browser_commands.h index 5bac947..f5f7fe7 100644 --- a/chrome/browser/ui/browser_commands.h +++ b/chrome/browser/ui/browser_commands.h
@@ -250,6 +250,11 @@ // Follows a web feed associated with the main frame of specified web contents. void FollowSite(Browser* browser, content::WebContents* web_contents); +#if BUILDFLAG(IS_LINUX) +// Triggers the Screen AI to be run once on the |browser|. +void RunScreenAi(Browser* browser); +#endif // BUILDFLAG(IS_LINUX) + } // namespace chrome #endif // CHROME_BROWSER_UI_BROWSER_COMMANDS_H_
diff --git a/chrome/browser/ui/cocoa/touchbar/browser_window_default_touch_bar.h b/chrome/browser/ui/cocoa/touchbar/browser_window_default_touch_bar.h index 0f4f2192..2bc4b6114 100644 --- a/chrome/browser/ui/cocoa/touchbar/browser_window_default_touch_bar.h +++ b/chrome/browser/ui/cocoa/touchbar/browser_window_default_touch_bar.h
@@ -52,6 +52,9 @@ @property(readonly, class) NSImage* starActiveIcon; @property(readonly, class) NSImage* navigateStopIcon; @property(readonly, class) NSImage* reloadIcon; +@property(readonly, class) NSString* homeItemIdentifier; + +- (NSButton*)searchButton; // Returns the bridge object that BrowserWindowDefaultTouchBar uses to receive // notifications.
diff --git a/chrome/browser/ui/cocoa/touchbar/browser_window_default_touch_bar.mm b/chrome/browser/ui/cocoa/touchbar/browser_window_default_touch_bar.mm index d145c4f..0bad2bd 100644 --- a/chrome/browser/ui/cocoa/touchbar/browser_window_default_touch_bar.mm +++ b/chrome/browser/ui/cocoa/touchbar/browser_window_default_touch_bar.mm
@@ -283,6 +283,16 @@ // The starred button in the touch bar. base::scoped_nsobject<NSButton> _starredButton; + + // The search button in the touch bar. + base::scoped_nsobject<NSButton> _searchButton; + + // The last created BrowserWindowDefaultTouchBar (cached until it needs a + // rebuild). + base::scoped_nsobject<NSTouchBar> _touchBar; + + // The existence of the Home button in the Touch Bar. + bool _touchBarHasHomeButton; } // Creates and returns a touch bar for tab non-fullscreen mode. @@ -297,8 +307,8 @@ // Updates the reload / stop button in the touch bar. - (void)updateReloadStopButton; -// Creates and returns the search button. -- (NSView*)searchTouchBarView; +// Updates the search button in the touch bar. +- (void)updateSearchTouchBarButton; @end @@ -391,7 +401,8 @@ setCustomizationLabel:l10n_util::GetNSString( IDS_TOUCH_BAR_BOOKMARK_CUSTOMIZATION_LABEL)]; } else if ([identifier hasSuffix:kSearchTouchId]) { - [touchBarItem setView:[self searchTouchBarView]]; + [self updateSearchTouchBarButton]; + [touchBarItem setView:_searchButton.get()]; [touchBarItem setCustomizationLabel:l10n_util::GetNSString( IDS_TOUCH_BAR_GOOGLE_SEARCH)]; } else if ([identifier hasSuffix:kFullscreenOriginLabelTouchId]) { @@ -434,37 +445,46 @@ } - (NSTouchBar*)createTabTouchBar { - base::scoped_nsobject<NSTouchBar> touchBar([[NSTouchBar alloc] init]); - [touchBar - setCustomizationIdentifier:ui::GetTouchBarId(kBrowserWindowTouchBarId)]; - [touchBar setDelegate:self]; + [self updateSearchTouchBarButton]; + bool showHomeButton = _notificationBridge->show_home_button(); - NSMutableArray<NSString*>* customIdentifiers = [NSMutableArray array]; - NSMutableArray<NSString*>* defaultIdentifiers = [NSMutableArray array]; + if (!_touchBar || _touchBarHasHomeButton != showHomeButton) { + _touchBar.reset([[NSTouchBar alloc] init]); + [_touchBar + setCustomizationIdentifier:ui::GetTouchBarId(kBrowserWindowTouchBarId)]; + [_touchBar setDelegate:self]; - NSArray<NSString*>* touchBarItems = @[ - kBackTouchId, kForwardTouchId, kReloadOrStopTouchId, kHomeTouchId, - kSearchTouchId, kStarTouchId, kNewTabTouchId - ]; + NSMutableArray<NSString*>* customizationIdentifiers = + [NSMutableArray array]; + NSMutableArray<NSString*>* defaultIdentifiers = [NSMutableArray array]; - for (NSString* item in touchBarItems) { - NSString* itemIdentifier = - ui::GetTouchBarItemId(kBrowserWindowTouchBarId, item); - [customIdentifiers addObject:itemIdentifier]; + NSArray<NSString*>* touchBarItemIdentifiers = @[ + kBackTouchId, kForwardTouchId, kReloadOrStopTouchId, kHomeTouchId, + kSearchTouchId, kStarTouchId, kNewTabTouchId + ]; - // Don't add the home button if it's not shown in the toolbar. - if (item == kHomeTouchId && !_notificationBridge->show_home_button()) - continue; + for (NSString* itemIdentifier in touchBarItemIdentifiers) { + NSString* fullIdentifier = + ui::GetTouchBarItemId(kBrowserWindowTouchBarId, itemIdentifier); + [customizationIdentifiers addObject:fullIdentifier]; - [defaultIdentifiers addObject:itemIdentifier]; + // Don't add the home button if it's not shown in the toolbar. + if (itemIdentifier == kHomeTouchId && !showHomeButton) { + continue; + } + + [defaultIdentifiers addObject:fullIdentifier]; + } + + [customizationIdentifiers addObject:NSTouchBarItemIdentifierFlexibleSpace]; + + [_touchBar setDefaultItemIdentifiers:defaultIdentifiers]; + [_touchBar setCustomizationAllowedItemIdentifiers:customizationIdentifiers]; + + _touchBarHasHomeButton = showHomeButton; } - [customIdentifiers addObject:NSTouchBarItemIdentifierFlexibleSpace]; - - [touchBar setDefaultItemIdentifiers:defaultIdentifiers]; - [touchBar setCustomizationAllowedItemIdentifiers:customIdentifiers]; - - return touchBar.autorelease(); + return _touchBar.get(); } - (NSTouchBar*)createTabFullscreenTouchBar { @@ -531,7 +551,7 @@ [_reloadStopButton setAccessibilityLabel:l10n_util::GetNSString(tooltipId)]; } -- (NSView*)searchTouchBarView { +- (void)updateSearchTouchBarButton { TemplateURLService* templateUrlService = TemplateURLServiceFactory::GetForProfile(_browser->profile()); const TemplateURL* defaultProvider = @@ -550,6 +570,12 @@ title = l10n_util::GetStringUTF16(IDS_TOUCH_BAR_NO_DEFAULT_SEARCH); } + NSString* buttonTitle = base::SysUTF16ToNSString(title); + + if ([buttonTitle isEqualToString:[_searchButton title]]) { + return; + } + NSImage* image = nil; #if BUILDFLAG(GOOGLE_CHROME_BRANDING) if (isGoogle) { @@ -564,20 +590,25 @@ if (!image) image = CreateNSImageFromIcon(vector_icons::kSearchIcon); - NSButton* searchButton = - [NSButton buttonWithTitle:base::SysUTF16ToNSString(title) - image:image - target:self - action:@selector(executeCommand:)]; - searchButton.imageHugsTitle = YES; - searchButton.tag = IDC_FOCUS_LOCATION; - [searchButton.widthAnchor - constraintGreaterThanOrEqualToConstant:kSearchBtnMinWidth] - .active = YES; - [searchButton - setContentHuggingPriority:1.0 - forOrientation:NSLayoutConstraintOrientationHorizontal]; - return searchButton; + if (!_searchButton) { + NSButton* searchButton = + [NSButton buttonWithTitle:buttonTitle + image:image + target:self + action:@selector(executeCommand:)]; + searchButton.imageHugsTitle = YES; + searchButton.tag = IDC_FOCUS_LOCATION; + [searchButton.widthAnchor + constraintGreaterThanOrEqualToConstant:kSearchBtnMinWidth] + .active = YES; + [searchButton + setContentHuggingPriority:1.0 + forOrientation:NSLayoutConstraintOrientationHorizontal]; + _searchButton.reset([searchButton retain]); + } else { + [_searchButton setTitle:buttonTitle]; + [_searchButton setImage:image]; + } } - (void)executeCommand:(id)sender { @@ -631,6 +662,10 @@ return _starDefaultIcon->get(); } ++ (NSString*)homeItemIdentifier { + return ui::GetTouchBarItemId(kBrowserWindowTouchBarId, kHomeTouchId); +} + + (NSImage*)starActiveIcon { static const base::NoDestructor<base::scoped_nsobject<NSImage>> _starActiveIcon([]() { @@ -655,6 +690,10 @@ return _reloadIcon->get(); } +- (NSButton*)searchButton { + return _searchButton.get(); +} + - (BookmarkTabHelperObserver*)bookmarkTabObserver { return _notificationBridge.get(); }
diff --git a/chrome/browser/ui/cocoa/touchbar/browser_window_default_touch_bar_unittest.mm b/chrome/browser/ui/cocoa/touchbar/browser_window_default_touch_bar_unittest.mm index 02144e4..2d522b3ce 100644 --- a/chrome/browser/ui/cocoa/touchbar/browser_window_default_touch_bar_unittest.mm +++ b/chrome/browser/ui/cocoa/touchbar/browser_window_default_touch_bar_unittest.mm
@@ -55,6 +55,16 @@ command_updater_->UpdateCommandEnabled(id, enabled); } + bool ShowsHomeButton() { + return browser()->profile()->GetPrefs()->GetBoolean(prefs::kShowHomeButton); + } + + void SetShowHomeButton(bool flag) { + browser()->profile()->GetPrefs()->SetBoolean(prefs::kShowHomeButton, flag); + browser()->profile()->GetPrefs()->ChangePrefValueStore(nullptr, nullptr, + nullptr, nullptr); + } + void TearDown() override { if (@available(macOS 10.12.2, *)) { touch_bar_.get().browser = nullptr; @@ -253,3 +263,31 @@ l10n_util::GetNSString(IDS_ACCNAME_FORWARD)); } } + +// Tests that the home button in the Touch Bar is in sync with the setting. +TEST_F(BrowserWindowDefaultTouchBarUnitTest, HomeUpdate) { + if (@available(macOS 10.12.2, *)) { + NSTouchBar* touch_bar = [touch_bar_ makeTouchBar]; + + // Save the current state before we start mucking with preferences. + bool home_button_showing = ShowsHomeButton(); + + SetShowHomeButton(false); + touch_bar = [touch_bar_ makeTouchBar]; + + NSString* home_identifier = + [BrowserWindowDefaultTouchBar homeItemIdentifier]; + + EXPECT_FALSE( + [[touch_bar defaultItemIdentifiers] containsObject:home_identifier]); + + SetShowHomeButton(true); + touch_bar = [touch_bar_ makeTouchBar]; + + EXPECT_TRUE( + [[touch_bar defaultItemIdentifiers] containsObject:home_identifier]); + + // Restore the original state. + SetShowHomeButton(home_button_showing); + } +}
diff --git a/chrome/browser/ui/cocoa/touchbar/browser_window_touch_bar_controller_browsertest.mm b/chrome/browser/ui/cocoa/touchbar/browser_window_touch_bar_controller_browsertest.mm index dbd220d..caf7a97 100644 --- a/chrome/browser/ui/cocoa/touchbar/browser_window_touch_bar_controller_browsertest.mm +++ b/chrome/browser/ui/cocoa/touchbar/browser_window_touch_bar_controller_browsertest.mm
@@ -2,10 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#import "base/mac/foundation_util.h" +#include "base/mac/scoped_objc_class_swizzler.h" #include "chrome/app/chrome_command_ids.h" #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h" #include "chrome/browser/ui/bookmarks/bookmark_tab_helper_observer.h" #include "chrome/browser/ui/browser.h" +#include "chrome/browser/ui/browser_commands.h" #include "chrome/browser/ui/browser_window.h" #import "chrome/browser/ui/cocoa/touchbar/browser_window_default_touch_bar.h" #import "chrome/browser/ui/cocoa/touchbar/browser_window_touch_bar_controller.h" @@ -13,6 +16,7 @@ #include "chrome/browser/ui/views/frame/browser_view.h" #include "chrome/common/pref_names.h" #include "chrome/test/base/in_process_browser_test.h" +#include "chrome/test/base/ui_test_utils.h" #include "components/prefs/pref_service.h" #include "components/remote_cocoa/app_shim/window_touch_bar_delegate.h" #include "components/search_engines/default_search_manager.h" @@ -24,8 +28,129 @@ #include "content/public/test/test_utils.h" #include "testing/gtest_mac.h" -// TODO(spqchan): Write tests that will check for page load and bookmark -// updates. +// A class that watches for invalidations of a window's touch bar by calls +// to -setTouchBar:. +// +// Why is this class structured the way it is, with statics for the invalidation +// flag and the swizzler? We want to catch calls to -setTouchBar:. We can use +// swizzling for that. We implement -setTouchBar: in this class and swap it for +// the NSWindow implementation. Once inside TouchBarInvalidationWatcher's +// -setTouchBar: we need to set a flag somewhere to the value of (aTouchBar == +// nil). In theory that flag could just be an instance variable of this class. +// The problem is when we reach -setTouchBar:, although the code comes from +// TouchBarInvalidationWatcher, the instance "executing" the code is an +// NSWindow. If we create an instance of TouchBarInvalidationWatcher that has a +// bool instance variable, say, the NSWindow can't access it (it's not the +// original TouchBarInvalidationWatcher instance). Similarly, at the end of +// -setTouchBar: we need to call the original (NSWindow) implementation of +// -setTouchBar:. To do that we need access to the ScopedObjCClassSwizzler that +// did the swap. If we store the ScopedObjCClassSwizzler in an instance variable +// of TouchBarInvalidationWatcher, our NSWindow instance again cannot access it. +// +// To get around these problems we store the flag and the swizzler in what are +// essentially class variables so they are accessible from anywhere. +API_AVAILABLE(macos(10.12.2)) +@interface TouchBarInvalidationWatcher : NSObject +// Returns a new (non-autoreleased) TouchBarInvalidationWatcher. ++ (instancetype)newWatcher; + +// Returns the touch bar invalidation flag. This flag is set to YES +// whenever -[NSWindow setTouchBar:] is called with nil. ++ (BOOL&)touchBarInvalidFlag; +@end + +@implementation TouchBarInvalidationWatcher + ++ (BOOL&)touchBarInvalidFlag { + static BOOL touchBarInvalidFlag = NO; + return touchBarInvalidFlag; +} + ++ (std::unique_ptr<base::mac::ScopedObjCClassSwizzler>&)setTouchBarSwizzler { + static base::NoDestructor<std::unique_ptr<base::mac::ScopedObjCClassSwizzler>> + setTouchBarSwizzler(new base::mac::ScopedObjCClassSwizzler( + [NSWindow class], [TouchBarInvalidationWatcher class], + @selector(setTouchBar:))); + + return *setTouchBarSwizzler; +} + ++ (instancetype)newWatcher { + // Set up the swizzling. + [self setTouchBarSwizzler]; + + return [[TouchBarInvalidationWatcher alloc] init]; +} + +- (void)dealloc { + [TouchBarInvalidationWatcher setTouchBarSwizzler].reset(); + [super dealloc]; +} + +- (void)setTouchBar:(NSTouchBar*)aTouchBar { + [TouchBarInvalidationWatcher touchBarInvalidFlag] = (aTouchBar == nil); + + // Proceed with setting the touch bar. + [TouchBarInvalidationWatcher setTouchBarSwizzler] + ->InvokeOriginal<void, NSTouchBar*>(self, @selector(setTouchBar:), + aTouchBar); +} + +@end + +// A class that watches for page reload notifications in a window's touch bar. +// +// See the explanation at the top of TouchBarInvalidationWatcher for info on +// why this class is structured the way it is. +API_AVAILABLE(macos(10.12.2)) +@interface PageReloadWatcher : NSObject +// Returns a new (non-autoreleased) PageReloadWatcher. ++ (instancetype)newWatcher; + +// Returns the page loading flag. This flag is set to YES whenever +// -[BrowserWindowDefaultTouchBar setIsPageLoading:] is called with YES. ++ (BOOL&)pageIsLoadingFlag; +@end + +@implementation PageReloadWatcher + ++ (BOOL&)pageIsLoadingFlag { + static BOOL pageIsLoadingFlag = NO; + return pageIsLoadingFlag; +} + ++ (std::unique_ptr<base::mac::ScopedObjCClassSwizzler>&) + setPageIsLoadingSwizzler { + static base::NoDestructor<std::unique_ptr<base::mac::ScopedObjCClassSwizzler>> + setPageIsLoadingSwizzler(new base::mac::ScopedObjCClassSwizzler( + [BrowserWindowDefaultTouchBar class], [PageReloadWatcher class], + @selector(setIsPageLoading:))); + + return *setPageIsLoadingSwizzler; +} + ++ (instancetype)newWatcher { + // Set up the swizzling. + [self setPageIsLoadingSwizzler]; + + return [[PageReloadWatcher alloc] init]; +} + +- (void)dealloc { + [PageReloadWatcher setPageIsLoadingSwizzler].reset(); + [super dealloc]; +} + +- (void)setIsPageLoading:(BOOL)flag { + if (flag) { + [PageReloadWatcher pageIsLoadingFlag] = YES; + } + + [PageReloadWatcher setPageIsLoadingSwizzler]->InvokeOriginal<void, BOOL>( + self, @selector(setIsPageLoading:), flag); +} + +@end class BrowserWindowTouchBarControllerTest : public InProcessBrowserTest { public: @@ -64,6 +189,9 @@ // Test if the touch bar gets invalidated when the active tab is changed. IN_PROC_BROWSER_TEST_F(BrowserWindowTouchBarControllerTest, TabChanges) { if (@available(macOS 10.12.2, *)) { + base::scoped_nsobject<TouchBarInvalidationWatcher> invalidationWatcher( + [TouchBarInvalidationWatcher newWatcher]); + EXPECT_FALSE(browser_touch_bar_controller()); MakeTouchBar(); EXPECT_TRUE(browser_touch_bar_controller()); @@ -71,38 +199,121 @@ auto* current_touch_bar = [native_window() touchBar]; EXPECT_TRUE(current_touch_bar); - // Insert a new tab in the foreground. The window should have a new touch - // bar. + // Insert a new tab in the foreground. The window should invalidate its + // touch bar as a result. + [TouchBarInvalidationWatcher touchBarInvalidFlag] = NO; + ASSERT_FALSE([TouchBarInvalidationWatcher touchBarInvalidFlag]); std::unique_ptr<content::WebContents> contents = content::WebContents::Create( content::WebContents::CreateParams(browser()->profile())); browser()->tab_strip_model()->AppendWebContents(std::move(contents), true); - EXPECT_NE(current_touch_bar, [native_window() touchBar]); + + EXPECT_TRUE([TouchBarInvalidationWatcher touchBarInvalidFlag]); + + // Update the touch bar. + [native_window() touchBar]; + + // Activating the original tab should invalidate the touch bar. + [TouchBarInvalidationWatcher touchBarInvalidFlag] = NO; + ASSERT_FALSE([TouchBarInvalidationWatcher touchBarInvalidFlag]); + browser()->tab_strip_model()->ActivateTabAt(0); + + EXPECT_TRUE([TouchBarInvalidationWatcher touchBarInvalidFlag]); } } -// Tests if the touch bar gets invalidated if the default search engine has -// changed. +// Test if the touch bar receives a notification that the current tab is +// loading. +IN_PROC_BROWSER_TEST_F(BrowserWindowTouchBarControllerTest, PageReload) { + if (@available(macOS 10.12.2, *)) { + base::scoped_nsobject<PageReloadWatcher> pageReloadWatcher( + [PageReloadWatcher newWatcher]); + + EXPECT_FALSE(browser_touch_bar_controller()); + MakeTouchBar(); + EXPECT_TRUE(browser_touch_bar_controller()); + + // Make sure the touch bar exists for the window. + auto* current_touch_bar = [native_window() touchBar]; + EXPECT_TRUE(current_touch_bar); + + // We can't just ask the BrowserWindowDefaultTouchBar for the value of the + // page loading flag like we can for the tab bookmark. The reload my happen + // so fast that the flag may be reset to NO by the time we check it. We + // have to use swizzling instead. + [PageReloadWatcher pageIsLoadingFlag] = NO; + ASSERT_FALSE([PageReloadWatcher pageIsLoadingFlag]); + + ASSERT_TRUE(ui_test_utils::NavigateToURL( + browser(), GURL("data:text/html, <html><body></body></html>"))); + + EXPECT_TRUE([PageReloadWatcher pageIsLoadingFlag]); + } +} + +// Test if the touch bar receives a notification that the current tab has been +// bookmarked. +IN_PROC_BROWSER_TEST_F(BrowserWindowTouchBarControllerTest, + BookmarkCurrentTab) { + if (@available(macOS 10.12.2, *)) { + EXPECT_FALSE(browser_touch_bar_controller()); + MakeTouchBar(); + EXPECT_TRUE(browser_touch_bar_controller()); + + // Make sure the touch bar exists for the window. + auto* current_touch_bar = [native_window() touchBar]; + EXPECT_TRUE(current_touch_bar); + BrowserWindowDefaultTouchBar* touch_bar_delegate = + base::mac::ObjCCastStrict<BrowserWindowDefaultTouchBar>( + [current_touch_bar delegate]); + EXPECT_FALSE([touch_bar_delegate isStarred]); + + chrome::BookmarkCurrentTab(browser()); + + EXPECT_TRUE([touch_bar_delegate isStarred]); + } +} + +// Tests if the touch bar's search button updates if the default search engine +// has changed. IN_PROC_BROWSER_TEST_F(BrowserWindowTouchBarControllerTest, SearchEngineChanges) { if (@available(macOS 10.12.2, *)) { + base::scoped_nsobject<TouchBarInvalidationWatcher> invalidationWatcher( + [TouchBarInvalidationWatcher newWatcher]); + PrefService* prefs = browser()->profile()->GetPrefs(); DCHECK(prefs); EXPECT_FALSE(browser_touch_bar_controller()); MakeTouchBar(); - auto* current_touch_bar = [native_window() touchBar]; - EXPECT_TRUE(current_touch_bar); + // Force the window to create the touch bar. + [native_window() touchBar]; + NSString* orig_search_button_title = + [[[browser_touch_bar_controller() defaultTouchBar] searchButton] title]; + EXPECT_TRUE(orig_search_button_title); // Change the default search engine. + [TouchBarInvalidationWatcher touchBarInvalidFlag] = NO; + ASSERT_FALSE([TouchBarInvalidationWatcher touchBarInvalidFlag]); std::unique_ptr<TemplateURLData> data = GenerateDummyTemplateURLData("poutine"); prefs->Set(DefaultSearchManager::kDefaultSearchProviderDataPrefName, *TemplateURLDataToDictionary(*data)); - // The window should have a new touch bar. - EXPECT_NE(current_touch_bar, [native_window() touchBar]); + // Confirm the touch bar was invalidated. + EXPECT_TRUE([TouchBarInvalidationWatcher touchBarInvalidFlag]); + + // Ask the window again for its touch bar. Previously, changes like updates + // to the default search engine would completely regenerate the touch bar. + // That's expensive (view creation, autolayout, etc.). Instead we now retain + // the original touch bar and expect touch bar invalidation to force an + // update of the search item. + [native_window() touchBar]; + EXPECT_FALSE([orig_search_button_title + isEqualToString:[[[browser_touch_bar_controller() defaultTouchBar] + searchButton] title]]); } }
diff --git a/chrome/browser/ui/hats/trust_safety_sentiment_service_unittest.cc b/chrome/browser/ui/hats/trust_safety_sentiment_service_unittest.cc index 220d11c..513163d 100644 --- a/chrome/browser/ui/hats/trust_safety_sentiment_service_unittest.cc +++ b/chrome/browser/ui/hats/trust_safety_sentiment_service_unittest.cc
@@ -12,6 +12,7 @@ #include "chrome/browser/ui/hats/hats_service_factory.h" #include "chrome/browser/ui/hats/mock_hats_service.h" #include "chrome/browser/ui/hats/trust_safety_sentiment_service_factory.h" +#include "chrome/common/channel_info.h" #include "chrome/common/chrome_features.h" #include "chrome/common/pref_names.h" #include "chrome/common/webui_url_constants.h" @@ -24,6 +25,7 @@ #include "components/signin/public/base/signin_pref_names.h" #include "components/sync_preferences/testing_pref_service_syncable.h" #include "components/unified_consent/pref_names.h" +#include "components/version_info/channel.h" #include "content/public/test/browser_task_environment.h" #include "content/public/test/test_renderer_host.h" #include "content/public/test/web_contents_tester.h" @@ -462,9 +464,10 @@ profile()->GetTestingPrefService()->SetUserPref( prefs::kPrivacySandboxApisEnabledV2, std::make_unique<base::Value>(true)); - SurveyBitsData expected_psd = {{"Stable channel", false}, - {"3P cookies blocked", true}, - {"Privacy Sandbox enabled", true}}; + SurveyBitsData expected_psd = { + {"Stable channel", chrome::GetChannel() == version_info::Channel::STABLE}, + {"3P cookies blocked", true}, + {"Privacy Sandbox enabled", true}}; EXPECT_CALL( *mock_hats_service(), @@ -486,9 +489,10 @@ params.ntp_visits_max_range = "0"; SetupFeatureParameters(params); - SurveyBitsData expected_psd = {{"Stable channel", false}, - {"3P cookies blocked", false}, - {"Privacy Sandbox enabled", false}}; + SurveyBitsData expected_psd = { + {"Stable channel", chrome::GetChannel() == version_info::Channel::STABLE}, + {"3P cookies blocked", false}, + {"Privacy Sandbox enabled", false}}; EXPECT_CALL( *mock_hats_service(), @@ -510,9 +514,10 @@ params.ntp_visits_max_range = "0"; SetupFeatureParameters(params); - SurveyBitsData expected_psd = {{"Stable channel", false}, - {"3P cookies blocked", false}, - {"Privacy Sandbox enabled", false}}; + SurveyBitsData expected_psd = { + {"Stable channel", chrome::GetChannel() == version_info::Channel::STABLE}, + {"3P cookies blocked", false}, + {"Privacy Sandbox enabled", false}}; EXPECT_CALL( *mock_hats_service(), @@ -533,9 +538,10 @@ params.ntp_visits_max_range = "0"; SetupFeatureParameters(params); - SurveyBitsData expected_psd = {{"Stable channel", false}, - {"3P cookies blocked", false}, - {"Privacy Sandbox enabled", false}}; + SurveyBitsData expected_psd = { + {"Stable channel", chrome::GetChannel() == version_info::Channel::STABLE}, + {"3P cookies blocked", false}, + {"Privacy Sandbox enabled", false}}; EXPECT_CALL(*mock_hats_service(), LaunchSurvey(kHatsSurveyTriggerTrustSafetyPrivacySandbox3NoticeOk, @@ -556,9 +562,10 @@ params.ntp_visits_max_range = "0"; SetupFeatureParameters(params); - SurveyBitsData expected_psd = {{"Stable channel", false}, - {"3P cookies blocked", false}, - {"Privacy Sandbox enabled", false}}; + SurveyBitsData expected_psd = { + {"Stable channel", chrome::GetChannel() == version_info::Channel::STABLE}, + {"3P cookies blocked", false}, + {"Privacy Sandbox enabled", false}}; EXPECT_CALL( *mock_hats_service(),
diff --git a/chrome/browser/ui/privacy_sandbox/privacy_sandbox_dialog_helper.cc b/chrome/browser/ui/privacy_sandbox/privacy_sandbox_dialog_helper.cc index d2f7deb..c0fd027 100644 --- a/chrome/browser/ui/privacy_sandbox/privacy_sandbox_dialog_helper.cc +++ b/chrome/browser/ui/privacy_sandbox/privacy_sandbox_dialog_helper.cc
@@ -7,6 +7,8 @@ #include "chrome/browser/privacy_sandbox/privacy_sandbox_service.h" #include "chrome/browser/privacy_sandbox/privacy_sandbox_service_factory.h" #include "chrome/browser/profiles/profile.h" +#include "chrome/browser/sync/sync_service_factory.h" +#include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_finder.h" #include "chrome/browser/ui/privacy_sandbox/privacy_sandbox_dialog.h" #include "content/public/browser/navigation_handle.h" @@ -40,21 +42,36 @@ void PrivacySandboxDialogHelper::DidFinishNavigation( content::NavigationHandle* navigation_handle) { - // Ignore everything except chrome:// urls. - if (!navigation_handle || !navigation_handle->IsInMainFrame() || - !navigation_handle->GetWebContents()->GetLastCommittedURL().SchemeIs( - content::kChromeUIScheme)) { - return; - } - - // TODO(crbug.com/1286276): This logic is too simple, there are more - // circumstances on which we may not wish to show the dialog, such as sync - // consent currently in progress. if (!ProfileRequiresDialog(profile())) return; - if (auto* browser = chrome::FindBrowserWithProfile(profile())) - ShowPrivacySandboxDialog(browser, GetRequiredDialogType(profile())); + // Only valid top frame navigations are considered. + if (!navigation_handle || !navigation_handle->IsInPrimaryMainFrame()) + return; + + // Check whether the navigation target is a suitable dialog location. The + // navigation URL, rather than the visible or committed URL, is required to + // distinguish between different types of NTPs. + if (!PrivacySandboxService::IsUrlSuitableForDialog( + navigation_handle->GetURL())) { + return; + } + + // If a Sync setup is in progress, the dialog should not be shown. + if (auto* sync_service = SyncServiceFactory::GetForProfile(profile())) { + if (sync_service->IsSetupInProgress()) + return; + } + + auto* browser = + chrome::FindBrowserWithWebContents(navigation_handle->GetWebContents()); + browser->tab_strip_model()->ActivateTabAt( + browser->tab_strip_model()->GetIndexOfWebContents( + navigation_handle->GetWebContents())); + + // TODO(crbug.com/1286276): Record to metrics the URL the dialog was shown + // over. + ShowPrivacySandboxDialog(browser, GetRequiredDialogType(profile())); } // static
diff --git a/chrome/browser/ui/privacy_sandbox/privacy_sandbox_dialog_helper_browsertest.cc b/chrome/browser/ui/privacy_sandbox/privacy_sandbox_dialog_helper_browsertest.cc new file mode 100644 index 0000000..348d4138 --- /dev/null +++ b/chrome/browser/ui/privacy_sandbox/privacy_sandbox_dialog_helper_browsertest.cc
@@ -0,0 +1,188 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/privacy_sandbox/privacy_sandbox_service.h" +#include "chrome/browser/privacy_sandbox/privacy_sandbox_service_factory.h" +#include "chrome/browser/sync/sync_service_factory.h" +#include "chrome/browser/ui/browser.h" +#include "chrome/browser/ui/search/ntp_test_utils.h" +#include "chrome/common/webui_url_constants.h" +#include "chrome/test/base/in_process_browser_test.h" +#include "chrome/test/base/ui_test_utils.h" +#include "components/keyed_service/content/browser_context_dependency_manager.h" +#include "components/sync/driver/test_sync_service.h" +#include "content/public/common/url_constants.h" +#include "content/public/test/browser_test.h" +#include "net/dns/mock_host_resolver.h" +#include "net/test/embedded_test_server/embedded_test_server.h" +#include "testing/gmock/include/gmock/gmock.h" + +namespace { + +class MockPrivacySandboxService : public PrivacySandboxService { + public: + MOCK_METHOD(PrivacySandboxService::DialogType, + GetRequiredDialogType, + (), + (override)); + MOCK_METHOD(void, DialogOpenedForBrowser, (Browser*), (override)); + MOCK_METHOD(void, + DialogActionOccurred, + (PrivacySandboxService::DialogAction), + (override)); +}; + +std::unique_ptr<KeyedService> CreateTestSyncService(content::BrowserContext*) { + return std::make_unique<syncer::TestSyncService>(); +} + +std::unique_ptr<KeyedService> CreateMockPrivacySandboxService( + content::BrowserContext*) { + return std::make_unique<testing::NiceMock<MockPrivacySandboxService>>(); +} + +} // namespace + +class PrivacySandboxDialogHelperTest : public InProcessBrowserTest { + public: + PrivacySandboxDialogHelperTest() + : https_test_server_(net::EmbeddedTestServer::TYPE_HTTPS) {} + + void SetUpInProcessBrowserTestFixture() override { + PrivacySandboxService::SetDialogDisabledForTests(false); + host_resolver()->AddRule("*", "127.0.0.1"); + https_test_server()->AddDefaultHandlers( + base::FilePath(FILE_PATH_LITERAL("content/test/data"))); + ASSERT_TRUE(https_test_server()->Start()); + create_services_subscription_ = + BrowserContextDependencyManager::GetInstance() + ->RegisterCreateServicesCallbackForTesting(base::BindRepeating( + &PrivacySandboxDialogHelperTest::SetupTestFactories, + base::Unretained(this))); + } + + void SetupTestFactories(content::BrowserContext* context) { + SyncServiceFactory::GetInstance()->SetTestingFactory( + context, base::BindRepeating(&CreateTestSyncService)); + auto* mock_privacy_sandbox_service = + static_cast<MockPrivacySandboxService*>( + PrivacySandboxServiceFactory::GetInstance() + ->SetTestingFactoryAndUse( + context, + base::BindRepeating(&CreateMockPrivacySandboxService))); + + ON_CALL(*mock_privacy_sandbox_service, GetRequiredDialogType()) + .WillByDefault(testing::Return(TestDialogType())); + } + + virtual PrivacySandboxService::DialogType TestDialogType() { + return PrivacySandboxService::DialogType::kNone; + } + + syncer::TestSyncService* test_sync_service() { + return static_cast<syncer::TestSyncService*>( + SyncServiceFactory::GetForProfile(browser()->profile())); + } + MockPrivacySandboxService* mock_privacy_sandbox_service() { + return static_cast<MockPrivacySandboxService*>( + PrivacySandboxServiceFactory::GetForProfile(browser()->profile())); + } + net::EmbeddedTestServer* https_test_server() { return &https_test_server_; } + + private: + base::CallbackListSubscription create_services_subscription_; + net::EmbeddedTestServer https_test_server_; +}; + +IN_PROC_BROWSER_TEST_F(PrivacySandboxDialogHelperTest, NoDialogRequired) { + // Check when no dialog is required, it is not shown. + EXPECT_CALL(*mock_privacy_sandbox_service(), + DialogOpenedForBrowser(browser())) + .Times(0); + ASSERT_TRUE(ui_test_utils::NavigateToURL( + browser(), GURL(chrome::kChromeUINewTabPageURL))); + base::RunLoop().RunUntilIdle(); +} + +class PrivacySandboxDialogHelperTestWithParam + : public PrivacySandboxDialogHelperTest, + public testing::WithParamInterface<bool> { + PrivacySandboxService::DialogType TestDialogType() override { + // Setup consent / notice based on testing parameter. Helper behavior should + // be identical regardless of which type of dialog is required. + return GetParam() ? PrivacySandboxService::DialogType::kConsent + : PrivacySandboxService::DialogType::kNotice; + } +}; + +IN_PROC_BROWSER_TEST_P(PrivacySandboxDialogHelperTestWithParam, + DialogOpensOnNtp) { + // Check when a navigation to the Chrome controlled NTP occurs, which is a + // suitable location, a dialog is shown. + EXPECT_CALL(*mock_privacy_sandbox_service(), + DialogOpenedForBrowser(browser())) + .Times(1); + ASSERT_TRUE(ui_test_utils::NavigateToURL( + browser(), GURL(chrome::kChromeUINewTabPageURL))); + base::RunLoop().RunUntilIdle(); +} + +IN_PROC_BROWSER_TEST_P(PrivacySandboxDialogHelperTestWithParam, + DialogOpensAboutBlank) { + // Check when a navigation to about:blank occurs, which is a suitable + // location, a dialog is shown. + EXPECT_CALL(*mock_privacy_sandbox_service(), + DialogOpenedForBrowser(browser())) + .Times(1); + ASSERT_TRUE( + ui_test_utils::NavigateToURL(browser(), GURL(url::kAboutBlankURL))); + base::RunLoop().RunUntilIdle(); +} + +IN_PROC_BROWSER_TEST_P(PrivacySandboxDialogHelperTestWithParam, + NoDialogNonDefaultNtp) { + // Check that navigations to the generic chrome://newtab, when a non default + // NTP is used, do not show a dialog. + EXPECT_CALL(*mock_privacy_sandbox_service(), + DialogOpenedForBrowser(browser())) + .Times(0); + + GURL ntp_url = https_test_server()->GetURL("/title1.html"); + ntp_test_utils::SetUserSelectedDefaultSearchProvider( + browser()->profile(), https_test_server()->base_url().spec(), + ntp_url.spec()); + + ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), + GURL(chrome::kChromeUINewTabURL))); + base::RunLoop().RunUntilIdle(); +} + +IN_PROC_BROWSER_TEST_P(PrivacySandboxDialogHelperTestWithParam, NoDialogSync) { + // Check when sync setup is in progress, that no dialog is shown. + EXPECT_CALL(*mock_privacy_sandbox_service(), + DialogOpenedForBrowser(browser())) + .Times(0); + test_sync_service()->SetSetupInProgress(true); + ASSERT_TRUE(ui_test_utils::NavigateToURL( + browser(), GURL(chrome::kChromeUINewTabPageURL))); + base::RunLoop().RunUntilIdle(); +} + +IN_PROC_BROWSER_TEST_P(PrivacySandboxDialogHelperTestWithParam, UnsuitableUrl) { + // Check that no dialog is shown for navigations to unsuitable URLs. + EXPECT_CALL(*mock_privacy_sandbox_service(), + DialogOpenedForBrowser(browser())) + .Times(0); + ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), + GURL(chrome::kChromeUIWelcomeURL))); + base::RunLoop().RunUntilIdle(); + + ASSERT_TRUE(ui_test_utils::NavigateToURL( + browser(), https_test_server()->GetURL("a.test", "/title1.html"))); + base::RunLoop().RunUntilIdle(); +} + +INSTANTIATE_TEST_SUITE_P(PrivacySandboxDialogHelperTestWithParamInstance, + PrivacySandboxDialogHelperTestWithParam, + testing::Bool());
diff --git a/chrome/browser/ui/side_search/side_search_side_contents_helper_unittest.cc b/chrome/browser/ui/side_search/side_search_side_contents_helper_unittest.cc index 39bc24e..1352c17 100644 --- a/chrome/browser/ui/side_search/side_search_side_contents_helper_unittest.cc +++ b/chrome/browser/ui/side_search/side_search_side_contents_helper_unittest.cc
@@ -22,9 +22,8 @@ namespace { -constexpr char kGoogleSearchURL[] = "https://www.google.com/search?q=test1"; -constexpr char kGoogleSearchHomePageURL[] = "https://www.google.com"; -constexpr char kNonGoogleURL[] = "https://www.test.com"; +constexpr char kSearchMatchUrl[] = "https://www.search-url.com/"; +constexpr char kNonMatchUrl[] = "https://www.tab-frame-url.com/"; class MockSideContentsDelegate : public SideSearchSideContentsHelper::Delegate { public: @@ -64,14 +63,22 @@ class SideSearchSideContentsHelperTest : public ::testing::Test { public: void SetUp() override { - scoped_feature_list_.InitAndEnableFeature(features::kSideSearch); + scoped_feature_list_.InitWithFeatures( + {features::kSideSearch, features::kSideSearchDSESupport}, {}); side_contents_ = content::WebContentsTester::CreateTestWebContents(&profile_, nullptr); SideSearchSideContentsHelper::CreateForWebContents(side_contents()); helper()->SetDelegate(&delegate_); - // TODO(crbug.com/1304513): Update test to avoid Google specific behavior. - SideSearchConfig::Get(&profile_) - ->ApplyGoogleSearchConfigurationForTesting(); + // Basic configuration for testing that will always show the side panel and + // allows navigations to URLs matching `kSearchMatchUrl` to proceed + // within the side panel. + auto* config = SideSearchConfig::Get(&profile_); + config->SetShouldNavigateInSidePanelCallback(base::BindRepeating( + [&](const GURL& url) { return url == kSearchMatchUrl; })); + config->SetCanShowSidePanelForURLCallback( + base::BindRepeating([](const GURL& url) { return true; })); + config->SetGenerateSideSearchURLCallback( + base::BindRepeating([](const GURL& url) { return url; })); Test::SetUp(); } @@ -118,11 +125,12 @@ base::test::ScopedFeatureList scoped_feature_list_; }; -TEST_F(SideSearchSideContentsHelperTest, GoogleSearchURLsNavigateSideContents) { - LoadURL(kGoogleSearchURL); - EXPECT_EQ(GURL(kGoogleSearchURL), +TEST_F(SideSearchSideContentsHelperTest, + RedirectionConfigNavigatesSideContents) { + LoadURL(kSearchMatchUrl); + EXPECT_EQ(GURL(kSearchMatchUrl), GetLastCommittedSideContentsEntry()->GetURL()); - EXPECT_EQ(GURL(kGoogleSearchURL), delegate().last_search_url()); + EXPECT_EQ(GURL(kSearchMatchUrl), delegate().last_search_url()); EXPECT_TRUE(delegate().tab_contents_url().is_empty()); histogram_tester_.ExpectUniqueSample( "SideSearch.Navigation", @@ -130,23 +138,12 @@ } TEST_F(SideSearchSideContentsHelperTest, - NonGoogleSearchURLNavigatesTabContents) { - LoadURL(kNonGoogleURL); + RedirectionConfigNavigatesTabContents) { + LoadURL(kNonMatchUrl); EXPECT_TRUE(!GetLastCommittedSideContentsEntry() || GetLastCommittedSideContentsEntry()->IsInitialEntry()); EXPECT_TRUE(delegate().last_search_url().is_empty()); - EXPECT_EQ(GURL(kNonGoogleURL), delegate().tab_contents_url()); - histogram_tester_.ExpectUniqueSample( - "SideSearch.Navigation", SideSearchNavigationType::kRedirectionToTab, 1); -} - -TEST_F(SideSearchSideContentsHelperTest, - GoogleHomePageURLNavigatesTabContents) { - LoadURL(kGoogleSearchHomePageURL); - EXPECT_TRUE(!GetLastCommittedSideContentsEntry() || - GetLastCommittedSideContentsEntry()->IsInitialEntry()); - EXPECT_TRUE(delegate().last_search_url().is_empty()); - EXPECT_EQ(GURL(kGoogleSearchHomePageURL), delegate().tab_contents_url()); + EXPECT_EQ(GURL(kNonMatchUrl), delegate().tab_contents_url()); histogram_tester_.ExpectUniqueSample( "SideSearch.Navigation", SideSearchNavigationType::kRedirectionToTab, 1); }
diff --git a/chrome/browser/ui/side_search/side_search_tab_contents_helper_unittest.cc b/chrome/browser/ui/side_search/side_search_tab_contents_helper_unittest.cc index d9f6116..c9e7cd4 100644 --- a/chrome/browser/ui/side_search/side_search_tab_contents_helper_unittest.cc +++ b/chrome/browser/ui/side_search/side_search_tab_contents_helper_unittest.cc
@@ -20,23 +20,12 @@ namespace { -constexpr char kGoogleSearchURL1[] = "https://www.google.com/search?q=test1"; -constexpr char kGoogleSearchURL2[] = "https://www.google.com/search?q=test2"; -constexpr char kGoogleSearchHomePageURL[] = "https://www.google.com"; -constexpr char kNonGoogleURL[] = "https://www.test.com"; +constexpr char kSearchMatchUrl1[] = "https://www.search-url-1.com/"; +constexpr char kSearchMatchUrl2[] = "https://www.search-url-2.com/"; +constexpr char kNonMatchUrl[] = "https://www.tab-frame-url.com/"; -// Tests to see if `navigated_url` matches `stored_url`. We cannot directly -// compare as the "sidesearch=1" query param may have been appended to the -// `stored_url` to ensure Google serves the side search SRP to the chrome -// client. -bool DoesURLMatch(const char* navigated_url, const GURL& stored_url) { - return stored_url.spec().find(GURL(navigated_url).spec()) != - std::string::npos; -} - -bool DoesURLMatch(const char* navigated_url, - const absl::optional<GURL>& stored_url) { - return stored_url && DoesURLMatch(navigated_url, stored_url.value()); +bool IsSearchURLMatch(const GURL& url) { + return url == kSearchMatchUrl1 || url == kSearchMatchUrl2; } } // namespace @@ -52,10 +41,17 @@ SideSearchTabContentsHelper::CreateForWebContents(web_contents_.get()); helper()->SetSidePanelContentsForTesting( content::WebContentsTester::CreateTestWebContents(&profile_, nullptr)); + // Basic configuration for testing that allows navigations to URLs matching + // `kSearchMatchUrl1` and `kSearchMatchUrl2` to proceed within the side + // panel and only allows showing the side panel on non-matching pages. auto* config = SideSearchConfig::Get(&profile_); + config->SetShouldNavigateInSidePanelCallback( + base::BindRepeating(IsSearchURLMatch)); + config->SetCanShowSidePanelForURLCallback(base::BindRepeating( + [](const GURL& url) { return !IsSearchURLMatch(url); })); + config->SetGenerateSideSearchURLCallback( + base::BindRepeating([](const GURL& url) { return url; })); config->set_is_side_panel_srp_available(true); - // TODO(crbug.com/1304513): Update test to avoid Google specific behavior. - config->ApplyGoogleSearchConfigurationForTesting(); Test::SetUp(); } @@ -112,98 +108,69 @@ }; TEST_F(SideSearchTabContentsHelperTest, LastSearchURLUpdatesCorrectly) { - // When a tab is first opened there should be no last encountered Google SRP. + // When a tab is first opened there should be no last encountered search URL. EXPECT_FALSE(helper()->last_search_url().has_value()); EXPECT_TRUE(!GetLastCommittedSideContentsEntry() || GetLastCommittedSideContentsEntry()->IsInitialEntry()); - // Navigating to a Google SRP should update the `last_search_url`. - LoadURL(kGoogleSearchURL1); - EXPECT_TRUE(DoesURLMatch(kGoogleSearchURL1, helper()->last_search_url())); - EXPECT_TRUE(DoesURLMatch(kGoogleSearchURL1, - GetLastCommittedSideContentsEntry()->GetURL())); + // Navigating to a matching search URL should update the `last_search_url`. + LoadURL(kSearchMatchUrl1); + EXPECT_EQ(kSearchMatchUrl1, helper()->last_search_url()); + EXPECT_EQ(kSearchMatchUrl1, GetLastCommittedSideContentsEntry()->GetURL()); - // Navigating to a non-Google SRP URL should not change the `last_search_url`. - LoadURL(kNonGoogleURL); - EXPECT_TRUE(DoesURLMatch(kGoogleSearchURL1, helper()->last_search_url())); - EXPECT_TRUE(DoesURLMatch(kGoogleSearchURL1, - GetLastCommittedSideContentsEntry()->GetURL())); + // Navigating to a non-matching search URL should not change the + // `last_search_url`. + LoadURL(kNonMatchUrl); + EXPECT_EQ(kSearchMatchUrl1, helper()->last_search_url()); + EXPECT_EQ(kSearchMatchUrl1, GetLastCommittedSideContentsEntry()->GetURL()); - // Navigating again to a Google SRP should update the `last_search_url`. - LoadURL(kGoogleSearchURL2); - EXPECT_TRUE(DoesURLMatch(kGoogleSearchURL2, helper()->last_search_url())); - EXPECT_TRUE(DoesURLMatch(kGoogleSearchURL2, - GetLastCommittedSideContentsEntry()->GetURL())); + // Navigating again to a new matching search url should update the + // `last_search_url`. + LoadURL(kSearchMatchUrl2); + EXPECT_EQ(kSearchMatchUrl2, helper()->last_search_url()); + EXPECT_EQ(kSearchMatchUrl2, GetLastCommittedSideContentsEntry()->GetURL()); - // Going backwards to the non-Google SRP URL should not update the last search - // url. + // Going backwards to the non-matching search URL should not update the + // `last_search_url`. GoBack(); - EXPECT_TRUE(DoesURLMatch(kGoogleSearchURL2, helper()->last_search_url())); - EXPECT_TRUE(DoesURLMatch(kGoogleSearchURL2, - GetLastCommittedSideContentsEntry()->GetURL())); + EXPECT_EQ(kSearchMatchUrl2, helper()->last_search_url()); + EXPECT_EQ(kSearchMatchUrl2, GetLastCommittedSideContentsEntry()->GetURL()); - // Going back to the original Google SRP should update the `last_search_url` - // to that Google SRP URL. + // Going back to the original search URL should update the `last_search_url`. GoBack(); - EXPECT_TRUE(DoesURLMatch(kGoogleSearchURL1, helper()->last_search_url())); - EXPECT_TRUE(DoesURLMatch(kGoogleSearchURL1, - GetLastCommittedSideContentsEntry()->GetURL())); + EXPECT_EQ(kSearchMatchUrl1, helper()->last_search_url()); + EXPECT_EQ(kSearchMatchUrl1, GetLastCommittedSideContentsEntry()->GetURL()); - // Going forward to the non-Google URL shouldn't change the `last_search_url`. + // Going forward to the non-matching search URL shouldn't change the + // `last_search_url`. GoForward(); - EXPECT_TRUE(DoesURLMatch(kGoogleSearchURL1, helper()->last_search_url())); - EXPECT_TRUE(DoesURLMatch(kGoogleSearchURL1, - GetLastCommittedSideContentsEntry()->GetURL())); + EXPECT_EQ(kSearchMatchUrl1, helper()->last_search_url()); + EXPECT_EQ(kSearchMatchUrl1, GetLastCommittedSideContentsEntry()->GetURL()); - // Going forward to the Google SRP URL should update the `last_search_url` to - // that Google SRP URL. + // Going forward to the latest matching search URL should update the + // `last_search_url` to that latest URL. GoForward(); - EXPECT_TRUE(DoesURLMatch(kGoogleSearchURL2, helper()->last_search_url())); - EXPECT_TRUE(DoesURLMatch(kGoogleSearchURL2, - GetLastCommittedSideContentsEntry()->GetURL())); -} - -TEST_F(SideSearchTabContentsHelperTest, LastSearchURLIgnoresGoogleHomePage) { - EXPECT_FALSE(helper()->last_search_url().has_value()); - - LoadURL(kGoogleSearchURL1); - EXPECT_TRUE(DoesURLMatch(kGoogleSearchURL1, helper()->last_search_url())); - EXPECT_TRUE(DoesURLMatch(kGoogleSearchURL1, - GetLastCommittedSideContentsEntry()->GetURL())); - - // Navigating to the Google home page should not update the `last_search_url`. - LoadURL(kGoogleSearchHomePageURL); - EXPECT_TRUE(DoesURLMatch(kGoogleSearchURL1, helper()->last_search_url())); - EXPECT_TRUE(DoesURLMatch(kGoogleSearchURL1, - GetLastCommittedSideContentsEntry()->GetURL())); - - LoadURL(kGoogleSearchURL2); - EXPECT_TRUE(DoesURLMatch(kGoogleSearchURL2, helper()->last_search_url())); - EXPECT_TRUE(DoesURLMatch(kGoogleSearchURL2, - GetLastCommittedSideContentsEntry()->GetURL())); + EXPECT_EQ(kSearchMatchUrl2, helper()->last_search_url()); + EXPECT_EQ(kSearchMatchUrl2, GetLastCommittedSideContentsEntry()->GetURL()); } TEST_F(SideSearchTabContentsHelperTest, IndicatesWhenSidePanelShouldBeShown) { // With no initial navigation the side panel should not be showing. EXPECT_FALSE(helper()->CanShowSidePanelForCommittedNavigation()); - // If no previous Google SRP has been seen for this tab contents the side - // panel should not show. - LoadURL(kNonGoogleURL); + // If no previous matching search URL has been seen for this tab contents the + // side panel should not show. + LoadURL(kNonMatchUrl); EXPECT_FALSE(helper()->CanShowSidePanelForCommittedNavigation()); - // The side panel should not be visible on Google SRP pages. - LoadURL(kGoogleSearchURL1); + // The side panel should not be visible on matching search pages. + LoadURL(kSearchMatchUrl1); EXPECT_FALSE(helper()->CanShowSidePanelForCommittedNavigation()); - // If a Google SRP has previously been navigated to it can appear in the side - // panel if on a non-Google page. - LoadURL(kNonGoogleURL); + // If a matching page has previously been seen the side panel may be opened + // on non-matching pages. + LoadURL(kNonMatchUrl); EXPECT_TRUE(helper()->CanShowSidePanelForCommittedNavigation()); - - // The side panel should not appear when on the Google home page. - LoadURL(kGoogleSearchHomePageURL); - EXPECT_FALSE(helper()->CanShowSidePanelForCommittedNavigation()); } TEST_F(SideSearchTabContentsHelperTest, ClearsSidePanelContentsWhenAsked) {
diff --git a/chrome/browser/ui/user_education/OWNERS b/chrome/browser/ui/user_education/OWNERS index 62918d8..54d8e0f 100644 --- a/chrome/browser/ui/user_education/OWNERS +++ b/chrome/browser/ui/user_education/OWNERS
@@ -1,7 +1,7 @@ # Primary -collinbaker@chromium.org +dfried@chromium.org # Backup bsep@chromium.org pbos@chromium.org -dpenning@chromium.org \ No newline at end of file +dpenning@chromium.org
diff --git a/chrome/browser/ui/views/accelerator_table.cc b/chrome/browser/ui/views/accelerator_table.cc index cc52a1799..27564a1 100644 --- a/chrome/browser/ui/views/accelerator_table.cc +++ b/chrome/browser/ui/views/accelerator_table.cc
@@ -229,6 +229,9 @@ {ui::VKEY_SPACE, ui::EF_CONTROL_DOWN, IDC_TOGGLE_COMMANDER}, #endif // !BUILDFLAG(IS_CHROMEOS_ASH) #endif // !BUILDFLAG(IS_MAC) +#if BUILDFLAG(IS_LINUX) + {ui::VKEY_S, ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN, IDC_RUN_SCREEN_AI}, +#endif }; #if BUILDFLAG(IS_CHROMEOS_ASH)
diff --git a/chrome/browser/ui/views/apps/app_dialog/app_pause_dialog_view.cc b/chrome/browser/ui/views/apps/app_dialog/app_pause_dialog_view.cc index 50d0612..9f2838c 100644 --- a/chrome/browser/ui/views/apps/app_dialog/app_pause_dialog_view.cc +++ b/chrome/browser/ui/views/apps/app_dialog/app_pause_dialog_view.cc
@@ -20,7 +20,7 @@ // static void apps::AppServiceProxy::CreatePauseDialog( - apps::mojom::AppType app_type, + apps::AppType app_type, const std::string& app_name, const gfx::ImageSkia& image, const apps::PauseData& pause_data, @@ -33,7 +33,7 @@ } AppPauseDialogView::AppPauseDialogView( - apps::mojom::AppType app_type, + apps::AppType app_type, const std::string& app_name, const gfx::ImageSkia& image, const apps::PauseData& pause_data, @@ -46,9 +46,8 @@ const int cutoff = pause_data.minutes == 0 || pause_data.hours == 0 ? 0 : -1; std::u16string heading_text = l10n_util::GetStringFUTF16( - (app_type == apps::mojom::AppType::kWeb) - ? IDS_APP_PAUSE_HEADING_FOR_WEB_APPS - : IDS_APP_PAUSE_HEADING, + (app_type == apps::AppType::kWeb) ? IDS_APP_PAUSE_HEADING_FOR_WEB_APPS + : IDS_APP_PAUSE_HEADING, base::UTF8ToUTF16(app_name), ui::TimeFormat::Detailed( ui::TimeFormat::Format::FORMAT_DURATION,
diff --git a/chrome/browser/ui/views/apps/app_dialog/app_pause_dialog_view.h b/chrome/browser/ui/views/apps/app_dialog/app_pause_dialog_view.h index 62183303..d039b238 100644 --- a/chrome/browser/ui/views/apps/app_dialog/app_pause_dialog_view.h +++ b/chrome/browser/ui/views/apps/app_dialog/app_pause_dialog_view.h
@@ -7,6 +7,7 @@ #include "chrome/browser/apps/app_service/app_service_proxy.h" #include "chrome/browser/ui/views/apps/app_dialog/app_dialog_view.h" +#include "components/services/app_service/public/cpp/app_types.h" namespace gfx { class ImageSkia; @@ -17,7 +18,7 @@ class AppPauseDialogView : public AppDialogView { public: AppPauseDialogView( - apps::mojom::AppType app_type, + apps::AppType app_type, const std::string& app_name, const gfx::ImageSkia& image, const apps::PauseData& pause_data,
diff --git a/chrome/browser/ui/views/apps/app_dialog/app_uninstall_dialog_view.cc b/chrome/browser/ui/views/apps/app_dialog/app_uninstall_dialog_view.cc index 8216fc9..a633925 100644 --- a/chrome/browser/ui/views/apps/app_dialog/app_uninstall_dialog_view.cc +++ b/chrome/browser/ui/views/apps/app_dialog/app_uninstall_dialog_view.cc
@@ -64,18 +64,18 @@ #endif std::u16string GetWindowTitleForApp(Profile* profile, - apps::mojom::AppType app_type, + apps::AppType app_type, const std::string& app_id, const std::string& app_name) { - using apps::mojom::AppType; #if BUILDFLAG(IS_CHROMEOS_ASH) // On ChromeOS, all app types exist, but Arc shortcut apps get the regular // extension uninstall title. - if (app_type == AppType::kArc && IsArcShortcutApp(profile, app_id)) + if (app_type == apps::AppType::kArc && IsArcShortcutApp(profile, app_id)) return l10n_util::GetStringUTF16(IDS_EXTENSION_UNINSTALL_PROMPT_TITLE); #else // On non-ChromeOS, only Chrome app and web app types meaningfully exist. - DCHECK(app_type != AppType::kChromeApp && app_type != AppType::kWeb); + DCHECK(app_type != apps::AppType::kChromeApp && + app_type != apps::AppType::kWeb); #endif return l10n_util::GetStringFUTF16(IDS_PROMPT_APP_UNINSTALL_TITLE, base::UTF8ToUTF16(app_name)); @@ -86,7 +86,7 @@ // static views::Widget* apps::UninstallDialog::UiBase::Create( Profile* profile, - apps::mojom::AppType app_type, + apps::AppType app_type, const std::string& app_id, const std::string& app_name, gfx::ImageSkia image, @@ -102,7 +102,7 @@ AppUninstallDialogView::AppUninstallDialogView( Profile* profile, - apps::mojom::AppType app_type, + apps::AppType app_type, const std::string& app_id, const std::string& app_name, gfx::ImageSkia image, @@ -137,7 +137,7 @@ } void AppUninstallDialogView::InitializeView(Profile* profile, - apps::mojom::AppType app_type, + apps::AppType app_type, const std::string& app_id, const std::string& app_name) { SetButtonLabel( @@ -150,25 +150,25 @@ provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_VERTICAL))); switch (app_type) { - case apps::mojom::AppType::kUnknown: - case apps::mojom::AppType::kBuiltIn: - case apps::mojom::AppType::kMacOs: - case apps::mojom::AppType::kStandaloneBrowser: - case apps::mojom::AppType::kRemote: - case apps::mojom::AppType::kExtension: + case apps::AppType::kUnknown: + case apps::AppType::kBuiltIn: + case apps::AppType::kMacOs: + case apps::AppType::kStandaloneBrowser: + case apps::AppType::kRemote: + case apps::AppType::kExtension: NOTREACHED(); break; - case apps::mojom::AppType::kStandaloneBrowserChromeApp: + case apps::AppType::kStandaloneBrowserChromeApp: // Do nothing special for kStandaloneBrowserChromeApp. break; - case apps::mojom::AppType::kArc: + case apps::AppType::kArc: #if BUILDFLAG(IS_CHROMEOS_ASH) InitializeViewForArcApp(profile, app_id); #else NOTREACHED(); #endif break; - case apps::mojom::AppType::kPluginVm: + case apps::AppType::kPluginVm: #if BUILDFLAG(IS_CHROMEOS_ASH) InitializeViewWithMessage(l10n_util::GetStringFUTF16( IDS_PLUGIN_VM_UNINSTALL_PROMPT_BODY, base::UTF8ToUTF16(app_name))); @@ -176,7 +176,7 @@ NOTREACHED(); #endif break; - case apps::mojom::AppType::kBorealis: + case apps::AppType::kBorealis: #if BUILDFLAG(IS_CHROMEOS_ASH) if (app_id == borealis::kClientAppId) { InitializeViewWithMessage(l10n_util::GetStringUTF16( @@ -189,7 +189,7 @@ NOTREACHED(); #endif break; - case apps::mojom::AppType::kCrostini: + case apps::AppType::kCrostini: #if BUILDFLAG(IS_CHROMEOS_ASH) InitializeViewWithMessage(l10n_util::GetStringUTF16( IDS_CROSTINI_APPLICATION_UNINSTALL_CONFIRM_BODY)); @@ -198,11 +198,11 @@ #endif break; - case apps::mojom::AppType::kWeb: - case apps::mojom::AppType::kSystemWeb: + case apps::AppType::kWeb: + case apps::AppType::kSystemWeb: InitializeViewForWebApp(profile, app_id); break; - case apps::mojom::AppType::kChromeApp: + case apps::AppType::kChromeApp: InitializeViewForExtension(profile, app_id); break; }
diff --git a/chrome/browser/ui/views/apps/app_dialog/app_uninstall_dialog_view.h b/chrome/browser/ui/views/apps/app_dialog/app_uninstall_dialog_view.h index 8500bc2e..35d5a746 100644 --- a/chrome/browser/ui/views/apps/app_dialog/app_uninstall_dialog_view.h +++ b/chrome/browser/ui/views/apps/app_dialog/app_uninstall_dialog_view.h
@@ -11,7 +11,7 @@ #include "build/chromeos_buildflags.h" #include "chrome/browser/apps/app_service/uninstall_dialog.h" #include "chrome/browser/ui/views/apps/app_dialog/app_dialog_view.h" -#include "components/services/app_service/public/mojom/types.mojom-forward.h" +#include "components/services/app_service/public/cpp/app_types.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" class Profile; @@ -32,7 +32,7 @@ public AppDialogView { public: AppUninstallDialogView(Profile* profile, - apps::mojom::AppType app_type, + apps::AppType app_type, const std::string& app_id, const std::string& app_name, gfx::ImageSkia image, @@ -47,7 +47,7 @@ private: void InitializeView(Profile* profile, - apps::mojom::AppType app_type, + apps::AppType app_type, const std::string& app_id, const std::string& app_name);
diff --git a/chrome/browser/ui/views/autofill/autofill_popup_view_utils.cc b/chrome/browser/ui/views/autofill/autofill_popup_view_utils.cc index 78894df..3fdb722 100644 --- a/chrome/browser/ui/views/autofill/autofill_popup_view_utils.cc +++ b/chrome/browser/ui/views/autofill/autofill_popup_view_utils.cc
@@ -254,6 +254,7 @@ element_bottom_is_within_content_area_bounds); } +// Keep in sync with TryToCloseAllPrompts() from autofill_uitest.cc. bool BoundsOverlapWithAnyOpenPrompt(const gfx::Rect& screen_bounds, content::WebContents* web_contents) { gfx::NativeView top_level_view =
diff --git a/chrome/browser/ui/views/autofill/autofill_popup_view_utils.h b/chrome/browser/ui/views/autofill/autofill_popup_view_utils.h index acc8608..a665c0f 100644 --- a/chrome/browser/ui/views/autofill/autofill_popup_view_utils.h +++ b/chrome/browser/ui/views/autofill/autofill_popup_view_utils.h
@@ -72,6 +72,8 @@ // Returns whether there is any open prompt in |web_contents| with bounds that // overlap |screen_bounds|. +// This is unreliable on Windows because bubbles are not necessarily children of +// the root view of the current tab. bool BoundsOverlapWithAnyOpenPrompt(const gfx::Rect& screen_bounds, content::WebContents* web_contents);
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_editor_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_editor_view.cc index 39f502a1..5220966 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_editor_view.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_editor_view.cc
@@ -141,10 +141,10 @@ bool BookmarkEditorView::IsCommandIdEnabled(int command_id) const { switch (command_id) { - case IDS_EDIT: - case IDS_DELETE: + case kContextMenuItemEdit: + case kContextMenuItemDelete: return !running_menu_for_root_; - case IDS_BOOKMARK_EDITOR_NEW_FOLDER_MENU_ITEM: + case kContextMenuItemNewFolder: return true; default: NOTREACHED(); @@ -160,13 +160,13 @@ void BookmarkEditorView::ExecuteCommand(int command_id, int event_flags) { DCHECK(tree_view_->GetActiveNode()); - if (command_id == IDS_EDIT) { + if (command_id == kContextMenuItemEdit) { tree_view_->StartEditing(tree_view_->GetActiveNode()); - } else if (command_id == IDS_DELETE) { + } else if (command_id == kContextMenuItemDelete) { ExecuteCommandDelete(base::BindOnce(&chrome::ConfirmDeleteBookmarkNode, GetWidget()->GetNativeWindow())); } else { - DCHECK_EQ(IDS_BOOKMARK_EDITOR_NEW_FOLDER_MENU_ITEM, command_id); + DCHECK_EQ(kContextMenuItemNewFolder, command_id); NewFolder(tree_model_->AsNode(tree_view_->GetActiveNode())); } } @@ -537,11 +537,11 @@ ui::SimpleMenuModel* BookmarkEditorView::GetMenuModel() { if (!context_menu_model_.get()) { context_menu_model_ = std::make_unique<ui::SimpleMenuModel>(this); - context_menu_model_->AddItemWithStringId(IDS_EDIT, IDS_EDIT); - context_menu_model_->AddItemWithStringId(IDS_DELETE, IDS_DELETE); + context_menu_model_->AddItemWithStringId(kContextMenuItemEdit, IDS_EDIT); + context_menu_model_->AddItemWithStringId(kContextMenuItemDelete, + IDS_DELETE); context_menu_model_->AddItemWithStringId( - IDS_BOOKMARK_EDITOR_NEW_FOLDER_MENU_ITEM, - IDS_BOOKMARK_EDITOR_NEW_FOLDER_MENU_ITEM); + kContextMenuItemNewFolder, IDS_BOOKMARK_EDITOR_NEW_FOLDER_MENU_ITEM); } return context_menu_model_.get(); }
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_editor_view.h b/chrome/browser/ui/views/bookmarks/bookmark_editor_view.h index df38ed6..cbc13bf 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_editor_view.h +++ b/chrome/browser/ui/views/bookmarks/bookmark_editor_view.h
@@ -211,6 +211,11 @@ EditorNode* editor_node, bookmarks::BookmarkExpandedStateTracker::Nodes* expanded_nodes); + enum { + kContextMenuItemEdit = 1, + kContextMenuItemDelete, + kContextMenuItemNewFolder, + }; ui::SimpleMenuModel* GetMenuModel(); // Helper functions that implements the IDS_DELETE logic for ExecuteCommand,
diff --git a/chrome/browser/ui/views/frame/webui_tab_strip_container_view.cc b/chrome/browser/ui/views/frame/webui_tab_strip_container_view.cc index a486aebf..6417a192b 100644 --- a/chrome/browser/ui/views/frame/webui_tab_strip_container_view.cc +++ b/chrome/browser/ui/views/frame/webui_tab_strip_container_view.cc
@@ -197,29 +197,6 @@ : nullptr; } -class WebUINewTabButton : public ToolbarButton { - public: - METADATA_HEADER(WebUINewTabButton); - explicit WebUINewTabButton(PressedCallback pressed_callback) - : ToolbarButton(pressed_callback) { - SetTooltipText(l10n_util::GetStringUTF16(IDS_TOOLTIP_NEW_TAB)); - const int button_height = GetLayoutConstant(TOOLBAR_BUTTON_HEIGHT); - SetPreferredSize(gfx::Size(button_height, button_height)); - SetHorizontalAlignment(gfx::ALIGN_CENTER); - } - - void OnThemeChanged() override { - ToolbarButton::OnThemeChanged(); - const SkColor normal_color = GetThemeProvider()->GetColor( - ThemeProperties::COLOR_TOOLBAR_BUTTON_ICON); - SetImage(views::Button::STATE_NORMAL, - gfx::CreateVectorIcon(kNewTabToolbarButtonIcon, normal_color)); - } -}; - -BEGIN_METADATA(WebUINewTabButton, ToolbarButton) -END_METADATA - } // namespace // When enabled, closes the container for taps in either the web content @@ -567,9 +544,17 @@ std::unique_ptr<views::View> WebUITabStripContainerView::CreateNewTabButton() { DCHECK_EQ(nullptr, new_tab_button_); - auto new_tab_button = std::make_unique<WebUINewTabButton>( + auto new_tab_button = std::make_unique<ToolbarButton>( base::BindRepeating(&WebUITabStripContainerView::NewTabButtonPressed, base::Unretained(this))); + + new_tab_button->SetTooltipText( + l10n_util::GetStringUTF16(IDS_TOOLTIP_NEW_TAB)); + const int button_height = GetLayoutConstant(TOOLBAR_BUTTON_HEIGHT); + new_tab_button->SetPreferredSize(gfx::Size(button_height, button_height)); + new_tab_button->SetHorizontalAlignment(gfx::ALIGN_CENTER); + new_tab_button->SetVectorIcon(kNewTabToolbarButtonIcon); + new_tab_button_ = new_tab_button.get(); view_observations_.AddObservation(new_tab_button_.get()); return new_tab_button;
diff --git a/chrome/browser/ui/views/privacy_sandbox/privacy_sandbox_dialog_view.cc b/chrome/browser/ui/views/privacy_sandbox/privacy_sandbox_dialog_view.cc index 08b4b78..ad725b4 100644 --- a/chrome/browser/ui/views/privacy_sandbox/privacy_sandbox_dialog_view.cc +++ b/chrome/browser/ui/views/privacy_sandbox/privacy_sandbox_dialog_view.cc
@@ -6,6 +6,7 @@ #include "base/metrics/histogram_functions.h" #include "chrome/browser/privacy_sandbox/privacy_sandbox_service.h" +#include "chrome/browser/privacy_sandbox/privacy_sandbox_service_factory.h" #include "chrome/browser/ui/chrome_pages.h" #include "chrome/browser/ui/privacy_sandbox/privacy_sandbox_dialog.h" #include "chrome/browser/ui/views/frame/app_menu_button.h" @@ -76,6 +77,10 @@ dialog_type); SetUseDefaultFillLayout(true); + + auto* privacy_sandbox_serivce = + PrivacySandboxServiceFactory::GetForProfile(browser->profile()); + privacy_sandbox_serivce->DialogOpenedForBrowser(browser); } void PrivacySandboxDialogView::Close() {
diff --git a/chrome/browser/ui/views/select_file_dialog_extension.cc b/chrome/browser/ui/views/select_file_dialog_extension.cc index d04ea99..cd5dbb21 100644 --- a/chrome/browser/ui/views/select_file_dialog_extension.cc +++ b/chrome/browser/ui/views/select_file_dialog_extension.cc
@@ -15,16 +15,12 @@ #include "ash/public/cpp/style/color_provider.h" #include "ash/public/cpp/style/scoped_light_mode_as_default.h" #include "ash/public/cpp/tablet_mode.h" -#include "base/bind.h" -#include "base/callback.h" #include "base/feature_list.h" #include "base/location.h" #include "base/logging.h" #include "base/memory/ref_counted.h" #include "base/no_destructor.h" #include "base/strings/stringprintf.h" -#include "base/task/single_thread_task_runner.h" -#include "base/threading/thread_task_runner_handle.h" #include "build/chromeos_buildflags.h" #include "chrome/browser/app_mode/app_mode_utils.h" #include "chrome/browser/apps/platform_apps/app_window_registry_util.h" @@ -51,7 +47,6 @@ #include "chromeos/ui/base/window_properties.h" #include "extensions/browser/app_window/app_window.h" #include "extensions/browser/app_window/native_app_window.h" -#include "extensions/browser/extension_system.h" #include "ui/aura/window.h" #include "ui/base/base_window.h" #include "ui/gfx/color_palette.h" @@ -300,29 +295,7 @@ void SelectFileDialogExtension::ExtensionTerminated( ExtensionDialog* dialog) { - // The extension would have been unloaded because of the termination, - // reload it. - std::string extension_id = dialog->host()->extension()->id(); - // Reload the extension after a bit; the extension may not have been unloaded - // yet. We don't want to try to reload the extension only to have the Unload - // code execute after us and re-unload the extension. - // - // TODO(rkc): This is ugly. The ideal solution is that we shouldn't need to - // reload the extension at all - when we try to open the extension the next - // time, the extension subsystem would automatically reload it for us. At - // this time though this is broken because of some faulty wiring in - // extensions::ProcessManager::CreateViewHost. Once that is fixed, remove - // this. - if (profile_) { - base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::BindOnce( - &extensions::ExtensionService::ReloadExtension, - base::Unretained(extensions::ExtensionSystem::Get(profile_) - ->extension_service()), - extension_id)); - } - + // The extension crashed (or the process was killed). Close the dialog. dialog->GetWidget()->Close(); }
diff --git a/chrome/browser/ui/views/side_search/side_search_browser_controller_browsertest.cc b/chrome/browser/ui/views/side_search/side_search_browser_controller_interactive_uitest.cc similarity index 79% rename from chrome/browser/ui/views/side_search/side_search_browser_controller_browsertest.cc rename to chrome/browser/ui/views/side_search/side_search_browser_controller_interactive_uitest.cc index d990a8e2..edd6b579 100644 --- a/chrome/browser/ui/views/side_search/side_search_browser_controller_browsertest.cc +++ b/chrome/browser/ui/views/side_search/side_search_browser_controller_interactive_uitest.cc
@@ -6,6 +6,8 @@ #include "base/feature_list.h" #include "base/files/file_util.h" +#include "base/strings/strcat.h" +#include "base/strings/string_number_conversions.h" #include "base/test/metrics/histogram_tester.h" #include "base/test/scoped_feature_list.h" #include "build/build_config.h" @@ -22,7 +24,6 @@ #include "chrome/common/webui_url_constants.h" #include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/ui_test_utils.h" -#include "components/google/core/common/google_util.h" #include "content/public/browser/render_frame_host.h" #include "content/public/browser/web_contents.h" #include "content/public/common/result_codes.h" @@ -40,52 +41,29 @@ namespace { +constexpr char kSearchMatchPath[] = "/search-match"; +constexpr char kNonMatchPath[] = "/non-match"; + ui::MouseEvent GetDummyEvent() { return ui::MouseEvent(ui::ET_MOUSE_PRESSED, gfx::PointF(), gfx::PointF(), base::TimeTicks::Now(), 0, 0); } -// Strips out the port from a given `url`. Useful when testing side search with -// the EmbeddedTestServer. -GURL GetFilteredURL(const GURL& url) { - GURL filtered_url = url; - if (url.has_port()) { - GURL::Replacements remove_port; - remove_port.ClearPort(); - filtered_url = filtered_url.ReplaceComponents(remove_port); - } - return filtered_url; -} - -// In the spirit of testing for the current use of side search for the Google -// DSE set the callback to allow Google SRP urls to proceed in the side panel. -// Note we clear away the port here since google_util::IsGoogleSearchUrl does -// not allow arbitrary ports in the url but the EmbeddedTestServer requires us -// to use URLs with the specific non-standard port it listens on. -// TODO(crbug.com/1304513): Eliminate the Google specific nature of both of -// these. We should be able to update tests to use URLs that satisfy a -// combination of the below two checks without needing such complicated and -// specific logic. -bool ShouldNavigateInSidePanel(const GURL& url) { - return google_util::IsGoogleSearchUrl(GetFilteredURL(url)); -} - -bool CanShowSidePanelForURL(const GURL& url) { - GURL filtered_url = GetFilteredURL(url); - return !google_util::IsGoogleSearchUrl(filtered_url) && - !google_util::IsGoogleHomePageUrl(filtered_url) && - filtered_url.spec() != chrome::kChromeUINewTabURL; +bool IsSearchURLMatch(const GURL& url) { + // Test via path prefix match as the embedded test server ensures that all + // URLs are using the same host and paths are made unique via appending a + // monotonically increasing value to the end of their paths. + return url.path().find(kSearchMatchPath) != std::string::npos; } } // namespace -// TODO(crbug.com/1304513): Refactor out google specific references and have -// this apply more generically to DSEs. class SideSearchBrowserControllerTest : public InProcessBrowserTest { public: // InProcessBrowserTest: void SetUp() override { - scoped_feature_list_.InitWithFeatures({features::kSideSearch}, {}); + scoped_feature_list_.InitWithFeatures({features::kSideSearch}, + {features::kSideSearchDSESupport}); ASSERT_TRUE(embedded_test_server()->InitializeAndListen()); InProcessBrowserTest::SetUp(); } @@ -99,12 +77,15 @@ InProcessBrowserTest::SetUpOnMainThread(); auto* config = SideSearchConfig::Get(browser()->profile()); - // TODO(crbug.com/1304513): Update test to avoid Google specific behavior. - config->ApplyGoogleSearchConfigurationForTesting(); + // Basic configuration for testing that allows navigations to URLs with + // paths prefixed with `kSearchMatchPath` to proceed within the side panel, + // and only allows showing the side panel on non-matching pages. config->SetShouldNavigateInSidePanelCallback( - base::BindRepeating(ShouldNavigateInSidePanel)); - config->SetCanShowSidePanelForURLCallback( - base::BindRepeating(CanShowSidePanelForURL)); + base::BindRepeating(IsSearchURLMatch)); + config->SetCanShowSidePanelForURLCallback(base::BindRepeating( + [](const GURL& url) { return !IsSearchURLMatch(url); })); + config->SetGenerateSideSearchURLCallback( + base::BindRepeating([](const GURL& url) { return url; })); SetIsSidePanelSRPAvailableAt(browser(), 0, true); } @@ -198,26 +179,21 @@ return tab_contents_helper->side_panel_contents_for_testing(); } - void NavigateToSRPAndNonGoogleUrl( - Browser* browser, - absl::optional<GURL> google_url = absl::nullopt) { - // The side panel button should never be visible on the Google search page. - NavigateActiveTab(browser, google_url.value_or(google_search_url())); + void NavigateToMatchingAndNonMatchingSearchPage(Browser* browser) { + // The side panel button should never be visible on the matched search page. + NavigateActiveTab(browser, GetMatchingSearchUrl()); EXPECT_FALSE(GetSidePanelButtonFor(browser)->GetVisible()); EXPECT_FALSE(GetSidePanelFor(browser)->GetVisible()); - // The side panel button should be visible if on a non-Google page and the - // current tab has previously encountered a Google search page. - NavigateActiveTab(browser, non_google_url()); + // The side panel button should be visible if on a non-matched page and the + // current tab has previously encountered a matched search page. + NavigateActiveTab(browser, GetNonMatchingUrl()); EXPECT_TRUE(GetSidePanelButtonFor(browser)->GetVisible()); EXPECT_FALSE(GetSidePanelFor(browser)->GetVisible()); } - void NavigateToSRPAndOpenSidePanel( - Browser* browser, - absl::optional<GURL> google_url = absl::nullopt) { - NavigateToSRPAndNonGoogleUrl(browser, - google_url.value_or(google_search_url())); + void NavigateToMatchingSearchPageAndOpenSidePanel(Browser* browser) { + NavigateToMatchingAndNonMatchingSearchPage(browser); NotifyButtonClick(browser); EXPECT_TRUE(GetSidePanelButtonFor(browser)->GetVisible()); @@ -227,16 +203,18 @@ } protected: - GURL google_search_url() { - return embedded_test_server()->GetURL("www.google.com", "/search?q=test"); + GURL GetMatchingSearchUrl() { + // Ensure that each returned matching URL is unique. + static int id = 1; + return embedded_test_server()->GetURL( + base::StrCat({kSearchMatchPath, base::NumberToString(id++)})); } - GURL google_homepage_url() { - return embedded_test_server()->GetURL("www.google.com", "/"); - } - - GURL non_google_url() { - return embedded_test_server()->GetURL("www.test.com", "/"); + GURL GetNonMatchingUrl() { + // Ensure that each returned non-matching URL is unique. + static int id = 1; + return embedded_test_server()->GetURL( + base::StrCat({kNonMatchPath, base::NumberToString(id++)})); } std::unique_ptr<net::test_server::HttpResponse> HandleRequest( @@ -264,8 +242,8 @@ IN_PROC_BROWSER_TEST_F(SideSearchBrowserControllerTest, SidePanelOpenedPagesInTheTabFrameAreNonSkippable) { // Start with the side panel in a toggled open state. The side panel will - // intercept non-google search URLs and redirect these to the tab contents. - NavigateToSRPAndOpenSidePanel(browser()); + // intercept non-matching search URLs and redirect these to the tab contents. + NavigateToMatchingSearchPageAndOpenSidePanel(browser()); // Always show the side panel for the duration of the navigation test. SideSearchConfig::Get(browser()->profile()) @@ -327,8 +305,8 @@ IN_PROC_BROWSER_TEST_F(SideSearchBrowserControllerTest, RedirectedPagesOpenedFromTheSidePanelAreSkippable) { // Start with the side panel in a toggled open state. The side panel will - // intercept non-google search URLs and redirect these to the tab contents. - NavigateToSRPAndOpenSidePanel(browser()); + // intercept non-matching search URLs and redirect these to the tab contents. + NavigateToMatchingSearchPageAndOpenSidePanel(browser()); // Always show the side panel for the duration of the navigation test. SideSearchConfig::Get(browser()->profile()) @@ -382,79 +360,59 @@ IN_PROC_BROWSER_TEST_F(SideSearchBrowserControllerTest, SidePanelButtonShowsCorrectlySingleTab) { - // The side panel button should never be visible on the Google home page. - NavigateActiveTab(browser(), google_homepage_url()); - EXPECT_FALSE(GetSidePanelButtonFor(browser())->GetVisible()); - - // If no previous Google search page has been navigated to the button should + // If no previous matched search page has been navigated to the button should // not be visible. - NavigateActiveTab(browser(), non_google_url()); + NavigateActiveTab(browser(), GetNonMatchingUrl()); EXPECT_FALSE(GetSidePanelButtonFor(browser())->GetVisible()); - // The side panel button should never be visible on the Google search page. - NavigateActiveTab(browser(), google_search_url()); + // The side panel button should never be visible on a matched search page. + NavigateActiveTab(browser(), GetMatchingSearchUrl()); EXPECT_FALSE(GetSidePanelButtonFor(browser())->GetVisible()); - // The side panel button should be visible if on a non-Google page and the - // current tab has previously encountered a Google search page. - NavigateActiveTab(browser(), non_google_url()); + // The side panel button should be visible if on a non-matched page and the + // current tab has previously encountered a matched search page. + NavigateActiveTab(browser(), GetNonMatchingUrl()); EXPECT_TRUE(GetSidePanelButtonFor(browser())->GetVisible()); histogram_tester_.ExpectBucketCount( "SideSearch.AvailabilityChanged", SideSearchAvailabilityChangeType::kBecomeAvailable, 1); - - // The side panel button should never be visible on the Google home page even - // if it has already been navigated to a Google search page. - NavigateActiveTab(browser(), google_homepage_url()); - EXPECT_FALSE(GetSidePanelButtonFor(browser())->GetVisible()); - histogram_tester_.ExpectBucketCount( - "SideSearch.AvailabilityChanged", - SideSearchAvailabilityChangeType::kBecomeUnavailable, 1); - - // The side panel button should be visible if on a non-Google page and the - // current tab has previously encountered a Google search page. - NavigateActiveTab(browser(), non_google_url()); - EXPECT_TRUE(GetSidePanelButtonFor(browser())->GetVisible()); - histogram_tester_.ExpectBucketCount( - "SideSearch.AvailabilityChanged", - SideSearchAvailabilityChangeType::kBecomeAvailable, 2); } IN_PROC_BROWSER_TEST_F(SideSearchBrowserControllerTest, SidePanelButtonShowsCorrectlyMultipleTabs) { - // The side panel button should never be visible on the Google home page. - AppendTab(browser(), google_homepage_url()); + // The side panel button should never be visible on non-matching pages. + AppendTab(browser(), GetNonMatchingUrl()); ActivateTabAt(browser(), 1); EXPECT_FALSE(GetSidePanelButtonFor(browser())->GetVisible()); - // Navigate to a Google search page and then to a non-Google search page. This - // should show the side panel button in the toolbar. - AppendTab(browser(), google_search_url()); + // Navigate to a matched search page and then to a non-matched search page. + // This should show the side panel button in the toolbar. + AppendTab(browser(), GetMatchingSearchUrl()); ActivateTabAt(browser(), 2); EXPECT_FALSE(GetSidePanelButtonFor(browser())->GetVisible()); - NavigateActiveTab(browser(), non_google_url()); + NavigateActiveTab(browser(), GetNonMatchingUrl()); EXPECT_TRUE(GetSidePanelButtonFor(browser())->GetVisible()); - // Switch back to the Google search page, the side panel button should no + // Switch back to the matched search page, the side panel button should no // longer be visible. ActivateTabAt(browser(), 1); EXPECT_FALSE(GetSidePanelButtonFor(browser())->GetVisible()); - // When switching back to the tab on the non-Google page with a previously - // visited Google search page the button should be visible. + // When switching back to the tab on the non-matched page with a previously + // visited matched search page, the button should be visible. ActivateTabAt(browser(), 2); EXPECT_TRUE(GetSidePanelButtonFor(browser())->GetVisible()); } IN_PROC_BROWSER_TEST_F(SideSearchBrowserControllerTest, SidePanelTogglesCorrectlySingleTab) { - NavigateActiveTab(browser(), google_search_url()); + NavigateActiveTab(browser(), GetMatchingSearchUrl()); EXPECT_FALSE(GetSidePanelButtonFor(browser())->GetVisible()); EXPECT_FALSE(GetSidePanelFor(browser())->GetVisible()); - // The side panel button should be visible if on a non-Google page and the - // current tab has previously encountered a Google search page. - NavigateActiveTab(browser(), non_google_url()); + // The side panel button should be visible if on a non-matched page and the + // current tab has previously encountered a matched search page. + NavigateActiveTab(browser(), GetNonMatchingUrl()); EXPECT_TRUE(GetSidePanelButtonFor(browser())->GetVisible()); EXPECT_FALSE(GetSidePanelFor(browser())->GetVisible()); @@ -478,7 +436,7 @@ IN_PROC_BROWSER_TEST_F(SideSearchBrowserControllerTest, CloseButtonClosesSidePanel) { // The close button should be visible in the toggled state. - NavigateToSRPAndOpenSidePanel(browser()); + NavigateToMatchingSearchPageAndOpenSidePanel(browser()); EXPECT_TRUE(GetSidePanelFor(browser())->GetVisible()); NotifyCloseButtonClick(browser()); histogram_tester_.ExpectBucketCount( @@ -490,8 +448,8 @@ SideSearchNotAvailableInOTR) { Browser* browser2 = CreateIncognitoBrowser(); EXPECT_TRUE(browser2->profile()->IsOffTheRecord()); - NavigateActiveTab(browser2, google_search_url()); - NavigateActiveTab(browser2, non_google_url()); + NavigateActiveTab(browser2, GetMatchingSearchUrl()); + NavigateActiveTab(browser2, GetNonMatchingUrl()); EXPECT_EQ(nullptr, GetSidePanelButtonFor(browser2)); EXPECT_EQ(nullptr, GetSidePanelFor(browser2)); @@ -502,39 +460,26 @@ // Set the side panel SRP be unavailable. SetIsSidePanelSRPAvailableAt(browser(), 0, false); - // The side panel button should never be visible on the Google home page. - NavigateActiveTab(browser(), google_homepage_url()); - EXPECT_FALSE(GetSidePanelFor(browser())->GetVisible()); - - // If no previous Google search page has been navigated to the button should + // If no previous matched search page has been navigated to the button should // not be visible. - NavigateActiveTab(browser(), non_google_url()); + NavigateActiveTab(browser(), GetNonMatchingUrl()); EXPECT_FALSE(GetSidePanelFor(browser())->GetVisible()); - // The side panel button should never be visible on the Google search page. - NavigateActiveTab(browser(), google_search_url()); + // The side panel button should never be visible on the matched search page. + NavigateActiveTab(browser(), GetMatchingSearchUrl()); EXPECT_FALSE(GetSidePanelFor(browser())->GetVisible()); // The side panel button should not be visible if the side panel SRP is not // available. - NavigateActiveTab(browser(), non_google_url()); + NavigateActiveTab(browser(), GetNonMatchingUrl()); EXPECT_FALSE(GetSidePanelFor(browser())->GetVisible()); } -// TODO(crbug.com/1269277): Fix flakiness on Linux and Lacros then reenable. -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) -#define MAYBE_OpeningAndClosingTheSidePanelHandlesFocusCorrectly \ - DISABLED_OpeningAndClosingTheSidePanelHandlesFocusCorrectly -#else -#define MAYBE_OpeningAndClosingTheSidePanelHandlesFocusCorrectly \ - OpeningAndClosingTheSidePanelHandlesFocusCorrectly -#endif -IN_PROC_BROWSER_TEST_F( - SideSearchBrowserControllerTest, - MAYBE_OpeningAndClosingTheSidePanelHandlesFocusCorrectly) { - // Navigate to a Google SRP and then a non-Google page. The side panel will be - // available but closed. - NavigateToSRPAndNonGoogleUrl(browser()); +IN_PROC_BROWSER_TEST_F(SideSearchBrowserControllerTest, + OpeningAndClosingTheSidePanelHandlesFocusCorrectly) { + // Navigate to a matching search page and then a non-matched page. The side + // panel will be available but closed. + NavigateToMatchingAndNonMatchingSearchPage(browser()); auto* browser_view = BrowserViewFor(browser()); auto* side_panel = GetSidePanelFor(browser()); @@ -563,10 +508,10 @@ IN_PROC_BROWSER_TEST_F( SideSearchBrowserControllerTest, SidePanelStatePreservedWhenMovingTabsAcrossBrowserWindows) { - NavigateToSRPAndOpenSidePanel(browser()); + NavigateToMatchingSearchPageAndOpenSidePanel(browser()); Browser* browser2 = CreateBrowser(browser()->profile()); - NavigateToSRPAndNonGoogleUrl(browser2); + NavigateToMatchingAndNonMatchingSearchPage(browser2); std::unique_ptr<content::WebContents> web_contents = browser2->tab_strip_model()->DetachWebContentsAtForInsertion(0); @@ -584,24 +529,24 @@ IN_PROC_BROWSER_TEST_F(SideSearchBrowserControllerTest, SidePanelTogglesCorrectlyMultipleTabs) { - // Navigate to a Google search URL followed by a non-Google URL in two + // Navigate to a matching search URL followed by a non-matching URL in two // independent browser tabs such that both have the side panel ready. The // side panel should respect the state-per-tab flag. // Tab 1. - NavigateActiveTab(browser(), google_search_url()); + NavigateActiveTab(browser(), GetMatchingSearchUrl()); EXPECT_FALSE(GetSidePanelButtonFor(browser())->GetVisible()); EXPECT_FALSE(GetSidePanelFor(browser())->GetVisible()); - NavigateActiveTab(browser(), non_google_url()); + NavigateActiveTab(browser(), GetNonMatchingUrl()); EXPECT_TRUE(GetSidePanelButtonFor(browser())->GetVisible()); EXPECT_FALSE(GetSidePanelFor(browser())->GetVisible()); // Tab 2. - AppendTab(browser(), google_search_url()); + AppendTab(browser(), GetMatchingSearchUrl()); ActivateTabAt(browser(), 1); EXPECT_FALSE(GetSidePanelButtonFor(browser())->GetVisible()); EXPECT_FALSE(GetSidePanelFor(browser())->GetVisible()); - NavigateActiveTab(browser(), non_google_url()); + NavigateActiveTab(browser(), GetNonMatchingUrl()); EXPECT_TRUE(GetSidePanelButtonFor(browser())->GetVisible()); EXPECT_FALSE(GetSidePanelFor(browser())->GetVisible()); @@ -636,16 +581,8 @@ EXPECT_TRUE(GetSidePanelFor(browser())->GetVisible()); } -// TODO(crbug.com/1303946): Fix flakiness on Lacros then reenable. -#if BUILDFLAG(IS_CHROMEOS_LACROS) -#define MAYBE_SwitchingTabsHandlesFocusCorrectly \ - DISABLED_SwitchingTabsHandlesFocusCorrectly -#else -#define MAYBE_SwitchingTabsHandlesFocusCorrectly \ - SwitchingTabsHandlesFocusCorrectly -#endif IN_PROC_BROWSER_TEST_F(SideSearchBrowserControllerTest, - MAYBE_SwitchingTabsHandlesFocusCorrectly) { + SwitchingTabsHandlesFocusCorrectly) { auto* browser_view = BrowserViewFor(browser()); auto* side_panel = GetSidePanelFor(browser()); auto* contents_view = browser_view->contents_web_view(); @@ -654,16 +591,16 @@ // The side panel should currently have focus as it was opened via the toolbar // button. - NavigateToSRPAndOpenSidePanel(browser()); + NavigateToMatchingSearchPageAndOpenSidePanel(browser()); EXPECT_TRUE(side_panel->GetVisible()); EXPECT_TRUE(side_panel->Contains(focus_manager->GetFocusedView())); EXPECT_FALSE(contents_view->HasFocus()); // Switch to another tab and open the side panel. The side panel should still // have focus as it was opened via the toolbar button. - AppendTab(browser(), non_google_url()); + AppendTab(browser(), GetNonMatchingUrl()); ActivateTabAt(browser(), 1); - NavigateToSRPAndOpenSidePanel(browser()); + NavigateToMatchingSearchPageAndOpenSidePanel(browser()); EXPECT_TRUE(side_panel->GetVisible()); EXPECT_TRUE(side_panel->Contains(focus_manager->GetFocusedView())); EXPECT_FALSE(contents_view->HasFocus()); @@ -684,30 +621,30 @@ IN_PROC_BROWSER_TEST_F(SideSearchBrowserControllerTest, SidePanelTogglesClosedCorrectlyDuringNavigation) { - // Navigate to a Google SRP and then a non-Google page. The side panel will be - // available and open. - NavigateToSRPAndOpenSidePanel(browser()); + // Navigate to a matching SRP and then a non-matched page. The side panel will + // be available and open. + NavigateToMatchingSearchPageAndOpenSidePanel(browser()); auto* side_panel = GetSidePanelFor(browser()); - // Navigating to a Google SRP URL should automatically hide the side panel as - // it should not be available. + // Navigating to a matching SRP URL should automatically hide the side panel + // as it should not be available. EXPECT_TRUE(side_panel->GetVisible()); - NavigateActiveTab(browser(), google_search_url()); + NavigateActiveTab(browser(), GetMatchingSearchUrl()); EXPECT_FALSE(side_panel->GetVisible()); - // When navigating again to a non-Google / non-NTP page the side panel will - // become available again but should not automatically reopen. - NavigateActiveTab(browser(), google_search_url()); + // When navigating again to a non-matching page the side panel will become + // available again but should not automatically reopen. + NavigateActiveTab(browser(), GetMatchingSearchUrl()); EXPECT_FALSE(side_panel->GetVisible()); } IN_PROC_BROWSER_TEST_F(SideSearchBrowserControllerTest, SidePanelCrashesCloseSidePanel) { // Open two tabs with the side panel open. - NavigateToSRPAndOpenSidePanel(browser()); - AppendTab(browser(), non_google_url()); + NavigateToMatchingSearchPageAndOpenSidePanel(browser()); + AppendTab(browser(), GetNonMatchingUrl()); ActivateTabAt(browser(), 1); - NavigateToSRPAndOpenSidePanel(browser()); + NavigateToMatchingSearchPageAndOpenSidePanel(browser()); auto* side_panel = GetSidePanelFor(browser());
diff --git a/chrome/browser/ui/views/user_education/OWNERS b/chrome/browser/ui/views/user_education/OWNERS index 8878a22..3878830f 100644 --- a/chrome/browser/ui/views/user_education/OWNERS +++ b/chrome/browser/ui/views/user_education/OWNERS
@@ -1,5 +1,5 @@ # Primary -collinbaker@chromium.org +dfried@chromium.org # Backup robliao@chromium.org
diff --git a/chrome/browser/ui/webui/certificates_handler.cc b/chrome/browser/ui/webui/certificates_handler.cc index 8acf9d5..916cde1 100644 --- a/chrome/browser/ui/webui/certificates_handler.cc +++ b/chrome/browser/ui/webui/certificates_handler.cc
@@ -531,7 +531,7 @@ // Currently, we don't support exporting more than one at a time. If we do, // this would need to either change this to use UnlockSlotsIfNecessary or // change UnlockCertSlotIfNecessary to take a CertificateList. - DCHECK_EQ(selected_cert_list_.size(), 1U); + CHECK_EQ(selected_cert_list_.size(), 1U); // TODO(mattm): do something smarter about non-extractable keys chrome::UnlockCertSlotIfNecessary(
diff --git a/chrome/browser/ui/webui/chromeos/login/testapi/oobe_test_api_browsertest.cc b/chrome/browser/ui/webui/chromeos/login/testapi/oobe_test_api_browsertest.cc index de44a3a..c14b1065 100644 --- a/chrome/browser/ui/webui/chromeos/login/testapi/oobe_test_api_browsertest.cc +++ b/chrome/browser/ui/webui/chromeos/login/testapi/oobe_test_api_browsertest.cc
@@ -49,14 +49,16 @@ test::OobeJS().Evaluate("OobeAPI.screens.NetworkScreen.clickNext()"); #if BUILDFLAG(GOOGLE_CHROME_BRANDING) - test::OobeJS().ExpectFalse("OobeAPI.screens.EulaScreen.shouldSkip()"); - test::OobeJS() - .CreateWaiter("OobeAPI.screens.EulaScreen.isReadyForTesting()") - ->Wait(); - test::OobeJS().Evaluate("OobeAPI.screens.EulaScreen.clickNext()"); -#else - test::OobeJS().ExpectTrue("OobeAPI.screens.EulaScreen.shouldSkip()"); + if (!chromeos::features::IsOobeConsolidatedConsentEnabled()) { + test::OobeJS().ExpectFalse("OobeAPI.screens.EulaScreen.shouldSkip()"); + test::OobeJS() + .CreateWaiter("OobeAPI.screens.EulaScreen.isReadyForTesting()") + ->Wait(); + test::OobeJS().Evaluate("OobeAPI.screens.EulaScreen.clickNext()"); + return; + } #endif + test::OobeJS().ExpectTrue("OobeAPI.screens.EulaScreen.shouldSkip()"); } class OobeTestApiTestChromebox : public OobeTestApiTest {
diff --git a/chrome/browser/ui/webui/favicon_source.cc b/chrome/browser/ui/webui/favicon_source.cc index d26878c1..604f7e1 100644 --- a/chrome/browser/ui/webui/favicon_source.cc +++ b/chrome/browser/ui/webui/favicon_source.cc
@@ -38,6 +38,9 @@ namespace { +// Generous cap to guard against out-of-memory issues. +constexpr int kMaxDesiredSizeInPixel = 2048; + // web_contents->GetLastCommittedURL in general will not necessarily yield the // original URL that started the request, but we're only interested in verifying // if it was issued by a history page, for whom this is the case. If it is not @@ -109,6 +112,15 @@ return; } + const int desired_size_in_pixel = + std::ceil(parsed.size_in_dip * parsed.device_scale_factor); + + // Guard against out-of-memory issues. + if (desired_size_in_pixel > kMaxDesiredSizeInPixel) { + SendDefaultResponse(std::move(callback), wc_getter); + return; + } + if (url_format_ == chrome::FaviconUrlFormat::kFaviconLegacy) { const extensions::Extension* extension = extensions::ExtensionRegistry::Get(profile_) @@ -121,9 +133,6 @@ } } - int desired_size_in_pixel = - std::ceil(parsed.size_in_dip * parsed.device_scale_factor); - if (parsed.page_url.empty()) { // Request by icon url.
diff --git a/chrome/browser/ui/webui/favicon_source_unittest.cc b/chrome/browser/ui/webui/favicon_source_unittest.cc index 3715dbc21..9207a27 100644 --- a/chrome/browser/ui/webui/favicon_source_unittest.cc +++ b/chrome/browser/ui/webui/favicon_source_unittest.cc
@@ -305,3 +305,17 @@ "com&allow_google_server_fallback=1"})), test_web_contents_getter_, base::BindOnce(&Noop)); } + +TEST_F(FaviconSourceTestWithFavicon2Format, + ShouldNotQueryIfDesiredSizeTooLarge) { + EXPECT_CALL(*mock_history_ui_favicon_request_handler_, + GetRawFaviconForPageURL) + .Times(0); + EXPECT_CALL(*mock_favicon_service_, GetRawFavicon).Times(0); + EXPECT_CALL(*mock_favicon_service_, GetRawFaviconForPageURL).Times(0); + + // 100x scale factor runs into the max cap. + source()->StartDataRequest( + GURL(base::StrCat({kDummyPrefix, "size/16@100x/https://www.google.com"})), + test_web_contents_getter_, base::BindOnce(&Noop)); +}
diff --git a/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc b/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc index 4d714e7..8bb4ac2 100644 --- a/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc +++ b/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc
@@ -51,13 +51,13 @@ #include "ui/base/theme_provider.h" #include "ui/base/webui/jstemplate_builder.h" #include "ui/base/webui/web_ui_util.h" -#include "ui/chromeos/devicetype_utils.h" #include "ui/gfx/color_utils.h" #include "ui/native_theme/native_theme.h" #if BUILDFLAG(IS_CHROMEOS_ASH) #include "chrome/browser/ash/policy/core/browser_policy_connector_ash.h" #include "chromeos/strings/grit/chromeos_strings.h" +#include "ui/chromeos/devicetype_utils.h" #endif #if !BUILDFLAG(IS_CHROMEOS)
diff --git a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc index 85332b56..5a3b1f9d 100644 --- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc +++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
@@ -1616,6 +1616,8 @@ {"privacySandboxTrialsTitle", IDS_SETTINGS_PRIVACY_SANDBOX_TRIALS_TITLE}, {"privacySandboxTrialsSummary", IDS_SETTINGS_PRIVACY_SANDBOX_TRIALS_SUMMARY}, + {"privacySandboxTrialsSummaryLearnMore", + IDS_SETTINGS_PRIVACY_SANDBOX_TRIALS_SUMMARY_LEARN_MORE}, {"privacySandboxAdPersonalizationTitle", IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_TITLE}, {"privacySandboxAdPersonalizationSummary", @@ -1640,40 +1642,56 @@ IDS_SETTINGS_PRIVACY_SANDBOX_LEARN_MORE_DIALOG_DATA_USAGE}, {"privacySandboxLearnMoreDialogDataManagement", IDS_SETTINGS_PRIVACY_SANDBOX_LEARN_MORE_DIALOG_DATA_MANAGEMENT}, + {"privacySandboxLearnMoreDialogTopicsDataTypes", + IDS_SETTINGS_PRIVACY_SANDBOX_LEARN_MORE_DIALOG_TOPICS_DATA_TYPES}, + {"privacySandboxLearnMoreDialogTopicsDataUsage", + IDS_SETTINGS_PRIVACY_SANDBOX_LEARN_MORE_DIALOG_TOPICS_DATA_USAGE}, + {"privacySandboxLearnMoreDialogTopicsDataManagement", + IDS_SETTINGS_PRIVACY_SANDBOX_LEARN_MORE_DIALOG_TOPICS_DATA_MANAGEMENT}, + {"privacySandboxLearnMoreDialogFledgeDataTypes", + IDS_SETTINGS_PRIVACY_SANDBOX_LEARN_MORE_DIALOG_FLEDGE_DATA_TYPES}, + {"privacySandboxLearnMoreDialogFledgeDataUsage", + IDS_SETTINGS_PRIVACY_SANDBOX_LEARN_MORE_DIALOG_FLEDGE_DATA_USAGE}, + {"privacySandboxLearnMoreDialogFledgeDataManagement", + IDS_SETTINGS_PRIVACY_SANDBOX_LEARN_MORE_DIALOG_FLEDGE_DATA_MANAGEMENT}, {"privacySandboxAdPersonalizationDialogTitle", IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_TITLE}, {"privacySandboxAdPersonalizationDialogDescription", IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_DESCRIPTION}, - {"privacySandboxAdPersonalizationDialogRemovedDescription", - IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_REMOVED_DESCRIPTION}, + {"privacySandboxAdPersonalizationRemovedDialogTitle", + IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_REMOVED_DIALOG_TITLE}, + {"privacySandboxAdPersonalizationRemovedDialogDescription", + IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_REMOVED_DIALOG_DESCRIPTION}, {"privacySandboxAdPersonalizationDialogTopicsTitle", IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_TOPICS_TITLE}, + {"privacySandboxAdPersonalizationDialogTopicsEmpty", + IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_TOPICS_EMPTY}, + {"privacySandboxAdPersonalizationDialogRemovedTopicsLabel", + IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_REMOVED_TOPICS_LABEL}, + {"privacySandboxAdPersonalizationDialogRemovedTopicsEmpty", + IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_REMOVED_TOPICS_EMPTY}, {"privacySandboxAdPersonalizationDialogTopicsLearnMore1", IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_TOPICS_LEARN_MORE_1}, {"privacySandboxAdPersonalizationDialogTopicsLearnMore2", IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_TOPICS_LEARN_MORE_2}, {"privacySandboxAdPersonalizationDialogTopicsLearnMore3", IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_TOPICS_LEARN_MORE_3}, - {"privacySandboxAdPersonalizationDialogTopicsEmpty", - IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_TOPICS_EMPTY}, - {"privacySandboxAdPersonalizationDialogRemovedTopicsEmpty", - IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_REMOVED_TOPICS_EMPTY}, - {"privacySandboxAdPersonalizationDialogRemovedTopicsLabel", - IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_REMOVED_TOPICS_LABEL}, + {"privacySandboxAdPersonalizationDialogTopicsLearnMore4", + IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_TOPICS_LEARN_MORE_4}, {"privacySandboxAdPersonalizationDialogFledgeTitle", IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_FLEDGE_TITLE}, + {"privacySandboxAdPersonalizationDialogFledgeEmpty", + IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_FLEDGE_EMPTY}, + {"privacySandboxAdPersonalizationDialogRemovedFledgeLabel", + IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_REMOVED_FLEDGE_LABEL}, + {"privacySandboxAdPersonalizationDialogRemovedFledgeEmpty", + IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_REMOVED_FLEDGE_EMPTY}, {"privacySandboxAdPersonalizationDialogFledgeLearnMore1", IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_FLEDGE_LEARN_MORE_1}, {"privacySandboxAdPersonalizationDialogFledgeLearnMore2", IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_FLEDGE_LEARN_MORE_2}, {"privacySandboxAdPersonalizationDialogFledgeLearnMore3", IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_FLEDGE_LEARN_MORE_3}, - {"privacySandboxAdPersonalizationDialogFledgeEmpty", - IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_FLEDGE_EMPTY}, - {"privacySandboxAdPersonalizationDialogRemovedFledgeEmpty", - IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_REMOVED_FLEDGE_EMPTY}, - {"privacySandboxAdPersonalizationDialogRemovedFledgeLabel", - IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_REMOVED_FLEDGE_LABEL}, {"privacySandboxAdMeasurementDialogTitle", IDS_SETTINGS_PRIVACY_SANDBOX_AD_MEASUREMENT_DIALOG_TITLE}, {"privacySandboxAdMeasurementDialogDescription",
diff --git a/chrome/browser/ui/webui/settings/shared_settings_localized_strings_provider.cc b/chrome/browser/ui/webui/settings/shared_settings_localized_strings_provider.cc index 6514f08..8977470 100644 --- a/chrome/browser/ui/webui/settings/shared_settings_localized_strings_provider.cc +++ b/chrome/browser/ui/webui/settings/shared_settings_localized_strings_provider.cc
@@ -30,17 +30,18 @@ #include "services/network/public/mojom/content_security_policy.mojom.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/webui/web_ui_util.h" -#include "ui/chromeos/devicetype_utils.h" + #if BUILDFLAG(IS_CHROMEOS_ASH) #include "chrome/browser/ash/crosapi/browser_util.h" #include "chrome/browser/nearby_sharing/common/nearby_share_features.h" #include "chrome/common/url_constants.h" #endif // BUILDFLAG(IS_CHROMEOS_ASH) + #if BUILDFLAG(IS_CHROMEOS_LACROS) #include "chromeos/lacros/lacros_service.h" #endif -#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_CHROMEOS) #include "chrome/browser/ui/webui/settings/chromeos/constants/routes.mojom.h" #endif @@ -181,7 +182,7 @@ {"urlKeyedAnonymizedDataCollectionDesc", IDS_SETTINGS_ENABLE_URL_KEYED_ANONYMIZED_DATA_COLLECTION_DESC}, {"spellingPref", IDS_SETTINGS_SPELLING_PREF}, -#if !BUILDFLAG(IS_CHROMEOS_ASH) && !BUILDFLAG(IS_CHROMEOS_LACROS) +#if !BUILDFLAG(IS_CHROMEOS) {"signinAllowedTitle", IDS_SETTINGS_SIGNIN_ALLOWED}, {"signinAllowedDescription", IDS_SETTINGS_SIGNIN_ALLOWED_DESC}, #endif @@ -237,7 +238,7 @@ html_source->AddLocalizedStrings(kLocalizedStrings); } -#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_CHROMEOS) void AddPasswordPromptDialogStrings(content::WebUIDataSource* html_source) { static constexpr webui::LocalizedString kLocalizedStrings[] = { {"passwordPromptTitle", IDS_SETTINGS_PEOPLE_PASSWORD_PROMPT_TITLE}, @@ -248,7 +249,7 @@ }; html_source->AddLocalizedStrings(kLocalizedStrings); } -#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#endif // BUILDFLAG(IS_CHROMEOS) void AddSyncPageStrings(content::WebUIDataSource* html_source) { static constexpr webui::LocalizedString kLocalizedStrings[] = { @@ -341,7 +342,7 @@ ShouldShowLacrosSideBySideWarningInLacros()); #endif -#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_CHROMEOS) html_source->AddString("chromeOSSyncSettingsPath", chromeos::settings::mojom::kSyncSetupSubpagePath); #endif
diff --git a/chrome/browser/web_applications/app_service/BUILD.gn b/chrome/browser/web_applications/app_service/BUILD.gn index 2eb7611..fca2cee3 100644 --- a/chrome/browser/web_applications/app_service/BUILD.gn +++ b/chrome/browser/web_applications/app_service/BUILD.gn
@@ -56,8 +56,8 @@ if (is_chromeos_lacros) { assert(enable_system_notifications) sources += [ - "web_apps_publisher_host.cc", - "web_apps_publisher_host.h", + "lacros_web_apps_controller.cc", + "lacros_web_apps_controller.h", ] deps += [
diff --git a/chrome/browser/web_applications/app_service/README.md b/chrome/browser/web_applications/app_service/README.md index 1ed041d2f..c4c81586 100644 --- a/chrome/browser/web_applications/app_service/README.md +++ b/chrome/browser/web_applications/app_service/README.md
@@ -8,7 +8,7 @@ In Ash with the Lacros flags enabled, this publisher only manages system web apps. -For Lacros, we have a proxy publisher [WebAppsCrosapi](../../apps/app_service/publishers/web_apps_crosapi.h) in the Ash process, that communicates over [mojom](../../../../chromeos/crosapi/mojom/app_service.mojom) with the Lacros [WebAppsPublisherHost](web_apps_publisher_host.h). (The web app registry for non-system web apps is in the Lacros process, while the App Service controlling the Chrome OS launcher, shelf, etc. is in the Ash process.) +For Lacros, we have a proxy publisher [WebAppsCrosapi](../../apps/app_service/publishers/web_apps_crosapi.h) in the Ash process, that communicates over [mojom](../../../../chromeos/crosapi/mojom/app_service.mojom) with the Lacros [LacrosWebAppsController](lacros_web_apps_controller.h). (The web app registry for non-system web apps is in the Lacros process, while the App Service controlling the Chrome OS launcher, shelf, etc. is in the Ash process.) # WebAppPublisherHelper
diff --git a/chrome/browser/web_applications/app_service/web_apps_publisher_host.cc b/chrome/browser/web_applications/app_service/lacros_web_apps_controller.cc similarity index 81% rename from chrome/browser/web_applications/app_service/web_apps_publisher_host.cc rename to chrome/browser/web_applications/app_service/lacros_web_apps_controller.cc index b8ecc91..e6f9b9b 100644 --- a/chrome/browser/web_applications/app_service/web_apps_publisher_host.cc +++ b/chrome/browser/web_applications/app_service/lacros_web_apps_controller.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/web_applications/app_service/web_apps_publisher_host.h" +#include "chrome/browser/web_applications/app_service/lacros_web_apps_controller.h" #include <utility> @@ -37,7 +37,7 @@ namespace web_app { -WebAppsPublisherHost::WebAppsPublisherHost(Profile* profile) +LacrosWebAppsController::LacrosWebAppsController(Profile* profile) : profile_(profile), provider_(WebAppProvider::GetForWebApps(profile)), publisher_helper_(profile, @@ -48,9 +48,9 @@ DCHECK(provider_); } -WebAppsPublisherHost::~WebAppsPublisherHost() = default; +LacrosWebAppsController::~LacrosWebAppsController() = default; -void WebAppsPublisherHost::Init() { +void LacrosWebAppsController::Init() { if (!remote_publisher_) { auto* service = chromeos::LacrosService::Get(); if (!service) { @@ -78,26 +78,26 @@ } provider_->on_registry_ready().Post( - FROM_HERE, base::BindOnce(&WebAppsPublisherHost::OnReady, + FROM_HERE, base::BindOnce(&LacrosWebAppsController::OnReady, weak_ptr_factory_.GetWeakPtr())); } -void WebAppsPublisherHost::Shutdown() { +void LacrosWebAppsController::Shutdown() { publisher_helper().Shutdown(); } -WebAppRegistrar& WebAppsPublisherHost::registrar() const { +WebAppRegistrar& LacrosWebAppsController::registrar() const { return provider_->registrar(); } -void WebAppsPublisherHost::SetPublisherForTesting( +void LacrosWebAppsController::SetPublisherForTesting( crosapi::mojom::AppPublisher* publisher) { remote_publisher_ = publisher; // Set the publisher version to the newest version for testing. remote_publisher_version_ = crosapi::mojom::AppPublisher::Version_; } -void WebAppsPublisherHost::OnReady() { +void LacrosWebAppsController::OnReady() { if (!remote_publisher_ || publisher_helper().IsShuttingDown()) { return; } @@ -109,7 +109,7 @@ PublishWebApps(std::move(apps)); } -void WebAppsPublisherHost::Uninstall( +void LacrosWebAppsController::Uninstall( const std::string& app_id, apps::mojom::UninstallSource uninstall_source, bool clear_site_data, @@ -123,19 +123,19 @@ report_abuse); } -void WebAppsPublisherHost::PauseApp(const std::string& app_id) { +void LacrosWebAppsController::PauseApp(const std::string& app_id) { publisher_helper().PauseApp(app_id); } -void WebAppsPublisherHost::UnpauseApp(const std::string& app_id) { +void LacrosWebAppsController::UnpauseApp(const std::string& app_id) { publisher_helper().UnpauseApp(app_id); } -void WebAppsPublisherHost::LoadIcon(const std::string& app_id, - apps::IconKeyPtr icon_key, - apps::IconType icon_type, - int32_t size_hint_in_dip, - apps::LoadIconCallback callback) { +void LacrosWebAppsController::LoadIcon(const std::string& app_id, + apps::IconKeyPtr icon_key, + apps::IconType icon_type, + int32_t size_hint_in_dip, + apps::LoadIconCallback callback) { if (!icon_key) { // On failure, we still run the callback, with an empty IconValue. std::move(callback).Run(std::make_unique<apps::IconValue>()); @@ -147,18 +147,18 @@ std::move(callback)); } -void WebAppsPublisherHost::OpenNativeSettings(const std::string& app_id) { +void LacrosWebAppsController::OpenNativeSettings(const std::string& app_id) { publisher_helper().OpenNativeSettings(app_id); } -void WebAppsPublisherHost::SetWindowMode(const std::string& app_id, - apps::WindowMode window_mode) { +void LacrosWebAppsController::SetWindowMode(const std::string& app_id, + apps::WindowMode window_mode) { return publisher_helper().SetWindowMode( app_id, apps::ConvertWindowModeToMojomWindowMode(window_mode)); } -void WebAppsPublisherHost::GetMenuModel(const std::string& app_id, - GetMenuModelCallback callback) { +void LacrosWebAppsController::GetMenuModel(const std::string& app_id, + GetMenuModelCallback callback) { const WebApp* web_app = GetWebApp(app_id); auto menu_items = crosapi::mojom::MenuItems::New(); if (!web_app) { @@ -169,15 +169,16 @@ // Read shortcuts menu item icons from disk, if any. if (!web_app->shortcuts_menu_item_infos().empty()) { provider_->icon_manager().ReadAllShortcutsMenuIcons( - app_id, base::BindOnce(&WebAppsPublisherHost::OnShortcutsMenuIconsRead, - weak_ptr_factory_.GetWeakPtr(), app_id, - std::move(menu_items), std::move(callback))); + app_id, + base::BindOnce(&LacrosWebAppsController::OnShortcutsMenuIconsRead, + weak_ptr_factory_.GetWeakPtr(), app_id, + std::move(menu_items), std::move(callback))); } else { std::move(callback).Run(std::move(menu_items)); } } -void WebAppsPublisherHost::ExecuteContextMenuCommand( +void LacrosWebAppsController::ExecuteContextMenuCommand( const std::string& app_id, const std::string& id, ExecuteContextMenuCommandCallback callback) { @@ -187,20 +188,21 @@ ReturnLaunchResult(std::move(callback), web_contents); } -void WebAppsPublisherHost::StopApp(const std::string& app_id) { +void LacrosWebAppsController::StopApp(const std::string& app_id) { publisher_helper().StopApp(app_id); } -void WebAppsPublisherHost::SetPermission(const std::string& app_id, - apps::PermissionPtr permission) { +void LacrosWebAppsController::SetPermission(const std::string& app_id, + apps::PermissionPtr permission) { publisher_helper().SetPermission( app_id, apps::ConvertPermissionToMojomPermission(permission)); } // TODO(crbug.com/1144877): Clean up the multiple launch interfaces and remove // duplicated code. -void WebAppsPublisherHost::Launch(crosapi::mojom::LaunchParamsPtr launch_params, - LaunchCallback callback) { +void LacrosWebAppsController::Launch( + crosapi::mojom::LaunchParamsPtr launch_params, + LaunchCallback callback) { content::WebContents* web_contents = nullptr; if (launch_params->intent) { if (!profile_) { @@ -223,7 +225,7 @@ // File handling may create the WebContents asynchronously. publisher_helper().LaunchAppWithFilesCheckingUserPermission( launch_params->app_id, std::move(params), - base::BindOnce(&WebAppsPublisherHost::ReturnLaunchResult, + base::BindOnce(&LacrosWebAppsController::ReturnLaunchResult, weak_ptr_factory_.GetWeakPtr(), std::move(callback))); return; } @@ -233,7 +235,7 @@ ReturnLaunchResult(std::move(callback), web_contents); } -void WebAppsPublisherHost::ReturnLaunchResult( +void LacrosWebAppsController::ReturnLaunchResult( LaunchCallback callback, content::WebContents* web_contents) { // TODO(crbug.com/1144877): Run callback when the window is ready. @@ -255,7 +257,7 @@ std::move(callback).Run(std::move(launch_result)); } -void WebAppsPublisherHost::OnShortcutsMenuIconsRead( +void LacrosWebAppsController::OnShortcutsMenuIconsRead( const std::string& app_id, crosapi::mojom::MenuItemsPtr menu_items, GetMenuModelCallback callback, @@ -302,11 +304,11 @@ std::move(callback).Run(std::move(menu_items)); } -const WebApp* WebAppsPublisherHost::GetWebApp(const AppId& app_id) const { +const WebApp* LacrosWebAppsController::GetWebApp(const AppId& app_id) const { return registrar().GetAppById(app_id); } -void WebAppsPublisherHost::PublishWebApps(std::vector<apps::AppPtr> apps) { +void LacrosWebAppsController::PublishWebApps(std::vector<apps::AppPtr> apps) { if (!remote_publisher_) { return; } @@ -321,7 +323,7 @@ remote_publisher_->OnApps(std::move(apps)); } -void WebAppsPublisherHost::PublishWebApp(apps::AppPtr app) { +void LacrosWebAppsController::PublishWebApp(apps::AppPtr app) { if (!remote_publisher_) { return; } @@ -331,7 +333,7 @@ PublishWebApps(std::move(apps)); } -void WebAppsPublisherHost::ModifyWebAppCapabilityAccess( +void LacrosWebAppsController::ModifyWebAppCapabilityAccess( const std::string& app_id, absl::optional<bool> accessing_camera, absl::optional<bool> accessing_microphone) {
diff --git a/chrome/browser/web_applications/app_service/web_apps_publisher_host.h b/chrome/browser/web_applications/app_service/lacros_web_apps_controller.h similarity index 76% rename from chrome/browser/web_applications/app_service/web_apps_publisher_host.h rename to chrome/browser/web_applications/app_service/lacros_web_apps_controller.h index 5d1bf9a..9a4d5ffc 100644 --- a/chrome/browser/web_applications/app_service/web_apps_publisher_host.h +++ b/chrome/browser/web_applications/app_service/lacros_web_apps_controller.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_WEB_APPLICATIONS_APP_SERVICE_WEB_APPS_PUBLISHER_HOST_H_ -#define CHROME_BROWSER_WEB_APPLICATIONS_APP_SERVICE_WEB_APPS_PUBLISHER_HOST_H_ +#ifndef CHROME_BROWSER_WEB_APPLICATIONS_APP_SERVICE_LACROS_WEB_APPS_CONTROLLER_H_ +#define CHROME_BROWSER_WEB_APPLICATIONS_APP_SERVICE_LACROS_WEB_APPS_CONTROLLER_H_ #include <string> #include <vector> @@ -36,17 +36,17 @@ class WebAppProvider; class WebAppRegistrar; -// This WebAppsPublisherHost observes web app updates on Lacros, and calls +// This LacrosWebAppsController observes web app updates on Lacros, and calls // WebAppsCrosapi to inform the Ash browser of the current set of web apps. -class WebAppsPublisherHost : public crosapi::mojom::AppController, - public WebAppPublisherHelper::Delegate { +class LacrosWebAppsController : public crosapi::mojom::AppController, + public WebAppPublisherHelper::Delegate { public: using LoadIconCallback = WebAppPublisherHelper::LoadIconCallback; - explicit WebAppsPublisherHost(Profile* profile); - WebAppsPublisherHost(const WebAppsPublisherHost&) = delete; - WebAppsPublisherHost& operator=(const WebAppsPublisherHost&) = delete; - ~WebAppsPublisherHost() override; + explicit LacrosWebAppsController(Profile* profile); + LacrosWebAppsController(const LacrosWebAppsController&) = delete; + LacrosWebAppsController& operator=(const LacrosWebAppsController&) = delete; + ~LacrosWebAppsController() override; void Init(); @@ -60,13 +60,14 @@ void SetPublisherForTesting(crosapi::mojom::AppPublisher* publisher); private: - FRIEND_TEST_ALL_PREFIXES(WebAppsPublisherHostBrowserTest, + FRIEND_TEST_ALL_PREFIXES(LacrosWebAppsControllerBrowserTest, ExecuteContextMenuCommand); - FRIEND_TEST_ALL_PREFIXES(WebAppsPublisherHostBrowserTest, PauseUnpause); - FRIEND_TEST_ALL_PREFIXES(WebAppsPublisherHostBrowserTest, OpenNativeSettings); - FRIEND_TEST_ALL_PREFIXES(WebAppsPublisherHostBrowserTest, WindowMode); - FRIEND_TEST_ALL_PREFIXES(WebAppsPublisherHostBrowserTest, Launch); - FRIEND_TEST_ALL_PREFIXES(WebAppsPublisherHostBrowserTest, LaunchWithFiles); + FRIEND_TEST_ALL_PREFIXES(LacrosWebAppsControllerBrowserTest, PauseUnpause); + FRIEND_TEST_ALL_PREFIXES(LacrosWebAppsControllerBrowserTest, + OpenNativeSettings); + FRIEND_TEST_ALL_PREFIXES(LacrosWebAppsControllerBrowserTest, WindowMode); + FRIEND_TEST_ALL_PREFIXES(LacrosWebAppsControllerBrowserTest, Launch); + FRIEND_TEST_ALL_PREFIXES(LacrosWebAppsControllerBrowserTest, LaunchWithFiles); void OnReady(); @@ -124,9 +125,9 @@ mojo::Receiver<crosapi::mojom::AppController> receiver_{this}; - base::WeakPtrFactory<WebAppsPublisherHost> weak_ptr_factory_{this}; + base::WeakPtrFactory<LacrosWebAppsController> weak_ptr_factory_{this}; }; } // namespace web_app -#endif // CHROME_BROWSER_WEB_APPLICATIONS_APP_SERVICE_WEB_APPS_PUBLISHER_HOST_H_ +#endif // CHROME_BROWSER_WEB_APPLICATIONS_APP_SERVICE_LACROS_WEB_APPS_CONTROLLER_H_
diff --git a/chrome/browser/web_applications/app_service/web_apps_publisher_host_browsertest.cc b/chrome/browser/web_applications/app_service/lacros_web_apps_controller_browsertest.cc similarity index 85% rename from chrome/browser/web_applications/app_service/web_apps_publisher_host_browsertest.cc rename to chrome/browser/web_applications/app_service/lacros_web_apps_controller_browsertest.cc index 6304a3fd..338cb2e 100644 --- a/chrome/browser/web_applications/app_service/web_apps_publisher_host_browsertest.cc +++ b/chrome/browser/web_applications/app_service/lacros_web_apps_controller_browsertest.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/web_applications/app_service/web_apps_publisher_host.h" +#include "chrome/browser/web_applications/app_service/lacros_web_apps_controller.h" #include <algorithm> #include <iterator> @@ -177,17 +177,17 @@ } // namespace -class WebAppsPublisherHostBrowserTest : public WebAppControllerBrowserTest { +class LacrosWebAppsControllerBrowserTest : public WebAppControllerBrowserTest { public: - WebAppsPublisherHostBrowserTest() = default; - ~WebAppsPublisherHostBrowserTest() override = default; + LacrosWebAppsControllerBrowserTest() = default; + ~LacrosWebAppsControllerBrowserTest() override = default; private: base::test::ScopedFeatureList feature_list_{ blink::features::kFileHandlingAPI}; }; -IN_PROC_BROWSER_TEST_F(WebAppsPublisherHostBrowserTest, PublishApps) { +IN_PROC_BROWSER_TEST_F(LacrosWebAppsControllerBrowserTest, PublishApps) { ASSERT_TRUE(embedded_test_server()->Start()); InstallWebAppFromManifest( browser(), embedded_test_server()->GetURL("/web_apps/basic.html")); @@ -195,9 +195,9 @@ "/web_share_target/charts.html")); MockAppPublisher mock_app_publisher; - WebAppsPublisherHost web_apps_publisher_host(profile()); - web_apps_publisher_host.SetPublisherForTesting(&mock_app_publisher); - web_apps_publisher_host.Init(); + LacrosWebAppsController lacros_web_apps_controller(profile()); + lacros_web_apps_controller.SetPublisherForTesting(&mock_app_publisher); + lacros_web_apps_controller.Init(); mock_app_publisher.Wait(); EXPECT_EQ(mock_app_publisher.get_deltas().size(), 2U); @@ -240,15 +240,15 @@ } } -IN_PROC_BROWSER_TEST_F(WebAppsPublisherHostBrowserTest, LaunchTime) { +IN_PROC_BROWSER_TEST_F(LacrosWebAppsControllerBrowserTest, LaunchTime) { ASSERT_TRUE(embedded_test_server()->Start()); AppId app_id = InstallWebAppFromManifest( browser(), embedded_test_server()->GetURL("/web_apps/basic.html")); MockAppPublisher mock_app_publisher; - WebAppsPublisherHost web_apps_publisher_host(profile()); - web_apps_publisher_host.SetPublisherForTesting(&mock_app_publisher); - web_apps_publisher_host.Init(); + LacrosWebAppsController lacros_web_apps_controller(profile()); + lacros_web_apps_controller.SetPublisherForTesting(&mock_app_publisher); + lacros_web_apps_controller.Init(); mock_app_publisher.Wait(); ASSERT_TRUE( mock_app_publisher.get_deltas().back()->last_launch_time.has_value()); @@ -264,15 +264,15 @@ last_launch_time); } -IN_PROC_BROWSER_TEST_F(WebAppsPublisherHostBrowserTest, ManifestUpdate) { +IN_PROC_BROWSER_TEST_F(LacrosWebAppsControllerBrowserTest, ManifestUpdate) { ASSERT_TRUE(embedded_test_server()->Start()); const GURL app_url = embedded_test_server()->GetURL("app.site.com", "/simple.html"); MockAppPublisher mock_app_publisher; - WebAppsPublisherHost web_apps_publisher_host(profile()); - web_apps_publisher_host.SetPublisherForTesting(&mock_app_publisher); - web_apps_publisher_host.Init(); + LacrosWebAppsController lacros_web_apps_controller(profile()); + lacros_web_apps_controller.SetPublisherForTesting(&mock_app_publisher); + lacros_web_apps_controller.Init(); AppId app_id; { @@ -315,7 +315,8 @@ } } -IN_PROC_BROWSER_TEST_F(WebAppsPublisherHostBrowserTest, LocallyInstalledState) { +IN_PROC_BROWSER_TEST_F(LacrosWebAppsControllerBrowserTest, + LocallyInstalledState) { ASSERT_TRUE(embedded_test_server()->Start()); const GURL app_url = embedded_test_server()->GetURL("app.site.com", "/simple.html"); @@ -336,9 +337,9 @@ } MockAppPublisher mock_app_publisher; - WebAppsPublisherHost web_apps_publisher_host(profile()); - web_apps_publisher_host.SetPublisherForTesting(&mock_app_publisher); - web_apps_publisher_host.Init(); + LacrosWebAppsController lacros_web_apps_controller(profile()); + lacros_web_apps_controller.SetPublisherForTesting(&mock_app_publisher); + lacros_web_apps_controller.Init(); mock_app_publisher.Wait(); EXPECT_EQ(mock_app_publisher.get_deltas().back()->icon_key->icon_effects, static_cast<IconEffects>(IconEffects::kRoundCorners | @@ -353,16 +354,16 @@ IconEffects::kRoundCorners | IconEffects::kCrOsStandardMask); } -IN_PROC_BROWSER_TEST_F(WebAppsPublisherHostBrowserTest, PolicyId) { +IN_PROC_BROWSER_TEST_F(LacrosWebAppsControllerBrowserTest, PolicyId) { ASSERT_TRUE(embedded_test_server()->Start()); const GURL app_url = embedded_test_server()->GetURL("/web_apps/basic.html"); const GURL install_url = embedded_test_server()->GetURL("/web_apps/get_manifest.html?basic.json"); AppId app_id = InstallWebAppFromPage(browser(), install_url); MockAppPublisher mock_app_publisher; - WebAppsPublisherHost web_apps_publisher_host(profile()); - web_apps_publisher_host.SetPublisherForTesting(&mock_app_publisher); - web_apps_publisher_host.Init(); + LacrosWebAppsController lacros_web_apps_controller(profile()); + lacros_web_apps_controller.SetPublisherForTesting(&mock_app_publisher); + lacros_web_apps_controller.Init(); mock_app_publisher.Wait(); EXPECT_EQ(mock_app_publisher.get_deltas().back()->publisher_id, @@ -382,7 +383,7 @@ install_url.spec()); } -IN_PROC_BROWSER_TEST_F(WebAppsPublisherHostBrowserTest, ContentSettings) { +IN_PROC_BROWSER_TEST_F(LacrosWebAppsControllerBrowserTest, ContentSettings) { ASSERT_TRUE(embedded_test_server()->Start()); const GURL app_url = embedded_test_server()->GetURL("/web_apps/basic.html"); AppId app_id = InstallWebAppFromManifest(browser(), app_url); @@ -397,9 +398,9 @@ } MockAppPublisher mock_app_publisher; - WebAppsPublisherHost web_apps_publisher_host(profile()); - web_apps_publisher_host.SetPublisherForTesting(&mock_app_publisher); - web_apps_publisher_host.Init(); + LacrosWebAppsController lacros_web_apps_controller(profile()); + lacros_web_apps_controller.SetPublisherForTesting(&mock_app_publisher); + lacros_web_apps_controller.Init(); mock_app_publisher.Wait(); EXPECT_EQ(mock_app_publisher.get_deltas().size(), 2U); @@ -428,7 +429,7 @@ apps::mojom::TriState::kAllow); } -IN_PROC_BROWSER_TEST_F(WebAppsPublisherHostBrowserTest, MediaRequest) { +IN_PROC_BROWSER_TEST_F(LacrosWebAppsControllerBrowserTest, MediaRequest) { ASSERT_TRUE(embedded_test_server()->Start()); const GURL app_url = embedded_test_server()->GetURL("/web_apps/basic.html"); AppId app_id = InstallWebAppFromManifest(browser(), app_url); @@ -439,10 +440,10 @@ const int render_frame_id = render_frame_host->GetRoutingID(); MockAppPublisher mock_app_publisher; - WebAppsPublisherHost& web_apps_publisher_host = + LacrosWebAppsController& lacros_web_apps_controller = *apps::AppServiceProxyFactory::GetForProfile(profile()) - ->WebAppsPublisherHostForTesting(); - web_apps_publisher_host.SetPublisherForTesting(&mock_app_publisher); + ->LacrosWebAppsControllerForTesting(); + lacros_web_apps_controller.SetPublisherForTesting(&mock_app_publisher); content::GetIOThreadTaskRunner({})->PostTask( FROM_HERE, base::BindLambdaForTesting([render_process_id, render_frame_id, @@ -476,15 +477,15 @@ apps::mojom::OptionalBool::kFalse); } -IN_PROC_BROWSER_TEST_F(WebAppsPublisherHostBrowserTest, Launch) { +IN_PROC_BROWSER_TEST_F(LacrosWebAppsControllerBrowserTest, Launch) { ASSERT_TRUE(embedded_test_server()->Start()); const GURL app_url = embedded_test_server()->GetURL("/web_apps/basic.html"); AppId app_id = InstallWebAppFromManifest(browser(), app_url); MockAppPublisher mock_app_publisher; - WebAppsPublisherHost web_apps_publisher_host(profile()); - web_apps_publisher_host.SetPublisherForTesting(&mock_app_publisher); - web_apps_publisher_host.Init(); + LacrosWebAppsController lacros_web_apps_controller(profile()); + lacros_web_apps_controller.SetPublisherForTesting(&mock_app_publisher); + lacros_web_apps_controller.Init(); mock_app_publisher.Wait(); content::TestNavigationObserver navigation_observer(app_url); @@ -492,20 +493,21 @@ auto launch_params = crosapi::mojom::LaunchParams::New(); launch_params->app_id = app_id; launch_params->launch_source = apps::mojom::LaunchSource::kFromTest; - web_apps_publisher_host.Launch(std::move(launch_params), base::DoNothing()); + lacros_web_apps_controller.Launch(std::move(launch_params), + base::DoNothing()); navigation_observer.Wait(); } -IN_PROC_BROWSER_TEST_F(WebAppsPublisherHostBrowserTest, LaunchWithFiles) { +IN_PROC_BROWSER_TEST_F(LacrosWebAppsControllerBrowserTest, LaunchWithFiles) { ASSERT_TRUE(embedded_test_server()->Start()); const GURL app_url = embedded_test_server()->GetURL("/web_apps/file_handler_index.html"); AppId app_id = InstallWebAppFromManifest(browser(), app_url); MockAppPublisher mock_app_publisher; - WebAppsPublisherHost web_apps_publisher_host(profile()); - web_apps_publisher_host.SetPublisherForTesting(&mock_app_publisher); - web_apps_publisher_host.Init(); + LacrosWebAppsController lacros_web_apps_controller(profile()); + lacros_web_apps_controller.SetPublisherForTesting(&mock_app_publisher); + lacros_web_apps_controller.Init(); mock_app_publisher.Wait(); const GURL launch_url = @@ -530,24 +532,25 @@ ->UpdateApp(app_id) ->SetFileHandlerApprovalState(web_app::ApiApprovalState::kAllowed); - web_apps_publisher_host.Launch(std::move(launch_params), base::DoNothing()); + lacros_web_apps_controller.Launch(std::move(launch_params), + base::DoNothing()); navigation_observer.Wait(); } -IN_PROC_BROWSER_TEST_F(WebAppsPublisherHostBrowserTest, PauseUnpause) { +IN_PROC_BROWSER_TEST_F(LacrosWebAppsControllerBrowserTest, PauseUnpause) { ASSERT_TRUE(embedded_test_server()->Start()); const GURL app_url = embedded_test_server()->GetURL("/web_apps/basic.html"); const AppId app_id = InstallWebAppFromManifest(browser(), app_url); LaunchWebAppBrowserAndWait(app_id); MockAppPublisher mock_app_publisher; - WebAppsPublisherHost web_apps_publisher_host(profile()); - web_apps_publisher_host.SetPublisherForTesting(&mock_app_publisher); - web_apps_publisher_host.Init(); + LacrosWebAppsController lacros_web_apps_controller(profile()); + lacros_web_apps_controller.SetPublisherForTesting(&mock_app_publisher); + lacros_web_apps_controller.Init(); mock_app_publisher.Wait(); EXPECT_EQ(mock_app_publisher.get_deltas().size(), 1U); - web_apps_publisher_host.PauseApp(app_id); + lacros_web_apps_controller.PauseApp(app_id); mock_app_publisher.Wait(); EXPECT_EQ(mock_app_publisher.get_deltas().size(), 3U); @@ -564,7 +567,7 @@ EXPECT_EQ(mock_app_publisher.get_deltas().back()->paused, apps::mojom::OptionalBool::kTrue); - web_apps_publisher_host.UnpauseApp(app_id); + lacros_web_apps_controller.UnpauseApp(app_id); mock_app_publisher.Wait(); EXPECT_EQ(mock_app_publisher.get_deltas().size(), 5U); @@ -581,7 +584,7 @@ apps::mojom::OptionalBool::kFalse); } -IN_PROC_BROWSER_TEST_F(WebAppsPublisherHostBrowserTest, GetMenuModel) { +IN_PROC_BROWSER_TEST_F(LacrosWebAppsControllerBrowserTest, GetMenuModel) { auto CheckMenuItem = [](const crosapi::mojom::MenuItem& menu_item, const std::string& label, absl::optional<SkColor> color) { @@ -598,14 +601,14 @@ https_server()->GetURL("/web_app_shortcuts/shortcuts.html"); const web_app::AppId app_id = web_app::InstallWebAppFromPage(browser(), app_url); - crosapi::mojom::AppController& web_apps_publisher_host = + crosapi::mojom::AppController& lacros_web_apps_controller = *apps::AppServiceProxyFactory::GetForProfile(profile()) - ->WebAppsPublisherHostForTesting(); + ->LacrosWebAppsControllerForTesting(); crosapi::mojom::MenuItemsPtr menu_items; { base::RunLoop run_loop; - web_apps_publisher_host.GetMenuModel( + lacros_web_apps_controller.GetMenuModel( app_id, base::BindLambdaForTesting( [&run_loop, &menu_items](crosapi::mojom::MenuItemsPtr items) { @@ -625,20 +628,20 @@ CheckMenuItem(*menu_items->items[5], "Six", absl::nullopt); } -IN_PROC_BROWSER_TEST_F(WebAppsPublisherHostBrowserTest, +IN_PROC_BROWSER_TEST_F(LacrosWebAppsControllerBrowserTest, ExecuteContextMenuCommand) { const GURL app_url = https_server()->GetURL("/web_app_shortcuts/shortcuts.html"); const web_app::AppId app_id = web_app::InstallWebAppFromPage(browser(), app_url); - WebAppsPublisherHost& web_apps_publisher_host = + LacrosWebAppsController& lacros_web_apps_controller = *apps::AppServiceProxyFactory::GetForProfile(profile()) - ->WebAppsPublisherHostForTesting(); + ->LacrosWebAppsControllerForTesting(); crosapi::mojom::MenuItemsPtr menu_items; { base::RunLoop run_loop; - web_apps_publisher_host.GetMenuModel( + lacros_web_apps_controller.GetMenuModel( app_id, base::BindLambdaForTesting( [&run_loop, &menu_items](crosapi::mojom::MenuItemsPtr items) { @@ -652,8 +655,8 @@ auto id = *menu_items->items[5]->id; - web_apps_publisher_host.ExecuteContextMenuCommand(app_id, id, - base::DoNothing()); + lacros_web_apps_controller.ExecuteContextMenuCommand(app_id, id, + base::DoNothing()); EXPECT_EQ(BrowserList::GetInstance() ->GetLastActive() @@ -663,18 +666,18 @@ https_server()->GetURL("/web_app_shortcuts/shortcuts.html#six")); } -IN_PROC_BROWSER_TEST_F(WebAppsPublisherHostBrowserTest, OpenNativeSettings) { +IN_PROC_BROWSER_TEST_F(LacrosWebAppsControllerBrowserTest, OpenNativeSettings) { ASSERT_TRUE(embedded_test_server()->Start()); const GURL app_url = embedded_test_server()->GetURL("/web_apps/basic.html"); AppId app_id = InstallWebAppFromManifest(browser(), app_url); MockAppPublisher mock_app_publisher; - WebAppsPublisherHost web_apps_publisher_host(profile()); - web_apps_publisher_host.SetPublisherForTesting(&mock_app_publisher); - web_apps_publisher_host.Init(); + LacrosWebAppsController lacros_web_apps_controller(profile()); + lacros_web_apps_controller.SetPublisherForTesting(&mock_app_publisher); + lacros_web_apps_controller.Init(); mock_app_publisher.Wait(); - web_apps_publisher_host.OpenNativeSettings(app_id); + lacros_web_apps_controller.OpenNativeSettings(app_id); content::WebContents* const web_contents = browser()->tab_strip_model()->GetActiveWebContents(); EXPECT_TRUE(base::StartsWith(web_contents->GetVisibleURL().spec(), @@ -682,22 +685,22 @@ base::CompareCase::SENSITIVE)); } -IN_PROC_BROWSER_TEST_F(WebAppsPublisherHostBrowserTest, WindowMode) { +IN_PROC_BROWSER_TEST_F(LacrosWebAppsControllerBrowserTest, WindowMode) { ASSERT_TRUE(embedded_test_server()->Start()); const GURL app_url = embedded_test_server()->GetURL("/web_apps/basic.html"); AppId app_id = InstallWebAppFromManifest(browser(), app_url); MockAppPublisher mock_app_publisher; - WebAppsPublisherHost web_apps_publisher_host(profile()); - web_apps_publisher_host.SetPublisherForTesting(&mock_app_publisher); - web_apps_publisher_host.Init(); + LacrosWebAppsController lacros_web_apps_controller(profile()); + lacros_web_apps_controller.SetPublisherForTesting(&mock_app_publisher); + lacros_web_apps_controller.Init(); mock_app_publisher.Wait(); EXPECT_EQ(mock_app_publisher.get_deltas().size(), 1U); EXPECT_EQ(mock_app_publisher.get_deltas().back()->window_mode, apps::mojom::WindowMode::kWindow); - web_apps_publisher_host.SetWindowMode(app_id, apps::WindowMode::kBrowser); + lacros_web_apps_controller.SetWindowMode(app_id, apps::WindowMode::kBrowser); mock_app_publisher.Wait(); EXPECT_GE(mock_app_publisher.get_deltas().size(), 2U); @@ -705,15 +708,15 @@ apps::mojom::WindowMode::kBrowser); } -IN_PROC_BROWSER_TEST_F(WebAppsPublisherHostBrowserTest, Notification) { +IN_PROC_BROWSER_TEST_F(LacrosWebAppsControllerBrowserTest, Notification) { ASSERT_TRUE(embedded_test_server()->Start()); const GURL app_url = embedded_test_server()->GetURL("/web_apps/basic.html"); AppId app_id = InstallWebAppFromManifest(browser(), app_url); MockAppPublisher mock_app_publisher; - WebAppsPublisherHost web_apps_publisher_host(profile()); - web_apps_publisher_host.SetPublisherForTesting(&mock_app_publisher); - web_apps_publisher_host.Init(); + LacrosWebAppsController lacros_web_apps_controller(profile()); + lacros_web_apps_controller.SetPublisherForTesting(&mock_app_publisher); + lacros_web_apps_controller.Init(); mock_app_publisher.Wait(); EXPECT_EQ(mock_app_publisher.get_deltas().size(), 1U); EXPECT_EQ(mock_app_publisher.get_deltas().back()->has_badge, @@ -739,7 +742,7 @@ apps::mojom::OptionalBool::kTrue); } -IN_PROC_BROWSER_TEST_F(WebAppsPublisherHostBrowserTest, DisabledState) { +IN_PROC_BROWSER_TEST_F(LacrosWebAppsControllerBrowserTest, DisabledState) { ASSERT_TRUE(embedded_test_server()->Start()); WebAppSyncBridge& web_app_sync_bridge = provider().sync_bridge(); const AppId app_id = InstallWebAppFromManifest( @@ -761,9 +764,9 @@ } MockAppPublisher mock_app_publisher; - WebAppsPublisherHost web_apps_publisher_host(profile()); - web_apps_publisher_host.SetPublisherForTesting(&mock_app_publisher); - web_apps_publisher_host.Init(); + LacrosWebAppsController lacros_web_apps_controller(profile()); + lacros_web_apps_controller.SetPublisherForTesting(&mock_app_publisher); + lacros_web_apps_controller.Init(); mock_app_publisher.Wait(); EXPECT_EQ(mock_app_publisher.get_deltas().size(), 2U); if (mock_app_publisher.get_deltas()[0]->app_id == app_id) { @@ -823,7 +826,7 @@ IconEffects::kRoundCorners | IconEffects::kCrOsStandardIcon); } -IN_PROC_BROWSER_TEST_F(WebAppsPublisherHostBrowserTest, GetLink) { +IN_PROC_BROWSER_TEST_F(LacrosWebAppsControllerBrowserTest, GetLink) { ASSERT_TRUE(embedded_test_server()->Start()); const AppId app_id = InstallWebAppFromManifest( browser(), @@ -832,9 +835,9 @@ embedded_test_server()->GetURL("/web_share_target/share.html"); MockAppPublisher mock_app_publisher; - WebAppsPublisherHost web_apps_publisher_host(profile()); - web_apps_publisher_host.SetPublisherForTesting(&mock_app_publisher); - web_apps_publisher_host.Init(); + LacrosWebAppsController lacros_web_apps_controller(profile()); + lacros_web_apps_controller.SetPublisherForTesting(&mock_app_publisher); + lacros_web_apps_controller.Init(); mock_app_publisher.Wait(); EXPECT_EQ(mock_app_publisher.get_deltas().size(), 1U); EXPECT_FALSE(mock_app_publisher.get_deltas().back()->intent_filters.empty()); @@ -854,7 +857,7 @@ apps_util::CreateShareIntentFromText(shared_link, shared_title), profile()); - static_cast<crosapi::mojom::AppController&>(web_apps_publisher_host) + static_cast<crosapi::mojom::AppController&>(lacros_web_apps_controller) .Launch(std::move(launch_params), base::DoNothing()); } content::WebContents* const web_contents = waiter.Wait(); @@ -869,7 +872,7 @@ EXPECT_EQ(shared_link, ReadTextContent(web_contents, "link")); } -IN_PROC_BROWSER_TEST_F(WebAppsPublisherHostBrowserTest, ShareImage) { +IN_PROC_BROWSER_TEST_F(LacrosWebAppsControllerBrowserTest, ShareImage) { ASSERT_TRUE(embedded_test_server()->Start()); const AppId app_id = InstallWebAppFromManifest( browser(), @@ -877,9 +880,9 @@ const std::string kData(12, '*'); MockAppPublisher mock_app_publisher; - WebAppsPublisherHost web_apps_publisher_host(profile()); - web_apps_publisher_host.SetPublisherForTesting(&mock_app_publisher); - web_apps_publisher_host.Init(); + LacrosWebAppsController lacros_web_apps_controller(profile()); + lacros_web_apps_controller.SetPublisherForTesting(&mock_app_publisher); + lacros_web_apps_controller.Init(); mock_app_publisher.Wait(); EXPECT_EQ(mock_app_publisher.get_deltas().size(), 1U); EXPECT_FALSE(mock_app_publisher.get_deltas().back()->intent_filters.empty()); @@ -908,7 +911,7 @@ display::kInvalidDisplayId); launch_params->intent = std::move(crosapi_intent); - static_cast<crosapi::mojom::AppController&>(web_apps_publisher_host) + static_cast<crosapi::mojom::AppController&>(lacros_web_apps_controller) .Launch(std::move(launch_params), base::DoNothing()); } content::WebContents* const web_contents = waiter.Wait(); @@ -919,7 +922,7 @@ EXPECT_EQ("sample.webp", ReadTextContent(web_contents, "image_filename")); } -IN_PROC_BROWSER_TEST_F(WebAppsPublisherHostBrowserTest, ShareMultimedia) { +IN_PROC_BROWSER_TEST_F(LacrosWebAppsControllerBrowserTest, ShareMultimedia) { ASSERT_TRUE(embedded_test_server()->Start()); const AppId app_id = InstallWebAppFromManifest( browser(), @@ -928,9 +931,9 @@ const std::string kVideoContent(67890, '*'); MockAppPublisher mock_app_publisher; - WebAppsPublisherHost web_apps_publisher_host(profile()); - web_apps_publisher_host.SetPublisherForTesting(&mock_app_publisher); - web_apps_publisher_host.Init(); + LacrosWebAppsController lacros_web_apps_controller(profile()); + lacros_web_apps_controller.SetPublisherForTesting(&mock_app_publisher); + lacros_web_apps_controller.Init(); mock_app_publisher.Wait(); EXPECT_EQ(mock_app_publisher.get_deltas().size(), 1U); EXPECT_FALSE(mock_app_publisher.get_deltas().back()->intent_filters.empty()); @@ -971,7 +974,7 @@ display::kInvalidDisplayId); launch_params->intent = std::move(crosapi_intent); - static_cast<crosapi::mojom::AppController&>(web_apps_publisher_host) + static_cast<crosapi::mojom::AppController&>(lacros_web_apps_controller) .Launch(std::move(launch_params), base::DoNothing()); } content::WebContents* const web_contents = waiter.Wait(); @@ -984,7 +987,7 @@ } // Regression test for crbug.com/1266642 -IN_PROC_BROWSER_TEST_F(WebAppsPublisherHostBrowserTest, +IN_PROC_BROWSER_TEST_F(LacrosWebAppsControllerBrowserTest, PublishOnlyEnabledFileHandlers) { ASSERT_TRUE(embedded_test_server()->Start()); auto app_id = InstallWebAppFromManifest( @@ -999,9 +1002,9 @@ .EnableAndRegisterOsFileHandlers(app_id); MockAppPublisher mock_app_publisher; - WebAppsPublisherHost web_apps_publisher_host(profile()); - web_apps_publisher_host.SetPublisherForTesting(&mock_app_publisher); - web_apps_publisher_host.Init(); + LacrosWebAppsController lacros_web_apps_controller(profile()); + lacros_web_apps_controller.SetPublisherForTesting(&mock_app_publisher); + lacros_web_apps_controller.Init(); mock_app_publisher.Wait(); EXPECT_EQ(mock_app_publisher.get_deltas().size(), 1U);
diff --git a/chrome/browser/web_applications/test/fake_web_app_registry_controller.cc b/chrome/browser/web_applications/test/fake_web_app_registry_controller.cc index d40866c..1a319bc 100644 --- a/chrome/browser/web_applications/test/fake_web_app_registry_controller.cc +++ b/chrome/browser/web_applications/test/fake_web_app_registry_controller.cc
@@ -45,8 +45,7 @@ /*icon_manager=*/nullptr); translation_manager_ = std::make_unique<WebAppTranslationManager>( profile, base::MakeRefCounted<TestFileUtils>()); - translation_manager_->SetSubsystems(/*install_manager=*/nullptr, - mutable_registrar_.get()); + translation_manager_->SetSubsystems(mutable_registrar_.get()); fake_externally_managed_app_manager_ = std::make_unique<FakeExternallyManagedAppManager>(profile);
diff --git a/chrome/browser/web_applications/web_app_install_finalizer.cc b/chrome/browser/web_applications/web_app_install_finalizer.cc index dfb0b17c..5d1bdac 100644 --- a/chrome/browser/web_applications/web_app_install_finalizer.cc +++ b/chrome/browser/web_applications/web_app_install_finalizer.cc
@@ -352,7 +352,7 @@ } auto uninstall_task = std::make_unique<WebAppUninstallJob>( os_integration_manager_, sync_bridge_, icon_manager_, registrar_, - install_manager_, this, profile_->GetPrefs()); + install_manager_, this, translation_manager_, profile_->GetPrefs()); uninstall_task->Start( app_id, url::Origin::Create(registrar_->GetAppById(app_id)->start_url()), @@ -373,7 +373,7 @@ continue; auto uninstall_task = std::make_unique<WebAppUninstallJob>( os_integration_manager_, sync_bridge_, icon_manager_, registrar_, - install_manager_, this, profile_->GetPrefs()); + install_manager_, this, translation_manager_, profile_->GetPrefs()); uninstall_task->Start( app_id, url::Origin::Create(registrar_->GetAppById(app_id)->start_url()), @@ -488,7 +488,7 @@ } auto uninstall_task = std::make_unique<WebAppUninstallJob>( os_integration_manager_, sync_bridge_, icon_manager_, registrar_, - install_manager_, this, profile_->GetPrefs()); + install_manager_, this, translation_manager_, profile_->GetPrefs()); uninstall_task->Start( app_id, url::Origin::Create(registrar_->GetAppById(app_id)->start_url()), uninstall_source, WebAppUninstallJob::ModifyAppRegistry::kYes,
diff --git a/chrome/browser/web_applications/web_app_launch_queue.cc b/chrome/browser/web_applications/web_app_launch_queue.cc index 0e8202b..ff40655 100644 --- a/chrome/browser/web_applications/web_app_launch_queue.cc +++ b/chrome/browser/web_applications/web_app_launch_queue.cc
@@ -135,10 +135,7 @@ } void WebAppLaunchQueue::DidFinishNavigation(content::NavigationHandle* handle) { - // Currently, launch data is only sent for the main frame. - // TODO(https://crbug.com/1218946): With MPArch there may be multiple main - // frames. This caller was converted automatically to the primary main frame - // to preserve its semantics. Follow up to confirm correctness. + // Currently, launch data is only sent the primary main frame. if (!handle->IsInPrimaryMainFrame()) return;
diff --git a/chrome/browser/web_applications/web_app_provider.cc b/chrome/browser/web_applications/web_app_provider.cc index ec93e6b..ff5b335 100644 --- a/chrome/browser/web_applications/web_app_provider.cc +++ b/chrome/browser/web_applications/web_app_provider.cc
@@ -304,7 +304,7 @@ sync_bridge_->SetSubsystems(database_factory_.get(), install_manager_.get()); icon_manager_->SetSubsystems(registrar_.get(), install_manager_.get()); - translation_manager_->SetSubsystems(install_manager_.get(), registrar_.get()); + translation_manager_->SetSubsystems(registrar_.get()); install_finalizer_->SetSubsystems( install_manager_.get(), registrar_.get(), ui_manager_.get(), sync_bridge_.get(), os_integration_manager_.get(), icon_manager_.get(),
diff --git a/chrome/browser/web_applications/web_app_translation_manager.cc b/chrome/browser/web_applications/web_app_translation_manager.cc index 8b11e19..8b7b531b 100644 --- a/chrome/browser/web_applications/web_app_translation_manager.cc +++ b/chrome/browser/web_applications/web_app_translation_manager.cc
@@ -88,6 +88,9 @@ bool DeleteTranslationsBlocking(scoped_refptr<FileUtilsWrapper> utils, const base::FilePath& web_apps_directory, const AppId& app_id) { + if (!utils->CreateDirectory(web_apps_directory)) { + return false; + } AllTranslations proto = ReadProtoBlocking(utils, web_apps_directory); proto.mutable_id_to_translations_map()->erase(app_id); @@ -134,9 +137,7 @@ WebAppTranslationManager::~WebAppTranslationManager() = default; void WebAppTranslationManager::SetSubsystems( - base::raw_ptr<WebAppInstallManager> install_manager, base::raw_ptr<WebAppRegistrar> registrar) { - install_manager_ = install_manager; registrar_ = registrar; } @@ -144,18 +145,9 @@ if (base::FeatureList::IsEnabled( blink::features::kWebAppEnableTranslations)) { ReadTranslations(base::DoNothing()); - install_manager_observation_.Observe(install_manager_.get()); } } -void WebAppTranslationManager::OnWebAppUninstalled(const AppId& app_id) { - DeleteTranslations(app_id, base::DoNothing()); -} - -void WebAppTranslationManager::OnWebAppInstallManagerDestroyed() { - install_manager_observation_.Reset(); -} - void WebAppTranslationManager::WriteTranslations( const AppId& app_id, const base::flat_map<Locale, blink::Manifest::TranslationItem>& @@ -184,6 +176,12 @@ void WebAppTranslationManager::DeleteTranslations(const AppId& app_id, WriteCallback callback) { + if (!base::FeatureList::IsEnabled( + blink::features::kWebAppEnableTranslations)) { + std::move(callback).Run(true); + return; + } + translation_cache_.erase(app_id); base::ThreadPool::PostTaskAndReplyWithResult( FROM_HERE, kTaskTraits,
diff --git a/chrome/browser/web_applications/web_app_translation_manager.h b/chrome/browser/web_applications/web_app_translation_manager.h index 67f6367..c842ee0 100644 --- a/chrome/browser/web_applications/web_app_translation_manager.h +++ b/chrome/browser/web_applications/web_app_translation_manager.h
@@ -14,15 +14,13 @@ #include "chrome/browser/web_applications/file_utils_wrapper.h" #include "chrome/browser/web_applications/proto/web_app_translations.pb.h" #include "chrome/browser/web_applications/web_app_id.h" -#include "chrome/browser/web_applications/web_app_install_manager.h" -#include "chrome/browser/web_applications/web_app_install_manager_observer.h" #include "chrome/browser/web_applications/web_app_registrar.h" namespace web_app { using Locale = std::u16string; -class WebAppTranslationManager : public WebAppInstallManagerObserver { +class WebAppTranslationManager { public: using ReadCallback = base::OnceCallback<void( const std::map<AppId, blink::Manifest::TranslationItem>& cache)>; @@ -32,10 +30,9 @@ scoped_refptr<FileUtilsWrapper> utils); WebAppTranslationManager(const WebAppTranslationManager&) = delete; WebAppTranslationManager& operator=(const WebAppTranslationManager&) = delete; - ~WebAppTranslationManager() override; + ~WebAppTranslationManager(); - void SetSubsystems(base::raw_ptr<WebAppInstallManager> install_manager, - base::raw_ptr<WebAppRegistrar> registrar); + void SetSubsystems(base::raw_ptr<WebAppRegistrar> registrar); void Start(); @@ -51,23 +48,15 @@ std::string GetDescription(const AppId& app_id); // TODO(crbug.com/1212519): Add a method to get the short_name. - // WebAppInstallManager: - void OnWebAppUninstalled(const AppId& app_id) override; - void OnWebAppInstallManagerDestroyed() override; - private: void OnTranslationsRead(ReadCallback callback, const AllTranslations& proto); - base::raw_ptr<WebAppInstallManager> install_manager_; base::raw_ptr<WebAppRegistrar> registrar_; base::FilePath web_apps_directory_; scoped_refptr<FileUtilsWrapper> utils_; // Cache of the translations on disk for the current device language. std::map<AppId, blink::Manifest::TranslationItem> translation_cache_; - base::ScopedObservation<WebAppInstallManager, WebAppInstallManagerObserver> - install_manager_observation_{this}; - base::WeakPtrFactory<WebAppTranslationManager> weak_ptr_factory_{this}; };
diff --git a/chrome/browser/web_applications/web_app_translation_manager_unittest.cc b/chrome/browser/web_applications/web_app_translation_manager_unittest.cc index 3c947c08..a8a913a 100644 --- a/chrome/browser/web_applications/web_app_translation_manager_unittest.cc +++ b/chrome/browser/web_applications/web_app_translation_manager_unittest.cc
@@ -25,8 +25,6 @@ std::make_unique<FakeWebAppRegistryController>(); fake_registry_controller_->SetUp(profile()); - install_manager_ = std::make_unique<WebAppInstallManager>(profile()); - file_utils_ = base::MakeRefCounted<TestFileUtils>(); controller().Init(); @@ -34,7 +32,7 @@ translation_manager_ = std::make_unique<WebAppTranslationManager>(profile(), file_utils_); - translation_manager_->SetSubsystems(&install_manager(), registrar()); + translation_manager_->SetSubsystems(registrar()); } protected:
diff --git a/chrome/browser/web_applications/web_app_uninstall_job.cc b/chrome/browser/web_applications/web_app_uninstall_job.cc index a1b215cf..4f54e46 100644 --- a/chrome/browser/web_applications/web_app_uninstall_job.cc +++ b/chrome/browser/web_applications/web_app_uninstall_job.cc
@@ -15,6 +15,7 @@ #include "chrome/browser/web_applications/web_app_registrar.h" #include "chrome/browser/web_applications/web_app_registry_update.h" #include "chrome/browser/web_applications/web_app_sync_bridge.h" +#include "chrome/browser/web_applications/web_app_translation_manager.h" #include "components/webapps/browser/installable/installable_metrics.h" #include "components/webapps/browser/uninstall_result_code.h" @@ -27,6 +28,7 @@ WebAppRegistrar* registrar, WebAppInstallManager* install_manager, WebAppInstallFinalizer* install_finalizer, + WebAppTranslationManager* translation_manager, PrefService* profile_prefs) : os_integration_manager_(os_integration_manager), sync_bridge_(sync_bridge), @@ -34,6 +36,7 @@ registrar_(registrar), install_manager_(install_manager), install_finalizer_(install_finalizer), + translation_manager_(translation_manager), profile_prefs_(profile_prefs) {} WebAppUninstallJob::~WebAppUninstallJob() = default; @@ -84,6 +87,10 @@ icon_manager_->DeleteData( app_id, base::BindOnce(&WebAppUninstallJob::OnIconDataDeleted, weak_ptr_factory_.GetWeakPtr())); + + translation_manager_->DeleteTranslations( + app_id, base::BindOnce(&WebAppUninstallJob::OnTranslationDataDeleted, + weak_ptr_factory_.GetWeakPtr())); } void WebAppUninstallJob::StopAppRegistryModification() { @@ -119,10 +126,17 @@ MaybeFinishUninstall(); } +void WebAppUninstallJob::OnTranslationDataDeleted(bool success) { + DCHECK(state_ == State::kPendingDataDeletion); + translation_data_deleted_ = true; + errors_ = errors_ || !success; + MaybeFinishUninstall(); +} + void WebAppUninstallJob::MaybeFinishUninstall() { DCHECK(state_ == State::kPendingDataDeletion); if (!hooks_uninstalled_ || !app_data_deleted_ || - num_pending_sub_app_uninstalls_ > 0) { + num_pending_sub_app_uninstalls_ > 0 || !translation_data_deleted_) { return; } DCHECK_EQ(num_pending_sub_app_uninstalls_, 0u);
diff --git a/chrome/browser/web_applications/web_app_uninstall_job.h b/chrome/browser/web_applications/web_app_uninstall_job.h index 4d31f83..5dd5468 100644 --- a/chrome/browser/web_applications/web_app_uninstall_job.h +++ b/chrome/browser/web_applications/web_app_uninstall_job.h
@@ -27,6 +27,7 @@ class WebAppInstallFinalizer; class WebAppRegistrar; class WebAppSyncBridge; +class WebAppTranslationManager; // Uninstalls a given web app by: // 1) Unregistering OS hooks. @@ -47,6 +48,7 @@ WebAppRegistrar* registrar, WebAppInstallManager* install_manager, WebAppInstallFinalizer* install_finalizer, + WebAppTranslationManager* translation_manager, PrefService* profile_prefs); ~WebAppUninstallJob(); @@ -75,6 +77,7 @@ void OnSubAppUninstalled(webapps::UninstallResultCode code); void OnOsHooksUninstalled(OsHooksErrors errors); void OnIconDataDeleted(bool success); + void OnTranslationDataDeleted(bool success); void MaybeFinishUninstall(); enum class State { @@ -89,6 +92,7 @@ raw_ptr<WebAppRegistrar> registrar_; raw_ptr<WebAppInstallManager> install_manager_; raw_ptr<WebAppInstallFinalizer> install_finalizer_; + raw_ptr<WebAppTranslationManager> translation_manager_; raw_ptr<PrefService> profile_prefs_; AppId app_id_; @@ -98,6 +102,7 @@ size_t num_pending_sub_app_uninstalls_; bool app_data_deleted_ = false; + bool translation_data_deleted_ = false; bool hooks_uninstalled_ = false; bool errors_ = false;
diff --git a/chrome/browser/web_applications/web_app_uninstall_job_unittest.cc b/chrome/browser/web_applications/web_app_uninstall_job_unittest.cc index 2d4ecab..f1b13d09 100644 --- a/chrome/browser/web_applications/web_app_uninstall_job_unittest.cc +++ b/chrome/browser/web_applications/web_app_uninstall_job_unittest.cc
@@ -89,6 +89,7 @@ WebAppUninstallJob task(&os_integration_manager_, &controller().sync_bridge(), icon_manager_.get(), &controller().registrar(), &install_manager(), &install_finalizer(), + &controller().translation_manager(), profile()->GetPrefs()); OsHooksErrors result; @@ -125,6 +126,7 @@ WebAppUninstallJob task(&os_integration_manager_, &controller().sync_bridge(), icon_manager_.get(), &controller().registrar(), &install_manager(), &install_finalizer(), + &controller().translation_manager(), profile()->GetPrefs()); OsHooksErrors result; @@ -161,6 +163,7 @@ WebAppUninstallJob task(&os_integration_manager_, &controller().sync_bridge(), icon_manager_.get(), &controller().registrar(), &install_manager(), &install_finalizer(), + &controller().translation_manager(), profile()->GetPrefs()); OsHooksErrors result;
diff --git a/chrome/build/linux.pgo.txt b/chrome/build/linux.pgo.txt index 4ccbb99..2eef7e4 100644 --- a/chrome/build/linux.pgo.txt +++ b/chrome/build/linux.pgo.txt
@@ -1 +1 @@ -chrome-linux-main-1646848743-f4bf9e0d566ba1b4309d748ee5f06b4c6576b1de.profdata +chrome-linux-main-1646911591-3860091e2cceda965fa7aa29c6619ac0b60f8ced.profdata
diff --git a/chrome/build/mac-arm.pgo.txt b/chrome/build/mac-arm.pgo.txt index 495d7dc..f892fcb 100644 --- a/chrome/build/mac-arm.pgo.txt +++ b/chrome/build/mac-arm.pgo.txt
@@ -1 +1 @@ -chrome-mac-arm-main-1646848743-259c444a76fa0f689cf0263d15b88189d22c7c5b.profdata +chrome-mac-arm-main-1646870321-a4ff75768993ceb035538c154fe6cb1ed18e31c5.profdata
diff --git a/chrome/build/mac.pgo.txt b/chrome/build/mac.pgo.txt index 9566cb5..085f08b 100644 --- a/chrome/build/mac.pgo.txt +++ b/chrome/build/mac.pgo.txt
@@ -1 +1 @@ -chrome-mac-main-1646848743-e2c7d6dc58a9807d53cf3a38e60f409d16bfb970.profdata +chrome-mac-main-1646891929-6e8950a9aea4ffd7853a4ffdde068b178092fb98.profdata
diff --git a/chrome/build/win32.pgo.txt b/chrome/build/win32.pgo.txt index 81146ff..61947d0 100644 --- a/chrome/build/win32.pgo.txt +++ b/chrome/build/win32.pgo.txt
@@ -1 +1 @@ -chrome-win32-main-1646848743-b8579d2cada885e51e0583777092fd6e89e1dd63.profdata +chrome-win32-main-1646891929-82d9d530e22aac0fbb4a173d962ff90df21e416c.profdata
diff --git a/chrome/build/win64.pgo.txt b/chrome/build/win64.pgo.txt index 76a4ec9a..d6b57c83 100644 --- a/chrome/build/win64.pgo.txt +++ b/chrome/build/win64.pgo.txt
@@ -1 +1 @@ -chrome-win64-main-1646848743-b9b53dfd52e3bf3cec452c85b7ec3285a0e17d67.profdata +chrome-win64-main-1646902708-df6bcb3ca92716bed756ccfd0e41a26162bc0de9.profdata
diff --git a/chrome/chrome_paks.gni b/chrome/chrome_paks.gni index 742c534..4070f5da 100644 --- a/chrome/chrome_paks.gni +++ b/chrome/chrome_paks.gni
@@ -475,7 +475,7 @@ output_dir = "${invoker.output_dir}/locales" if (is_mac) { - output_locales = locales_as_mac_outputs + output_locales = locales_as_apple_outputs } else { output_locales = platform_pak_locales }
diff --git a/chrome/common/extensions/api/webview_tag.json b/chrome/common/extensions/api/webview_tag.json index 183de3b..a012f38 100644 --- a/chrome/common/extensions/api/webview_tag.json +++ b/chrome/common/extensions/api/webview_tag.json
@@ -1029,7 +1029,7 @@ { "name": "setUserAgentOverride", "type": "function", - "description": "Override the user agent string used by the <code>webview</code> for guest page requests.", + "description": "Override the user agent string used by the <code>webview</code> for guest page requests. Overriding will cause the User-Agent Client Hint header values and the values returned by <code>navigator.userAgentData</code> to be empty for guest page requests this override is applied to.", "parameters": [ { "name": "userAgent",
diff --git a/chrome/installer/mac/signing/config.py b/chrome/installer/mac/signing/config.py index 1f33eeac..8d0582f 100644 --- a/chrome/installer/mac/signing/config.py +++ b/chrome/installer/mac/signing/config.py
@@ -34,7 +34,8 @@ installer_identity=None, notary_user=None, notary_password=None, - notary_asc_provider=None): + notary_asc_provider=None, + codesign_requirements_basic=''): """Creates a CodeSignConfig that will sign the product using the static properties on the class, using the code signing identity passed to the constructor. @@ -65,6 +66,7 @@ self._notary_user = notary_user self._notary_password = notary_password self._notary_asc_provider = notary_asc_provider + self._codesign_requirements_basic = codesign_requirements_basic @staticmethod def is_chrome_branded(): @@ -146,7 +148,7 @@ |model.CodeSignedProduct|. This requirement is applied to all CodeSignedProducts. """ - return '' + return self._codesign_requirements_basic @property def codesign_requirements_outer_app(self):
diff --git a/chrome/installer/mac/signing/model.py b/chrome/installer/mac/signing/model.py index 2431ab9d..5a92fcc 100644 --- a/chrome/installer/mac/signing/model.py +++ b/chrome/installer/mac/signing/model.py
@@ -105,7 +105,12 @@ # a hash to the identifier, which would violate the # identifier_requirement and most other requirements that would be # specified. - if config.identity == '-': + # + # Similarly, if no explicit requirements are available, let codesign + # --sign use its defaults, which should be appropriate in any case where + # requirement customization is unnecessary. + if config.identity == '-' or (not self.requirements and + not config.codesign_requirements_basic): return '' reqs = []
diff --git a/chrome/installer/mac/signing/model_test.py b/chrome/installer/mac/signing/model_test.py index 457a68d..c3ea8e1d 100644 --- a/chrome/installer/mac/signing/model_test.py +++ b/chrome/installer/mac/signing/model_test.py
@@ -21,8 +21,7 @@ def test_requirements_string_identifier(self): product = model.CodeSignedProduct('path/binary', 'binary') - self.assertEqual('designated => identifier "binary"', - product.requirements_string(TestConfig())) + self.assertEqual('', product.requirements_string(TestConfig())) def test_requirements_no_identifier(self): product = model.CodeSignedProduct(
diff --git a/chrome/installer/mac/signing/signing_test.py b/chrome/installer/mac/signing/signing_test.py index de38c0f..b020569d 100644 --- a/chrome/installer/mac/signing/signing_test.py +++ b/chrome/installer/mac/signing/signing_test.py
@@ -98,11 +98,21 @@ def test_sign_part(self, run_command, linker_signed_arm64_needs_force): part = model.CodeSignedProduct('Test.app', 'test.signing.app') signing.sign_part(self.paths, self.config, part) + run_command.assert_called_once_with( + ['codesign', '--sign', '[IDENTITY]', '--timestamp', '/$W/Test.app']) + + def test_sign_part_with_requirements(self, run_command, + linker_signed_arm64_needs_force): + part = model.CodeSignedProduct( + 'Test.app', 'test.signing.app', requirements='and true') + signing.sign_part(self.paths, self.config, part) run_command.assert_called_once_with([ 'codesign', '--sign', '[IDENTITY]', '--timestamp', '--requirements', - '=designated => identifier "test.signing.app"', '/$W/Test.app' + '=designated => identifier "test.signing.app" and true', + '/$W/Test.app' ]) + def test_sign_part_needs_force(self, run_command, linker_signed_arm64_needs_force): linker_signed_arm64_needs_force.return_value = True @@ -110,7 +120,19 @@ signing.sign_part(self.paths, self.config, part) run_command.assert_called_once_with([ 'codesign', '--sign', '[IDENTITY]', '--force', '--timestamp', - '--requirements', '=designated => identifier "test.signing.app"', + '/$W/Test.app' + ]) + + def test_sign_part_with_requirements_needs_force( + self, run_command, linker_signed_arm64_needs_force): + linker_signed_arm64_needs_force.return_value = True + part = model.CodeSignedProduct( + 'Test.app', 'test.signing.app', requirements='and true') + signing.sign_part(self.paths, self.config, part) + run_command.assert_called_once_with([ + 'codesign', '--sign', '[IDENTITY]', '--force', '--timestamp', + '--requirements', + '=designated => identifier "test.signing.app" and true', '/$W/Test.app' ]) @@ -119,10 +141,8 @@ config = test_config.TestConfig(notary_user=None, notary_password=None) part = model.CodeSignedProduct('Test.app', 'test.signing.app') signing.sign_part(self.paths, config, part) - run_command.assert_called_once_with([ - 'codesign', '--sign', '[IDENTITY]', '--requirements', - '=designated => identifier "test.signing.app"', '/$W/Test.app' - ]) + run_command.assert_called_once_with( + ['codesign', '--sign', '[IDENTITY]', '/$W/Test.app']) def test_sign_part_no_identifier_requirement( self, run_command, linker_signed_arm64_needs_force): @@ -139,8 +159,22 @@ signing.sign_part(self.paths, self.config, part) run_command.assert_called_once_with([ 'codesign', '--sign', '[IDENTITY]', '--timestamp', '--identifier', + 'test.signing.app', '/$W/Test.app' + ]) + + def test_sign_with_requirement_and_identifier( + self, run_command, linker_signed_arm64_needs_force): + part = model.CodeSignedProduct( + 'Test.app', + 'test.signing.app', + requirements='and true', + sign_with_identifier=True) + signing.sign_part(self.paths, self.config, part) + run_command.assert_called_once_with([ + 'codesign', '--sign', '[IDENTITY]', '--timestamp', '--identifier', 'test.signing.app', '--requirements', - '=designated => identifier "test.signing.app"', '/$W/Test.app' + '=designated => identifier "test.signing.app" and true', + '/$W/Test.app' ]) def test_sign_with_identifier_no_requirement( @@ -165,11 +199,41 @@ | model.CodeSignOptions.LIBRARY_VALIDATION) signing.sign_part(self.paths, self.config, part) run_command.assert_called_once_with([ - 'codesign', '--sign', '[IDENTITY]', '--timestamp', '--requirements', - '=designated => identifier "test.signing.app"', '--options', + 'codesign', '--sign', '[IDENTITY]', '--timestamp', '--options', 'library,restrict', '/$W/Test.app' ]) + def test_sign_part_with_requirement_and_options( + self, run_command, linker_signed_arm64_needs_force): + config = test_config.TestConfig(codesign_requirements_basic='or false') + part = model.CodeSignedProduct( + 'Test.app', + 'test.signing.app', + options=model.CodeSignOptions.RESTRICT + | model.CodeSignOptions.LIBRARY_VALIDATION) + signing.sign_part(self.paths, config, part) + run_command.assert_called_once_with([ + 'codesign', '--sign', '[IDENTITY]', '--timestamp', '--requirements', + '=designated => identifier "test.signing.app" or false', + '--options', 'library,restrict', '/$W/Test.app' + ]) + + def test_sign_part_with_requirements_and_options( + self, run_command, linker_signed_arm64_needs_force): + config = test_config.TestConfig(codesign_requirements_basic='or false') + part = model.CodeSignedProduct( + 'Test.app', + 'test.signing.app', + requirements='and true', + options=model.CodeSignOptions.RESTRICT + | model.CodeSignOptions.LIBRARY_VALIDATION) + signing.sign_part(self.paths, config, part) + run_command.assert_called_once_with([ + 'codesign', '--sign', '[IDENTITY]', '--timestamp', '--requirements', + '=designated => identifier "test.signing.app" and true or false', + '--options', 'library,restrict', '/$W/Test.app' + ]) + def test_sign_part_with_entitlements(self, run_command, linker_signed_arm64_needs_force): part = model.CodeSignedProduct(
diff --git a/chrome/installer/mac/signing/test_config.py b/chrome/installer/mac/signing/test_config.py index 96a9d69..bab1112 100644 --- a/chrome/installer/mac/signing/test_config.py +++ b/chrome/installer/mac/signing/test_config.py
@@ -12,10 +12,12 @@ installer_identity='[INSTALLER-IDENTITY]', notary_user='[NOTARY-USER]', notary_password='[NOTARY-PASSWORD]', - notary_asc_provider=None): + notary_asc_provider=None, + codesign_requirements_basic=''): super(TestConfig, self).__init__(identity, installer_identity, notary_user, - notary_password, notary_asc_provider) + notary_password, notary_asc_provider, + codesign_requirements_basic) @staticmethod def is_chrome_branded():
diff --git a/chrome/renderer/BUILD.gn b/chrome/renderer/BUILD.gn index 0e6d552..88aafb3 100644 --- a/chrome/renderer/BUILD.gn +++ b/chrome/renderer/BUILD.gn
@@ -186,7 +186,6 @@ "//mojo/public/cpp/bindings", "//net", "//pdf:buildflags", - "//pdf:pdf_view_web_plugin", "//ppapi/buildflags", "//printing/buildflags", "//services/metrics/public/cpp:metrics_cpp",
diff --git a/chrome/renderer/DEPS b/chrome/renderer/DEPS index 8a70ec3..000d46bd 100644 --- a/chrome/renderer/DEPS +++ b/chrome/renderer/DEPS
@@ -81,7 +81,6 @@ "+google_apis", "+media/base", "+media/mojo", - "+pdf/pdf_view_web_plugin.h", "+ppapi/shared_impl", "+services/network/public/cpp", "+services/network/public/mojom",
diff --git a/chrome/services/media_gallery_util/public/mojom/media_parser.mojom b/chrome/services/media_gallery_util/public/mojom/media_parser.mojom index 1e1435d..1801b218 100644 --- a/chrome/services/media_gallery_util/public/mojom/media_parser.mojom +++ b/chrome/services/media_gallery_util/public/mojom/media_parser.mojom
@@ -78,7 +78,7 @@ string type; // A string->string dictionary of tags for the media stream. - mojo_base.mojom.DictionaryValue additional_properties; + mojo_base.mojom.DeprecatedDictionaryValue additional_properties; }; // All data are parsed from user-defined media data. The consumer of this API should filter special
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index 867445c..1b0e363 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn
@@ -2066,6 +2066,7 @@ "../browser/ui/permission_bubble/permission_bubble_browser_test_util.h", "../browser/ui/popup_browsertest.cc", "../browser/ui/prefs/prefs_tab_helper_browsertest.cc", + "../browser/ui/privacy_sandbox/privacy_sandbox_dialog_helper_browsertest.cc", "../browser/ui/profile_error_browsertest.cc", "../browser/ui/read_later/read_later_test_utils.cc", "../browser/ui/read_later/read_later_test_utils.h", @@ -2508,7 +2509,7 @@ "../browser/lacros/app_mode/kiosk_session_service_browsertest.cc", "../browser/lacros/lacros_extension_apps_controller_browsertest.cc", "../browser/lacros/lacros_extension_apps_publisher_browsertest.cc", - "../browser/web_applications/app_service/web_apps_publisher_host_browsertest.cc", + "../browser/web_applications/app_service/lacros_web_apps_controller_browsertest.cc", ] deps += [ "//chromeos/crosapi/mojom", @@ -4204,10 +4205,6 @@ ] } - if (enable_side_search) { - sources += [ "../browser/ui/views/side_search/side_search_browser_controller_browsertest.cc" ] - } - if (enable_spellcheck) { sources += [ "../browser/site_isolation/spellcheck_per_process_browsertest.cc" ] @@ -8854,6 +8851,7 @@ "//ui/events:events_interactive_ui_tests", "//ui/events:gesture_detection", "//ui/events:test_support", + "//ui/views", "//ui/web_dialogs:test_support", ] if (include_js_tests) { @@ -9205,6 +9203,10 @@ if (enable_print_preview) { sources += [ "../browser/window_placement/window_placement_printing_interactive_uitest.cc" ] } + + if (enable_side_search) { + sources += [ "../browser/ui/views/side_search/side_search_browser_controller_interactive_uitest.cc" ] + } } } @@ -9500,6 +9502,10 @@ "//third_party/leveldatabase", ] + if (is_chromeos_ash) { + deps += [ "//chrome/browser/ash/crosapi:browser_util" ] + } + data_deps = [ "//testing:test_scripts_shared", "//testing/buildbot/filters:sync_integration_tests_filters", @@ -9531,6 +9537,7 @@ } if (is_chromeos_ash) { sources += [ + "../browser/sync/test/integration/ash_lacros_sync_test.cc", "../browser/sync/test/integration/single_client_app_list_sync_test.cc", "../browser/sync/test/integration/single_client_arc_package_sync_test.cc", "../browser/sync/test/integration/single_client_os_preferences_sync_test.cc", @@ -9671,6 +9678,7 @@ "../browser/password_manager/password_manager_test_base.h", "../browser/password_manager/passwords_navigation_observer.cc", "../browser/password_manager/passwords_navigation_observer.h", + "../browser/ui/views/translate/translate_bubble_test_utils_views.cc", "base/interactive_ui_tests_main.cc", ] @@ -9722,6 +9730,7 @@ "//third_party/libpng", "//ui/base:test_support", "//ui/resources:ui_test_pak", + "//ui/views", "//ui/web_dialogs:test_support", ]
diff --git a/chrome/test/base/in_process_browser_test.cc b/chrome/test/base/in_process_browser_test.cc index 3486cdf..c7af716 100644 --- a/chrome/test/base/in_process_browser_test.cc +++ b/chrome/test/base/in_process_browser_test.cc
@@ -38,6 +38,7 @@ #include "chrome/browser/net/net_error_tab_helper.h" #include "chrome/browser/net/system_network_context_manager.h" #include "chrome/browser/predictors/loading_predictor_config.h" +#include "chrome/browser/privacy_sandbox/privacy_sandbox_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_attributes_entry.h" #include "chrome/browser/profiles/profile_attributes_storage.h" @@ -458,6 +459,11 @@ // What's New for tests that simulate first run, is unexpected by most tests. whats_new::DisableRemoteContentForTests(); + // The Privacy Sandbox service may attempt to show a modal dialog to the + // profile on browser start, which is unexpected by mosts tests. Tests which + // expect this can allow the dialog as desired. + PrivacySandboxService::SetDialogDisabledForTests(true); + BrowserTestBase::SetUp(); }
diff --git a/chrome/test/data/extensions/api_test/declarative_net_request/fenced_frames/background.js b/chrome/test/data/extensions/api_test/declarative_net_request/fenced_frames/background.js index d709d84..4c3036d 100644 --- a/chrome/test/data/extensions/api_test/declarative_net_request/fenced_frames/background.js +++ b/chrome/test/data/extensions/api_test/declarative_net_request/fenced_frames/background.js
@@ -98,7 +98,29 @@ rule: {ruleId: 1, rulesetId: 'rules'} }; verifyExpectedRuleInfo(expectedRuleInfo); - chrome.test.succeed(); + + const getFencedFrameWidth = + '(async function() {' + + ' while(true) { ' + + ' await new Promise(requestAnimationFrame);' + + ' let width =' + + ' document.getElementsByTagName("fencedframe")[0].clientWidth;' + + ' if (width == 0) {' + + ' chrome.runtime.sendMessage({width: width});' + + ' break;' + + ' }' + + ' }' + + '})()'; + + chrome.runtime.onMessage.addListener(results => { + // Ensure the clientWidth is 0 indicating + // the frame has no layout size and was + // collapsed correctly. + chrome.test.assertEq(0, results.width); + chrome.test.succeed(); + }); + chrome.tabs.executeScript(tab.id, {frameId: 0, + code: getFencedFrameWidth}); }); },
diff --git a/chrome/test/data/extensions/api_test/virtual_keyboard_private/test.js b/chrome/test/data/extensions/api_test/virtual_keyboard_private/test.js index 350ebdf..4a822f22 100644 --- a/chrome/test/data/extensions/api_test/virtual_keyboard_private/test.js +++ b/chrome/test/data/extensions/api_test/virtual_keyboard_private/test.js
@@ -2,21 +2,23 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -var callbackPass = chrome.test.callbackPass; +const callbackPass = chrome.test.callbackPass; -function callbackResult(result) { - var result = result.map((item) => { - return { - displayFormat: item.displayFormat, - textData: !!item.textData, - imageData: !!item.imageData, - timeCopied: !!item.timeCopied - }; - }); +const itemToDict = (item) => { + return { + displayFormat: item.displayFormat, + textData: !!item.textData, + imageData: !!item.imageData, + timeCopied: !!item.timeCopied + }; +}; + +function checkFullResult(result) { + const parsed = result.map(itemToDict); // Test that clipboard items are in the correct order with the correct data // types. - chrome.test.assertEq(result, [ + chrome.test.assertEq(parsed, [ { 'displayFormat': 'file', 'textData': true, @@ -44,9 +46,17 @@ ]); } -chrome.test.runTests([ - function multipasteApi() { - chrome.virtualKeyboardPrivate.getClipboardHistory({}, - callbackPass(callbackResult)); - } -]); +function checkEmptyResult(result) { + const parsed = result.map(itemToDict); + + // Test that no clipboard items are returned. + chrome.test.assertEq(parsed, []); +} + +chrome.test.getConfig(function(config) { + const screenLocked = config.customArg; + chrome.test.runTests([function multipasteApi() { + chrome.virtualKeyboardPrivate.getClipboardHistory( + {}, callbackPass(screenLocked ? checkEmptyResult : checkFullResult)); + }]); +});
diff --git a/chrome/test/data/pdf/test_util.js b/chrome/test/data/pdf/test_util.js index f7a7036..a5a9cc2 100644 --- a/chrome/test/data/pdf/test_util.js +++ b/chrome/test/data/pdf/test_util.js
@@ -4,7 +4,7 @@ // Utilities that are used in multiple tests. -import {LayoutOptions, Viewport} from 'chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/pdf_viewer_wrapper.js'; +import {Viewport} from 'chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/pdf_viewer_wrapper.js'; import {html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; export class MockElement {
diff --git a/chrome/test/data/webui/chromeos/ash_common/keyboard_diagram_test.js b/chrome/test/data/webui/chromeos/ash_common/keyboard_diagram_test.js index 96754830..55cc988 100644 --- a/chrome/test/data/webui/chromeos/ash_common/keyboard_diagram_test.js +++ b/chrome/test/data/webui/chromeos/ash_common/keyboard_diagram_test.js
@@ -4,6 +4,8 @@ import {MechanicalLayout, PhysicalLayout, TopRowKey} from 'chrome://resources/ash/common/keyboard_diagram.js'; import {KeyboardKeyState} from 'chrome://resources/ash/common/keyboard_key.js'; +import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js'; + import {assertEquals, assertNotEquals, assertThrows, assertTrue} from '../../chai_assert.js'; import {flushTasks, waitAfterNextRender} from '../../test_util.js'; @@ -12,6 +14,51 @@ let diagramElement = null; setup(() => { + // TODO(b/223455415): serve the Ash common JavaScript from its own WebUI + // request handler for the tests, to avoid having to duplicate the strings + // here. + if (!loadTimeData.isInitialized()) { + loadTimeData.data = { + 'keyboardDiagramAriaLabelNotPressed': '$1 key not pressed', + 'keyboardDiagramAriaLabelPressed': '$1 key pressed', + 'keyboardDiagramAriaLabelTested': '$1 key tested', + 'keyboardDiagramAriaNameArrowDown': 'Down arrow', + 'keyboardDiagramAriaNameArrowLeft': 'Left arrow', + 'keyboardDiagramAriaNameArrowRight': 'Right arrow', + 'keyboardDiagramAriaNameArrowUp': 'Up arrow', + 'keyboardDiagramAriaNameAssistant': 'Assistant', + 'keyboardDiagramAriaNameBack': 'Back', + 'keyboardDiagramAriaNameBackspace': 'Backspace', + 'keyboardDiagramAriaNameEnter': 'Enter', + 'keyboardDiagramAriaNameForward': 'Forward', + 'keyboardDiagramAriaNameFullscreen': 'Fullscreen', + 'keyboardDiagramAriaNameJisLetterSwitch': 'Kana/alphanumeric switch', + 'keyboardDiagramAriaNameKeyboardBacklightDown': + 'Keyboard brightness down', + 'keyboardDiagramAriaNameKeyboardBacklightUp': 'Keyboard brightness up', + 'keyboardDiagramAriaNameLauncher': 'Launcher', + 'keyboardDiagramAriaNameLayoutSwitch': 'Layout switch', + 'keyboardDiagramAriaNameMute': 'Mute', + 'keyboardDiagramAriaNameOverview': 'Overview', + 'keyboardDiagramAriaNamePlayPause': 'Play/Pause', + 'keyboardDiagramAriaNamePower': 'Power', + 'keyboardDiagramAriaNamePrivacyScreenToggle': 'Privacy screen toggle', + 'keyboardDiagramAriaNameRefresh': 'Refresh', + 'keyboardDiagramAriaNameScreenBrightnessDown': + 'Display brightness down', + 'keyboardDiagramAriaNameScreenBrightnessUp': 'Display brightness up', + 'keyboardDiagramAriaNameScreenMirror': 'Screen mirror', + 'keyboardDiagramAriaNameScreenshot': 'Screenshot', + 'keyboardDiagramAriaNameShiftLeft': 'Left shift', + 'keyboardDiagramAriaNameShiftRight': 'Right shift', + 'keyboardDiagramAriaNameTab': 'Tab', + 'keyboardDiagramAriaNameTrackNext': 'Next track', + 'keyboardDiagramAriaNameTrackPrevious': 'Previous track', + 'keyboardDiagramAriaNameVolumeDown': 'Volume down', + 'keyboardDiagramAriaNameVolumeUp': 'Volume up', + }; + } + diagramElement = /** @type {!KeyboardDiagramElement} */ ( document.createElement('keyboard-diagram')); document.body.appendChild(diagramElement); @@ -144,6 +191,7 @@ assertEquals(testKeySet.length + 2, keyElements.length); assertEquals('keyboard:back', keyElements[1].icon); + assertEquals('Back', keyElements[1].ariaName); assertEquals('delete', keyElements[6].mainGlyph); }); @@ -262,4 +310,12 @@ assertEquals('•', slashKey.topRightGlyph); assertEquals('め', slashKey.bottomRightGlyph); }); + + test('visualLayout_ariaNames', async () => { + diagramElement.regionCode = 'jp'; + + const letterSwitchKey = + diagramElement.root.querySelector('[data-code="41"]'); + assertEquals('Kana/alphanumeric switch', letterSwitchKey.ariaName); + }); }
diff --git a/chrome/test/data/webui/cr_elements/cr_auto_img_test.ts b/chrome/test/data/webui/cr_elements/cr_auto_img_test.ts index 6868b2f..d9776ac 100644 --- a/chrome/test/data/webui/cr_elements/cr_auto_img_test.ts +++ b/chrome/test/data/webui/cr_elements/cr_auto_img_test.ts
@@ -72,7 +72,7 @@ const autoSrc = 'https://foo.com/img.png'; // Act. - img.withCookies = ''; + img.withCookies = true; img.autoSrc = autoSrc; // Assert. @@ -80,6 +80,12 @@ `chrome://image/?url=${ encodeURIComponent(autoSrc)}&withCookies=true`, img.src); + + // Act. + img.withCookies = false; + + // Assert. + assertEquals(`chrome://image/?${autoSrc}`, img.src); }); test( @@ -96,6 +102,12 @@ `chrome://image/?url=${ encodeURIComponent(autoSrc)}&withCookies=true`, img.src); + + // Act. + img.removeAttribute('with-cookies'); + + // Assert. + assertEquals(`chrome://image/?${autoSrc}`, img.src); }); test(
diff --git a/chrome/test/data/webui/signin/local_profile_customization_test.ts b/chrome/test/data/webui/signin/local_profile_customization_test.ts index 98671134..19457e7 100644 --- a/chrome/test/data/webui/signin/local_profile_customization_test.ts +++ b/chrome/test/data/webui/signin/local_profile_customization_test.ts
@@ -175,11 +175,6 @@ .backgroundColor, browserProxy.profileThemeInfo.themeFrameColor); assertEquals( - getComputedStyle(customizeProfileElement.$.backButton) - .getPropertyValue('--cr-icon-button-fill-color') - .trim(), - browserProxy.profileThemeInfo.themeFrameTextColor); - assertEquals( getComputedStyle( customizeProfileElement.shadowRoot!.querySelector('#title')!) .color,
diff --git a/chrome/test/data/webui/signin/profile_picker_app_test.ts b/chrome/test/data/webui/signin/profile_picker_app_test.ts index b78f9e4..97bce57 100644 --- a/chrome/test/data/webui/signin/profile_picker_app_test.ts +++ b/chrome/test/data/webui/signin/profile_picker_app_test.ts
@@ -65,11 +65,6 @@ getComputedStyle(element.shadowRoot!.querySelector('#headerContainer')!) .backgroundColor, browserProxy.profileThemeInfo.themeFrameColor); - assertEquals( - getComputedStyle(element.shadowRoot!.querySelector('#backButton')!) - .getPropertyValue('--cr-icon-button-fill-color') - .trim(), - browserProxy.profileThemeInfo.themeFrameTextColor); } test('ProfilePickerMainView', async function() {
diff --git a/chrome/updater/BUILD.gn b/chrome/updater/BUILD.gn index d8c69c5..3c438470 100644 --- a/chrome/updater/BUILD.gn +++ b/chrome/updater/BUILD.gn
@@ -265,6 +265,8 @@ "win/net/network.h", "win/net/network_fetcher.cc", "win/net/network_fetcher.h", + "win/protocol_parser_xml.cc", + "win/protocol_parser_xml.h", "win/scoped_handle.h", "win/scoped_impersonation.cc", "win/scoped_impersonation.h", @@ -329,6 +331,7 @@ defines = [ "SECURITY_WIN32" ] libs = [ + "msxml2.lib", "secur32.lib", "taskschd.lib", "wtsapi32.lib", @@ -631,6 +634,7 @@ "util_win_unittest.cc", "win/installer_api_unittest.cc", "win/net/network_unittest.cc", + "win/protocol_parser_xml_unittest.cc", "win/setup/setup_util_unittest.cc", "win/tag_extractor_unittest.cc", "win/task_scheduler_unittest.cc",
diff --git a/chrome/updater/win/protocol_parser_xml.cc b/chrome/updater/win/protocol_parser_xml.cc new file mode 100644 index 0000000..cdf86215 --- /dev/null +++ b/chrome/updater/win/protocol_parser_xml.cc
@@ -0,0 +1,343 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/updater/win/protocol_parser_xml.h" + +// clang-format off +#include <objbase.h> +#include <msxml2.h> +// clang-format on +#include <wrl/client.h> + +#include <cstdint> +#include <string> + +#include "base/check.h" +#include "base/containers/flat_map.h" +#include "base/strings/string_number_conversions_win.h" +#include "base/strings/sys_string_conversions.h" +#include "base/version.h" +#include "base/win/scoped_bstr.h" +#include "base/win/scoped_variant.h" +#include "components/update_client/protocol_definition.h" +#include "url/gurl.h" + +namespace updater { +namespace { + +bool ReadAttribute(IXMLDOMNode* node, + const std::wstring& attribute_name, + BSTR* value) { + Microsoft::WRL::ComPtr<IXMLDOMNamedNodeMap> attributes; + HRESULT hr = node->get_attributes(&attributes); + if (FAILED(hr) || !attributes) { + return false; + } + + Microsoft::WRL::ComPtr<IXMLDOMNode> attribute_node; + base::win::ScopedVariant node_value; + base::win::ScopedBstr attr_name(attribute_name); + + hr = attributes->getNamedItem(attr_name.Get(), &attribute_node); + if (FAILED(hr) || !attribute_node) { + return false; + } + + hr = attribute_node->get_nodeValue(node_value.Receive()); + if (FAILED(hr) || node_value.type() == VT_EMPTY) { + return false; + } + + DCHECK_EQ(node_value.type(), VT_BSTR); + VARIANT released_variant = node_value.Release(); + *value = V_BSTR(&released_variant); + return true; +} + +bool ReadInt64Attribute(IXMLDOMNode* node, + const std::wstring& attribute_name, + int64_t* value) { + base::win::ScopedBstr node_value; + return ReadAttribute(node, attribute_name, node_value.Receive()) && + base::StringToInt64(node_value.Get(), value); +} + +bool ReadStringAttribute(IXMLDOMNode* node, + const std::wstring& attribute_name, + std::string* value) { + base::win::ScopedBstr node_value; + if (!ReadAttribute(node, attribute_name, node_value.Receive())) { + return false; + } + + *value = base::SysWideToUTF8(node_value.Get()); + return true; +} + +} // namespace + +bool ProtocolParserXML::ParseAction(IXMLDOMNode* node, Results* results) { + if (!results->list.back().manifest.run.empty()) { + // All actions except the first one are ignored. + return true; + } + + if (!ReadStringAttribute(node, L"run", &results->list.back().manifest.run) || + results->list.back().manifest.run.empty()) { + ParseError("Missing `run` attribute in <action>"); + return false; + } + + ReadStringAttribute(node, L"arguments", + &results->list.back().manifest.arguments); + return true; +} + +bool ProtocolParserXML::ParseActions(IXMLDOMNode* node, Results* results) { + return ParseChildren( + { + {L"action", &ProtocolParserXML::ParseAction}, + }, + node, results); +} + +bool ProtocolParserXML::ParseApp(IXMLDOMNode* node, Results* results) { + Result result; + if (!ReadStringAttribute(node, L"appid", &result.extension_id)) { + ParseError("Missing `appid` attribute in <app>"); + return false; + } + + if (!ReadStringAttribute(node, L"status", &result.status)) { + ParseError("Missing `status` attribute in <app>"); + return false; + } + + if (result.status != "ok") { + ParseError("Unexpected app status: %s", result.status.c_str()); + return false; + } + results->list.push_back(result); + + return ParseChildren( + { + {L"data", &ProtocolParserXML::ParseData}, + {L"updatecheck", &ProtocolParserXML::ParseUpdateCheck}, + }, + node, results); +} + +bool ProtocolParserXML::ParseData(IXMLDOMNode* node, Results* results) { + // TODO(crbug.com/1292640): Parse <data> once Results structure adds the + // peer members. + return true; +} + +bool ProtocolParserXML::ParseManifest(IXMLDOMNode* node, Results* results) { + std::string version; + if (!ReadStringAttribute(node, L"version", &version) || + !base::Version(version).IsValid()) { + ParseError("Bad `version` attribute in <manifest>: %s", version.c_str()); + return false; + } + results->list.back().manifest.version = version; + + return ParseChildren( + { + {L"actions", &ProtocolParserXML::ParseActions}, + {L"packages", &ProtocolParserXML::ParsePackages}, + }, + node, results); +} + +bool ProtocolParserXML::ParsePackage(IXMLDOMNode* node, Results* results) { + ProtocolParser::Result::Manifest::Package p; + + if (!ReadStringAttribute(node, L"name", &p.name) || p.name.empty()) { + ParseError("Missing `name` attribute in <package>"); + return false; + } + + if (!ReadStringAttribute(node, L"hash_sha256", &p.hash_sha256)) { + ParseError("Missing `hash_sha256` attribute in <package>"); + return false; + } + + if (!ReadInt64Attribute(node, L"size", &p.size)) { + ParseError("Missing `size` attribute in <package>"); + return false; + } + + ReadStringAttribute(node, L"fp", &p.fingerprint); + + results->list.back().manifest.packages.push_back(p); + return true; +} + +bool ProtocolParserXML::ParsePackages(IXMLDOMNode* node, Results* results) { + return ParseChildren( + { + {L"package", &ProtocolParserXML::ParsePackage}, + }, + node, results); +} + +bool ProtocolParserXML::ParseResponse(IXMLDOMNode* node, Results* results) { + return ParseChildren( + { + {L"app", &ProtocolParserXML::ParseApp}, + {L"systemrequirements", &ProtocolParserXML::ParseSystemRequirements}, + }, + node, results); +} + +bool ProtocolParserXML::ParseSystemRequirements(IXMLDOMNode* node, + Results* results) { + return true; +} + +bool ProtocolParserXML::ParseUpdateCheck(IXMLDOMNode* node, Results* results) { + Result& result = results->list.back(); + + if (!ReadStringAttribute(node, L"status", &result.status)) { + ParseError("Missing `status` attribute in <updatecheck>"); + return false; + } + + const ElementHandlerMap child_handlers = { + {L"manifest", &ProtocolParserXML::ParseManifest}, + {L"urls", &ProtocolParserXML::ParseUrls}, + }; + return ParseChildren(child_handlers, node, results); +} + +bool ProtocolParserXML::ParseUrl(IXMLDOMNode* node, Results* results) { + std::string url_string; + if (!ReadStringAttribute(node, L"codebase", &url_string)) { + ParseError("Missing `codebase` attribute in <url>"); + return false; + } + + GURL url(url_string); + if (!url.is_valid()) { + ParseError("Invalid URL codebase in <url>: %s", url_string.c_str()); + return false; + } + + results->list.back().crx_urls.push_back(url); + return true; +} + +bool ProtocolParserXML::ParseUrls(IXMLDOMNode* node, Results* results) { + return ParseChildren( + { + {L"url", &ProtocolParserXML::ParseUrl}, + }, + node, results); +} + +bool ProtocolParserXML::ParseElement(const ElementHandlerMap& handler_map, + IXMLDOMNode* node, + Results* results) { + base::win::ScopedBstr basename; + + if (FAILED(node->get_baseName(basename.Receive()))) { + ParseError("Failed to get name for a DOM element."); + return false; + } + + for (const auto& handler : handler_map) { + if (handler.first == basename.Get()) { + return (this->*handler.second)(node, results); + } + } + + ParseError("Unrecognized element: %s", + base::SysWideToUTF8(basename.Get()).c_str()); + return false; +} + +bool ProtocolParserXML::ParseChildren(const ElementHandlerMap& handler_map, + IXMLDOMNode* node, + Results* results) { + Microsoft::WRL::ComPtr<IXMLDOMNodeList> children_list; + + HRESULT hr = node->get_childNodes(&children_list); + if (FAILED(hr)) { + ParseError("Failed to get child elements: 0x%x", hr); + return false; + } + + long num_children = 0; + hr = children_list->get_length(&num_children); + if (FAILED(hr)) { + ParseError("Failed to get the number of child elements: 0x%x", hr); + return false; + } + + for (long i = 0; i < num_children; ++i) { + Microsoft::WRL::ComPtr<IXMLDOMNode> child_node; + hr = children_list->get_item(i, &child_node); + if (FAILED(hr)) { + ParseError("Failed to get %d-th child element: 0x%x", i, hr); + return false; + } + + DOMNodeType type = NODE_INVALID; + hr = child_node->get_nodeType(&type); + if (FAILED(hr)) { + ParseError("Failed to get %d-th child element type: 0x%x", i, hr); + return false; + } + + if (type == NODE_ELEMENT && + !ParseElement(handler_map, child_node.Get(), results)) { + return false; + } + } + + return true; +} + +bool ProtocolParserXML::DoParse(const std::string& response_xml, + Results* results) { + DCHECK(results); + + Microsoft::WRL::ComPtr<IXMLDOMDocument> xmldoc; + HRESULT hr = ::CoCreateInstance(CLSID_DOMDocument30, nullptr, CLSCTX_ALL, + IID_IXMLDOMDocument, &xmldoc); + if (FAILED(hr)) { + ParseError("IXMLDOMDocument.CoCreateInstance failed: 0x%x", hr); + return false; + } + hr = xmldoc->put_resolveExternals(VARIANT_FALSE); + if (FAILED(hr)) { + ParseError("IXMLDOMDocument.put_resolveExternals failed: 0x%x", hr); + return false; + } + + VARIANT_BOOL is_successful(VARIANT_FALSE); + auto xml_bstr = + base::win::ScopedBstr(base::SysUTF8ToWide(response_xml).c_str()); + hr = xmldoc->loadXML(xml_bstr.Get(), &is_successful); + if (FAILED(hr)) { + ParseError("Load maniftest failed: 0x%x", hr); + return false; + } + + Microsoft::WRL::ComPtr<IXMLDOMElement> root_node; + hr = xmldoc->get_documentElement(&root_node); + if (FAILED(hr) || !root_node) { + ParseError("Load maniftest failed: 0x%x", hr); + return false; + } + + return ParseElement( + { + {L"response", &ProtocolParserXML::ParseResponse}, + }, + root_node.Get(), results); +} + +} // namespace updater
diff --git a/chrome/updater/win/protocol_parser_xml.h b/chrome/updater/win/protocol_parser_xml.h new file mode 100644 index 0000000..f3b210a --- /dev/null +++ b/chrome/updater/win/protocol_parser_xml.h
@@ -0,0 +1,75 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_UPDATER_WIN_PROTOCOL_PARSER_XML_H_ +#define CHROME_UPDATER_WIN_PROTOCOL_PARSER_XML_H_ + +// clang-format off +#include <objbase.h> +#include <msxml2.h> +// clang-format on + +#include <cstdint> +#include <string> + +#include "base/containers/flat_map.h" +#include "components/update_client/protocol_parser.h" + +namespace updater { + +// Class that parses the XML manifest for offline installers. +// +// Only features that are used by Windows legacy offline installers AND those +// supported by `ProtocolParser` (components/update_client/protocol_parser.h) +// are implemented. Element types that are not (fully) handled: +// * <systemrequirements> is ignored. +// * All elements related with diff update are ignored. +// * Parse fails if <package> only has SHA1 hash. +// * Only the first manifest action is honored and the rest are ignored. +// * All elements related with cohort are ignored. +// +class ProtocolParserXML final : public update_client::ProtocolParser { + public: + ProtocolParserXML() = default; + + ProtocolParserXML(const ProtocolParserXML&) = delete; + ProtocolParserXML& operator=(const ProtocolParserXML&) = delete; + + private: + using ElementHandler = + bool (ProtocolParserXML::*)(IXMLDOMNode* node, + ProtocolParserXML::Results* results); + using ElementHandlerMap = base::flat_map<std::wstring, ElementHandler>; + + // Overrides for ProtocolParser. + bool DoParse(const std::string& response_xml, Results* results) override; + + // Helper functions to traverse the XML document. + bool ParseElement(const ElementHandlerMap& handler_map, + IXMLDOMNode* node, + Results* results); + bool ParseChildren(const ElementHandlerMap& handler_map, + IXMLDOMNode* node, + Results* results); + + // DOM element handlers. + bool ParseAction(IXMLDOMNode* node, Results* results); + bool ParseActions(IXMLDOMNode* node, Results* results); + bool ParseApp(IXMLDOMNode* node, Results* results); + bool ParseData(IXMLDOMNode* node, Results* results); + bool ParseEvent(IXMLDOMNode* node, Results* results); + bool ParseManifest(IXMLDOMNode* node, Results* results); + bool ParsePackage(IXMLDOMNode* node, Results* results); + bool ParsePackages(IXMLDOMNode* node, Results* results); + bool ParsePing(IXMLDOMNode* node, Results* results); + bool ParseResponse(IXMLDOMNode* node, Results* results); + bool ParseSystemRequirements(IXMLDOMNode* node, Results* results); + bool ParseUpdateCheck(IXMLDOMNode* node, Results* results); + bool ParseUrl(IXMLDOMNode* node, Results* results); + bool ParseUrls(IXMLDOMNode* node, Results* results); +}; + +} // namespace updater + +#endif // CHROME_UPDATER_WIN_PROTOCOL_PARSER_XML_H_
diff --git a/chrome/updater/win/protocol_parser_xml_unittest.cc b/chrome/updater/win/protocol_parser_xml_unittest.cc new file mode 100644 index 0000000..354eea1 --- /dev/null +++ b/chrome/updater/win/protocol_parser_xml_unittest.cc
@@ -0,0 +1,94 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/updater/win/protocol_parser_xml.h" + +#include "base/logging.h" + +#include "testing/gtest/include/gtest/gtest.h" + +namespace updater { + +TEST(ProtocolParserXML, Parse) { + const char kUpdateResponse[] = + "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<response protocol=\"3.0\">" + " <systemrequirements platform=\"win\" arch=\"x64\" " + " min_os_version=\"6.1\"/>" + " <app appid=\"{8A69D345-D564-463C-AFF1-A69D9E530F96}\" status=\"ok\">" + " <updatecheck status=\"ok\">" + " <urls>" + " <url codebase=\"http://dl.google.com/edgedl/chrome/install/\"/>" + " <url codebase=\"http://dl.google.com/fallback/install/\"/>" + " </urls>" + " <manifest version=\"1.2.3.4\">" + " <packages>" + " <package name=\"installer.exe\" hash_sha256=\"SamPLE_SHA==\" " + " size=\"112233\"/>" + " </packages>" + " <actions>" + " <action event=\"install\" run=\"installer.exe\" " + " arguments=\"--do-not-launch-chrome\"/>" + " <action event=\"postinstall\" " + " onsuccess=\"exitsilentlyonlaunchcmd\"/>" + " </actions>" + " </manifest>" + " </updatecheck>" + " <data index=\"verboselogging\" name=\"install\" status=\"ok\">" + " {" + " \"distribution\": {" + " \"verbose_logging\": true" + " }" + " }" + " </data>" + " <data index=\"defaultbrowser\" name=\"install\" status=\"ok\">" + " {" + " \"distribution\": {" + " \"make_chrome_default_for_user\": true" + " }" + " }" + " </data>" + " </app>" + "</response>"; + ProtocolParserXML xml_parser; + EXPECT_TRUE(xml_parser.Parse(kUpdateResponse)); + EXPECT_TRUE(xml_parser.errors().empty()); + + const update_client::ProtocolParser::Results& results = xml_parser.results(); + + // No daystart for offline installs. + EXPECT_EQ(results.daystart_elapsed_seconds, + update_client::ProtocolParser::kNoDaystart); + EXPECT_EQ(results.daystart_elapsed_days, + update_client::ProtocolParser::kNoDaystart); + EXPECT_EQ(results.list.size(), size_t{1}); + + const update_client::ProtocolParser::Result& result = results.list[0]; + EXPECT_TRUE(result.action_run.empty()); + EXPECT_EQ(result.cohort_attrs.size(), size_t{0}); + EXPECT_EQ(result.custom_attributes.size(), size_t{0}); + EXPECT_EQ(result.crx_diffurls.size(), size_t{0}); + + EXPECT_EQ(result.extension_id, "{8A69D345-D564-463C-AFF1-A69D9E530F96}"); + EXPECT_EQ(result.status, "ok"); + EXPECT_EQ(result.crx_urls.size(), size_t{2}); + EXPECT_EQ(result.crx_urls[0], "http://dl.google.com/edgedl/chrome/install/"); + EXPECT_EQ(result.crx_urls[1], "http://dl.google.com/fallback/install/"); + + EXPECT_EQ(result.manifest.version, "1.2.3.4"); + EXPECT_TRUE(result.manifest.browser_min_version.empty()); + EXPECT_EQ(result.manifest.run, "installer.exe"); + EXPECT_EQ(result.manifest.arguments, "--do-not-launch-chrome"); + + EXPECT_EQ(result.manifest.packages.size(), size_t{1}); + EXPECT_TRUE(result.manifest.packages[0].fingerprint.empty()); + EXPECT_EQ(result.manifest.packages[0].name, "installer.exe"); + EXPECT_EQ(result.manifest.packages[0].hash_sha256, "SamPLE_SHA=="); + EXPECT_EQ(result.manifest.packages[0].size, 112233); + EXPECT_TRUE(result.manifest.packages[0].namediff.empty()); + EXPECT_TRUE(result.manifest.packages[0].hashdiff_sha256.empty()); + EXPECT_EQ(result.manifest.packages[0].sizediff, 0); +} + +} // namespace updater
diff --git a/chromecast/browser/cast_extension_message_filter.cc b/chromecast/browser/cast_extension_message_filter.cc index c0af27a0..145d0c7 100644 --- a/chromecast/browser/cast_extension_message_filter.cc +++ b/chromecast/browser/cast_extension_message_filter.cc
@@ -9,6 +9,7 @@ #include "base/bind.h" #include "base/callback_helpers.h" #include "base/check_op.h" +#include "base/containers/adapters.h" #include "base/files/file_path.h" #include "base/memory/ptr_util.h" #include "base/notreached.h" @@ -109,11 +110,11 @@ // Iterate through the imports in reverse. This will allow later imported // modules to override earlier imported modules, as the list order is // maintained from the definition in manifest.json of the imports. - for (auto it = imports.rbegin(); it != imports.rend(); ++it) { + for (const auto& import_info : base::Reversed(imports)) { const extensions::Extension* imported_extension = - extension_set.GetByID(it->extension_id); + extension_set.GetByID(import_info.extension_id); if (!imported_extension) { - NOTREACHED() << "Missing shared module " << it->extension_id; + NOTREACHED() << "Missing shared module " << import_info.extension_id; continue; } paths_to_load.push_back(imported_extension->path());
diff --git a/chromecast/browser/webui/mojom/webui.mojom b/chromecast/browser/webui/mojom/webui.mojom index d6f47f6..05a6c35 100644 --- a/chromecast/browser/webui/mojom/webui.mojom +++ b/chromecast/browser/webui/mojom/webui.mojom
@@ -18,7 +18,7 @@ // Wraps a repeating callback which is invoked by the Web UI messenger. interface MessageCallback { // Receive a message with generic parameters. - OnMessage(mojo_base.mojom.ListValue list); + OnMessage(mojo_base.mojom.DeprecatedListValue list); }; // Use this interface to control the Web UI. This interface is hosted in the
diff --git a/chromecast/common/mojom/feature_manager.mojom b/chromecast/common/mojom/feature_manager.mojom index 3ced1f7..9d3a2498 100644 --- a/chromecast/common/mojom/feature_manager.mojom +++ b/chromecast/common/mojom/feature_manager.mojom
@@ -10,7 +10,7 @@ // DictionaryValue struct Feature { string name; - mojo_base.mojom.DictionaryValue config; + mojo_base.mojom.DeprecatedDictionaryValue config; }; // Receives messages from the browser process to enable/disable Cast
diff --git a/chromecast/common/mojom/feature_update.mojom b/chromecast/common/mojom/feature_update.mojom index 1bb3ebd..d7fe96b 100644 --- a/chromecast/common/mojom/feature_update.mojom +++ b/chromecast/common/mojom/feature_update.mojom
@@ -11,7 +11,7 @@ // Triggered when there is an update to base::Feature configs because a // DCS download is completed. `features` is a dictionary which is ready to be // persisted to disk (via PrefService). - OnFeaturesUpdated(mojo_base.mojom.DictionaryValue features); + OnFeaturesUpdated(mojo_base.mojom.DeprecatedDictionaryValue features); }; // This interface is implemented in the Cast Service process and allows the
diff --git a/chromecast/graphics/rounded_window_corners_manager.cc b/chromecast/graphics/rounded_window_corners_manager.cc index ad9ece29..1424662 100644 --- a/chromecast/graphics/rounded_window_corners_manager.cc +++ b/chromecast/graphics/rounded_window_corners_manager.cc
@@ -8,6 +8,7 @@ #include <string> #include <unordered_set> +#include "base/containers/adapters.h" #include "base/containers/contains.h" #include "base/strings/string_number_conversions.h" #include "chromecast/graphics/cast_window_manager.h" @@ -28,10 +29,9 @@ if (base::Contains(observed_container_windows, window)) return window; - for (auto it = window->children().rbegin(); it != window->children().rend(); - ++it) { + for (auto* child : base::Reversed(window->children())) { found_window = - FindTopmostVisibleNonCornersWindow(*it, observed_container_windows); + FindTopmostVisibleNonCornersWindow(child, observed_container_windows); if (found_window) return found_window; }
diff --git a/chromeos/chromeos_strings.grd b/chromeos/chromeos_strings.grd index 53383d8..b5440e8 100644 --- a/chromeos/chromeos_strings.grd +++ b/chromeos/chromeos_strings.grd
@@ -1182,6 +1182,115 @@ USB touchscreen </message> + <!-- Ash keyboard diagram ARIA labels --> + <message name="IDS_KEYBOARD_DIAGRAM_ARIA_LABEL_NOT_PRESSED" desc="ARIA label that describes a key that has not yet been pressed, as part of a keyboard testing UI. Key names could be single letters like Q, or a phrase like 'Down arrow'."> + <ph name="KEY_NAME">$1<ex>Q</ex></ph> key not pressed + </message> + <message name="IDS_KEYBOARD_DIAGRAM_ARIA_LABEL_PRESSED" desc="ARIA label that describes a key that is currently being pressed, as part of a keyboard testing UI. Key names could be single letters like W, or a phrase like 'Down arrow'."> + <ph name="KEY_NAME">$1<ex>W</ex></ph> key pressed + </message> + <message name="IDS_KEYBOARD_DIAGRAM_ARIA_LABEL_TESTED" desc="ARIA label that describes a key that is not currently being pressed but has been pressed during the current test, as part of a keyboard testing UI. Key names could be single letters like E, or a phrase like 'Down arrow'."> + <ph name="KEY_NAME">$1<ex>E</ex></ph> key tested + </message> + + <message name="IDS_KEYBOARD_DIAGRAM_ARIA_NAME_ARROW_DOWN" desc="Describes the down arrow key on a keyboard. Used as part of an ARIA label on a keyboard testing UI (one of 'Down arrow key not pressed', 'Down arrow key pressed', or 'Down arrow key tested')."> + Down arrow + </message> + <message name="IDS_KEYBOARD_DIAGRAM_ARIA_NAME_ARROW_LEFT" desc="Describes the left arrow key on a keyboard. Used as part of an ARIA label on a keyboard testing UI (one of 'Left arrow key not pressed', 'Left arrow key pressed', or 'Left arrow key tested')."> + Left arrow + </message> + <message name="IDS_KEYBOARD_DIAGRAM_ARIA_NAME_ARROW_RIGHT" desc="Describes the right arrow key on a keyboard. Used as part of an ARIA label on a keyboard testing UI (one of 'Right arrow key not pressed', 'Right arrow key pressed', or 'Right arrow key tested')."> + Right arrow + </message> + <message name="IDS_KEYBOARD_DIAGRAM_ARIA_NAME_ARROW_UP" desc="Describes the up arrow key on a keyboard. Used as part of an ARIA label on a keyboard testing UI (one of 'Up arrow key not pressed', 'Up arrow key pressed', or 'Up arrow key tested')."> + Up arrow + </message> + <message name="IDS_KEYBOARD_DIAGRAM_ARIA_NAME_ASSISTANT" desc="Describes the key on a keyboard that activates the Google Assistant. Used as part of an ARIA label on a keyboard testing UI (one of 'Assistant key not pressed', 'Assistant key pressed', or 'Assistant key tested')."> + Assistant + </message> + <message name="IDS_KEYBOARD_DIAGRAM_ARIA_NAME_BACKSPACE" desc="Describes the Backspace key on a keyboard. Used as part of an ARIA label on a keyboard testing UI (one of 'Backspace key not pressed', 'Backspace key pressed', or 'Backspace key tested')."> + Backspace + </message> + <message name="IDS_KEYBOARD_DIAGRAM_ARIA_NAME_ENTER" desc="Describes the Enter key on a keyboard. Used as part of an ARIA label on a keyboard testing UI (one of 'Enter key not pressed', 'Enter key pressed', or 'Enter key tested')."> + Enter + </message> + <message name="IDS_KEYBOARD_DIAGRAM_ARIA_NAME_JIS_LETTER_SWITCH" desc="Describes the key on a Japanese Chromebook keyboard that switches between entering Kana and alphanumeric characters, labelled 'かな/英数' on the keyboard itself. Used as part of an ARIA label on a keyboard testing UI (one of 'Kana/alphanumeric switch key not pressed', 'Kana/alphanumeric switch key pressed', or 'Kana/alphanumeric switch key tested')."> + Kana/alphanumeric switch + </message> + <message name="IDS_KEYBOARD_DIAGRAM_ARIA_NAME_LAUNCHER" desc="Describes the Launcher key on a keyboard. Used as part of an ARIA label on a keyboard testing UI (one of 'Launcher key not pressed', 'Launcher key pressed', or 'Launcher key tested')."> + Launcher + </message> + <message name="IDS_KEYBOARD_DIAGRAM_ARIA_NAME_LAYOUT_SWITCH" desc="Describes the key on a Dell Chromebook keyboard that switches between keyboard layouts. Used as part of an ARIA label on a keyboard testing UI (one of 'Layout switch key not pressed', 'Layout switch key pressed', or 'Layout switch key tested')."> + Layout switch + </message> + <message name="IDS_KEYBOARD_DIAGRAM_ARIA_NAME_POWER" desc="Describes the power key on a keyboard. Used as part of an ARIA label on a keyboard testing UI (one of 'Power key not pressed', 'Power key pressed', or 'Power key tested')."> + Power + </message> + <message name="IDS_KEYBOARD_DIAGRAM_ARIA_NAME_SHIFT_LEFT" desc="Describes the left Shift key on a keyboard. Used as part of an ARIA label on a keyboard testing UI (one of 'Left shift key not pressed', 'Left shift key pressed', or 'Left shift key tested')."> + Left shift + </message> + <message name="IDS_KEYBOARD_DIAGRAM_ARIA_NAME_SHIFT_RIGHT" desc="Describes the right Shift key on a keyboard. Used as part of an ARIA label on a keyboard testing UI (one of 'Right shift key not pressed', 'Right shift key pressed', or 'Right shift key tested')."> + Right shift + </message> + <message name="IDS_KEYBOARD_DIAGRAM_ARIA_NAME_TAB" desc="Describes the Tab key on a keyboard. Used as part of an ARIA label on a keyboard testing UI (one of 'Tab key not pressed', 'Tab key pressed', or 'Tab key tested')."> + Tab + </message> + + <message name="IDS_KEYBOARD_DIAGRAM_ARIA_NAME_BACK" desc="Describes the Back key on the top row of a ChromeOS keyboard. Used as part of an ARIA label on a keyboard testing UI (one of 'Back key not pressed', 'Back key pressed', or 'Back key tested')"> + Back + </message> + <message name="IDS_KEYBOARD_DIAGRAM_ARIA_NAME_FORWARD" desc="Describes the Forward key on the top row of a ChromeOS keyboard. Used as part of an ARIA label on a keyboard testing UI (one of 'Forward key not pressed', 'Forward key pressed', or 'Forward key tested')"> + Forward + </message> + <message name="IDS_KEYBOARD_DIAGRAM_ARIA_NAME_FULLSCREEN" desc="Describes the Fullscreen key on the top row of a ChromeOS keyboard. Used as part of an ARIA label on a keyboard testing UI (one of 'Fullscreen key not pressed', 'Fullscreen key pressed', or 'Fullscreen key tested')"> + Fullscreen + </message> + <message name="IDS_KEYBOARD_DIAGRAM_ARIA_NAME_KEYBOARD_BACKLIGHT_DOWN" desc="Describes the key for decreasing keyboard backlight brightness on the top row of a ChromeOS keyboard. Used as part of an ARIA label on a keyboard testing UI (one of 'Keyboard brightness up key not pressed', 'Keyboard brightness up key pressed', or 'Keyboard brightness up key tested')"> + Keyboard brightness down + </message> + <message name="IDS_KEYBOARD_DIAGRAM_ARIA_NAME_KEYBOARD_BACKLIGHT_UP" desc="Describes the key for increasing keyboard backlight brightness on the top row of a ChromeOS keyboard. Used as part of an ARIA label on a keyboard testing UI (one of 'Keyboard brightness down key not pressed', 'Keyboard brightness down key pressed', or 'Keyboard brightness down key tested')"> + Keyboard brightness up + </message> + <message name="IDS_KEYBOARD_DIAGRAM_ARIA_NAME_MUTE" desc="Describes the Mute key on the top row of a ChromeOS keyboard. Used as part of an ARIA label on a keyboard testing UI (one of 'Mute key not pressed', 'Mute key pressed', or 'Mute key tested')"> + Mute + </message> + <message name="IDS_KEYBOARD_DIAGRAM_ARIA_NAME_OVERVIEW" desc="Describes the Overview key on the top row of a ChromeOS keyboard. Used as part of an ARIA label on a keyboard testing UI (one of 'Overview key not pressed', 'Overview key pressed', or 'Overview key tested')"> + Overview + </message> + <message name="IDS_KEYBOARD_DIAGRAM_ARIA_NAME_PLAY_PAUSE" desc="Describes the play/pause key on the top row of a ChromeOS keyboard. Used as part of an ARIA label on a keyboard testing UI (one of 'Play/Pause key not pressed', 'Play/Pause key pressed', or 'Play/Pause key tested')"> + Play/Pause + </message> + <message name="IDS_KEYBOARD_DIAGRAM_ARIA_NAME_PRIVACY_SCREEN_TOGGLE" desc="Describes the key on the top row of a ChromeOS keyboard that toggles the electronic privacy screen. Used as part of an ARIA label on a keyboard testing UI (one of 'Privacy screen toggle key not pressed', 'Privacy screen toggle key pressed', or 'Privacy screen toggle key tested')"> + Privacy screen toggle + </message> + <message name="IDS_KEYBOARD_DIAGRAM_ARIA_NAME_REFRESH" desc="Describes the Refresh key on the top row of a ChromeOS keyboard. Used as part of an ARIA label on a keyboard testing UI (one of 'Refresh key not pressed', 'Refresh key pressed', or 'Refresh key tested')"> + Refresh + </message> + <message name="IDS_KEYBOARD_DIAGRAM_ARIA_NAME_SCREENSHOT" desc="Describes the Screenshot key on the top row of a ChromeOS keyboard. Used as part of an ARIA label on a keyboard testing UI (one of 'Screenshot key not pressed', 'Screenshot key pressed', or 'Screenshot key tested')"> + Screenshot + </message> + <message name="IDS_KEYBOARD_DIAGRAM_ARIA_NAME_SCREEN_BRIGHTNESS_DOWN" desc="Describes the key for decreasing display brightness on the top row of a ChromeOS keyboard. Used as part of an ARIA label on a keyboard testing UI (one of 'Display brightness down key not pressed', 'Display brightness down key pressed', or 'Display brightness down key tested')"> + Display brightness down + </message> + <message name="IDS_KEYBOARD_DIAGRAM_ARIA_NAME_SCREEN_BRIGHTNESS_UP" desc="Describes the key for increasing display brightness on the top row of a ChromeOS keyboard. Used as part of an ARIA label on a keyboard testing UI (one of 'Display brightness up key not pressed', 'Display brightness up key pressed', or 'Display brightness up key tested')"> + Display brightness up + </message> + <message name="IDS_KEYBOARD_DIAGRAM_ARIA_NAME_SCREEN_MIRROR" desc="Describes the key on the top row of a ChromeOS keyboard that changes the screen mirroring mode. Used as part of an ARIA label on a keyboard testing UI (one of 'Screen mirror key not pressed', 'Screen mirror key pressed', or 'Screen mirror key tested')"> + Screen mirror + </message> + <message name="IDS_KEYBOARD_DIAGRAM_ARIA_NAME_TRACK_NEXT" desc="Describes the next track key on the top row of a ChromeOS keyboard. Used as part of an ARIA label on a keyboard testing UI (one of 'Next track key not pressed', 'Next track key pressed', or 'Next track key tested')"> + Next track + </message> + <message name="IDS_KEYBOARD_DIAGRAM_ARIA_NAME_TRACK_PREVIOUS" desc="Describes the previous track key on the top row of a ChromeOS keyboard. Used as part of an ARIA label on a keyboard testing UI (one of 'Previous track key not pressed', 'Previous track key pressed', or 'Previous track key tested')"> + Previous track + </message> + <message name="IDS_KEYBOARD_DIAGRAM_ARIA_NAME_VOLUME_DOWN" desc="Describes the volume down key on the top row of a ChromeOS keyboard. Used as part of an ARIA label on a keyboard testing UI (one of 'Volume down key not pressed', 'Volume down key pressed', or 'Volume down key tested')"> + Volume down + </message> + <message name="IDS_KEYBOARD_DIAGRAM_ARIA_NAME_VOLUME_UP" desc="Describes the volume up key on the top row of a ChromeOS keyboard. Used as part of an ARIA label on a keyboard testing UI (one of 'Volume up key not pressed', 'Volume up key pressed', or 'Volume up key tested')"> + Volume up + </message> + <message name="IDS_ECHE_APP_DEFAULT_DEVICE_NAME" desc="The default device name used to display on Android endpoint of Eche app."> <ph name="GIVEN_NAME">$1<ex>Josh</ex></ph>'s <ph name="DEVICE_TYPE">$2<ex>Chromebook</ex></ph> </message>
diff --git a/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_LABEL_NOT_PRESSED.png.sha1 b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_LABEL_NOT_PRESSED.png.sha1 new file mode 100644 index 0000000..1a78ea1 --- /dev/null +++ b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_LABEL_NOT_PRESSED.png.sha1
@@ -0,0 +1 @@ +5a8d78375d8db9ab80c1ee215d2b883a89c035ad \ No newline at end of file
diff --git a/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_LABEL_PRESSED.png.sha1 b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_LABEL_PRESSED.png.sha1 new file mode 100644 index 0000000..b8b6b8d --- /dev/null +++ b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_LABEL_PRESSED.png.sha1
@@ -0,0 +1 @@ +8b99c4260f5f28d041dbd5ab4928a055e67b813b \ No newline at end of file
diff --git a/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_LABEL_TESTED.png.sha1 b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_LABEL_TESTED.png.sha1 new file mode 100644 index 0000000..c1fc74b --- /dev/null +++ b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_LABEL_TESTED.png.sha1
@@ -0,0 +1 @@ +7fbe0baf7174e2202306d0485c5bf0df9494ca18 \ No newline at end of file
diff --git a/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_ARROW_DOWN.png.sha1 b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_ARROW_DOWN.png.sha1 new file mode 100644 index 0000000..af2487d --- /dev/null +++ b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_ARROW_DOWN.png.sha1
@@ -0,0 +1 @@ +71d34fc205f69c119a3cdfac5faf1f7963a96738 \ No newline at end of file
diff --git a/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_ARROW_LEFT.png.sha1 b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_ARROW_LEFT.png.sha1 new file mode 100644 index 0000000..7e9e5195 --- /dev/null +++ b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_ARROW_LEFT.png.sha1
@@ -0,0 +1 @@ +2e7bafc249ea57cc49abff42cd2c05d1b606e898 \ No newline at end of file
diff --git a/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_ARROW_RIGHT.png.sha1 b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_ARROW_RIGHT.png.sha1 new file mode 100644 index 0000000..849f4874 --- /dev/null +++ b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_ARROW_RIGHT.png.sha1
@@ -0,0 +1 @@ +de0c42a80c2f616f7e7bc3d09b44d2d62a55f155 \ No newline at end of file
diff --git a/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_ARROW_UP.png.sha1 b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_ARROW_UP.png.sha1 new file mode 100644 index 0000000..156deb7 --- /dev/null +++ b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_ARROW_UP.png.sha1
@@ -0,0 +1 @@ +3fba8edd4cb66918453cca882a9978bdfd253f93 \ No newline at end of file
diff --git a/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_ASSISTANT.png.sha1 b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_ASSISTANT.png.sha1 new file mode 100644 index 0000000..e39959e --- /dev/null +++ b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_ASSISTANT.png.sha1
@@ -0,0 +1 @@ +f3643b7fe1da1b1965d4cc72b66e784d8cddfd72 \ No newline at end of file
diff --git a/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_BACK.png.sha1 b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_BACK.png.sha1 new file mode 100644 index 0000000..70a77e0 --- /dev/null +++ b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_BACK.png.sha1
@@ -0,0 +1 @@ +2a5608efa321f3381065877fe657134232e039f4 \ No newline at end of file
diff --git a/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_BACKSPACE.png.sha1 b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_BACKSPACE.png.sha1 new file mode 100644 index 0000000..711a74e --- /dev/null +++ b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_BACKSPACE.png.sha1
@@ -0,0 +1 @@ +758a303267a94c1a44be75c97ae412593f5e28ce \ No newline at end of file
diff --git a/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_ENTER.png.sha1 b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_ENTER.png.sha1 new file mode 100644 index 0000000..59932dbe --- /dev/null +++ b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_ENTER.png.sha1
@@ -0,0 +1 @@ +b794e75981612e4c9bc43bf26c4d5eb3481781c0 \ No newline at end of file
diff --git a/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_FORWARD.png.sha1 b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_FORWARD.png.sha1 new file mode 100644 index 0000000..be3a128 --- /dev/null +++ b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_FORWARD.png.sha1
@@ -0,0 +1 @@ +e5afab65b24a84e0ebe2359dd49fa9532c8f5050 \ No newline at end of file
diff --git a/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_FULLSCREEN.png.sha1 b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_FULLSCREEN.png.sha1 new file mode 100644 index 0000000..574ae29a --- /dev/null +++ b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_FULLSCREEN.png.sha1
@@ -0,0 +1 @@ +71ee503138559985b54126756017faceb70940ed \ No newline at end of file
diff --git a/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_JIS_LETTER_SWITCH.png.sha1 b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_JIS_LETTER_SWITCH.png.sha1 new file mode 100644 index 0000000..44cee45 --- /dev/null +++ b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_JIS_LETTER_SWITCH.png.sha1
@@ -0,0 +1 @@ +5d028edb804a628548bdf4a34856c7a90f931798 \ No newline at end of file
diff --git a/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_KEYBOARD_BACKLIGHT_DOWN.png.sha1 b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_KEYBOARD_BACKLIGHT_DOWN.png.sha1 new file mode 100644 index 0000000..6c95c1c --- /dev/null +++ b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_KEYBOARD_BACKLIGHT_DOWN.png.sha1
@@ -0,0 +1 @@ +aead7df6445464b14f11263af54123d180e22505 \ No newline at end of file
diff --git a/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_KEYBOARD_BACKLIGHT_UP.png.sha1 b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_KEYBOARD_BACKLIGHT_UP.png.sha1 new file mode 100644 index 0000000..068f367 --- /dev/null +++ b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_KEYBOARD_BACKLIGHT_UP.png.sha1
@@ -0,0 +1 @@ +42e27c5da5c7948e429ae9b58e58a54931e778e8 \ No newline at end of file
diff --git a/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_LAUNCHER.png.sha1 b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_LAUNCHER.png.sha1 new file mode 100644 index 0000000..ec202cb1 --- /dev/null +++ b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_LAUNCHER.png.sha1
@@ -0,0 +1 @@ +94842f4749c3305d965eed88c8d53585a464068b \ No newline at end of file
diff --git a/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_LAYOUT_SWITCH.png.sha1 b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_LAYOUT_SWITCH.png.sha1 new file mode 100644 index 0000000..31ebb3aa --- /dev/null +++ b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_LAYOUT_SWITCH.png.sha1
@@ -0,0 +1 @@ +34db9d4cc0701defaf172414daef73ebfa03d8cd \ No newline at end of file
diff --git a/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_MUTE.png.sha1 b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_MUTE.png.sha1 new file mode 100644 index 0000000..d5b2756 --- /dev/null +++ b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_MUTE.png.sha1
@@ -0,0 +1 @@ +bc3ba9eae29db9a6ce9f5d1e88a7994f1e365ffd \ No newline at end of file
diff --git a/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_OVERVIEW.png.sha1 b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_OVERVIEW.png.sha1 new file mode 100644 index 0000000..c6ac14b8 --- /dev/null +++ b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_OVERVIEW.png.sha1
@@ -0,0 +1 @@ +b125ddb54d31a2afbc2c8268e4c240b03b962ab3 \ No newline at end of file
diff --git a/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_PLAY_PAUSE.png.sha1 b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_PLAY_PAUSE.png.sha1 new file mode 100644 index 0000000..a9a2310 --- /dev/null +++ b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_PLAY_PAUSE.png.sha1
@@ -0,0 +1 @@ +ad4a9d7508cedfc1cb96ac2d15f7266642bc9fa1 \ No newline at end of file
diff --git a/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_POWER.png.sha1 b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_POWER.png.sha1 new file mode 100644 index 0000000..4786686 --- /dev/null +++ b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_POWER.png.sha1
@@ -0,0 +1 @@ +b56b04794423d4b68fc8eb0463203ab0f919b708 \ No newline at end of file
diff --git a/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_PRIVACY_SCREEN_TOGGLE.png.sha1 b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_PRIVACY_SCREEN_TOGGLE.png.sha1 new file mode 100644 index 0000000..c30bdb4c --- /dev/null +++ b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_PRIVACY_SCREEN_TOGGLE.png.sha1
@@ -0,0 +1 @@ +31d7805b8a659552da7bf947eb42308e1bcab5c9 \ No newline at end of file
diff --git a/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_REFRESH.png.sha1 b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_REFRESH.png.sha1 new file mode 100644 index 0000000..1853eb6b --- /dev/null +++ b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_REFRESH.png.sha1
@@ -0,0 +1 @@ +d2bdf84d138f53eeed3ce686d6df1becb386684c \ No newline at end of file
diff --git a/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_SCREENSHOT.png.sha1 b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_SCREENSHOT.png.sha1 new file mode 100644 index 0000000..5f8b040 --- /dev/null +++ b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_SCREENSHOT.png.sha1
@@ -0,0 +1 @@ +ac37d4adf9f500cef125bd280ef866f851ad5246 \ No newline at end of file
diff --git a/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_SCREEN_BRIGHTNESS_DOWN.png.sha1 b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_SCREEN_BRIGHTNESS_DOWN.png.sha1 new file mode 100644 index 0000000..cfce39e --- /dev/null +++ b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_SCREEN_BRIGHTNESS_DOWN.png.sha1
@@ -0,0 +1 @@ +3727c147b7f72a7a770b1f843fe2b361090fc55c \ No newline at end of file
diff --git a/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_SCREEN_BRIGHTNESS_UP.png.sha1 b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_SCREEN_BRIGHTNESS_UP.png.sha1 new file mode 100644 index 0000000..69f8cc4 --- /dev/null +++ b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_SCREEN_BRIGHTNESS_UP.png.sha1
@@ -0,0 +1 @@ +81249d7065bf3b7c5e542426df22a1dffe414a5a \ No newline at end of file
diff --git a/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_SCREEN_MIRROR.png.sha1 b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_SCREEN_MIRROR.png.sha1 new file mode 100644 index 0000000..273eec8 --- /dev/null +++ b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_SCREEN_MIRROR.png.sha1
@@ -0,0 +1 @@ +e52c1a8bee7f00d2a718c8043443190fada53f13 \ No newline at end of file
diff --git a/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_SHIFT_LEFT.png.sha1 b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_SHIFT_LEFT.png.sha1 new file mode 100644 index 0000000..45d4462 --- /dev/null +++ b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_SHIFT_LEFT.png.sha1
@@ -0,0 +1 @@ +52cba9536fd0becdf505a0478e7b84c5206bd62d \ No newline at end of file
diff --git a/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_SHIFT_RIGHT.png.sha1 b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_SHIFT_RIGHT.png.sha1 new file mode 100644 index 0000000..6e29e366 --- /dev/null +++ b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_SHIFT_RIGHT.png.sha1
@@ -0,0 +1 @@ +01c25023e924f480ea4951859f93823c9d8eb639 \ No newline at end of file
diff --git a/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_TAB.png.sha1 b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_TAB.png.sha1 new file mode 100644 index 0000000..3147902 --- /dev/null +++ b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_TAB.png.sha1
@@ -0,0 +1 @@ +19b9622ee57bcb58bc9e633da6a087580a91e76f \ No newline at end of file
diff --git a/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_TRACK_NEXT.png.sha1 b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_TRACK_NEXT.png.sha1 new file mode 100644 index 0000000..65d0c649b --- /dev/null +++ b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_TRACK_NEXT.png.sha1
@@ -0,0 +1 @@ +71a1880cf256c5ae5fe2e224b55bb426a8fb395f \ No newline at end of file
diff --git a/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_TRACK_PREVIOUS.png.sha1 b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_TRACK_PREVIOUS.png.sha1 new file mode 100644 index 0000000..ed300c37 --- /dev/null +++ b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_TRACK_PREVIOUS.png.sha1
@@ -0,0 +1 @@ +a85c07aa73cb4c5a0a6081598d34fc356a8b273a \ No newline at end of file
diff --git a/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_VOLUME_DOWN.png.sha1 b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_VOLUME_DOWN.png.sha1 new file mode 100644 index 0000000..033a2974 --- /dev/null +++ b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_VOLUME_DOWN.png.sha1
@@ -0,0 +1 @@ +dc9e1e7549cd9fc24f36a8facc822c9fc14b7619 \ No newline at end of file
diff --git a/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_VOLUME_UP.png.sha1 b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_VOLUME_UP.png.sha1 new file mode 100644 index 0000000..d2a5494 --- /dev/null +++ b/chromeos/chromeos_strings_grd/IDS_KEYBOARD_DIAGRAM_ARIA_NAME_VOLUME_UP.png.sha1
@@ -0,0 +1 @@ +7d7d070655ca89a77366898dbdada97c18ea1fdf \ No newline at end of file
diff --git a/chromeos/crosapi/mojom/automation.mojom b/chromeos/crosapi/mojom/automation.mojom index b01a06e..440afa0 100644 --- a/chromeos/crosapi/mojom/automation.mojom +++ b/chromeos/crosapi/mojom/automation.mojom
@@ -22,7 +22,7 @@ PerformActionDeprecated@2( mojo_base.mojom.UnguessableToken tree_id, int32 automation_node_id, string action_type, int32 request_id, - mojo_base.mojom.DictionaryValue optional_args); + mojo_base.mojom.DeprecatedDictionaryValue optional_args); // Enables automation for the client. This will result in the client // repeatedly calling ReceiveEventPrototype() on the Automation interface.
diff --git a/chromeos/crosapi/mojom/crosapi.mojom b/chromeos/crosapi/mojom/crosapi.mojom index 1035de1..af2a128 100644 --- a/chromeos/crosapi/mojom/crosapi.mojom +++ b/chromeos/crosapi/mojom/crosapi.mojom
@@ -1049,7 +1049,7 @@ // "Lacros extensions: xxx", "Lacros mem_usage: xxx", etc. [MinVersion=6] GetFeedbackData@3() => ( - mojo_base.mojom.DictionaryValue feedback_info); + mojo_base.mojom.DeprecatedDictionaryValue feedback_info); // Returns the browser histograms used for generating feedback report. // The histograms returned is zip compressed and is typically around 100KB.
diff --git a/chromeos/dbus/fwupd/fwupd_client.cc b/chromeos/dbus/fwupd/fwupd_client.cc index 7a4a8cf..2016e88 100644 --- a/chromeos/dbus/fwupd/fwupd_client.cc +++ b/chromeos/dbus/fwupd/fwupd_client.cc
@@ -25,6 +25,7 @@ FwupdClient* g_instance = nullptr; const char kCabFileExtension[] = ".cab"; +const int kSha256Length = 64; // "1" is the bitflag for an internal device. Defined here: // https://github.com/fwupd/fwupd/blob/main/libfwupd/fwupd-enums.h @@ -50,6 +51,35 @@ return base::FilePath(); } +std::string ParseCheckSum(const std::string& raw_sum) { + // The raw checksum string from fwupd can be formatted as: + // "SHA{Option},SHA{Option}" or "SHA{Option}". Grab the SHA256 when possible. + const std::size_t delim_pos = raw_sum.find_first_of(","); + if (delim_pos != std::string::npos) { + DCHECK(raw_sum.size() > 0); + if (delim_pos >= raw_sum.size() - 1) { + return ""; + } + + const std::string first = raw_sum.substr(0, delim_pos); + const std::string second = raw_sum.substr(delim_pos + 1); + if (first.length() == kSha256Length) { + return first; + } + if (second.length() == kSha256Length) { + return second; + } + return ""; + } + + // Only one checksum available, use it if it's a sha256 checksum. + if (raw_sum.length() != kSha256Length) { + return ""; + } + + return raw_sum; +} + } // namespace class FwupdClientImpl : public FwupdClient { @@ -226,23 +256,29 @@ const auto* description = dict->FindKey("Description"); const auto* priority = dict->FindKey("Urgency"); const auto* uri = dict->FindKey("Uri"); - base::FilePath filepath; + const auto* checksum = dict->FindKey("Checksum"); + base::FilePath filepath; if (uri) { filepath = GetFilePathFromUri(GURL(uri->GetString())); } - const bool success = - version && description && priority && !filepath.empty(); + std::string sha_checksum; + if (checksum) { + sha_checksum = ParseCheckSum(checksum->GetString()); + } + + const bool success = version && description && priority && + !filepath.empty() && !sha_checksum.empty(); // TODO(michaelcheco): Confirm that this is the expected behavior. if (success) { VLOG(1) << "fwupd: Found update version for device: " << device_id << " with version: " << version->GetString(); updates.emplace_back(version->GetString(), description->GetString(), - priority->GetInt(), filepath); + priority->GetInt(), filepath, sha_checksum); } else { - LOG(ERROR) << "Update version, description, filepath or priority is " - << "not found."; + LOG(ERROR) << "Update version, description, filepath, checksum or " + << "priority is not found."; } }
diff --git a/chromeos/dbus/fwupd/fwupd_client_unittest.cc b/chromeos/dbus/fwupd/fwupd_client_unittest.cc index 1bc85c2..ec2f310b 100644 --- a/chromeos/dbus/fwupd/fwupd_client_unittest.cc +++ b/chromeos/dbus/fwupd/fwupd_client_unittest.cc
@@ -31,12 +31,15 @@ const uint32_t kFakeUpdatePriorityForTesting = 1; const char kFakeUpdateUriForTesting[] = "file:///usr/share/fwupd/remotes.d/vendor/firmware/testFirmwarePath-V1.cab"; +const char kFakeSha256ForTesting[] = + "3fab34cfa1ef97238fb24c5e40a979bc544bb2b0967b863e43e7d58e0d9a923f"; const char kNameKey[] = "Name"; const char kIdKey[] = "DeviceId"; const char kVersionKey[] = "Version"; const char kDescriptionKey[] = "Description"; const char kPriorityKey[] = "Urgency"; const char kUriKey[] = "Uri"; +const char kChecksumKey[] = "Checksum"; void RunResponseOrErrorCallback( dbus::ObjectProxy::ResponseOrErrorCallback callback, @@ -118,12 +121,62 @@ std::move(result.first), std::move(result.second))); } + std::unique_ptr<dbus::Response> CreateOneUpdateResponseWithChecksum( + const std::string& checksum) { + auto response = dbus::Response::CreateEmpty(); + + dbus::MessageWriter response_writer(response.get()); + dbus::MessageWriter response_array_writer(nullptr); + dbus::MessageWriter device_array_writer(nullptr); + dbus::MessageWriter dict_writer(nullptr); + + // The response is an array of arrays of dictionaries. Each dictionary is + // one device description. + response_writer.OpenArray("a{sv}", &response_array_writer); + response_array_writer.OpenArray("{sv}", &device_array_writer); + + device_array_writer.OpenDictEntry(&dict_writer); + dict_writer.AppendString(kDescriptionKey); + dict_writer.AppendVariantOfString(kFakeUpdateDescriptionForTesting); + device_array_writer.CloseContainer(&dict_writer); + + device_array_writer.OpenDictEntry(&dict_writer); + dict_writer.AppendString(kVersionKey); + dict_writer.AppendVariantOfString(kFakeUpdateVersionForTesting); + device_array_writer.CloseContainer(&dict_writer); + + device_array_writer.OpenDictEntry(&dict_writer); + dict_writer.AppendString(kPriorityKey); + dict_writer.AppendVariantOfUint32(kFakeUpdatePriorityForTesting); + device_array_writer.CloseContainer(&dict_writer); + + device_array_writer.OpenDictEntry(&dict_writer); + dict_writer.AppendString(kUriKey); + dict_writer.AppendVariantOfString(kFakeUpdateUriForTesting); + device_array_writer.CloseContainer(&dict_writer); + + device_array_writer.OpenDictEntry(&dict_writer); + dict_writer.AppendString(kChecksumKey); + dict_writer.AppendVariantOfString(checksum); + device_array_writer.CloseContainer(&dict_writer); + + response_array_writer.CloseContainer(&device_array_writer); + response_writer.CloseContainer(&response_array_writer); + + return response; + } + void CheckDevices(FwupdDeviceList* devices) { CHECK_EQ(kFakeDeviceNameForTesting, (*devices)[0].device_name); CHECK_EQ(kFakeDeviceIdForTesting, (*devices)[0].id); } void CheckUpdates(const std::string& device_id, FwupdUpdateList* updates) { + if (updates->empty()) { + EXPECT_TRUE(expect_no_updates_); + return; + } + CHECK_EQ(kFakeDeviceIdForTesting, device_id); CHECK_EQ(kFakeUpdateVersionForTesting, (*updates)[0].version); CHECK_EQ(kFakeUpdateDescriptionForTesting, (*updates)[0].description); @@ -132,12 +185,19 @@ CHECK_EQ(static_cast<int>(kFakeUpdatePriorityForTesting), (*updates)[0].priority); CHECK_EQ(kFakeUpdateUriForTesting, (*updates)[0].filepath.value()); + CHECK_EQ(expected_checksum_, (*updates)[0].checksum); } void CheckInstallState(bool success) { CHECK_EQ(install_success_, success); } void SetInstallState(bool success) { install_success_ = success; } + void SetExpectedChecksum(const std::string& checksum) { + expected_checksum_ = checksum; + } + + void SetExpectNoUpdates(bool no_updates) { expect_no_updates_ = no_updates; } + void CheckPropertyChanged(FwupdProperties* properties) { if (properties->percentage.is_valid()) { CHECK_EQ(expected_properties_->percentage.value(), @@ -205,6 +265,10 @@ std::deque<MethodCallResult> dbus_method_call_simulated_results_; bool install_success_ = false; + + bool expect_no_updates_ = false; + + std::string expected_checksum_; }; // TODO (swifton): Rewrite this test with an observer when it's available. @@ -302,6 +366,12 @@ dict_writer.AppendVariantOfString(kFakeUpdateUriForTesting); device_array_writer.CloseContainer(&dict_writer); + device_array_writer.OpenDictEntry(&dict_writer); + dict_writer.AppendString(kChecksumKey); + dict_writer.AppendVariantOfString(kFakeSha256ForTesting); + device_array_writer.CloseContainer(&dict_writer); + SetExpectedChecksum(kFakeSha256ForTesting); + response_array_writer.CloseContainer(&device_array_writer); response_writer.CloseContainer(&response_array_writer); @@ -312,6 +382,119 @@ base::RunLoop().RunUntilIdle(); } +TEST_F(FwupdClientTest, TwoChecksumAvailable) { + // The observer will check that the update description is parsed and passed + // correctly. + MockObserver observer; + EXPECT_CALL(observer, OnUpdateListResponse(_, _)) + .Times(1) + .WillRepeatedly(Invoke(this, &FwupdClientTest::CheckUpdates)); + fwupd_client_->AddObserver(&observer); + + EXPECT_CALL(*proxy_, DoCallMethodWithErrorResponse(_, _, _)) + .WillRepeatedly(Invoke(this, &FwupdClientTest::OnMethodCalled)); + + const std::string checksum = std::string(kFakeSha256ForTesting) + + ",badbbadbad1ef97238fb24c5e40a979bc544bb2b"; + + AddDbusMethodCallResultSimulation( + CreateOneUpdateResponseWithChecksum(checksum), nullptr); + SetExpectedChecksum(kFakeSha256ForTesting); + + fwupd_client_->RequestUpdates(kFakeDeviceIdForTesting); + + base::RunLoop().RunUntilIdle(); +} + +TEST_F(FwupdClientTest, TwoChecksumAvailableInverse) { + // The observer will check that the update description is parsed and passed + // correctly. + MockObserver observer; + EXPECT_CALL(observer, OnUpdateListResponse(_, _)) + .Times(1) + .WillRepeatedly(Invoke(this, &FwupdClientTest::CheckUpdates)); + fwupd_client_->AddObserver(&observer); + + EXPECT_CALL(*proxy_, DoCallMethodWithErrorResponse(_, _, _)) + .WillRepeatedly(Invoke(this, &FwupdClientTest::OnMethodCalled)); + + const std::string checksum = "badbbadbad1ef97238fb24c5e40a979bc544bb2b," + + std::string(kFakeSha256ForTesting); + + AddDbusMethodCallResultSimulation( + CreateOneUpdateResponseWithChecksum(checksum), nullptr); + SetExpectedChecksum(kFakeSha256ForTesting); + + fwupd_client_->RequestUpdates(kFakeDeviceIdForTesting); + + base::RunLoop().RunUntilIdle(); +} + +TEST_F(FwupdClientTest, MissingChecksum) { + // The observer will check that the update description is parsed and passed + // correctly. + MockObserver observer; + EXPECT_CALL(observer, OnUpdateListResponse(_, _)) + .Times(1) + .WillRepeatedly(Invoke(this, &FwupdClientTest::CheckUpdates)); + fwupd_client_->AddObserver(&observer); + + EXPECT_CALL(*proxy_, DoCallMethodWithErrorResponse(_, _, _)) + .WillRepeatedly(Invoke(this, &FwupdClientTest::OnMethodCalled)); + + AddDbusMethodCallResultSimulation(CreateOneUpdateResponseWithChecksum(""), + nullptr); + SetExpectNoUpdates(/*expect_no_updates=*/true); + + fwupd_client_->RequestUpdates(kFakeDeviceIdForTesting); + + base::RunLoop().RunUntilIdle(); +} + +TEST_F(FwupdClientTest, BadFormatChecksum) { + // The observer will check that the update description is parsed and passed + // correctly. + MockObserver observer; + EXPECT_CALL(observer, OnUpdateListResponse(_, _)) + .Times(1) + .WillRepeatedly(Invoke(this, &FwupdClientTest::CheckUpdates)); + fwupd_client_->AddObserver(&observer); + + EXPECT_CALL(*proxy_, DoCallMethodWithErrorResponse(_, _, _)) + .WillRepeatedly(Invoke(this, &FwupdClientTest::OnMethodCalled)); + + const std::string checksum = std::string(kFakeSha256ForTesting) + ","; + + AddDbusMethodCallResultSimulation( + CreateOneUpdateResponseWithChecksum(checksum), nullptr); + SetExpectNoUpdates(/*expect_no_updates=*/true); + + fwupd_client_->RequestUpdates(kFakeDeviceIdForTesting); + + base::RunLoop().RunUntilIdle(); +} + +TEST_F(FwupdClientTest, BadFormatChecksumOnlyComma) { + // The observer will check that the update description is parsed and passed + // correctly. + MockObserver observer; + EXPECT_CALL(observer, OnUpdateListResponse(_, _)) + .Times(1) + .WillRepeatedly(Invoke(this, &FwupdClientTest::CheckUpdates)); + fwupd_client_->AddObserver(&observer); + + EXPECT_CALL(*proxy_, DoCallMethodWithErrorResponse(_, _, _)) + .WillRepeatedly(Invoke(this, &FwupdClientTest::OnMethodCalled)); + + AddDbusMethodCallResultSimulation(CreateOneUpdateResponseWithChecksum(","), + nullptr); + SetExpectNoUpdates(/*expect_no_updates=*/true); + + fwupd_client_->RequestUpdates(kFakeDeviceIdForTesting); + + base::RunLoop().RunUntilIdle(); +} + TEST_F(FwupdClientTest, Install) { // The observer will check that the update description is parsed and passed // correctly.
diff --git a/chromeos/dbus/fwupd/fwupd_update.cc b/chromeos/dbus/fwupd/fwupd_update.cc index 2346f36..096bc52 100644 --- a/chromeos/dbus/fwupd/fwupd_update.cc +++ b/chromeos/dbus/fwupd/fwupd_update.cc
@@ -13,11 +13,13 @@ FwupdUpdate::FwupdUpdate(const std::string& version, const std::string& description, int priority, - const base::FilePath& filepath) + const base::FilePath& filepath, + const std::string& checksum) : version(version), description(description), priority(priority), - filepath(filepath) {} + filepath(filepath), + checksum(checksum) {} FwupdUpdate::FwupdUpdate(FwupdUpdate&& other) = default; FwupdUpdate& FwupdUpdate::operator=(FwupdUpdate&& other) = default;
diff --git a/chromeos/dbus/fwupd/fwupd_update.h b/chromeos/dbus/fwupd/fwupd_update.h index 466afe4..10d28c8 100644 --- a/chromeos/dbus/fwupd/fwupd_update.h +++ b/chromeos/dbus/fwupd/fwupd_update.h
@@ -18,7 +18,8 @@ FwupdUpdate(const std::string& version, const std::string& description, int priority, - const base::FilePath& filename); + const base::FilePath& filename, + const std::string& checksum); FwupdUpdate(FwupdUpdate&& other); FwupdUpdate& operator=(FwupdUpdate&& other); ~FwupdUpdate(); @@ -27,6 +28,7 @@ std::string description; int priority; base::FilePath filepath; + std::string checksum; }; using FwupdUpdateList = std::vector<FwupdUpdate>;
diff --git a/chromeos/memory/userspace_swap/userspace_swap.cc b/chromeos/memory/userspace_swap/userspace_swap.cc index 0a2935ff..5c6de4e6 100644 --- a/chromeos/memory/userspace_swap/userspace_swap.cc +++ b/chromeos/memory/userspace_swap/userspace_swap.cc
@@ -155,10 +155,8 @@ const std::vector<::userspace_swap::mojom::MemoryRegionPtr>& regions, std::vector<Region>& resident_regions); - static const size_t kPageSize; - - const int render_process_host_id_ = 0; - const base::ProcessId pid_ = 0; + const int render_process_host_id_; + const base::ProcessId pid_; bool swap_allowed_ = false; @@ -180,9 +178,6 @@ RendererSwapDataImpl::~RendererSwapDataImpl() = default; -// static -const size_t RendererSwapDataImpl::kPageSize = base::GetPageSize(); - int RendererSwapDataImpl::render_process_host_id() const { return render_process_host_id_; } @@ -205,7 +200,7 @@ // the destination of MREMAP_DONTUNMAPs. const uint64_t kPagesPerRegion = UserspaceSwapConfig::Get().number_of_pages_per_region; - const size_t kRegionSizeBytes = kPageSize * kPagesPerRegion; + const size_t kRegionSizeBytes = base::GetPageSize() * kPagesPerRegion; for (uint64_t base_addr = swap_remap_area.address; (base_addr + kRegionSizeBytes) <= @@ -310,8 +305,8 @@ // The RegionSize is the size that is considered for swapping, this is // independent of PA SuperPage size and is configurable as a multiple of the // system page size. - size_t kRegionSize = - UserspaceSwapConfig::Get().number_of_pages_per_region * kPageSize; + size_t kRegionSize = UserspaceSwapConfig::Get().number_of_pages_per_region * + base::GetPageSize(); for (const auto& area : regions) { Region area_end(area->address + area->length); for (Region r(area->address, kRegionSize); r < area_end;
diff --git a/chromeos/network/client_cert_util.cc b/chromeos/network/client_cert_util.cc index 5487458..a2fcbcd 100644 --- a/chromeos/network/client_cert_util.cc +++ b/chromeos/network/client_cert_util.cc
@@ -134,12 +134,12 @@ // Look for L2TP-IPsec specific properties. pkcs11_id_str = provider_properties->FindStringKey( - shill::kL2tpIpsecClientCertIdProperty); + shill::kL2TPIPsecClientCertIdProperty); if (pkcs11_id_str) { *pkcs11_id = *pkcs11_id_str; const std::string* cert_slot = provider_properties->FindStringKey( - shill::kL2tpIpsecClientCertSlotProperty); + shill::kL2TPIPsecClientCertSlotProperty); if (cert_slot && !cert_slot->empty() && !base::StringToInt(*cert_slot, tpm_slot)) { LOG(ERROR) << "Cert slot is not an integer: " << *cert_slot << "."; @@ -208,11 +208,11 @@ break; } case ConfigType::kL2tpIpsec: { - properties->SetKey(shill::kL2tpIpsecPinProperty, + properties->SetKey(shill::kL2TPIPsecPinProperty, base::Value(kDefaultTPMPin)); - properties->SetKey(shill::kL2tpIpsecClientCertSlotProperty, + properties->SetKey(shill::kL2TPIPsecClientCertSlotProperty, base::Value(base::NumberToString(tpm_slot))); - properties->SetKey(shill::kL2tpIpsecClientCertIdProperty, + properties->SetKey(shill::kL2TPIPsecClientCertIdProperty, base::Value(pkcs11_id)); break; } @@ -254,11 +254,11 @@ break; } case ConfigType::kL2tpIpsec: { - properties->SetKey(shill::kL2tpIpsecPinProperty, + properties->SetKey(shill::kL2TPIPsecPinProperty, base::Value(std::string())); - properties->SetKey(shill::kL2tpIpsecClientCertSlotProperty, + properties->SetKey(shill::kL2TPIPsecClientCertSlotProperty, base::Value(std::string())); - properties->SetKey(shill::kL2tpIpsecClientCertIdProperty, + properties->SetKey(shill::kL2TPIPsecClientCertIdProperty, base::Value(std::string())); break; }
diff --git a/chromeos/network/network_cert_migrator_unittest.cc b/chromeos/network/network_cert_migrator_unittest.cc index 25dd616..1235747b 100644 --- a/chromeos/network/network_cert_migrator_unittest.cc +++ b/chromeos/network/network_cert_migrator_unittest.cc
@@ -172,9 +172,9 @@ } else { provider.SetKey(shill::kTypeProperty, base::Value(shill::kProviderL2tpIpsec)); - provider.SetKey(shill::kL2tpIpsecClientCertSlotProperty, + provider.SetKey(shill::kL2TPIPsecClientCertSlotProperty, base::Value(slot_id)); - provider.SetKey(shill::kL2tpIpsecClientCertIdProperty, + provider.SetKey(shill::kL2TPIPsecClientCertIdProperty, base::Value(pkcs11_id)); } service_test_->SetServiceProperty(kVPNStub, shill::kProviderProperty, @@ -200,11 +200,11 @@ *pkcs11_id = *pkcs11_id_value; } else { const std::string* slot_value = - provider->FindStringKey(shill::kL2tpIpsecClientCertSlotProperty); + provider->FindStringKey(shill::kL2TPIPsecClientCertSlotProperty); if (slot_value) *slot_id = *slot_value; const std::string* pkcs11_id_value = - provider->FindStringKey(shill::kL2tpIpsecClientCertIdProperty); + provider->FindStringKey(shill::kL2TPIPsecClientCertIdProperty); if (pkcs11_id_value) *pkcs11_id = *pkcs11_id_value; }
diff --git a/chromeos/network/network_connection_handler_impl.cc b/chromeos/network/network_connection_handler_impl.cc index de7e75b..dc5ab7a 100644 --- a/chromeos/network/network_connection_handler_impl.cc +++ b/chromeos/network/network_connection_handler_impl.cc
@@ -84,7 +84,7 @@ return false; std::string client_cert_id = GetStringFromDictionary( - *provider_properties, shill::kL2tpIpsecClientCertIdProperty); + *provider_properties, shill::kL2TPIPsecClientCertIdProperty); return !client_cert_id.empty(); } case client_cert::ConfigType::kEap: { @@ -124,7 +124,7 @@ NET_LOG(EVENT) << "OpenVPN Is Configured: " << NetworkPathId(service_path); } else { bool passphrase_required = - provider_properties.FindBoolKey(shill::kL2tpIpsecPskRequiredProperty) + provider_properties.FindBoolKey(shill::kL2TPIPsecPskRequiredProperty) .value_or(false); if (passphrase_required) { NET_LOG(ERROR) << "VPN: PSK Required for: " @@ -650,7 +650,7 @@ vpn_provider_host = GetStringFromDictionary(*provider_properties, shill::kHostProperty); vpn_client_cert_id = GetStringFromDictionary( - *provider_properties, shill::kL2tpIpsecClientCertIdProperty); + *provider_properties, shill::kL2TPIPsecClientCertIdProperty); } if (vpn_provider_type.empty() || vpn_provider_host.empty()) { NET_LOG(ERROR) << "VPN Provider missing for: "
diff --git a/chromeos/network/onc/onc_translation_tables.cc b/chromeos/network/onc/onc_translation_tables.cc index a58d67e..30cdfefb 100644 --- a/chromeos/network/onc/onc_translation_tables.cc +++ b/chromeos/network/onc/onc_translation_tables.cc
@@ -46,33 +46,33 @@ // This group of fields are for L2TP/IPsec, see |kIPsecIKEv2Table| for IKEv2. const FieldTranslationEntry ipsec_fields[] = { // This field is converted during translation, see onc_translator_*. - // { ::onc::ipsec::kAuthenticationType, shill::kL2tpIpsecAuthenticationType + // { ::onc::ipsec::kAuthenticationType, shill::kL2TPIPsecAuthenticationType // }, // {::onc::client_cert::kClientCertPKCS11Id, - // shill::kL2tpIpsecClientCertIdProperty}, - {::onc::ipsec::kGroup, shill::kL2tpIpsecTunnelGroupProperty}, + // shill::kL2TPIPsecClientCertIdProperty}, + {::onc::ipsec::kGroup, shill::kL2TPIPsecTunnelGroupProperty}, // Ignored by Shill, not necessary to synchronize. - // { ::onc::ipsec::kIKEVersion, shill::kL2tpIpsecIkeVersion }, - {::onc::ipsec::kPSK, shill::kL2tpIpsecPskProperty}, + // { ::onc::ipsec::kIKEVersion, shill::kL2TPIPsecIkeVersion }, + {::onc::ipsec::kPSK, shill::kL2TPIPsecPskProperty}, // This field is converted during translation, see onc_translator_*. // { ::onc::vpn::kSaveCredentials, shill::kSaveCredentialsProperty}, - {::onc::ipsec::kServerCAPEMs, shill::kL2tpIpsecCaCertPemProperty}, + {::onc::ipsec::kServerCAPEMs, shill::kL2TPIPsecCaCertPemProperty}, {nullptr}}; const FieldTranslationEntry xauth_fields[] = { - {::onc::vpn::kPassword, shill::kL2tpIpsecXauthPasswordProperty}, - {::onc::vpn::kUsername, shill::kL2tpIpsecXauthUserProperty}, + {::onc::vpn::kPassword, shill::kL2TPIPsecXauthPasswordProperty}, + {::onc::vpn::kUsername, shill::kL2TPIPsecXauthUserProperty}, {nullptr}}; const FieldTranslationEntry l2tp_fields[] = { - {::onc::l2tp::kPassword, shill::kL2tpIpsecPasswordProperty}, + {::onc::l2tp::kPassword, shill::kL2TPIPsecPasswordProperty}, // We don't synchronize l2tp's SaveCredentials field for now, as Shill // doesn't support separate settings for ipsec and l2tp. // { ::onc::l2tp::kSaveCredentials, &kBoolSignature }, - {::onc::l2tp::kUsername, shill::kL2tpIpsecUserProperty}, + {::onc::l2tp::kUsername, shill::kL2TPIPsecUserProperty}, // kLcpEchoDisabled is a bool in ONC and a string in Shill. // {::onc::l2tp::kLcpEchoDisabled, - // shill::kL2tpIpsecLcpEchoDisabledProperty}, + // shill::kL2TPIPsecLcpEchoDisabledProperty}, {nullptr}}; const FieldTranslationEntry openvpn_fields[] = {
diff --git a/chromeos/network/onc/onc_translator_onc_to_shill.cc b/chromeos/network/onc/onc_translator_onc_to_shill.cc index 3347ef17..e4fc76d 100644 --- a/chromeos/network/onc/onc_translator_onc_to_shill.cc +++ b/chromeos/network/onc/onc_translator_onc_to_shill.cc
@@ -286,20 +286,20 @@ if (lcp_echo_disabled) { base::Value lcp_echo_disabled_value = ConvertVpnValueToString(*lcp_echo_disabled); - shill_dictionary_->SetKey(shill::kL2tpIpsecLcpEchoDisabledProperty, + shill_dictionary_->SetKey(shill::kL2TPIPsecLcpEchoDisabledProperty, std::move(lcp_echo_disabled_value)); } - // Set shill::kL2tpIpsecUseLoginPasswordProperty according to whether or not + // Set shill::kL2TPIPsecUseLoginPasswordProperty according to whether or not // the password substitution variable is set. const std::string* password = onc_object_->FindStringKey(::onc::l2tp::kPassword); if (password && *password == ::onc::substitutes::kPasswordPlaceholderVerbatim) { - // TODO(b/147658302): shill::kL2tpIpsecUseLoginPasswordProperty is a string + // TODO(b/147658302): shill::kL2TPIPsecUseLoginPasswordProperty is a string // property containing "false" or "true". Migrate it to a bool to match // shill::kEapUseLoginPasswordProperty. - shill_dictionary_->SetKey(shill::kL2tpIpsecUseLoginPasswordProperty, + shill_dictionary_->SetKey(shill::kL2TPIPsecUseLoginPasswordProperty, base::Value("true")); }
diff --git a/chromeos/network/onc/onc_translator_shill_to_onc.cc b/chromeos/network/onc/onc_translator_shill_to_onc.cc index 4f10d87..d6e23db0 100644 --- a/chromeos/network/onc/onc_translator_shill_to_onc.cc +++ b/chromeos/network/onc/onc_translator_shill_to_onc.cc
@@ -337,12 +337,12 @@ } // This is an L2TP/IPsec VPN service. - if (shill_dictionary_->FindKey(shill::kL2tpIpsecXauthUserProperty)) + if (shill_dictionary_->FindKey(shill::kL2TPIPsecXauthUserProperty)) TranslateAndAddNestedObject(::onc::ipsec::kXAUTH); std::string authentication_type; - if (SetPKCS11Id(shill_dictionary_, shill::kL2tpIpsecClientCertIdProperty, - shill::kL2tpIpsecClientCertSlotProperty, &onc_object_)) { + if (SetPKCS11Id(shill_dictionary_, shill::kL2TPIPsecClientCertIdProperty, + shill::kL2TPIPsecClientCertSlotProperty, &onc_object_)) { authentication_type = ::onc::ipsec::kCert; } else { authentication_type = ::onc::ipsec::kPSK; @@ -355,7 +355,7 @@ CopyPropertiesAccordingToSignature(); const base::Value* lcp_echo_disabled = - shill_dictionary_->FindKey(shill::kL2tpIpsecLcpEchoDisabledProperty); + shill_dictionary_->FindKey(shill::kL2TPIPsecLcpEchoDisabledProperty); if (lcp_echo_disabled && lcp_echo_disabled->is_string()) { base::Value lcp_echo_disabled_value = ConvertVpnStringToValue( lcp_echo_disabled->GetString(), base::Value::Type::BOOLEAN); @@ -363,11 +363,11 @@ std::move(lcp_echo_disabled_value)); } - // TODO(b/147658302): shill::kL2tpIpsecUseLoginPasswordProperty is a string + // TODO(b/147658302): shill::kL2TPIPsecUseLoginPasswordProperty is a string // property containing "false" or "true". Migrate it to a bool to match // shill::kEapUseLoginPasswordProperty. const std::string* use_login_password = shill_dictionary_->FindStringKey( - shill::kL2tpIpsecUseLoginPasswordProperty); + shill::kL2TPIPsecUseLoginPasswordProperty); if (use_login_password && *use_login_password == "true") { onc_object_.SetKey( ::onc::l2tp::kPassword,
diff --git a/chromeos/network/shill_property_util.cc b/chromeos/network/shill_property_util.cc index 2437e5e2..66c18c0 100644 --- a/chromeos/network/shill_property_util.cc +++ b/chromeos/network/shill_property_util.cc
@@ -386,10 +386,10 @@ s_skip_properties->insert(shill::kEapCaCertProperty); s_skip_properties->insert(shill::kEapPasswordProperty); s_skip_properties->insert(shill::kEapPinProperty); - s_skip_properties->insert(shill::kL2tpIpsecCaCertPemProperty); - s_skip_properties->insert(shill::kL2tpIpsecPasswordProperty); - s_skip_properties->insert(shill::kL2tpIpsecPinProperty); - s_skip_properties->insert(shill::kL2tpIpsecPskProperty); + s_skip_properties->insert(shill::kL2TPIPsecCaCertPemProperty); + s_skip_properties->insert(shill::kL2TPIPsecPasswordProperty); + s_skip_properties->insert(shill::kL2TPIPsecPinProperty); + s_skip_properties->insert(shill::kL2TPIPsecPskProperty); s_skip_properties->insert(shill::kOpenVPNAuthUserPassProperty); s_skip_properties->insert(shill::kOpenVPNCaCertPemProperty); s_skip_properties->insert(shill::kOpenVPNExtraCertPemProperty);
diff --git a/chromeos/profiles/atom.afdo.newest.txt b/chromeos/profiles/atom.afdo.newest.txt index 0b2ae8c..afe09940 100644 --- a/chromeos/profiles/atom.afdo.newest.txt +++ b/chromeos/profiles/atom.afdo.newest.txt
@@ -1 +1 @@ -chromeos-chrome-amd64-atom-101-4918.0-1646651687-benchmark-101.0.4930.0-r1-redacted.afdo.xz +chromeos-chrome-amd64-atom-101-4918.0-1646651687-benchmark-101.0.4932.0-r1-redacted.afdo.xz
diff --git a/chromeos/profiles/bigcore.afdo.newest.txt b/chromeos/profiles/bigcore.afdo.newest.txt index 6ddf64b..ca79bf1 100644 --- a/chromeos/profiles/bigcore.afdo.newest.txt +++ b/chromeos/profiles/bigcore.afdo.newest.txt
@@ -1 +1 @@ -chromeos-chrome-amd64-bigcore-101-4896.16-1646649426-benchmark-101.0.4930.0-r1-redacted.afdo.xz +chromeos-chrome-amd64-bigcore-101-4896.16-1646649426-benchmark-101.0.4932.0-r1-redacted.afdo.xz
diff --git a/components/autofill_assistant/android/BUILD.gn b/components/autofill_assistant/android/BUILD.gn index 6cc200b..3cfdd4e 100644 --- a/components/autofill_assistant/android/BUILD.gn +++ b/components/autofill_assistant/android/BUILD.gn
@@ -310,8 +310,8 @@ ] sources = [ - "internal/java/src/org/chromium/chrome/browser/autofill_assistant/user_data/GmsIntegrator.java", "java/src/org/chromium/components/autofill_assistant/header/AnimatedPoodle.java", + "java/src/org/chromium/components/autofill_assistant/user_data/GmsIntegrator.java", ] # Add the actual implementation where necessary so that downstream targets @@ -335,8 +335,8 @@ ] sources = [ - "internal/java/src/org/chromium/chrome/browser/autofill_assistant/user_data/GmsIntegrator.java", "java/src/org/chromium/components/autofill_assistant/header/AnimatedPoodle.java", + "java/src/org/chromium/components/autofill_assistant/user_data/GmsIntegrator.java", ] }
diff --git a/components/autofill_assistant/android/java/src/org/chromium/components/autofill_assistant/AutofillAssistantClient.java b/components/autofill_assistant/android/java/src/org/chromium/components/autofill_assistant/AutofillAssistantClient.java index 67b97de0..4d1c4f7 100644 --- a/components/autofill_assistant/android/java/src/org/chromium/components/autofill_assistant/AutofillAssistantClient.java +++ b/components/autofill_assistant/android/java/src/org/chromium/components/autofill_assistant/AutofillAssistantClient.java
@@ -16,8 +16,8 @@ import org.chromium.base.annotations.CalledByNative; import org.chromium.base.annotations.JNINamespace; import org.chromium.base.annotations.NativeMethods; -import org.chromium.chrome.browser.autofill_assistant.user_data.GmsIntegrator; import org.chromium.components.autofill_assistant.overlay.AssistantOverlayCoordinator; +import org.chromium.components.autofill_assistant.user_data.GmsIntegrator; import org.chromium.components.signin.AccessTokenData; import org.chromium.components.signin.AccountManagerFacadeProvider; import org.chromium.components.signin.identitymanager.IdentityManager;
diff --git a/components/autofill_assistant/android/internal/java/src/org/chromium/chrome/browser/autofill_assistant/user_data/GmsIntegrator.java b/components/autofill_assistant/android/java/src/org/chromium/components/autofill_assistant/user_data/GmsIntegrator.java similarity index 94% rename from components/autofill_assistant/android/internal/java/src/org/chromium/chrome/browser/autofill_assistant/user_data/GmsIntegrator.java rename to components/autofill_assistant/android/java/src/org/chromium/components/autofill_assistant/user_data/GmsIntegrator.java index 0809d90..be3d43a 100644 --- a/components/autofill_assistant/android/internal/java/src/org/chromium/chrome/browser/autofill_assistant/user_data/GmsIntegrator.java +++ b/components/autofill_assistant/android/java/src/org/chromium/components/autofill_assistant/user_data/GmsIntegrator.java
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -package org.chromium.chrome.browser.autofill_assistant.user_data; +package org.chromium.components.autofill_assistant.user_data; import android.app.Activity;
diff --git a/components/autofill_assistant/android/public/java/src/org/chromium/components/autofill_assistant/AssistantAddressEditorGms.java b/components/autofill_assistant/android/public/java/src/org/chromium/components/autofill_assistant/AssistantAddressEditorGms.java index c808d03b..4f054727 100644 --- a/components/autofill_assistant/android/public/java/src/org/chromium/components/autofill_assistant/AssistantAddressEditorGms.java +++ b/components/autofill_assistant/android/public/java/src/org/chromium/components/autofill_assistant/AssistantAddressEditorGms.java
@@ -7,9 +7,9 @@ import android.app.Activity; import org.chromium.base.Callback; -import org.chromium.chrome.browser.autofill_assistant.user_data.GmsIntegrator; import org.chromium.components.autofill_assistant.AssistantEditor.AssistantAddressEditor; import org.chromium.components.autofill_assistant.AssistantOptionModel.AddressModel; +import org.chromium.components.autofill_assistant.user_data.GmsIntegrator; import org.chromium.ui.base.WindowAndroid; /**
diff --git a/components/autofill_assistant/android/public/java/src/org/chromium/components/autofill_assistant/AssistantContactEditorAccount.java b/components/autofill_assistant/android/public/java/src/org/chromium/components/autofill_assistant/AssistantContactEditorAccount.java index 2d9ee27..a80151d 100644 --- a/components/autofill_assistant/android/public/java/src/org/chromium/components/autofill_assistant/AssistantContactEditorAccount.java +++ b/components/autofill_assistant/android/public/java/src/org/chromium/components/autofill_assistant/AssistantContactEditorAccount.java
@@ -9,9 +9,9 @@ import androidx.annotation.Nullable; import org.chromium.base.Callback; -import org.chromium.chrome.browser.autofill_assistant.user_data.GmsIntegrator; import org.chromium.components.autofill_assistant.AssistantEditor.AssistantContactEditor; import org.chromium.components.autofill_assistant.AssistantOptionModel.ContactModel; +import org.chromium.components.autofill_assistant.user_data.GmsIntegrator; import org.chromium.ui.base.WindowAndroid; /**
diff --git a/components/autofill_assistant/android/public/java/src/org/chromium/components/autofill_assistant/AssistantPaymentInstrumentEditorGms.java b/components/autofill_assistant/android/public/java/src/org/chromium/components/autofill_assistant/AssistantPaymentInstrumentEditorGms.java index 326f4f53..c271c563 100644 --- a/components/autofill_assistant/android/public/java/src/org/chromium/components/autofill_assistant/AssistantPaymentInstrumentEditorGms.java +++ b/components/autofill_assistant/android/public/java/src/org/chromium/components/autofill_assistant/AssistantPaymentInstrumentEditorGms.java
@@ -7,9 +7,9 @@ import android.app.Activity; import org.chromium.base.Callback; -import org.chromium.chrome.browser.autofill_assistant.user_data.GmsIntegrator; import org.chromium.components.autofill_assistant.AssistantEditor.AssistantPaymentInstrumentEditor; import org.chromium.components.autofill_assistant.AssistantOptionModel.PaymentInstrumentModel; +import org.chromium.components.autofill_assistant.user_data.GmsIntegrator; import org.chromium.ui.base.WindowAndroid; /**
diff --git a/components/browser_ui/styles/android/BUILD.gn b/components/browser_ui/styles/android/BUILD.gn index 2963e0a..af80ce5 100644 --- a/components/browser_ui/styles/android/BUILD.gn +++ b/components/browser_ui/styles/android/BUILD.gn
@@ -43,6 +43,7 @@ "java/res/color/default_text_color_list.xml", "java/res/color/default_text_color_on_accent1_list.xml", "java/res/color/default_text_color_secondary_list.xml", + "java/res/color/filled_button_bg_dynamic.xml", "java/res/color/icon_animated_faded_color.xml", "java/res/color/new_tab_button_pressed_tint.xml", "java/res/color/new_tab_button_tint.xml",
diff --git a/components/browser_ui/styles/android/java/res/color/default_text_color_link_tint_list.xml b/components/browser_ui/styles/android/java/res/color/default_text_color_link_tint_list.xml index 2e558e88..43cc206 100644 --- a/components/browser_ui/styles/android/java/res/color/default_text_color_link_tint_list.xml +++ b/components/browser_ui/styles/android/java/res/color/default_text_color_link_tint_list.xml
@@ -6,5 +6,5 @@ <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:alpha="@dimen/default_disabled_alpha" android:color="@macro/default_text_color" android:state_enabled="false" /> - <item android:color="@macro/default_text_color_link"/> + <item android:color="?attr/globalLinkTextColor"/> </selector>
diff --git a/components/browser_ui/styles/android/java/res/color/filled_button_bg_dynamic.xml b/components/browser_ui/styles/android/java/res/color/filled_button_bg_dynamic.xml new file mode 100644 index 0000000..7925206 --- /dev/null +++ b/components/browser_ui/styles/android/java/res/color/filled_button_bg_dynamic.xml
@@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:alpha="@dimen/filled_button_bg_disabled_alpha" android:color="?attr/colorOnSurface" + android:state_enabled="false" /> + <item android:color="?attr/colorPrimary"/> +</selector>
diff --git a/components/browser_ui/styles/android/java/res/values/dimens.xml b/components/browser_ui/styles/android/java/res/values/dimens.xml index a409eb5..cf18180 100644 --- a/components/browser_ui/styles/android/java/res/values/dimens.xml +++ b/components/browser_ui/styles/android/java/res/values/dimens.xml
@@ -24,6 +24,7 @@ <item name="progress_bar_bg_alpha" format="float" type="dimen">0.2</item> <item name="switch_track_disabled_alpha" format="float" type="dimen">0.12</item> <item name="switch_track_enabled_alpha" format="float" type="dimen">0.3</item> + <item name="filled_button_bg_disabled_alpha" format="float" type="dimen">0.12</item> <!-- Surface color elevations --> <dimen name="dialog_bg_color_elev">@dimen/default_elevation_0</dimen>
diff --git a/components/browser_ui/styles/android/java/res/values/styles.xml b/components/browser_ui/styles/android/java/res/values/styles.xml index 2e855f5..cfa567d 100644 --- a/components/browser_ui/styles/android/java/res/values/styles.xml +++ b/components/browser_ui/styles/android/java/res/values/styles.xml
@@ -145,6 +145,12 @@ <item name="android:background">@macro/default_bg_color</item> </style> + <style name="TextButton.OnAccent1" tools:ignore="UnusedResources"> + <item name="android:textAppearance">@style/TextAppearance.Button.OnAccent1</item> + <item name="buttonTextColor">@color/default_text_color_on_accent1_list</item> + <item name="rippleColor">@color/filled_button_ripple_color</item> + </style> + <!-- Text styles --> <!-- Primary text styles --> <style name="TextAppearance.Headline.Primary"> @@ -225,6 +231,7 @@ <style name="TextAppearance.TextSmall.Primary.OnAccent1" tools:ignore="UnusedResources"> <item name="android:textColor">@color/default_text_color_on_accent1_list</item> </style> + <style name="TextAppearance.Button.OnAccent1" parent="TextAppearance.TextMediumThick.Primary.OnAccent1"/> <!-- Chip Text Styles --> <style name="TextAppearance.ChipText" parent="TextAppearance.TextAccentMediumThick">
diff --git a/components/browser_ui/styles/android/java/res/values/themes.xml b/components/browser_ui/styles/android/java/res/values/themes.xml index 4428826..19762889 100644 --- a/components/browser_ui/styles/android/java/res/values/themes.xml +++ b/components/browser_ui/styles/android/java/res/values/themes.xml
@@ -51,6 +51,14 @@ <!-- Supports dynamic colors now. --> <item name="default_bg_color_dynamic">?attr/colorSurface</item> <item name="divider_line_bg_color_dynamic">?attr/colorSurfaceVariant</item> + + <!-- Baseline values for the theme attributes in ThemeOverlay.DynamicButtons, used to + prevent crashes when the DynamicColorCTAAndroid flag is disabled. --> + <item name="globalFilledButtonBgColor">@color/filled_button_bg</item> + <item name="globalFilledButtonTextColor">@color/default_text_color_on_accent1_baseline_list</item> + <item name="globalTextButtonTextColor">@color/blue_when_enabled</item> + <item name="globalLinkTextColor">@color/default_text_color_link_baseline</item> + <item name="globalClickableSpanColor">@color/default_text_color_blue_baseline</item> </style> <style name="Base.V31.Theme.BrowserUI" parent="Base.V21.Theme.BrowserUI" /> <style name="Base.Theme.BrowserUI" parent="Base.V31.Theme.BrowserUI" /> @@ -135,6 +143,14 @@ <!-- Supports dynamic colors now. --> <item name="default_bg_color_dynamic">?attr/colorSurface</item> <item name="divider_line_bg_color_dynamic">?attr/colorSurfaceVariant</item> + + <!-- Baseline values for the theme attributes in ThemeOverlay.DynamicButtons, used to + prevent crashes when the DynamicColorCTAAndroid flag is disabled. --> + <item name="globalFilledButtonBgColor">@color/filled_button_bg</item> + <item name="globalFilledButtonTextColor">@color/default_text_color_on_accent1_baseline_list</item> + <item name="globalTextButtonTextColor">@color/blue_when_enabled</item> + <item name="globalLinkTextColor">@color/default_text_color_link_baseline</item> + <item name="globalClickableSpanColor">@color/default_text_color_blue_baseline</item> </style> <!-- Overridden by night mode. --> <style name="Theme.BrowserUI.DialogWhenLarge.DayNight" parent="Theme.BrowserUI.DialogWhenLarge"/> @@ -204,4 +220,11 @@ color state list. --> <item name="android:textColorHint">@color/default_text_color_hint_list</item> </style> + <style name="ThemeOverlay.DynamicButtons" parent=""> + <item name="globalFilledButtonBgColor">@color/filled_button_bg_dynamic</item> + <item name="globalFilledButtonTextColor">@color/default_text_color_on_accent1_list</item> + <item name="globalTextButtonTextColor">@color/default_text_color_accent1_tint_list</item> + <item name="globalLinkTextColor">?attr/colorPrimary</item> + <item name="globalClickableSpanColor">?attr/colorPrimary</item> + </style> </resources>
diff --git a/components/browser_ui/styles/android/java/src/org/chromium/components/browser_ui/styles/SemanticColorUtils.java b/components/browser_ui/styles/android/java/src/org/chromium/components/browser_ui/styles/SemanticColorUtils.java index 5e9a040..8f5945a 100644 --- a/components/browser_ui/styles/android/java/src/org/chromium/components/browser_ui/styles/SemanticColorUtils.java +++ b/components/browser_ui/styles/android/java/src/org/chromium/components/browser_ui/styles/SemanticColorUtils.java
@@ -151,6 +151,7 @@ // Colors that will be experimented with. This is independent of |IS_FULL_DYNAMIC_COLORS|. /** Returns the semantic color value that corresponds to default_text_color_link. */ public static @ColorInt int getDefaultTextColorLink(Context context) { - return context.getColor(R.color.default_text_color_link_baseline); + final @ColorInt int fallback = context.getColor(R.color.default_text_color_link_baseline); + return MaterialColors.getColor(context, R.attr.globalLinkTextColor, fallback); } }
diff --git a/components/browser_ui/widget/android/java/res/layout/textbubble_text.xml b/components/browser_ui/widget/android/java/res/layout/textbubble_text.xml index e3da969..1cd7a6bd 100644 --- a/components/browser_ui/widget/android/java/res/layout/textbubble_text.xml +++ b/components/browser_ui/widget/android/java/res/layout/textbubble_text.xml
@@ -28,7 +28,7 @@ android:clickable="true" android:visibility="gone" android:text="@string/iph_snooze" - style="@style/TextButton.Inverse.Snooze" /> + style="@style/TextButton.OnAccent1.Snooze" /> <org.chromium.ui.widget.ButtonCompat android:id="@+id/button_dismiss" @@ -38,6 +38,6 @@ android:clickable="true" android:visibility="gone" android:text="@string/got_it" - style="@style/TextButton.Inverse.Snooze" /> + style="@style/TextButton.OnAccent1.Snooze" /> </LinearLayout>
diff --git a/components/browser_ui/widget/android/java/res/values/styles.xml b/components/browser_ui/widget/android/java/res/values/styles.xml index 75a7db2..173ffb9 100644 --- a/components/browser_ui/widget/android/java/res/values/styles.xml +++ b/components/browser_ui/widget/android/java/res/values/styles.xml
@@ -145,7 +145,7 @@ </style> <!-- Snooze button --> - <style name="TextButton.Inverse.Snooze"> + <style name="TextButton.OnAccent1.Snooze"> <item name="android:paddingStart">@dimen/text_bubble_with_snooze_padding_horizontal</item> <item name="android:paddingEnd">@dimen/text_bubble_with_snooze_padding_horizontal</item> <item name="android:paddingTop">10dp</item>
diff --git a/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/DualControlLayout.java b/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/DualControlLayout.java index e0d53128..d8529182 100644 --- a/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/DualControlLayout.java +++ b/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/DualControlLayout.java
@@ -15,7 +15,6 @@ import androidx.annotation.IntDef; -import org.chromium.base.ApiCompatibilityUtils; import org.chromium.ui.widget.ButtonCompat; import java.lang.annotation.Retention; @@ -76,8 +75,6 @@ secondaryButton.setId(R.id.button_secondary); secondaryButton.setOnClickListener(listener); secondaryButton.setText(text); - ApiCompatibilityUtils.setTextAppearance( - secondaryButton, R.style.TextAppearance_Button_Text_Blue); return secondaryButton; } }
diff --git a/components/crash/core/app/crashpad_linux.cc b/components/crash/core/app/crashpad_linux.cc index dc2b18b3..32e2038 100644 --- a/components/crash/core/app/crashpad_linux.cc +++ b/components/crash/core/app/crashpad_linux.cc
@@ -68,16 +68,6 @@ return crashpad::CrashpadClient::GetHandlerSocket(fd, pid); } -void SetPtracerAtFork() { - pid_t pid; - if (!GetHandlerSocket(nullptr, &pid)) { - return; - } - if (pid > 0 && prctl(PR_SET_PTRACER, pid, 0, 0, 0) != 0) { - PLOG(ERROR) << "prctl"; - } -} - namespace internal { bool PlatformCrashpadInitialization( @@ -226,8 +216,6 @@ *database_path = base::FilePath(); } - pthread_atfork(nullptr, nullptr, SetPtracerAtFork); - if (crash_reporter_client->GetShouldDumpLargerDumps()) { const uint32_t kIndirectMemoryLimit = 4 * 1024 * 1024; crashpad::CrashpadInfo::GetCrashpadInfo()
diff --git a/components/data_reduction_proxy/OWNERS b/components/data_reduction_proxy/OWNERS index af7c4fd6..c5f65ed 100644 --- a/components/data_reduction_proxy/OWNERS +++ b/components/data_reduction_proxy/OWNERS
@@ -1,10 +1,8 @@ -# Primary -tbansal@chromium.org -mcrouse@chromium.org -rajendrant@chromium.org -robertogden@chromium.org -ryansturm@chromium.org -sophiechang@chromium.org +curranmax@chromium.org # Primary +ryansturm@chromium.org # Primary +spelchat@chromium.org # Primary + +tbansal@chromium.org # Secondary per-file *_messages.cc=set noparent per-file *_messages.cc=file://ipc/SECURITY_OWNERS
diff --git a/components/exo/wayland/zcr_remote_shell_impl.cc b/components/exo/wayland/zcr_remote_shell_impl.cc index 2283c6b..ae1f21f 100644 --- a/components/exo/wayland/zcr_remote_shell_impl.cc +++ b/components/exo/wayland/zcr_remote_shell_impl.cc
@@ -434,6 +434,7 @@ WMHelperChromeOS* helper = WMHelperChromeOS::GetInstance(); helper->AddTabletModeObserver(this); helper->AddFrameThrottlingObserver(); + helper->SetDefaultScaleCancellation(use_default_scale_cancellation_); layout_mode_ = helper->InTabletMode() ? ZCR_REMOTE_SHELL_V1_LAYOUT_MODE_TABLET
diff --git a/components/feed/feed_feature_list.cc b/components/feed/feed_feature_list.cc index 9cb07ca..58cb216 100644 --- a/components/feed/feed_feature_list.cc +++ b/components/feed/feed_feature_list.cc
@@ -79,6 +79,9 @@ const char kDefaultReferrerUrl[] = "https://www.google.com/"; +const base::Feature kWebFeedOnboarding{"WebFeedOnboarding", + base::FEATURE_DISABLED_BY_DEFAULT}; + const base::Feature kWebFeedSort{"WebFeedSort", base::FEATURE_DISABLED_BY_DEFAULT};
diff --git a/components/feed/feed_feature_list.h b/components/feed/feed_feature_list.h index 0447c73..b63021b 100644 --- a/components/feed/feed_feature_list.h +++ b/components/feed/feed_feature_list.h
@@ -85,6 +85,10 @@ // Feature that enables StAMP cards in the feed. extern const base::Feature kFeedStamp; +// Feature that provides the user assistance in discovering and using the web +// feed. +extern const base::Feature kWebFeedOnboarding; + // Feature that enables sorting by different heuristics in the web feed. extern const base::Feature kWebFeedSort;
diff --git a/components/global_media_controls/public/views/media_item_ui_view.cc b/components/global_media_controls/public/views/media_item_ui_view.cc index 186ab34..89f7352 100644 --- a/components/global_media_controls/public/views/media_item_ui_view.cc +++ b/components/global_media_controls/public/views/media_item_ui_view.cc
@@ -137,7 +137,7 @@ view = std::make_unique<media_message_center::MediaNotificationViewModernImpl>( this, std::move(item), std::move(dismiss_button_placeholder), - std::move(footer_view), kModernUIWidth); + std::move(footer_view), kModernUIWidth, theme); SetPreferredSize(kModernUISize); } else { view = std::make_unique<media_message_center::MediaNotificationViewImpl>(
diff --git a/components/guest_view/common/guest_view.mojom b/components/guest_view/common/guest_view.mojom index 8929e45..cf98794c 100644 --- a/components/guest_view/common/guest_view.mojom +++ b/components/guest_view/common/guest_view.mojom
@@ -18,7 +18,7 @@ int32 embedder_local_frame_routing_id, int32 element_instance_id, int32 guest_instance_id, - mojo_base.mojom.DictionaryValue params) => (); + mojo_base.mojom.DeprecatedDictionaryValue params) => (); // Sent by the renderer when a GuestView (identified by |view_instance_id|) // has been created in JavaScript.
diff --git a/components/history_clusters/core/on_device_clustering_features.cc b/components/history_clusters/core/on_device_clustering_features.cc index d99cea6d..0982d11 100644 --- a/components/history_clusters/core/on_device_clustering_features.cc +++ b/components/history_clusters/core/on_device_clustering_features.cc
@@ -18,7 +18,7 @@ base::FEATURE_ENABLED_BY_DEFAULT}; const base::Feature kUseEngagementScoreCache{"JourneysUseEngagementScoreCache", - base::FEATURE_DISABLED_BY_DEFAULT}; + base::FEATURE_ENABLED_BY_DEFAULT}; const base::Feature kSplitClusteringTasksToSmallerBatches{ "JourneysSplitClusteringTasksToSmallerBatches",
diff --git a/components/media_message_center/BUILD.gn b/components/media_message_center/BUILD.gn index 9389449..0fe31aa 100644 --- a/components/media_message_center/BUILD.gn +++ b/components/media_message_center/BUILD.gn
@@ -25,6 +25,7 @@ "media_notification_view_modern_impl.h", "media_notification_volume_slider_view.cc", "media_notification_volume_slider_view.h", + "notification_theme.h", ] defines = [ "IS_MEDIA_MESSAGE_CENTER_IMPL" ]
diff --git a/components/media_message_center/DEPS b/components/media_message_center/DEPS index 2386fdf..2470b04 100644 --- a/components/media_message_center/DEPS +++ b/components/media_message_center/DEPS
@@ -5,5 +5,6 @@ "+mojo/public/cpp/bindings", "+services/media_session/public", "+skia/ext", + "+third_party/skia/include/core", "+ui", ]
diff --git a/components/media_message_center/media_notification_background_ash_impl.cc b/components/media_message_center/media_notification_background_ash_impl.cc index 2142b4f5..1c7929b 100644 --- a/components/media_message_center/media_notification_background_ash_impl.cc +++ b/components/media_message_center/media_notification_background_ash_impl.cc
@@ -39,6 +39,10 @@ } // namespace +MediaNotificationBackgroundAshImpl::MediaNotificationBackgroundAshImpl( + bool paint_artwork) + : paint_artwork_(paint_artwork) {} + gfx::Rect MediaNotificationBackgroundAshImpl::GetArtworkBounds( const gfx::Rect& view_bounds) const { gfx::Size target_size = ScaleToFitSize(artwork_.size()); @@ -73,6 +77,9 @@ void MediaNotificationBackgroundAshImpl::Paint(gfx::Canvas* canvas, views::View* view) const { + if (!paint_artwork_) + return; + gfx::Rect source_bounds(0, 0, artwork_.width(), artwork_.height()); gfx::Rect target_bounds = GetArtworkBounds(view->GetContentsBounds());
diff --git a/components/media_message_center/media_notification_background_ash_impl.h b/components/media_message_center/media_notification_background_ash_impl.h index 217885d..5d612f9 100644 --- a/components/media_message_center/media_notification_background_ash_impl.h +++ b/components/media_message_center/media_notification_background_ash_impl.h
@@ -20,7 +20,7 @@ class COMPONENT_EXPORT(MEDIA_MESSAGE_CENTER) MediaNotificationBackgroundAshImpl : public MediaNotificationBackground { public: - MediaNotificationBackgroundAshImpl() = default; + explicit MediaNotificationBackgroundAshImpl(bool paint_artwork = true); MediaNotificationBackgroundAshImpl( const MediaNotificationBackgroundAshImpl&) = delete; MediaNotificationBackgroundAshImpl& operator=( @@ -45,6 +45,9 @@ SkPath GetArtworkClipPath(const gfx::Rect& view_bounds) const; gfx::ImageSkia artwork_; + + // True if this should paint the artwork as part of the background. + bool paint_artwork_; }; } // namespace media_message_center
diff --git a/components/media_message_center/media_notification_view_impl.cc b/components/media_message_center/media_notification_view_impl.cc index 02bd427..492e9a2 100644 --- a/components/media_message_center/media_notification_view_impl.cc +++ b/components/media_message_center/media_notification_view_impl.cc
@@ -11,6 +11,7 @@ #include "components/media_message_center/media_notification_container.h" #include "components/media_message_center/media_notification_item.h" #include "components/media_message_center/media_notification_util.h" +#include "components/media_message_center/notification_theme.h" #include "components/media_message_center/vector_icons/vector_icons.h" #include "components/strings/grit/components_strings.h" #include "services/media_session/public/mojom/media_session.mojom.h"
diff --git a/components/media_message_center/media_notification_view_impl.h b/components/media_message_center/media_notification_view_impl.h index 0c2d1d7..af1ca9b7 100644 --- a/components/media_message_center/media_notification_view_impl.h +++ b/components/media_message_center/media_notification_view_impl.h
@@ -9,6 +9,7 @@ #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "components/media_message_center/media_notification_view.h" +#include "components/media_message_center/notification_theme.h" #include "services/media_session/public/mojom/media_session.mojom.h" #include "third_party/abseil-cpp/absl/types/optional.h" #include "ui/base/metadata/metadata_header_macros.h" @@ -31,14 +32,6 @@ class MediaNotificationContainer; class MediaNotificationItem; -struct COMPONENT_EXPORT(MEDIA_MESSAGE_CENTER) NotificationTheme { - SkColor primary_text_color = 0; - SkColor secondary_text_color = 0; - SkColor enabled_icon_color = 0; - SkColor disabled_icon_color = 0; - SkColor separator_color = 0; -}; - class COMPONENT_EXPORT(MEDIA_MESSAGE_CENTER) MediaNotificationViewImpl : public MediaNotificationView { public:
diff --git a/components/media_message_center/media_notification_view_modern_impl.cc b/components/media_message_center/media_notification_view_modern_impl.cc index 0b025f29..b891330 100644 --- a/components/media_message_center/media_notification_view_modern_impl.cc +++ b/components/media_message_center/media_notification_view_modern_impl.cc
@@ -9,11 +9,13 @@ #include "base/ranges/algorithm.h" #include "components/media_message_center/media_artwork_view.h" #include "components/media_message_center/media_controls_progress_view.h" +#include "components/media_message_center/media_notification_background_ash_impl.h" #include "components/media_message_center/media_notification_background_impl.h" #include "components/media_message_center/media_notification_container.h" #include "components/media_message_center/media_notification_item.h" #include "components/media_message_center/media_notification_util.h" #include "components/media_message_center/media_notification_volume_slider_view.h" +#include "components/media_message_center/notification_theme.h" #include "components/media_message_center/vector_icons/vector_icons.h" #include "components/strings/grit/components_strings.h" #include "components/vector_icons/vector_icons.h" @@ -226,8 +228,9 @@ base::WeakPtr<MediaNotificationItem> item, std::unique_ptr<views::View> notification_controls_view, std::unique_ptr<views::View> notification_footer_view, - int notification_width) - : container_(container), item_(std::move(item)) { + int notification_width, + absl::optional<NotificationTheme> theme) + : container_(container), item_(std::move(item)), theme_(theme) { DCHECK(container_); DCHECK(notification_controls_view); @@ -244,9 +247,20 @@ SetLayoutManager(std::make_unique<views::BoxLayout>( views::BoxLayout::Orientation::kVertical, gfx::Insets(), 0)); - SetBackground(std::make_unique<MediaNotificationBackgroundImpl>( - message_center::kNotificationCornerRadius, - message_center::kNotificationCornerRadius, 0)); + bool is_cros = theme_.has_value(); + if (is_cros) { + // We don't want the background to paint the artwork since we're painting it + // ourselves. + SetBackground(std::make_unique<MediaNotificationBackgroundAshImpl>( + /*paint_artwork=*/false)); + } else { + // Force the artwork width to be zero since we're painting the artwork + // ourselves. + SetBackground(std::make_unique<MediaNotificationBackgroundImpl>( + message_center::kNotificationCornerRadius, + message_center::kNotificationCornerRadius, + /*artwork_max_width_pct=*/0)); + } UpdateCornerRadius(message_center::kNotificationCornerRadius, message_center::kNotificationCornerRadius); @@ -683,38 +697,50 @@ const SkColor disabled_icon_color = SkColorSetA(foreground, gfx::kDisabledControlAlpha); - artwork_->SetBackgroundColor(disabled_icon_color); + NotificationTheme theme; + if (theme_.has_value()) { + theme = *theme_; + } else { + theme.primary_text_color = foreground; + theme.secondary_text_color = foreground; + theme.enabled_icon_color = foreground; + theme.disabled_icon_color = disabled_icon_color; + theme.separator_color = SkColorSetA(foreground, 0x1F); + } + + artwork_->SetBackgroundColor(theme.disabled_icon_color); artwork_->SetVignetteColor(background); - progress_->SetForegroundColor(foreground); - progress_->SetBackgroundColor(disabled_icon_color); - progress_->SetTextColor(foreground); + progress_->SetForegroundColor(theme.primary_text_color); + progress_->SetBackgroundColor(theme.disabled_icon_color); + progress_->SetTextColor(theme.primary_text_color); if (volume_slider_) - volume_slider_->UpdateColor(foreground, disabled_icon_color); + volume_slider_->UpdateColor(theme.primary_text_color, + theme.disabled_icon_color); if (mute_button_) { - views::SetImageFromVectorIconWithColor(mute_button_, - vector_icons::kVolumeUpIcon, - kMuteButtonIconSize, foreground); + views::SetImageFromVectorIconWithColor( + mute_button_, vector_icons::kVolumeUpIcon, kMuteButtonIconSize, + theme.enabled_icon_color); views::SetToggledImageFromVectorIconWithColor( mute_button_, vector_icons::kVolumeOffIcon, kMediaButtonIconSize, - foreground, disabled_icon_color); + theme.enabled_icon_color, theme.disabled_icon_color); } // Update the colors for the labels - title_label_->SetEnabledColor(foreground); - subtitle_label_->SetEnabledColor(disabled_icon_color); + title_label_->SetEnabledColor(theme.primary_text_color); + subtitle_label_->SetEnabledColor(theme.secondary_text_color); title_label_->SetBackgroundColor(background); subtitle_label_->SetBackgroundColor(background); // Update the colors for the toggle buttons (play/pause and // picture-in-picture) - play_pause_button_->SetButtonColor(foreground); + play_pause_button_->SetButtonColor(theme.enabled_icon_color); if (picture_in_picture_button_) - picture_in_picture_button_->SetButtonColor(foreground); + picture_in_picture_button_->SetButtonColor(theme.enabled_icon_color); // Update the colors for the media control buttons. for (views::View* child : media_controls_container_->children()) { @@ -724,11 +750,11 @@ MediaButton* button = static_cast<MediaButton*>(child); - button->SetButtonColor(foreground); + button->SetButtonColor(theme.enabled_icon_color); } SchedulePaint(); - container_->OnColorsChanged(foreground, background); + container_->OnColorsChanged(theme.enabled_icon_color, background); } void MediaNotificationViewModernImpl::ButtonPressed(views::Button* button) {
diff --git a/components/media_message_center/media_notification_view_modern_impl.h b/components/media_message_center/media_notification_view_modern_impl.h index 91dfb5784..0313a33 100644 --- a/components/media_message_center/media_notification_view_modern_impl.h +++ b/components/media_message_center/media_notification_view_modern_impl.h
@@ -11,7 +11,9 @@ #include "base/component_export.h" #include "base/memory/weak_ptr.h" #include "components/media_message_center/media_notification_view.h" +#include "components/media_message_center/notification_theme.h" #include "services/media_session/public/mojom/media_session.mojom.h" +#include "third_party/abseil-cpp/absl/types/optional.h" #include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/button/image_button.h" #include "ui/views/controls/image_view.h" @@ -64,7 +66,8 @@ base::WeakPtr<MediaNotificationItem> item, std::unique_ptr<views::View> notification_controls_view, std::unique_ptr<views::View> notification_footer_view, - int notification_width); + int notification_width, + absl::optional<NotificationTheme> theme = absl::nullopt); MediaNotificationViewModernImpl(const MediaNotificationViewModernImpl&) = delete; MediaNotificationViewModernImpl& operator=( @@ -164,6 +167,8 @@ raw_ptr<MediaControlsProgressView> progress_ = nullptr; raw_ptr<views::ToggleImageButton> mute_button_ = nullptr; raw_ptr<MediaNotificationVolumeSliderView> volume_slider_ = nullptr; + + absl::optional<NotificationTheme> theme_; }; } // namespace media_message_center
diff --git a/components/media_message_center/notification_theme.h b/components/media_message_center/notification_theme.h new file mode 100644 index 0000000..b84e68d --- /dev/null +++ b/components/media_message_center/notification_theme.h
@@ -0,0 +1,23 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_MEDIA_MESSAGE_CENTER_NOTIFICATION_THEME_H_ +#define COMPONENTS_MEDIA_MESSAGE_CENTER_NOTIFICATION_THEME_H_ + +#include "base/component_export.h" +#include "third_party/skia/include/core/SkColor.h" + +namespace media_message_center { + +struct COMPONENT_EXPORT(MEDIA_MESSAGE_CENTER) NotificationTheme { + SkColor primary_text_color = 0; + SkColor secondary_text_color = 0; + SkColor enabled_icon_color = 0; + SkColor disabled_icon_color = 0; + SkColor separator_color = 0; +}; + +} // namespace media_message_center + +#endif // COMPONENTS_MEDIA_MESSAGE_CENTER_NOTIFICATION_THEME_H_
diff --git a/components/nacl/browser/pnacl_translation_cache.cc b/components/nacl/browser/pnacl_translation_cache.cc index 5b44739..0016e73 100644 --- a/components/nacl/browser/pnacl_translation_cache.cc +++ b/components/nacl/browser/pnacl_translation_cache.cc
@@ -341,8 +341,9 @@ int cache_size, CompletionOnceCallback callback) { int rv = disk_cache::CreateCacheBackend( - cache_type, net::CACHE_BACKEND_DEFAULT, cache_dir, cache_size, - disk_cache::ResetHandling::kResetOnError, nullptr, /* dummy net log */ + cache_type, net::CACHE_BACKEND_DEFAULT, /*file_operations=*/nullptr, + cache_dir, cache_size, disk_cache::ResetHandling::kResetOnError, + nullptr, /* dummy net log */ &disk_cache_, base::BindOnce(&PnaclTranslationCache::OnCreateBackendComplete, AsWeakPtr()));
diff --git a/components/nacl/common/BUILD.gn b/components/nacl/common/BUILD.gn index 12a1022a..3d6b2131 100644 --- a/components/nacl/common/BUILD.gn +++ b/components/nacl/common/BUILD.gn
@@ -33,11 +33,11 @@ ] deps = [ - ":nacl_error_code", "//base", "//base:base_static", "//content/public/common:content_descriptors", "//mojo/core/embedder", + "//native_client/src/trusted/error_code", "//services/service_manager/public/cpp", ] } @@ -103,11 +103,6 @@ } } - source_set("nacl_error_code") { - sources = - [ "//native_client/src/trusted/service_runtime/nacl_error_code.h" ] - } - mojom("mojo_bindings") { sources = [ "nacl.mojom" ] cpp_typemaps = [ @@ -124,7 +119,7 @@ [ "//components/nacl/common/nacl_types_param_traits.h" ] traits_public_deps = [ ":minimal", - ":nacl_error_code", + "//native_client/src/trusted/error_code", ] traits_deps = [ "//ipc" ] },
diff --git a/components/nacl/renderer/BUILD.gn b/components/nacl/renderer/BUILD.gn index d2034d9..c34c5a5 100644 --- a/components/nacl/renderer/BUILD.gn +++ b/components/nacl/renderer/BUILD.gn
@@ -36,11 +36,11 @@ deps = [ "//base", "//components/nacl/common", - "//components/nacl/common:nacl_error_code", "//components/nacl/renderer/plugin:nacl_trusted_plugin", "//content/public/common", "//content/public/renderer", "//ipc", + "//native_client/src/trusted/error_code", "//net", "//ppapi/c", "//ppapi/proxy:ipc",
diff --git a/components/nacl/renderer/plugin/BUILD.gn b/components/nacl/renderer/plugin/BUILD.gn index d9957ccb..6199966f 100644 --- a/components/nacl/renderer/plugin/BUILD.gn +++ b/components/nacl/renderer/plugin/BUILD.gn
@@ -25,9 +25,9 @@ deps = [ "//base", - "//components/nacl/common:nacl_error_code", "//content/public/common", "//media:shared_memory_support", + "//native_client/src/trusted/error_code", "//ppapi/c", "//ppapi/cpp:objects", "//ppapi/cpp/private:internal_module",
diff --git a/components/optimization_guide/content/browser/BUILD.gn b/components/optimization_guide/content/browser/BUILD.gn index 09a22e1..26462cd 100644 --- a/components/optimization_guide/content/browser/BUILD.gn +++ b/components/optimization_guide/content/browser/BUILD.gn
@@ -75,6 +75,7 @@ source_set("unit_tests") { testonly = true sources = [ + "page_content_annotations_service_unittest.cc", "page_content_annotations_web_contents_observer_unittest.cc", "page_text_dump_result_unittest.cc", "page_text_observer_unittest.cc",
diff --git a/components/optimization_guide/content/browser/page_content_annotations_service.cc b/components/optimization_guide/content/browser/page_content_annotations_service.cc index b7e3c2e..0a79e2b 100644 --- a/components/optimization_guide/content/browser/page_content_annotations_service.cc +++ b/components/optimization_guide/content/browser/page_content_annotations_service.cc
@@ -238,10 +238,38 @@ annotator_ = annotator; } +// static +std::string PageContentAnnotationsService::StringInputForPageTopicsDomain( + const GURL& url) { + // TODO(crbug.com/1240822): Add whatever logic needs to be here to match the + // model data processing. + return url.host(); +} + +void PageContentAnnotationsService::BatchAnnotatePageTopics( + BatchAnnotationCallback callback, + const std::vector<GURL>& inputs) { + std::vector<std::string> domains; + for (const GURL& url : inputs) { + domains.emplace_back(StringInputForPageTopicsDomain(url)); + } + + if (!annotator_) { + std::move(callback).Run(CreateEmptyBatchAnnotationResults(domains)); + return; + } + + annotator_->Annotate(std::move(callback), domains, + AnnotationType::kPageTopics); +} + void PageContentAnnotationsService::BatchAnnotate( BatchAnnotationCallback callback, const std::vector<std::string>& inputs, AnnotationType annotation_type) { + DCHECK_NE(annotation_type, AnnotationType::kPageTopics) + << "Please use |BatchAnnotatePageTopics| instead"; + if (!annotator_) { std::move(callback).Run(CreateEmptyBatchAnnotationResults(inputs)); return;
diff --git a/components/optimization_guide/content/browser/page_content_annotations_service.h b/components/optimization_guide/content/browser/page_content_annotations_service.h index 7931d37..fc3b6dd 100644 --- a/components/optimization_guide/content/browser/page_content_annotations_service.h +++ b/components/optimization_guide/content/browser/page_content_annotations_service.h
@@ -52,6 +52,7 @@ class LocalPageEntitiesMetadataProvider; class OptimizationGuideModelProvider; class PageContentAnnotationsModelManager; +class PageContentAnnotationsServiceTest; class PageContentAnnotationsServiceBrowserTest; class PageContentAnnotationsWebContentsObserver; @@ -106,6 +107,11 @@ const std::vector<std::string>& inputs, AnnotationType annotation_type); + // Calls |BatchAnnotate| with pre-processing the urls into its domain string, + // all specific to PageTopics. + void BatchAnnotatePageTopics(BatchAnnotationCallback callback, + const std::vector<GURL>& inputs); + // Requests that the given model for |type| be loaded in the background and // then runs |callback| with true when the model is ready to execute. If the // model is ready now, the callback is run immediately. If the model file will @@ -128,6 +134,9 @@ void OverridePageContentAnnotatorForTesting(PageContentAnnotator* annotator); private: + friend class PageContentAnnotationsServiceTest; + static std::string StringInputForPageTopicsDomain(const GURL& url); + #if BUILDFLAG(BUILD_WITH_TFLITE_LIB) // Callback invoked when |visit| has been annotated. void OnPageContentAnnotated(
diff --git a/components/optimization_guide/content/browser/page_content_annotations_service_unittest.cc b/components/optimization_guide/content/browser/page_content_annotations_service_unittest.cc new file mode 100644 index 0000000..e9dde0e --- /dev/null +++ b/components/optimization_guide/content/browser/page_content_annotations_service_unittest.cc
@@ -0,0 +1,39 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/optimization_guide/content/browser/page_content_annotations_service.h" + +#include <string> +#include <vector> + +#include "testing/gtest/include/gtest/gtest.h" +#include "url/gurl.h" + +namespace optimization_guide { + +class PageContentAnnotationsServiceTest : public testing::Test { + public: + PageContentAnnotationsServiceTest() = default; + ~PageContentAnnotationsServiceTest() override = default; + + std::string CallStringInputForPageTopicsDomain(const GURL& url) { + return PageContentAnnotationsService::StringInputForPageTopicsDomain(url); + } +}; + +TEST_F(PageContentAnnotationsServiceTest, PageTopicsDomain) { + std::vector<std::pair<GURL, std::string>> tests = { + {GURL("https://www.chromium.org"), "www.chromium.org"}, + }; + + for (const auto& test : tests) { + GURL url = test.first; + std::string expected = test.second; + std::string got = CallStringInputForPageTopicsDomain(url); + + EXPECT_EQ(expected, got) << url; + } +} + +} // namespace optimization_guide \ No newline at end of file
diff --git a/components/os_crypt/os_crypt_linux.cc b/components/os_crypt/os_crypt_linux.cc index 07da4e55..d2192378 100644 --- a/components/os_crypt/os_crypt_linux.cc +++ b/components/os_crypt/os_crypt_linux.cc
@@ -25,32 +25,25 @@ namespace { // Salt for Symmetric key derivation. -const char kSalt[] = "saltysalt"; +constexpr char kSalt[] = "saltysalt"; // Key size required for 128 bit AES. -const size_t kDerivedKeySizeInBits = 128; +constexpr size_t kDerivedKeySizeInBits = 128; -// Constant for Symmetic key derivation. -const size_t kEncryptionIterations = 1; +// Constant for Symmetric key derivation. +constexpr size_t kEncryptionIterations = 1; // Size of initialization vector for AES 128-bit. -const size_t kIVBlockSizeAES128 = 16; +constexpr size_t kIVBlockSizeAES128 = 16; -// Password version. V10 means that the hardcoded password will be used. -// V11 means that a password is/will be stored using an OS-level library (e.g -// Libsecret). V11 will not be used if such a library is not available. -// Used for array indexing. -enum Version { - V10 = 0, - V11 = 1, -}; - -// Prefix for cipher text returned by obfuscation version. We prefix the +// Prefixes for cypher text returned by obfuscation version. We prefix the // ciphertext with this string so that future data migration can detect -// this and migrate to full encryption without data loss. -const char kObfuscationPrefix[][4] = { - "v10", "v11", -}; +// this and migrate to full encryption without data loss. kObfuscationPrefixV10 +// means that the hardcoded password will be used. kObfuscationPrefixV11 means +// that a password is/will be stored using an OS-level library (e.g Libsecret). +// V11 will not be used if such a library is not available. +constexpr char kObfuscationPrefixV10[] = "v10"; +constexpr char kObfuscationPrefixV11[] = "v11"; // Everything in Cache may be leaked on shutdown. struct Cache { @@ -88,7 +81,7 @@ // generation error occurs. std::unique_ptr<crypto::SymmetricKey> GenerateEncryptionKey( const std::string& password) { - std::string salt(kSalt); + const std::string salt(kSalt); // Create an encryption key from our password and salt. std::unique_ptr<crypto::SymmetricKey> encryption_key( @@ -126,13 +119,6 @@ return g_cache.Get().password_v11_cache.get(); } -// Pointers to functions that return a password for deriving the encryption key. -// One function for each supported password version (see Version enum). -crypto::SymmetricKey* (*g_get_password[])() = { - &GetPasswordV10, - &GetPasswordV11, -}; - } // namespace // static @@ -162,17 +148,17 @@ // If we are able to create a V11 key (i.e. a KeyStorage was available), then // we'll use it. If not, we'll use V10. - Version version = Version::V11; - crypto::SymmetricKey* encryption_key = g_get_password[version](); + crypto::SymmetricKey* encryption_key = GetPasswordV11(); + std::string obfuscation_prefix = kObfuscationPrefixV11; if (!encryption_key) { - version = Version::V10; - encryption_key = g_get_password[version](); + encryption_key = GetPasswordV10(); + obfuscation_prefix = kObfuscationPrefixV10; } if (!encryption_key) return false; - std::string iv(kIVBlockSizeAES128, ' '); + const std::string iv(kIVBlockSizeAES128, ' '); crypto::Encryptor encryptor; if (!encryptor.Init(encryption_key, crypto::Encryptor::CBC, iv)) return false; @@ -181,7 +167,7 @@ return false; // Prefix the cipher text with version information. - ciphertext->insert(0, kObfuscationPrefix[version]); + ciphertext->insert(0, obfuscation_prefix); return true; } @@ -196,13 +182,16 @@ // Check that the incoming ciphertext was encrypted and with what version. // Credit card numbers are current legacy unencrypted data, so false match // with prefix won't happen. - Version version; - if (base::StartsWith(ciphertext, kObfuscationPrefix[Version::V10], + crypto::SymmetricKey* encryption_key = nullptr; + std::string obfuscation_prefix; + if (base::StartsWith(ciphertext, kObfuscationPrefixV10, base::CompareCase::SENSITIVE)) { - version = Version::V10; - } else if (base::StartsWith(ciphertext, kObfuscationPrefix[Version::V11], + encryption_key = GetPasswordV10(); + obfuscation_prefix = kObfuscationPrefixV10; + } else if (base::StartsWith(ciphertext, kObfuscationPrefixV11, base::CompareCase::SENSITIVE)) { - version = Version::V11; + encryption_key = GetPasswordV11(); + obfuscation_prefix = kObfuscationPrefixV11; } else { // If the prefix is not found then we'll assume we're dealing with // old data saved as clear text and we'll return it directly. @@ -210,20 +199,19 @@ return true; } - crypto::SymmetricKey* encryption_key(g_get_password[version]()); if (!encryption_key) { VLOG(1) << "Decryption failed: could not get the key"; return false; } - std::string iv(kIVBlockSizeAES128, ' '); + const std::string iv(kIVBlockSizeAES128, ' '); crypto::Encryptor encryptor; if (!encryptor.Init(encryption_key, crypto::Encryptor::CBC, iv)) return false; // Strip off the versioning prefix before decrypting. - std::string raw_ciphertext = - ciphertext.substr(strlen(kObfuscationPrefix[version])); + const std::string raw_ciphertext = + ciphertext.substr(obfuscation_prefix.length()); if (!encryptor.Decrypt(raw_ciphertext, plaintext)) { VLOG(1) << "Decryption failed"; @@ -242,7 +230,7 @@ // static bool OSCrypt::IsEncryptionAvailable() { - return g_get_password[Version::V11](); + return GetPasswordV11(); } // static @@ -267,10 +255,9 @@ // static std::string OSCrypt::GetRawEncryptionKey() { - crypto::SymmetricKey* key = g_get_password[Version::V11](); - if (!key) - return std::string(); - return key->key(); + if (crypto::SymmetricKey* key = GetPasswordV11()) + return key->key(); + return std::string(); } // static
diff --git a/components/os_crypt/os_crypt_mac.mm b/components/os_crypt/os_crypt_mac.mm index d7c1312..51bb252 100644 --- a/components/os_crypt/os_crypt_mac.mm +++ b/components/os_crypt/os_crypt_mac.mm
@@ -30,13 +30,13 @@ namespace { // Salt for Symmetric key derivation. -const char kSalt[] = "saltysalt"; +constexpr char kSalt[] = "saltysalt"; // Key size required for 128 bit AES. -const size_t kDerivedKeySizeInBits = 128; +constexpr size_t kDerivedKeySizeInBits = 128; // Constant for Symmetic key derivation. -const size_t kEncryptionIterations = 1003; +constexpr size_t kEncryptionIterations = 1003; // TODO(dhollowa): Refactor to allow dependency injection of Keychain. bool use_mock_keychain = false; @@ -48,7 +48,7 @@ // Prefix for cypher text returned by current encryption version. We prefix // the cypher text with this string so that future data migration can detect // this and migrate to different encryption without data loss. -const char kEncryptionVersionPrefix[] = "v10"; +constexpr char kEncryptionVersionPrefix[] = "v10"; // This lock is used to make the GetEncrytionKey and // OSCrypt::GetRawEncryptionKey methods thread-safe. @@ -93,7 +93,7 @@ if (password.empty()) return g_cached_encryption_key; - std::string salt(kSalt); + const std::string salt(kSalt); // Create an encryption key from our password and salt. The key is // intentionally leaked. @@ -111,10 +111,9 @@ // static std::string OSCrypt::GetRawEncryptionKey() { - crypto::SymmetricKey* key = GetEncryptionKey(); - if (!key) - return std::string(); - return key->key(); + if (crypto::SymmetricKey* key = GetEncryptionKey()) + return key->key(); + return std::string(); } // static @@ -154,7 +153,7 @@ if (!encryption_key) return false; - std::string iv(kCCBlockSizeAES128, ' '); + const std::string iv(kCCBlockSizeAES128, ' '); crypto::Encryptor encryptor; if (!encryptor.Init(encryption_key, crypto::Encryptor::CBC, iv)) return false; @@ -185,7 +184,7 @@ } // Strip off the versioning prefix before decrypting. - std::string raw_ciphertext = + const std::string raw_ciphertext = ciphertext.substr(strlen(kEncryptionVersionPrefix)); crypto::SymmetricKey* encryption_key = GetEncryptionKey(); @@ -194,7 +193,7 @@ return false; } - std::string iv(kCCBlockSizeAES128, ' '); + const std::string iv(kCCBlockSizeAES128, ' '); crypto::Encryptor encryptor; if (!encryptor.Init(encryption_key, crypto::Encryptor::CBC, iv)) return false;
diff --git a/components/os_crypt/os_crypt_posix.cc b/components/os_crypt/os_crypt_posix.cc index 76175a9..3f8a523 100644 --- a/components/os_crypt/os_crypt_posix.cc +++ b/components/os_crypt/os_crypt_posix.cc
@@ -17,21 +17,21 @@ namespace { // Salt for Symmetric key derivation. -const char kSalt[] = "saltysalt"; +constexpr char kSalt[] = "saltysalt"; // Key size required for 128 bit AES. -const size_t kDerivedKeySizeInBits = 128; +constexpr size_t kDerivedKeySizeInBits = 128; -// Constant for Symmetic key derivation. -const size_t kEncryptionIterations = 1; +// Constant for Symmetric key derivation. +constexpr size_t kEncryptionIterations = 1; // Size of initialization vector for AES 128-bit. -const size_t kIVBlockSizeAES128 = 16; +constexpr size_t kIVBlockSizeAES128 = 16; // Prefix for cypher text returned by obfuscation version. We prefix the // cyphertext with this string so that future data migration can detect // this and migrate to full encryption without data loss. -const char kObfuscationPrefix[] = "v10"; +constexpr char kObfuscationPrefix[] = "v10"; // Generates a newly allocated SymmetricKey object based a hard-coded password. // Ownership of the key is passed to the caller. Returns NULL key if a key @@ -41,8 +41,8 @@ // password. We need to improve this password situation by moving a secure // password into a system-level key store. // http://crbug.com/25404 and http://crbug.com/49115 - std::string password = "peanuts"; - std::string salt(kSalt); + const std::string password = "peanuts"; + const std::string salt(kSalt); // Create an encryption key from our password and salt. std::unique_ptr<crypto::SymmetricKey> encryption_key( @@ -87,7 +87,7 @@ if (!encryption_key.get()) return false; - std::string iv(kIVBlockSizeAES128, ' '); + const std::string iv(kIVBlockSizeAES128, ' '); crypto::Encryptor encryptor; if (!encryptor.Init(encryption_key.get(), crypto::Encryptor::CBC, iv)) return false; @@ -124,13 +124,14 @@ } // Strip off the versioning prefix before decrypting. - std::string raw_ciphertext = ciphertext.substr(strlen(kObfuscationPrefix)); + const std::string raw_ciphertext = + ciphertext.substr(strlen(kObfuscationPrefix)); std::unique_ptr<crypto::SymmetricKey> encryption_key(GetEncryptionKey()); if (!encryption_key.get()) return false; - std::string iv(kIVBlockSizeAES128, ' '); + const std::string iv(kIVBlockSizeAES128, ' '); crypto::Encryptor encryptor; if (!encryptor.Init(encryption_key.get(), crypto::Encryptor::CBC, iv)) return false;
diff --git a/components/os_crypt/os_crypt_win.cc b/components/os_crypt/os_crypt_win.cc index 1a4042d..2c7159b 100644 --- a/components/os_crypt/os_crypt_win.cc +++ b/components/os_crypt/os_crypt_win.cc
@@ -21,19 +21,19 @@ namespace { // Contains base64 random key encrypted with DPAPI. -const char kOsCryptEncryptedKeyPrefName[] = "os_crypt.encrypted_key"; +constexpr char kOsCryptEncryptedKeyPrefName[] = "os_crypt.encrypted_key"; // AEAD key length in bytes. -const size_t kKeyLength = 256 / 8; +constexpr size_t kKeyLength = 256 / 8; // AEAD nonce length in bytes. -const size_t kNonceLength = 96 / 8; +constexpr size_t kNonceLength = 96 / 8; // Version prefix for data encrypted with profile bound key. -const char kEncryptionVersionPrefix[] = "v10"; +constexpr char kEncryptionVersionPrefix[] = "v10"; // Key prefix for a key encrypted with DPAPI. -const char kDPAPIKeyPrefix[] = "DPAPI"; +constexpr char kDPAPIKeyPrefix[] = "DPAPI"; // Use mock key instead of a real encryption key. Used for testing. bool g_use_mock_key = false; @@ -64,7 +64,7 @@ input.cbData = static_cast<DWORD>(plaintext.length()); DATA_BLOB output; - BOOL result = + const BOOL result = CryptProtectData(&input, L"", nullptr, nullptr, nullptr, 0, &output); if (!result) { PLOG(ERROR) << "Failed to encrypt"; @@ -87,8 +87,8 @@ input.cbData = static_cast<DWORD>(ciphertext.length()); DATA_BLOB output; - BOOL result = CryptUnprotectData(&input, nullptr, nullptr, nullptr, nullptr, - 0, &output); + const BOOL result = CryptUnprotectData(&input, nullptr, nullptr, nullptr, + nullptr, 0, &output); if (!result) { PLOG(ERROR) << "Failed to decrypt"; return false; @@ -140,7 +140,7 @@ crypto::Aead aead(crypto::Aead::AES_256_GCM); - auto key = GetEncryptionKeyInternal(); + const auto key = GetEncryptionKeyInternal(); aead.Init(&key); // Note: can only check these once AEAD is initialized. @@ -171,10 +171,10 @@ aead.Init(&key); // Obtain the nonce. - std::string nonce = + const std::string nonce = ciphertext.substr(sizeof(kEncryptionVersionPrefix) - 1, kNonceLength); // Strip off the versioning prefix before decrypting. - std::string raw_ciphertext = + const std::string raw_ciphertext = ciphertext.substr(kNonceLength + (sizeof(kEncryptionVersionPrefix) - 1)); return aead.Open(raw_ciphertext, nonce, std::string(), plaintext); @@ -224,7 +224,7 @@ if (!local_state->HasPrefPath(kOsCryptEncryptedKeyPrefName)) return kKeyDoesNotExist; - std::string base64_encrypted_key = + const std::string base64_encrypted_key = local_state->GetString(kOsCryptEncryptedKeyPrefName); std::string encrypted_key_with_header; @@ -236,7 +236,7 @@ return kInvalidKeyFormat; } - std::string encrypted_key = + const std::string encrypted_key = encrypted_key_with_header.substr(sizeof(kDPAPIKeyPrefix) - 1); std::string key; // This DPAPI decryption can fail if the user's password has been reset
diff --git a/components/performance_manager/prerendering_browsertest.cc b/components/performance_manager/prerendering_browsertest.cc index eb61056..dfaf6aa 100644 --- a/components/performance_manager/prerendering_browsertest.cc +++ b/components/performance_manager/prerendering_browsertest.cc
@@ -132,11 +132,10 @@ // its main frame, and the original frame tree is gone. content::RenderFrameDeletedObserver deleted_observer( web_contents()->GetMainFrame()); - content::TestNavigationManager navigation_manager(web_contents(), - kPrerenderingUrl); + content::test::PrerenderHostObserver prerender_observer(*web_contents(), + kPrerenderingUrl); prerender_helper_.NavigatePrimaryPage(kPrerenderingUrl); - navigation_manager.WaitForNavigationFinished(); - ASSERT_TRUE(navigation_manager.was_prerendered_page_activation()); + ASSERT_TRUE(prerender_observer.was_activated()); deleted_observer.WaitUntilDeleted(); RunInGraph([&](Graph*) { ASSERT_TRUE(page_node);
diff --git a/components/permissions/bluetooth_delegate_impl.cc b/components/permissions/bluetooth_delegate_impl.cc index 6b9372b..29cfaae 100644 --- a/components/permissions/bluetooth_delegate_impl.cc +++ b/components/permissions/bluetooth_delegate_impl.cc
@@ -83,6 +83,14 @@ frame->GetMainFrame()->GetLastCommittedOrigin(), device_id); } +void BluetoothDelegateImpl::RevokeDevicePermissionWebInitiated( + RenderFrameHost* frame, + const WebBluetoothDeviceId& device_id) { + client_->GetBluetoothChooserContext(frame) + ->RevokeDevicePermissionWebInitiated( + frame->GetMainFrame()->GetLastCommittedOrigin(), device_id); +} + bool BluetoothDelegateImpl::IsAllowedToAccessService( RenderFrameHost* frame, const WebBluetoothDeviceId& device_id,
diff --git a/components/permissions/bluetooth_delegate_impl.h b/components/permissions/bluetooth_delegate_impl.h index aed5c35..71a81c6 100644 --- a/components/permissions/bluetooth_delegate_impl.h +++ b/components/permissions/bluetooth_delegate_impl.h
@@ -109,6 +109,9 @@ bool HasDevicePermission( content::RenderFrameHost* frame, const blink::WebBluetoothDeviceId& device_id) override; + void RevokeDevicePermissionWebInitiated( + content::RenderFrameHost* frame, + const blink::WebBluetoothDeviceId& device_id) override; bool IsAllowedToAccessService(content::RenderFrameHost* frame, const blink::WebBluetoothDeviceId& device_id, const device::BluetoothUUID& service) override;
diff --git a/components/permissions/contexts/bluetooth_chooser_context.cc b/components/permissions/contexts/bluetooth_chooser_context.cc index a2b84457..257509e8 100644 --- a/components/permissions/contexts/bluetooth_chooser_context.cc +++ b/components/permissions/contexts/bluetooth_chooser_context.cc
@@ -256,6 +256,14 @@ return !device.is_none(); } +void BluetoothChooserContext::RevokeDevicePermissionWebInitiated( + const url::Origin& origin, + const WebBluetoothDeviceId& device_id) { + base::Value device = FindDeviceObject(origin, device_id); + if (!device.is_none()) + RevokeObjectPermission(origin, device); +} + bool BluetoothChooserContext::IsAllowedToAccessAtLeastOneService( const url::Origin& origin, const WebBluetoothDeviceId& device_id) {
diff --git a/components/permissions/contexts/bluetooth_chooser_context.h b/components/permissions/contexts/bluetooth_chooser_context.h index 09d2184..4e4ce2a 100644 --- a/components/permissions/contexts/bluetooth_chooser_context.h +++ b/components/permissions/contexts/bluetooth_chooser_context.h
@@ -68,6 +68,9 @@ const blink::mojom::WebBluetoothRequestDeviceOptions* options); bool HasDevicePermission(const url::Origin& origin, const blink::WebBluetoothDeviceId& device_id); + void RevokeDevicePermissionWebInitiated( + const url::Origin& origin, + const blink::WebBluetoothDeviceId& device_id); bool IsAllowedToAccessAtLeastOneService( const url::Origin& origin, const blink::WebBluetoothDeviceId& device_id);
diff --git a/components/policy/resources/webui/policy.css b/components/policy/resources/webui/policy.css index 06f8205..d275057 100644 --- a/components/policy/resources/webui/policy.css +++ b/components/policy/resources/webui/policy.css
@@ -85,6 +85,7 @@ background-color: rgb(250, 250, 250); } +.policy.conflict.row .value, .warnings.row .value, .errors.row .value, .infos.row .value,
diff --git a/components/policy/resources/webui/policy.html b/components/policy/resources/webui/policy.html index ae6be99..8675505 100644 --- a/components/policy/resources/webui/policy.html +++ b/components/policy/resources/webui/policy.html
@@ -158,10 +158,6 @@ <div class="messages" role="cell"></div> <div class="toggle" role="cell"></div> </div> - <div class="value row" role="row"> - <div class="name" role="rowheader"></div> - <div class="value" role="cell"></div> - </div> </div> <div class="policy-data" id="policy-template" role="rowgroup">
diff --git a/components/policy/resources/webui/policy_base.js b/components/policy/resources/webui/policy_base.js index 143e13c..d6433f3 100644 --- a/components/policy/resources/webui/policy_base.js +++ b/components/policy/resources/webui/policy_base.js
@@ -236,7 +236,7 @@ 'levelMandatory'); this.querySelector('.source').textContent = loadTimeData.getString(conflict.source); - this.querySelector('.value.row .value').textContent = conflict.value; + this.querySelector('.value').textContent = conflict.value; this.querySelector('.name').textContent = loadTimeData.getString(row_label); } };
diff --git a/components/printing/common/print.mojom b/components/printing/common/print.mojom index 51ebcb4..5afad24 100644 --- a/components/printing/common/print.mojom +++ b/components/printing/common/print.mojom
@@ -208,7 +208,7 @@ // The returned |preview_document_region| contains the preview document data // as a flattened PDF. It will be invalid if errors occurred while rendering // the preview document. - CreatePreviewDocument(mojo_base.mojom.DictionaryValue job_settings) + CreatePreviewDocument(mojo_base.mojom.DeprecatedDictionaryValue job_settings) => (mojo_base.mojom.ReadOnlySharedMemoryRegion? preview_document_region); }; @@ -296,7 +296,7 @@ // every requested page for print preview using the given |settings|. This // gets called multiple times as the user updates settings. [EnableIf=enable_print_preview] - PrintPreview(mojo_base.mojom.DictionaryValue settings); + PrintPreview(mojo_base.mojom.DeprecatedDictionaryValue settings); // Tells the RenderFrame that the print preview dialog was closed. [EnableIf=enable_print_preview] @@ -353,7 +353,7 @@ [EnableIf=enable_print_preview, Sync] UpdatePrintSettings( int32 cookie, - mojo_base.mojom.DictionaryValue job_settings) + mojo_base.mojom.DeprecatedDictionaryValue job_settings) => (PrintPagesParams current_settings, bool canceled); // Tells the browser to set up the print preview requested by the script. It
diff --git a/components/privacy_sandbox/privacy_sandbox_prefs.cc b/components/privacy_sandbox/privacy_sandbox_prefs.cc index 04413e5..14f3d904 100644 --- a/components/privacy_sandbox/privacy_sandbox_prefs.cc +++ b/components/privacy_sandbox/privacy_sandbox_prefs.cc
@@ -47,6 +47,12 @@ extern const char kPrivacySandboxNoConfirmationSandboxRestricted[] = "privacy_sandbox.no_confirmation_sandbox_restricted"; +extern const char kPrivacySandboxNoConfirmationSandboxManaged[] = + "privacy_sandbox.no_confirmation_sandbox_managed"; + +extern const char kPrivacySandboxNoConfirmationThirdPartyCookiesBlocked[] = + "privacy_sandbox.no_confirmation_3PC_blocked"; + extern const char kPrivacySandboxDisabledInsufficientConfirmation[] = "privacy_sandbox.disabled_insufficient_confirmation"; @@ -82,6 +88,10 @@ registry->RegisterBooleanPref( prefs::kPrivacySandboxNoConfirmationSandboxRestricted, false); registry->RegisterBooleanPref( + prefs::kPrivacySandboxNoConfirmationSandboxManaged, false); + registry->RegisterBooleanPref( + prefs::kPrivacySandboxNoConfirmationThirdPartyCookiesBlocked, false); + registry->RegisterBooleanPref( prefs::kPrivacySandboxDisabledInsufficientConfirmation, false); }
diff --git a/components/privacy_sandbox/privacy_sandbox_prefs.h b/components/privacy_sandbox/privacy_sandbox_prefs.h index 298884d..702fc54 100644 --- a/components/privacy_sandbox/privacy_sandbox_prefs.h +++ b/components/privacy_sandbox/privacy_sandbox_prefs.h
@@ -76,6 +76,14 @@ // profile because the Privacy Sandbox was being restricted. extern const char kPrivacySandboxNoConfirmationSandboxRestricted[]; +// Boolean that indicates a Privacy Sandbox confirmation was not shown to the +// profile because the Privacy Sandbox was being managed. +extern const char kPrivacySandboxNoConfirmationSandboxManaged[]; + +// Boolean that indicates a Privacy Sandbox confirmation was not shown to the +// profile because the third party cookies were being blocked. +extern const char kPrivacySandboxNoConfirmationThirdPartyCookiesBlocked[]; + // Boolean that indicates the user's Privacy Sandbox setting was disabled // automatically because they do not have the correct level of confirmation. extern const char kPrivacySandboxDisabledInsufficientConfirmation[];
diff --git a/components/segmentation_platform/DEPS b/components/segmentation_platform/DEPS index a5fc96a..ff68f5e 100644 --- a/components/segmentation_platform/DEPS +++ b/components/segmentation_platform/DEPS
@@ -6,6 +6,7 @@ "+components/optimization_guide", "-components/optimization_guide/content", "+components/prefs", + "+components/ukm", "+services/metrics/public", "+sql", "+third_party/perfetto",
diff --git a/components/segmentation_platform/components_unittests.filter b/components/segmentation_platform/components_unittests.filter index f36eba0..c7b8036 100644 --- a/components/segmentation_platform/components_unittests.filter +++ b/components/segmentation_platform/components_unittests.filter
@@ -28,6 +28,7 @@ StatsTest.* TrainingDataCollectorTest.* UkmConfigTest.* +UkmObserverTest.* UrlSignalHandlerTest.* UkmDatabaseBackendTest.* UkmMetricsTableTest.*
diff --git a/components/segmentation_platform/internal/BUILD.gn b/components/segmentation_platform/internal/BUILD.gn index a3cbd9e..741e6bd 100644 --- a/components/segmentation_platform/internal/BUILD.gn +++ b/components/segmentation_platform/internal/BUILD.gn
@@ -98,6 +98,8 @@ "signals/signal_filter_processor.h", "signals/ukm_config.cc", "signals/ukm_config.h", + "signals/ukm_observer.cc", + "signals/ukm_observer.h", "signals/url_signal_handler.cc", "signals/url_signal_handler.h", "signals/user_action_signal_handler.cc", @@ -118,6 +120,7 @@ "//components/prefs", "//components/segmentation_platform/internal/proto", "//components/segmentation_platform/public", + "//components/ukm:ukm_recorder", "//services/metrics/public/cpp:metrics_cpp", "//services/metrics/public/cpp:ukm_builders", "//sql:sql", @@ -170,6 +173,8 @@ "database/mock_signal_database.h", "database/mock_signal_storage_config.cc", "database/mock_signal_storage_config.h", + "database/mock_ukm_database.cc", + "database/mock_ukm_database.h", "database/segment_info_database_unittest.cc", "database/signal_database_impl_unittest.cc", "database/signal_key_internal_unittest.cc", @@ -206,6 +211,7 @@ "signals/mock_histogram_signal_handler.h", "signals/signal_filter_processor_unittest.cc", "signals/ukm_config_unittest.cc", + "signals/ukm_observer_unittest.cc", "signals/url_signal_handler_unittest.cc", "signals/user_action_signal_handler_unittest.cc", "stats_unittest.cc",
diff --git a/components/segmentation_platform/internal/database/mock_ukm_database.cc b/components/segmentation_platform/internal/database/mock_ukm_database.cc new file mode 100644 index 0000000..f521fe9 --- /dev/null +++ b/components/segmentation_platform/internal/database/mock_ukm_database.cc
@@ -0,0 +1,14 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/segmentation_platform/internal/database/mock_ukm_database.h" + +#include "base/files/file_path.h" + +namespace segmentation_platform { + +MockUkmDatabase::MockUkmDatabase() : UkmDatabase(base::FilePath()) {} +MockUkmDatabase::~MockUkmDatabase() = default; + +} // namespace segmentation_platform
diff --git a/components/segmentation_platform/internal/database/mock_ukm_database.h b/components/segmentation_platform/internal/database/mock_ukm_database.h new file mode 100644 index 0000000..42246ca --- /dev/null +++ b/components/segmentation_platform/internal/database/mock_ukm_database.h
@@ -0,0 +1,33 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_SEGMENTATION_PLATFORM_INTERNAL_DATABASE_MOCK_UKM_DATABASE_H_ +#define COMPONENTS_SEGMENTATION_PLATFORM_INTERNAL_DATABASE_MOCK_UKM_DATABASE_H_ + +#include "components/segmentation_platform/internal/database/ukm_database.h" + +#include "testing/gmock/include/gmock/gmock.h" + +namespace segmentation_platform { + +class MockUkmDatabase : public UkmDatabase { + public: + MockUkmDatabase(); + ~MockUkmDatabase() override; + + MOCK_METHOD1(UkmEntryAdded, void(ukm::mojom::UkmEntryPtr ukm_entry)); + + MOCK_METHOD3(UkmSourceUrlUpdated, + void(ukm::SourceId source_id, + const GURL& url, + bool is_validated)); + + MOCK_METHOD1(OnUrlValidated, void(const GURL& url)); + + MOCK_METHOD1(RemoveUrls, void(const std::vector<GURL>& urls)); +}; + +} // namespace segmentation_platform + +#endif // COMPONENTS_SEGMENTATION_PLATFORM_INTERNAL_DATABASE_MOCK_UKM_DATABASE_H_
diff --git a/components/segmentation_platform/internal/execution/model_execution_manager_impl.cc b/components/segmentation_platform/internal/execution/model_execution_manager_impl.cc index bb4bdb1c..afca81ae4 100644 --- a/components/segmentation_platform/internal/execution/model_execution_manager_impl.cc +++ b/components/segmentation_platform/internal/execution/model_execution_manager_impl.cc
@@ -295,6 +295,7 @@ // If we find an existing SegmentInfo in the database, we can verify that it // is valid, and we can copy over the PredictionResult to the new version // we are creating. + absl::optional<int64_t> old_model_version; if (old_segment_info.has_value()) { // The retrieved SegmentInfo's ID should match the one we looked up, // otherwise the DB has not upheld its contract. @@ -311,6 +312,10 @@ auto* prediction_result = new_segment_info.mutable_prediction_result(); prediction_result->CopyFrom(old_segment_info->prediction_result()); } + + if (old_segment_info->has_model_version()) { + old_model_version = old_segment_info->model_version(); + } } // Inject the newly updated metadata into the new SegmentInfo. @@ -318,6 +323,12 @@ new_metadata->CopyFrom(metadata); new_segment_info.set_model_version(model_version); + if (!old_model_version.has_value() || + old_model_version.value() != model_version) { + new_segment_info.set_model_update_time_s( + clock_->Now().ToDeltaSinceWindowsEpoch().InSeconds()); + } + // We have a valid segment id, and the new metadata was valid, therefore the // new metadata should be valid. We are not allowed to invoke the callback // unless the metadata is valid.
diff --git a/components/segmentation_platform/internal/execution/model_execution_manager_impl_unittest.cc b/components/segmentation_platform/internal/execution/model_execution_manager_impl_unittest.cc index ed0aff8..640bbef 100644 --- a/components/segmentation_platform/internal/execution/model_execution_manager_impl_unittest.cc +++ b/components/segmentation_platform/internal/execution/model_execution_manager_impl_unittest.cc
@@ -283,6 +283,10 @@ // The metadata should have been stored. EXPECT_EQ(42u, segment_info_from_db->model_metadata().bucket_duration()); + + // Model update time should be updated. + EXPECT_EQ(clock_.Now().ToDeltaSinceWindowsEpoch().InSeconds(), + segment_info_from_db->model_update_time_s()); } TEST_F(ModelExecutionManagerTest, @@ -369,6 +373,8 @@ segment_database_->GetSegmentInfo(segment_id, db_callback_2.Get()); EXPECT_TRUE(segment_info_from_db_2.has_value()); EXPECT_EQ(segment_id, segment_info_from_db_2->segment_id()); + EXPECT_EQ(clock_.Now().ToDeltaSinceWindowsEpoch().InSeconds(), + segment_info_from_db_2->model_update_time_s()); // The metadata should have been updated. EXPECT_EQ(42u, segment_info_from_db_2->model_metadata().bucket_duration());
diff --git a/components/segmentation_platform/internal/proto/model_prediction.proto b/components/segmentation_platform/internal/proto/model_prediction.proto index fad9a16..c6ab5785 100644 --- a/components/segmentation_platform/internal/proto/model_prediction.proto +++ b/components/segmentation_platform/internal/proto/model_prediction.proto
@@ -22,7 +22,7 @@ // Top level message for a segment. Contains both the model metadata and // prediction results. -// Next tag: 5 +// Next tag: 6 message SegmentInfo { // Segment target. optional optimization_guide.proto.OptimizationTarget segment_id = 1; @@ -38,4 +38,9 @@ // The model version defined in ModeInfo in optimization guide, given by // optimization guide API after ModeInfo is fetched. optional int64 model_version = 4; + + // The time that a new version of model from optimization guide is available + // and the metadta is persisted to this proto, in seconds since windows epoch. + // Could be empty for data persisted before this field is added in M101. + optional int64 model_update_time_s = 5; }
diff --git a/components/segmentation_platform/internal/segmentation_platform_service_impl.cc b/components/segmentation_platform/internal/segmentation_platform_service_impl.cc index 75d8b318..bce9a93b 100644 --- a/components/segmentation_platform/internal/segmentation_platform_service_impl.cc +++ b/components/segmentation_platform/internal/segmentation_platform_service_impl.cc
@@ -37,6 +37,7 @@ #include "components/segmentation_platform/internal/selection/segment_selector_impl.h" #include "components/segmentation_platform/internal/selection/segmentation_result_prefs.h" #include "components/segmentation_platform/internal/signals/histogram_signal_handler.h" +#include "components/segmentation_platform/internal/signals/history_service_observer.h" #include "components/segmentation_platform/internal/signals/signal_filter_processor.h" #include "components/segmentation_platform/internal/signals/user_action_signal_handler.h" #include "components/segmentation_platform/internal/stats.h" @@ -61,6 +62,7 @@ const base::FilePath& storage_dir, UkmDataManager* ukm_data_manager, PrefService* pref_service, + history::HistoryService* history_service, const scoped_refptr<base::SequencedTaskRunner>& task_runner, base::Clock* clock, std::vector<std::unique_ptr<Config>> configs) @@ -80,6 +82,7 @@ ukm_data_manager, model_provider, pref_service, + history_service, task_runner, clock, std::move(configs)) {} @@ -93,6 +96,7 @@ UkmDataManager* ukm_data_manager, optimization_guide::OptimizationGuideModelProvider* model_provider, PrefService* pref_service, + history::HistoryService* history_service, const scoped_refptr<base::SequencedTaskRunner>& task_runner, base::Clock* clock, std::vector<std::unique_ptr<Config>> configs) @@ -102,7 +106,6 @@ platform_options_(PlatformOptions::CreateDefault()), configs_(std::move(configs)), ukm_data_manager_(ukm_data_manager) { - ukm_data_manager_->AddRef(); // Construct databases. segment_info_database_ = std::make_unique<SegmentInfoDatabase>(std::move(segment_db)); @@ -112,6 +115,7 @@ std::move(signal_storage_config_db), clock); segmentation_result_prefs_ = std::make_unique<SegmentationResultPrefs>(pref_service); + ukm_data_manager_->AddRef(); // Construct signal processors. user_action_signal_handler_ = @@ -122,6 +126,13 @@ segment_info_database_.get(), user_action_signal_handler_.get(), histogram_signal_handler_.get(), ukm_data_manager_); + if (ukm_data_manager_->IsUkmEngineEnabled() && history_service) { + // If UKM engine is enabled and history service is not available, then we + // would write metrics without URLs to the database, which is OK. + history_service_observer_ = std::make_unique<HistoryServiceObserver>( + history_service, ukm_data_manager_->GetOrCreateUrlHandler()); + } + for (const auto& config : configs_) { segment_selectors_[config->segmentation_key] = std::make_unique<SegmentSelectorImpl>( @@ -159,6 +170,7 @@ } SegmentationPlatformServiceImpl::~SegmentationPlatformServiceImpl() { + history_service_observer_.reset(); ukm_data_manager_->RemoveRef(); }
diff --git a/components/segmentation_platform/internal/segmentation_platform_service_impl.h b/components/segmentation_platform/internal/segmentation_platform_service_impl.h index f6b2cf64..46fd76d8 100644 --- a/components/segmentation_platform/internal/segmentation_platform_service_impl.h +++ b/components/segmentation_platform/internal/segmentation_platform_service_impl.h
@@ -27,6 +27,10 @@ class SequencedTaskRunner; } // namespace base +namespace history { +class HistoryService; +} + namespace leveldb_proto { class ProtoDatabaseProvider; } // namespace leveldb_proto @@ -49,6 +53,7 @@ class DatabaseMaintenanceImpl; class FeatureListQueryProcessor; class HistogramSignalHandler; +class HistoryServiceObserver; class ModelExecutionManager; class ModelExecutionSchedulerImpl; class SegmentationResultPrefs; @@ -87,6 +92,7 @@ const base::FilePath& storage_dir, UkmDataManager* ukm_data_manager, PrefService* pref_service, + history::HistoryService* history_service, const scoped_refptr<base::SequencedTaskRunner>& task_runner, base::Clock* clock, std::vector<std::unique_ptr<Config>> configs); @@ -102,6 +108,7 @@ UkmDataManager* ukm_data_manager, optimization_guide::OptimizationGuideModelProvider* model_provider, PrefService* pref_service, + history::HistoryService* history_service, const scoped_refptr<base::SequencedTaskRunner>& task_runner, base::Clock* clock, std::vector<std::unique_ptr<Config>> configs); @@ -166,6 +173,7 @@ std::unique_ptr<UserActionSignalHandler> user_action_signal_handler_; std::unique_ptr<HistogramSignalHandler> histogram_signal_handler_; std::unique_ptr<SignalFilterProcessor> signal_filter_processor_; + std::unique_ptr<HistoryServiceObserver> history_service_observer_; // Training/inference input data generation. std::unique_ptr<FeatureListQueryProcessor> feature_list_query_processor_;
diff --git a/components/segmentation_platform/internal/segmentation_platform_service_impl_unittest.cc b/components/segmentation_platform/internal/segmentation_platform_service_impl_unittest.cc index 170f1e4..d553888a 100644 --- a/components/segmentation_platform/internal/segmentation_platform_service_impl_unittest.cc +++ b/components/segmentation_platform/internal/segmentation_platform_service_impl_unittest.cc
@@ -152,12 +152,13 @@ SetUpPrefs(); std::vector<std::unique_ptr<Config>> configs = CreateTestConfigs(); + // TODO(ssid): use mock a history service here. segmentation_platform_service_impl_ = std::make_unique<SegmentationPlatformServiceImpl>( std::move(segment_db), std::move(signal_db), std::move(segment_storage_config_db), ukm_data_manager_.get(), - &model_provider_, &pref_service_, task_runner_, &test_clock_, - std::move(configs)); + &model_provider_, &pref_service_, /*history_service=*/nullptr, + task_runner_, &test_clock_, std::move(configs)); segmentation_platform_service_impl_->GetServiceProxy()->AddObserver( &observer_); }
diff --git a/components/segmentation_platform/internal/signals/ukm_config.cc b/components/segmentation_platform/internal/signals/ukm_config.cc index 9ce94c90..c14e14a 100644 --- a/components/segmentation_platform/internal/signals/ukm_config.cc +++ b/components/segmentation_platform/internal/signals/ukm_config.cc
@@ -30,12 +30,13 @@ return events; } -bool UkmConfig::IsObserving(UkmEventHash event, UkmMetricHash metric) const { - const auto it = metrics_for_event_.find(event); +const base::flat_set<UkmMetricHash>* UkmConfig::GetObservedMetrics( + UkmEventHash event) { + const auto& it = metrics_for_event_.find(event); if (it != metrics_for_event_.end()) { - return it->second.count(metric) > 0; + return &it->second; } - return false; + return nullptr; } void UkmConfig::AddEvent(UkmEventHash event_hash,
diff --git a/components/segmentation_platform/internal/signals/ukm_config.h b/components/segmentation_platform/internal/signals/ukm_config.h index 99405dc0..d3b5edd 100644 --- a/components/segmentation_platform/internal/signals/ukm_config.h +++ b/components/segmentation_platform/internal/signals/ukm_config.h
@@ -40,8 +40,9 @@ // Returns a list of observed event hashes, for sending it to UkmRecorderImpl. base::flat_set<uint64_t> GetRawObservedEvents() const; - // Returns true if the config has the given event and metric. - bool IsObserving(UkmEventHash event, UkmMetricHash metric) const; + // Returns a list of metrics observed for the given |event|. Returns nullptr + // if the event is not observed. + const base::flat_set<UkmMetricHash>* GetObservedMetrics(UkmEventHash event); // Add the given event and metrics for observation. void AddEvent(UkmEventHash event_hash,
diff --git a/components/segmentation_platform/internal/signals/ukm_config_unittest.cc b/components/segmentation_platform/internal/signals/ukm_config_unittest.cc index 12366b1..699be4c3 100644 --- a/components/segmentation_platform/internal/signals/ukm_config_unittest.cc +++ b/components/segmentation_platform/internal/signals/ukm_config_unittest.cc
@@ -28,7 +28,7 @@ UkmConfig config; EXPECT_EQ(config.metrics_for_event_for_testing(), UkmConfig::EventsToMetricsMap()); - EXPECT_FALSE(config.IsObserving(kEvent1, TestMetric(100))); + EXPECT_EQ(config.GetObservedMetrics(kEvent1), nullptr); EXPECT_EQ(config.GetRawObservedEvents(), base::flat_set<uint64_t>()); config.AddEvent(kEvent1, {TestMetric(100), TestMetric(101), TestMetric(102)}); @@ -37,8 +37,10 @@ UkmConfig::EventsToMetricsMap( {{kEvent1, {TestMetric(100), TestMetric(101), TestMetric(102)}}})); - EXPECT_TRUE(config.IsObserving(kEvent1, TestMetric(100))); - EXPECT_TRUE(config.IsObserving(kEvent1, TestMetric(102))); + EXPECT_EQ(*config.GetObservedMetrics(kEvent1), + base::flat_set<UkmMetricHash>( + {TestMetric(100), TestMetric(101), TestMetric(102)})); + EXPECT_EQ(config.GetObservedMetrics(kEvent3), nullptr); EXPECT_EQ(config.GetRawObservedEvents(), base::flat_set<uint64_t>({kEvent1.GetUnsafeValue()})); @@ -48,11 +50,13 @@ {{kEvent1, {TestMetric(100), TestMetric(101), TestMetric(102)}}, {kEvent2, {TestMetric(100)}}})); - EXPECT_TRUE(config.IsObserving(kEvent1, TestMetric(100))); - EXPECT_TRUE(config.IsObserving(kEvent1, TestMetric(102))); - EXPECT_TRUE(config.IsObserving(kEvent2, TestMetric(100))); - EXPECT_FALSE(config.IsObserving(kEvent2, TestMetric(101))); - EXPECT_FALSE(config.IsObserving(kEvent3, TestMetric(100))); + config.AddEvent(kEvent2, {TestMetric(100), TestMetric(102), TestMetric(103)}); + EXPECT_EQ(*config.GetObservedMetrics(kEvent1), + base::flat_set<UkmMetricHash>( + {TestMetric(100), TestMetric(101), TestMetric(102)})); + EXPECT_EQ(*config.GetObservedMetrics(kEvent2), + base::flat_set<UkmMetricHash>( + {TestMetric(100), TestMetric(102), TestMetric(103)})); EXPECT_EQ(config.GetRawObservedEvents(), base::flat_set<uint64_t>( {kEvent1.GetUnsafeValue(), kEvent2.GetUnsafeValue()}));
diff --git a/components/segmentation_platform/internal/signals/ukm_observer.cc b/components/segmentation_platform/internal/signals/ukm_observer.cc new file mode 100644 index 0000000..bae47e3 --- /dev/null +++ b/components/segmentation_platform/internal/signals/ukm_observer.cc
@@ -0,0 +1,84 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/segmentation_platform/internal/signals/ukm_observer.h" + +#include <cstdint> + +#include "base/rand_util.h" +#include "base/time/time.h" +#include "components/segmentation_platform/internal/database/ukm_database.h" +#include "components/segmentation_platform/internal/signals/ukm_config.h" +#include "components/segmentation_platform/internal/signals/url_signal_handler.h" +#include "components/ukm/ukm_recorder_impl.h" +#include "services/metrics/public/mojom/ukm_interface.mojom.h" + +namespace segmentation_platform { + +UkmObserver::UkmObserver(ukm::UkmRecorderImpl* ukm_recorder, + UkmDatabase* ukm_database, + UrlSignalHandler* url_signal_handler) + : ukm_database_(ukm_database), + url_signal_handler_(url_signal_handler), + ukm_recorder_(ukm_recorder) {} + +UkmObserver::~UkmObserver() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_check_); + if (config_) + ukm_recorder_->RemoveUkmRecorderObserver(this); +} + +void UkmObserver::StartObserving(const UkmConfig& config) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_check_); + + bool was_observing = true; + if (!config_) { + config_ = std::make_unique<UkmConfig>(); + was_observing = false; + } + + UkmConfig::MergeResult result = config_->Merge(config); + if (result == UkmConfig::NO_NEW_EVENT) + return; + + if (was_observing) + ukm_recorder_->RemoveUkmRecorderObserver(this); + ukm_recorder_->AddUkmRecorderObserver(config_->GetRawObservedEvents(), this); +} + +void UkmObserver::OnEntryAdded(ukm::mojom::UkmEntryPtr entry) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_check_); + if (paused_) + return; + + // Remove any metric from the entry that is not observed. + const base::flat_set<UkmMetricHash>* metrics_for_event = + config_->GetObservedMetrics( + UkmEventHash::FromUnsafeValue(entry->event_hash)); + if (!metrics_for_event) + return; + for (const auto& metric_and_value : entry->metrics) { + if (!metrics_for_event->count( + UkmMetricHash::FromUnsafeValue(metric_and_value.first))) { + entry->metrics.erase(metric_and_value); + } + } + ukm_database_->UkmEntryAdded(std::move(entry)); +} + +void UkmObserver::OnUpdateSourceURL(ukm::SourceId source_id, + const std::vector<GURL>& urls) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_check_); + if (paused_) + return; + + url_signal_handler_->OnUkmSourceUpdated(source_id, urls); +} + +void UkmObserver::PauseOrResumeObservation(bool pause) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_check_); + paused_ = pause; +} + +} // namespace segmentation_platform
diff --git a/components/segmentation_platform/internal/signals/ukm_observer.h b/components/segmentation_platform/internal/signals/ukm_observer.h new file mode 100644 index 0000000..f75762f --- /dev/null +++ b/components/segmentation_platform/internal/signals/ukm_observer.h
@@ -0,0 +1,70 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_SEGMENTATION_PLATFORM_INTERNAL_SIGNALS_UKM_OBSERVER_H_ +#define COMPONENTS_SEGMENTATION_PLATFORM_INTERNAL_SIGNALS_UKM_OBSERVER_H_ + +#include <cstdint> + +#include "base/memory/raw_ptr.h" +#include "base/memory/scoped_refptr.h" +#include "components/ukm/ukm_recorder_observer.h" + +namespace ukm { +class UkmRecorderImpl; +} + +namespace segmentation_platform { + +class UkmDatabase; +class UrlSignalHandler; +class UkmConfig; + +// Observes UKM metrics and URL source and stores the relevant data in UKM +// database. +class UkmObserver : public ukm::UkmRecorderObserver { + public: + UkmObserver(ukm::UkmRecorderImpl* ukm_recorder, + UkmDatabase* ukm_database, + UrlSignalHandler* url_signal_handler); + ~UkmObserver() override; + + UkmObserver(UkmObserver&) = delete; + UkmObserver& operator=(UkmObserver&) = delete; + + // Starts observing with the given |config| if not started. Otherwise, merges + // the currently observed config with the new |config|, and observes a + // superset of the metrics. + void StartObserving(const UkmConfig& config); + + // Pause/Resume observation of UKM. The observer stops sending any signal to + // database when paused. + void PauseOrResumeObservation(bool pause); + + // UkmRecorderObserver implementation: + void OnEntryAdded(ukm::mojom::UkmEntryPtr entry) override; + void OnUpdateSourceURL(ukm::SourceId source_id, + const std::vector<GURL>& urls) override; + + private: + // Owned by UkmDataManagerImpl. The manager guarantees that database is + // deleted after observer. + raw_ptr<UkmDatabase> ukm_database_; + // Owned by UkmDataManagerImpl. The manager guarantees that handler is deleted + // after observer. + raw_ptr<UrlSignalHandler> url_signal_handler_; + // UkmDataManagerImpl destroys this observer before the UKM service is + // destroyed. + raw_ptr<ukm::UkmRecorderImpl> const ukm_recorder_; + + // Currently observed config. + std::unique_ptr<UkmConfig> config_; + bool paused_ = false; + + SEQUENCE_CHECKER(sequence_check_); +}; + +} // namespace segmentation_platform + +#endif // COMPONENTS_SEGMENTATION_PLATFORM_INTERNAL_SIGNALS_UKM_OBSERVER_H_
diff --git a/components/segmentation_platform/internal/signals/ukm_observer_unittest.cc b/components/segmentation_platform/internal/signals/ukm_observer_unittest.cc new file mode 100644 index 0000000..7956e3e --- /dev/null +++ b/components/segmentation_platform/internal/signals/ukm_observer_unittest.cc
@@ -0,0 +1,238 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/segmentation_platform/internal/signals/ukm_observer.h" + +#include <memory> + +#include "base/test/task_environment.h" +#include "components/segmentation_platform/internal/database/mock_ukm_database.h" +#include "components/segmentation_platform/internal/signals/ukm_config.h" +#include "components/segmentation_platform/internal/signals/url_signal_handler.h" +#include "components/ukm/test_ukm_recorder.h" +#include "services/metrics/public/cpp/ukm_builders.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "url/gurl.h" + +namespace segmentation_platform { + +namespace { + +using testing::_; +using testing::Invoke; +using testing::UnorderedElementsAre; +using ukm::builders::PageLoad; +using ukm::builders::PaintPreviewCapture; + +constexpr ukm::SourceId kSourceId = 10; + +ukm::mojom::UkmEntryPtr GetSamplePageLoadEntry( + ukm::SourceId source_id = kSourceId) { + ukm::mojom::UkmEntryPtr entry = ukm::mojom::UkmEntry::New(); + entry->source_id = source_id; + entry->event_hash = PageLoad::kEntryNameHash; + entry->metrics[PageLoad::kCpuTimeNameHash] = 10; + entry->metrics[PageLoad::kIsNewBookmarkNameHash] = 20; + entry->metrics[PageLoad::kIsNTPCustomLinkNameHash] = 30; + return entry; +} + +ukm::mojom::UkmEntryPtr GetSamplePaintPreviewEntry( + ukm::SourceId source_id = kSourceId) { + ukm::mojom::UkmEntryPtr entry = ukm::mojom::UkmEntry::New(); + entry->source_id = source_id; + entry->event_hash = PaintPreviewCapture::kEntryNameHash; + entry->metrics[PaintPreviewCapture::kBlinkCaptureTimeNameHash] = 5; + entry->metrics[PaintPreviewCapture::kCompressedOnDiskSizeNameHash] = 15; + return entry; +} + +UkmEventHash TestEvent(uint64_t hash) { + return UkmEventHash::FromUnsafeValue(hash); +} + +UkmMetricHash TestMetric(uint64_t hash) { + return UkmMetricHash::FromUnsafeValue(hash); +} + +} // namespace + +class UkmObserverTest : public testing::Test { + public: + UkmObserverTest() = default; + ~UkmObserverTest() override = default; + + void SetUp() override { + ukm_database_ = std::make_unique<MockUkmDatabase>(); + url_signal_handler_ = + std::make_unique<UrlSignalHandler>(ukm_database_.get()); + ukm_recorder_ = std::make_unique<ukm::TestAutoSetUkmRecorder>(); + ukm_observer_ = std::make_unique<UkmObserver>( + ukm_recorder_.get(), ukm_database_.get(), url_signal_handler_.get()); + } + + void TearDown() override { + ukm_observer_.reset(); + ukm_recorder_.reset(); + url_signal_handler_.reset(); + ukm_database_.reset(); + } + + void ExpectUkmEventFromRecorder(ukm::mojom::UkmEntryPtr entry) { + uint64_t event_hash = entry->event_hash; + base::RunLoop wait_for_record; + EXPECT_CALL(ukm_database(), UkmEntryAdded(_)) + .WillOnce( + [&wait_for_record, &event_hash](ukm::mojom::UkmEntryPtr ukm_entry) { + EXPECT_EQ(ukm_entry->event_hash, event_hash); + wait_for_record.QuitClosure().Run(); + }); + ukm_recorder_->AddEntry(std::move(entry)); + wait_for_record.Run(); + } + + UkmObserver& ukm_observer() { return *ukm_observer_; } + ukm::TestUkmRecorder& ukm_recorder() { return *ukm_recorder_; } + MockUkmDatabase& ukm_database() { return *ukm_database_; } + + private: + base::test::TaskEnvironment task_environment_{ + base::test::TaskEnvironment::TimeSource::MOCK_TIME}; + std::unique_ptr<MockUkmDatabase> ukm_database_; + std::unique_ptr<UrlSignalHandler> url_signal_handler_; + std::unique_ptr<ukm::TestUkmRecorder> ukm_recorder_; + std::unique_ptr<UkmObserver> ukm_observer_; +}; + +TEST_F(UkmObserverTest, EmptyConfig) { + UkmObserver& observer = ukm_observer(); + + // Empty config should not add anything to database. + observer.StartObserving(UkmConfig()); + EXPECT_CALL(ukm_database(), UkmEntryAdded(_)).Times(0); + + observer.OnEntryAdded(GetSamplePageLoadEntry()); + observer.OnEntryAdded(GetSamplePaintPreviewEntry()); + + // Add page load config with no metrics. + UkmConfig config; + config.AddEvent(TestEvent(PageLoad::kEntryNameHash), {}); + observer.StartObserving(UkmConfig()); + observer.OnEntryAdded(GetSamplePageLoadEntry()); +} + +TEST_F(UkmObserverTest, FilterEventsAndMetrics) { + UkmObserver& observer = ukm_observer(); + + // Add PageLoad to the config. + UkmConfig config1; + config1.AddEvent(TestEvent(PageLoad::kEntryNameHash), + {TestMetric(PageLoad::kCpuTimeNameHash), + TestMetric(PageLoad::kNet_CacheBytes2NameHash), + TestMetric(PageLoad::kIsNewBookmarkNameHash)}); + observer.StartObserving(config1); + + EXPECT_CALL(ukm_database(), UkmEntryAdded(_)) + .WillOnce(Invoke([](ukm::mojom::UkmEntryPtr entry) { + EXPECT_EQ(entry->event_hash, PageLoad::kEntryNameHash); + EXPECT_THAT(entry->metrics, + UnorderedElementsAre( + std::make_pair(PageLoad::kCpuTimeNameHash, 10), + std::make_pair(PageLoad::kIsNewBookmarkNameHash, 20))); + })); + observer.OnEntryAdded(GetSamplePaintPreviewEntry()); + observer.OnEntryAdded(GetSamplePageLoadEntry()); + + // Add Paint preview config to the same observer, also add metrics with wrong + // event hashes, which should not match. + UkmConfig config2; + config2.AddEvent( + TestEvent(PaintPreviewCapture::kEntryNameHash), + {TestMetric(PaintPreviewCapture::kBlinkCaptureTimeNameHash)}); + config2.AddEvent( + UkmEventHash(), + {TestMetric(PaintPreviewCapture::kCompressedOnDiskSizeNameHash)}); + config2.AddEvent( + TestEvent(PageLoad::kEntryNameHash), + {TestMetric(PaintPreviewCapture::kCompressedOnDiskSizeNameHash)}); + + // In addition to already added metrics. + observer.StartObserving(config2); + + EXPECT_CALL(ukm_database(), UkmEntryAdded(_)) + .WillOnce(Invoke([](ukm::mojom::UkmEntryPtr entry) { + EXPECT_EQ(entry->event_hash, PaintPreviewCapture::kEntryNameHash); + EXPECT_THAT(entry->metrics, + UnorderedElementsAre(std::make_pair( + PaintPreviewCapture::kBlinkCaptureTimeNameHash, 5))); + })); + observer.OnEntryAdded(GetSamplePaintPreviewEntry()); + + EXPECT_CALL(ukm_database(), UkmEntryAdded(_)) + .WillOnce(Invoke([](ukm::mojom::UkmEntryPtr entry) { + EXPECT_EQ(entry->event_hash, PageLoad::kEntryNameHash); + EXPECT_THAT(entry->metrics, + UnorderedElementsAre( + std::make_pair(PageLoad::kCpuTimeNameHash, 10), + std::make_pair(PageLoad::kIsNewBookmarkNameHash, 20))); + })); + observer.OnEntryAdded(GetSamplePageLoadEntry()); +} + +TEST_F(UkmObserverTest, PauseObservation) { + UkmObserver& observer = ukm_observer(); + + // Add PageLoad to the config. + UkmConfig config; + config.AddEvent(TestEvent(PageLoad::kEntryNameHash), + {TestMetric(PageLoad::kCpuTimeNameHash), + TestMetric(PageLoad::kNet_CacheBytes2NameHash), + TestMetric(PageLoad::kIsNewBookmarkNameHash)}); + observer.StartObserving(config); + + EXPECT_CALL(ukm_database(), UkmEntryAdded(_)).Times(0); + EXPECT_CALL(ukm_database(), UkmSourceUrlUpdated(_, _, _)).Times(0); + + observer.PauseOrResumeObservation(true); + + const GURL kUrl1("https://www.url1.com"); + observer.OnEntryAdded(GetSamplePageLoadEntry()); + observer.OnUpdateSourceURL(kSourceId, {kUrl1}); +} + +TEST_F(UkmObserverTest, ObservationFromRecorder) { + UkmObserver& observer = ukm_observer(); + ukm::TestUkmRecorder& recorder = ukm_recorder(); + + // Add PageLoad to the config. + UkmConfig config; + config.AddEvent(TestEvent(PageLoad::kEntryNameHash), + {TestMetric(PageLoad::kCpuTimeNameHash), + TestMetric(PageLoad::kIsNewBookmarkNameHash)}); + observer.StartObserving(config); + + ExpectUkmEventFromRecorder(GetSamplePageLoadEntry()); + + const GURL kUrl1("https://www.url1.com"); + base::RunLoop wait_for_source; + EXPECT_CALL(ukm_database(), + UkmSourceUrlUpdated(kSourceId, kUrl1, /*is_validated=*/false)) + .WillOnce([&wait_for_source](ukm::SourceId, const GURL&, bool) { + wait_for_source.QuitClosure().Run(); + }); + recorder.UpdateSourceURL(kSourceId, {kUrl1}); + wait_for_source.Run(); + + // Update the Config to include more events. + UkmConfig config2; + config2.AddEvent( + TestEvent(PaintPreviewCapture::kEntryNameHash), + {TestMetric(PaintPreviewCapture::kBlinkCaptureTimeNameHash)}); + observer.StartObserving(config2); + + ExpectUkmEventFromRecorder(GetSamplePageLoadEntry()); + ExpectUkmEventFromRecorder(GetSamplePaintPreviewEntry()); +} + +} // namespace segmentation_platform
diff --git a/components/segmentation_platform/internal/signals/url_signal_handler_unittest.cc b/components/segmentation_platform/internal/signals/url_signal_handler_unittest.cc index 8bc4f6a9..2fa6c31 100644 --- a/components/segmentation_platform/internal/signals/url_signal_handler_unittest.cc +++ b/components/segmentation_platform/internal/signals/url_signal_handler_unittest.cc
@@ -5,6 +5,7 @@ #include "components/segmentation_platform/internal/signals/url_signal_handler.h" #include "base/test/task_environment.h" +#include "components/segmentation_platform/internal/database/mock_ukm_database.h" #include "components/segmentation_platform/internal/database/ukm_database.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -24,22 +25,6 @@ std::move(callback).Run(false); } -class MockUkmDatabase : public UkmDatabase { - public: - MockUkmDatabase() : UkmDatabase(base::FilePath()) {} - - MOCK_METHOD1(UkmEntryAdded, void(ukm::mojom::UkmEntryPtr ukm_entry)); - - MOCK_METHOD3(UkmSourceUrlUpdated, - void(ukm::SourceId source_id, - const GURL& url, - bool is_validated)); - - MOCK_METHOD1(OnUrlValidated, void(const GURL& url)); - - MOCK_METHOD1(RemoveUrls, void(const std::vector<GURL>& urls)); -}; - class MockHistoryDelegate : public UrlSignalHandler::HistoryDelegate { public: MOCK_METHOD(bool, FastCheckUrl, (const GURL& url), (override));
diff --git a/components/segmentation_platform/internal/ukm_data_manager_impl.cc b/components/segmentation_platform/internal/ukm_data_manager_impl.cc index 1fd30479..fe2333e5a 100644 --- a/components/segmentation_platform/internal/ukm_data_manager_impl.cc +++ b/components/segmentation_platform/internal/ukm_data_manager_impl.cc
@@ -5,19 +5,28 @@ #include "components/segmentation_platform/internal/ukm_data_manager_impl.h" #include "base/check_op.h" +#include "components/segmentation_platform/internal/database/ukm_database.h" #include "components/segmentation_platform/internal/signals/ukm_config.h" +#include "components/segmentation_platform/internal/signals/ukm_observer.h" +#include "components/segmentation_platform/internal/signals/url_signal_handler.h" namespace segmentation_platform { UkmDataManagerImpl::UkmDataManagerImpl() = default; UkmDataManagerImpl::~UkmDataManagerImpl() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_check_); DCHECK_EQ(ref_count_, 0); - // TODO(ssid): Destroy signal handler and database here. + + // UKM observer should be destroyed earlier since it uses the database. + DCHECK(!ukm_observer_); + url_signal_handler_.reset(); + ukm_database_.reset(); } void UkmDataManagerImpl::Initialize(const base::FilePath& database_path) { - // TODO(ssid): Create database here. + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_check_); + ukm_database_ = std::make_unique<UkmDatabase>(database_path); } bool UkmDataManagerImpl::IsUkmEngineEnabled() { @@ -26,37 +35,63 @@ } UrlSignalHandler* UkmDataManagerImpl::GetOrCreateUrlHandler() { - // TODO(ssid): Return signal handler here. - return nullptr; + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_check_); + DCHECK(ukm_database_); + if (!url_signal_handler_) { + url_signal_handler_ = + std::make_unique<UrlSignalHandler>(ukm_database_.get()); + } + return url_signal_handler_.get(); } void UkmDataManagerImpl::NotifyCanObserveUkm( ukm::UkmRecorderImpl* ukm_recorder) { - // TODO(ssid): Create observer here. + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_check_); + DCHECK(ukm_database_); + ukm_observer_ = std::make_unique<UkmObserver>( + ukm_recorder, ukm_database_.get(), GetOrCreateUrlHandler()); + if (pending_ukm_config_) { + ukm_observer_->StartObserving(*pending_ukm_config_); + pending_ukm_config_.reset(); + } } void UkmDataManagerImpl::StartObservingUkm(const UkmConfig& ukm_config) { - // TODO(ssid): Implement this. + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_check_); + if (ukm_observer_) { + ukm_observer_->StartObserving(ukm_config); + } else { + if (!pending_ukm_config_) + pending_ukm_config_ = std::make_unique<UkmConfig>(); + pending_ukm_config_->Merge(ukm_config); + } } void UkmDataManagerImpl::PauseOrResumeObservation(bool pause) { - // TODO(ssid): Implement this. + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_check_); + ukm_observer_->PauseOrResumeObservation(pause); } void UkmDataManagerImpl::StopObservingUkm() { - // TODO(ssid): Destroy observer here. + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_check_); + DCHECK(ukm_database_); + DCHECK(url_signal_handler_); + ukm_observer_.reset(); } UkmDatabase* UkmDataManagerImpl::GetUkmDatabase() { - // TODO(ssid): Implement. - return nullptr; + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_check_); + DCHECK(ukm_database_); + return ukm_database_.get(); } void UkmDataManagerImpl::AddRef() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_check_); ref_count_++; } void UkmDataManagerImpl::RemoveRef() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_check_); DCHECK_GT(ref_count_, 0); ref_count_--; }
diff --git a/components/segmentation_platform/internal/ukm_data_manager_impl.h b/components/segmentation_platform/internal/ukm_data_manager_impl.h index 3158390..fec82d8e 100644 --- a/components/segmentation_platform/internal/ukm_data_manager_impl.h +++ b/components/segmentation_platform/internal/ukm_data_manager_impl.h
@@ -5,10 +5,17 @@ #ifndef COMPONENTS_SEGMENTATION_PLATFORM_INTERNAL_UKM_DATA_MANAGER_IMPL_H_ #define COMPONENTS_SEGMENTATION_PLATFORM_INTERNAL_UKM_DATA_MANAGER_IMPL_H_ +#include <memory> + +#include "base/sequence_checker.h" #include "components/segmentation_platform/internal/ukm_data_manager.h" namespace segmentation_platform { +class UkmDatabase; +class UkmObserver; +class UrlSignalHandler; + class UkmDataManagerImpl : public UkmDataManager { public: UkmDataManagerImpl(); @@ -31,6 +38,12 @@ private: int ref_count_ = 0; + std::unique_ptr<UkmDatabase> ukm_database_; + std::unique_ptr<UrlSignalHandler> url_signal_handler_; + std::unique_ptr<UkmObserver> ukm_observer_; + std::unique_ptr<UkmConfig> pending_ukm_config_; + + SEQUENCE_CHECKER(sequence_check_); }; } // namespace segmentation_platform
diff --git a/components/services/storage/public/mojom/indexed_db_control.mojom b/components/services/storage/public/mojom/indexed_db_control.mojom index 16542dc..0090f50 100644 --- a/components/services/storage/public/mojom/indexed_db_control.mojom +++ b/components/services/storage/public/mojom/indexed_db_control.mojom
@@ -75,7 +75,7 @@ // Called by chrome://indexeddb-internals to populate its page details. GetAllStorageKeysDetails() => (bool incognito, - mojo_base.mojom.ListValue details); + mojo_base.mojom.DeprecatedListValue details); // Disables the exit-time deletion of session-only data, so that internal // restarts can preserve that data.
diff --git a/components/services/storage/service_worker/service_worker_disk_cache.cc b/components/services/storage/service_worker/service_worker_disk_cache.cc index 314b08b..76ac0d6 100644 --- a/components/services/storage/service_worker/service_worker_disk_cache.cc +++ b/components/services/storage/service_worker/service_worker_disk_cache.cc
@@ -273,9 +273,9 @@ base::MakeRefCounted<CreateBackendCallbackShim>(this); net::Error return_value = disk_cache::CreateCacheBackend( - cache_type, net::CACHE_BACKEND_SIMPLE, cache_directory, cache_size, - disk_cache::ResetHandling::kNeverReset, nullptr, - &(create_backend_callback_->backend_ptr_), + cache_type, net::CACHE_BACKEND_SIMPLE, /*file_operations=*/nullptr, + cache_directory, cache_size, disk_cache::ResetHandling::kNeverReset, + nullptr, &(create_backend_callback_->backend_ptr_), std::move(post_cleanup_callback), base::BindOnce(&CreateBackendCallbackShim::Callback, create_backend_callback_));
diff --git a/components/spellcheck/common/spellcheck_common.cc b/components/spellcheck/common/spellcheck_common.cc index 903fa56..ef41a6ed 100644 --- a/components/spellcheck/common/spellcheck_common.cc +++ b/components/spellcheck/common/spellcheck_common.cc
@@ -138,12 +138,13 @@ // January 2020: Update fa-IR dictionaries from upstream. {"fa-IR", "-9-0"}, - // March 2022: Update en-* dictionaries from upstream. - {"en-AU", "-10-0"}, - {"en-CA", "-10-0"}, - {"en-GB", "-10-0"}, - {"en-GB-oxendict", "-10-0"}, - {"en-US", "-10-0"}, + // March 2022: Update en-* dictionaries from upstream and add "Kyiv" to + // those dictionaries. + {"en-AU", "-10-1"}, + {"en-CA", "-10-1"}, + {"en-GB", "-10-1"}, + {"en-GB-oxendict", "-10-1"}, + {"en-US", "-10-1"}, // March 2022: Update uk-UA dictionary from upstream. {"uk-UA", "-5-0"},
diff --git a/components/sync/driver/sync_user_settings.h b/components/sync/driver/sync_user_settings.h index 8c07b44..f78f45b 100644 --- a/components/sync/driver/sync_user_settings.h +++ b/components/sync/driver/sync_user_settings.h
@@ -61,8 +61,7 @@ virtual void SetSelectedTypes(bool sync_everything, UserSelectableTypeSet types) = 0; // Registered user selectable types are derived from registered model types. - // UserSelectableType is registered iff main corresponding ModelType is - // registered. + // A UserSelectableType is registered if any of its ModelTypes is registered. virtual UserSelectableTypeSet GetRegisteredSelectableTypes() const = 0; #if BUILDFLAG(IS_CHROMEOS_ASH)
diff --git a/components/sync/driver/sync_user_settings_impl.cc b/components/sync/driver/sync_user_settings_impl.cc index ad2359f..40af755f 100644 --- a/components/sync/driver/sync_user_settings_impl.cc +++ b/components/sync/driver/sync_user_settings_impl.cc
@@ -24,7 +24,10 @@ namespace { -ModelTypeSet ResolvePreferredTypes(UserSelectableTypeSet selected_types) { +// Converts |selected_types| to the corresponding ModelTypeSet (e.g. +// {kExtensions} becomes {EXTENSIONS, EXTENSION_SETTINGS}). +ModelTypeSet UserSelectableTypesToModelTypes( + UserSelectableTypeSet selected_types) { ModelTypeSet preferred_types; for (UserSelectableType type : selected_types) { preferred_types.PutAll(UserSelectableTypeToAllModelTypes(type)); @@ -33,7 +36,8 @@ } #if BUILDFLAG(IS_CHROMEOS_ASH) -ModelTypeSet ResolvePreferredOsTypes(UserSelectableOsTypeSet selected_types) { +ModelTypeSet UserSelectableOsTypesToModelTypes( + UserSelectableOsTypeSet selected_types) { ModelTypeSet preferred_types; for (UserSelectableOsType type : selected_types) { preferred_types.PutAll(UserSelectableOsTypeToAllModelTypes(type)); @@ -239,11 +243,11 @@ } ModelTypeSet SyncUserSettingsImpl::GetPreferredDataTypes() const { - ModelTypeSet types = ResolvePreferredTypes(GetSelectedTypes()); + ModelTypeSet types = UserSelectableTypesToModelTypes(GetSelectedTypes()); types.PutAll(AlwaysPreferredUserTypes()); #if BUILDFLAG(IS_CHROMEOS_ASH) if (chromeos::features::IsSyncSettingsCategorizationEnabled()) { - types.PutAll(ResolvePreferredOsTypes(GetSelectedOsTypes())); + types.PutAll(UserSelectableOsTypesToModelTypes(GetSelectedOsTypes())); } #endif types.RetainAll(registered_model_types_); @@ -276,10 +280,4 @@ return !Intersection(preferred_types, encrypted_types).Empty(); } -// static -ModelTypeSet SyncUserSettingsImpl::ResolvePreferredTypesForTesting( - UserSelectableTypeSet selected_types) { - return ResolvePreferredTypes(selected_types); -} - } // namespace syncer
diff --git a/components/sync/driver/sync_user_settings_impl.h b/components/sync/driver/sync_user_settings_impl.h index 97b40d8..1fa2948 100644 --- a/components/sync/driver/sync_user_settings_impl.h +++ b/components/sync/driver/sync_user_settings_impl.h
@@ -77,12 +77,6 @@ ModelTypeSet GetPreferredDataTypes() const; bool IsEncryptedDatatypeEnabled() const; - // Converts |selected_types| to ModelTypeSet of corresponding UserTypes() by - // resolving pref groups (e.g. {kExtensions} becomes {EXTENSIONS, - // EXTENSION_SETTINGS}). - static ModelTypeSet ResolvePreferredTypesForTesting( - UserSelectableTypeSet selected_types); - private: const raw_ptr<SyncServiceCrypto> crypto_; const raw_ptr<SyncPrefs> prefs_;
diff --git a/components/sync/driver/test_sync_user_settings.cc b/components/sync/driver/test_sync_user_settings.cc index 9d8d754..da8ed58 100644 --- a/components/sync/driver/test_sync_user_settings.cc +++ b/components/sync/driver/test_sync_user_settings.cc
@@ -64,12 +64,15 @@ void TestSyncUserSettings::SetSelectedTypes(bool sync_everything, UserSelectableTypeSet types) { sync_everything_enabled_ = sync_everything; - syncer::ModelTypeSet preferred_types; + if (sync_everything_enabled_) { - preferred_types = syncer::ModelTypeSet::All(); - } else { - preferred_types = - syncer::SyncUserSettingsImpl::ResolvePreferredTypesForTesting(types); + service_->SetPreferredDataTypes(syncer::ModelTypeSet::All()); + return; + } + + syncer::ModelTypeSet preferred_types; + for (UserSelectableType type : types) { + preferred_types.PutAll(UserSelectableTypeToAllModelTypes(type)); } service_->SetPreferredDataTypes(preferred_types); }
diff --git a/components/viz/service/display/overlay_proposed_candidate.h b/components/viz/service/display/overlay_proposed_candidate.h index 5826b2a..d85dae1 100644 --- a/components/viz/service/display/overlay_proposed_candidate.h +++ b/components/viz/service/display/overlay_proposed_candidate.h
@@ -26,8 +26,6 @@ // An iterator in the QuadList. QuadList::Iterator quad_iter; - // This is needed to sort candidates based on DrawQuad order. - size_t quad_index; OverlayCandidate candidate; raw_ptr<OverlayProcessorStrategy> strategy = nullptr;
diff --git a/components/webapps/browser/android/shortcut_info.cc b/components/webapps/browser/android/shortcut_info.cc index 596f3562..a6c7577 100644 --- a/components/webapps/browser/android/shortcut_info.cc +++ b/components/webapps/browser/android/shortcut_info.cc
@@ -25,6 +25,8 @@ } // namespace +using blink::mojom::DisplayMode; + ShareTargetParamsFile::ShareTargetParamsFile() {} ShareTargetParamsFile::ShareTargetParamsFile( @@ -102,12 +104,20 @@ scope = manifest.scope; // Set the display based on the manifest value, if any. - if (manifest.display != blink::mojom::DisplayMode::kUndefined) + if (manifest.display != DisplayMode::kUndefined) display = manifest.display; - if (display == blink::mojom::DisplayMode::kStandalone || - display == blink::mojom::DisplayMode::kFullscreen || - display == blink::mojom::DisplayMode::kMinimalUi) { + for (DisplayMode display_mode : manifest.display_override) { + if (display_mode == DisplayMode::kStandalone || + display_mode == DisplayMode::kFullscreen) { + display = display_mode; + break; + } + } + + if (display == DisplayMode::kStandalone || + display == DisplayMode::kFullscreen || + display == DisplayMode::kMinimalUi) { source = SOURCE_ADD_TO_HOMESCREEN_STANDALONE; // Set the orientation based on the manifest value, or ignore if the display // mode is different from 'standalone', 'fullscreen' or 'minimal-ui'.
diff --git a/components/webapps/browser/android/shortcut_info_unittest.cc b/components/webapps/browser/android/shortcut_info_unittest.cc index 767d23d..ad13cc11 100644 --- a/components/webapps/browser/android/shortcut_info_unittest.cc +++ b/components/webapps/browser/android/shortcut_info_unittest.cc
@@ -236,4 +236,12 @@ EXPECT_FALSE(info_.is_splash_image_maskable); } +TEST_F(ShortcutInfoTest, DisplayOverride) { + manifest_.display = blink::mojom::DisplayMode::kStandalone; + manifest_.display_override = {blink::mojom::DisplayMode::kFullscreen}; + info_.UpdateFromManifest(manifest_); + + EXPECT_EQ(info_.display, blink::mojom::DisplayMode::kFullscreen); +} + } // namespace webapps
diff --git a/components/webapps/browser/banners/app_banner_manager.cc b/components/webapps/browser/banners/app_banner_manager.cc index 2184636..cf282c0 100644 --- a/components/webapps/browser/banners/app_banner_manager.cc +++ b/components/webapps/browser/banners/app_banner_manager.cc
@@ -224,16 +224,9 @@ : content::WebContentsObserver(web_contents), SiteEngagementObserver(site_engagement::SiteEngagementService::Get( web_contents->GetBrowserContext())), - has_maskable_primary_icon_(false), - state_(State::INACTIVE), manager_(InstallableManager::FromWebContents(web_contents)), manifest_(blink::mojom::Manifest::New()), - has_sufficient_engagement_(false), - load_finished_(false), - status_reporter_(std::make_unique<NullStatusReporter>()), - install_animation_pending_(false), - installable_web_app_check_result_( - InstallableWebAppCheckResult::kUnknown) { + status_reporter_(std::make_unique<NullStatusReporter>()) { DCHECK(manager_); AppBannerSettingsHelper::UpdateFromFieldTrial();
diff --git a/components/webapps/browser/banners/app_banner_manager.h b/components/webapps/browser/banners/app_banner_manager.h index cfe90ca..ee68072 100644 --- a/components/webapps/browser/banners/app_banner_manager.h +++ b/components/webapps/browser/banners/app_banner_manager.h
@@ -191,8 +191,8 @@ // Simple accessors: const blink::mojom::Manifest& manifest() const; - const SkBitmap& primary_icon() { return primary_icon_; } - bool has_maskable_primary_icon() { return has_maskable_primary_icon_; } + const SkBitmap& primary_icon() const { return primary_icon_; } + bool has_maskable_primary_icon() const { return has_maskable_primary_icon_; } const GURL& validated_url() { return validated_url_; } // Tracks the route taken to an install of a PWA (whether the bottom sheet @@ -267,7 +267,7 @@ // Callback invoked by the InstallableManager once it has fetched the page's // manifest. - virtual void OnDidGetManifest(const InstallableData& result); + virtual void OnDidGetManifest(const InstallableData& data); // Returns an InstallableParams object that requests all checks // necessary for a web app banner. @@ -284,8 +284,7 @@ // Callback invoked by the InstallableManager once it has finished checking // all other installable properties. - virtual void OnDidPerformInstallableWebAppCheck( - const InstallableData& result); + virtual void OnDidPerformInstallableWebAppCheck(const InstallableData& data); // Records that a banner was shown. void RecordDidShowBanner(); @@ -364,10 +363,10 @@ SkBitmap primary_icon_; // Whether or not the primary icon is maskable. - bool has_maskable_primary_icon_; + bool has_maskable_primary_icon_ = false; // The current banner pipeline state for this page load. - State state_; + State state_ = State::INACTIVE; private: friend class AppBannerManagerTest; @@ -418,12 +417,13 @@ // If a banner is requested before the page has finished loading, defer // triggering the pipeline until the load is complete. - bool has_sufficient_engagement_; - bool load_finished_; + bool has_sufficient_engagement_ = false; + bool load_finished_ = false; std::unique_ptr<StatusReporter> status_reporter_; - bool install_animation_pending_; - InstallableWebAppCheckResult installable_web_app_check_result_; + bool install_animation_pending_ = false; + InstallableWebAppCheckResult installable_web_app_check_result_ = + InstallableWebAppCheckResult::kUnknown; // The scope of the most recent installability check that passes promotability // requirements, otherwise invalid.
diff --git a/components/webapps/browser/installable/installable_logging.cc b/components/webapps/browser/installable/installable_logging.cc index 20a557b..cfe5756 100644 --- a/components/webapps/browser/installable/installable_logging.cc +++ b/components/webapps/browser/installable/installable_logging.cc
@@ -268,18 +268,18 @@ break; case MANIFEST_MISSING_SUITABLE_ICON: error_id = kManifestMissingSuitableIconId; - error_arguments.push_back(content::InstallabilityErrorArgument( + error_arguments.emplace_back( kMinimumIconSizeInPixelsId, - base::NumberToString(InstallableManager::GetMinimumIconSizeInPx()))); + base::NumberToString(InstallableManager::GetMinimumIconSizeInPx())); break; case NO_MATCHING_SERVICE_WORKER: error_id = kNoMatchingServiceWorkerId; break; case NO_ACCEPTABLE_ICON: error_id = kNoAcceptableIconId; - error_arguments.push_back(content::InstallabilityErrorArgument( + error_arguments.emplace_back( kMinimumIconSizeInPixelsId, - base::NumberToString(InstallableManager::GetMinimumIconSizeInPx()))); + base::NumberToString(InstallableManager::GetMinimumIconSizeInPx())); break; case CANNOT_DOWNLOAD_ICON: error_id = kCannotDownloadIconId;
diff --git a/components/webapps/browser/installable/installable_manager.cc b/components/webapps/browser/installable/installable_manager.cc index 9e848f6..2b196fb 100644 --- a/components/webapps/browser/installable/installable_manager.cc +++ b/components/webapps/browser/installable/installable_manager.cc
@@ -219,13 +219,10 @@ InstallableManager::ValidManifestProperty::~ValidManifestProperty() = default; -InstallableManager::IconProperty::IconProperty() - : error(NO_ERROR_DETECTED), - purpose(IconPurpose::ANY), - icon(), - fetched(false) {} +InstallableManager::IconProperty::IconProperty() = default; -InstallableManager::IconProperty::IconProperty(IconProperty&& other) = default; +InstallableManager::IconProperty::IconProperty(IconProperty&& other) noexcept = + default; InstallableManager::IconProperty::~IconProperty() = default; @@ -914,7 +911,7 @@ } } -void InstallableManager::OnScreenshotFetched(const GURL screenshot_url, +void InstallableManager::OnScreenshotFetched(GURL screenshot_url, const SkBitmap& bitmap) { DCHECK_GT(screenshots_downloading_, 0);
diff --git a/components/webapps/browser/installable/installable_manager.h b/components/webapps/browser/installable/installable_manager.h index 82e19c67..bcc7bd2 100644 --- a/components/webapps/browser/installable/installable_manager.h +++ b/components/webapps/browser/installable/installable_manager.h
@@ -155,29 +155,29 @@ IconProperty(const IconProperty&) = delete; IconProperty& operator=(const IconProperty&) = delete; - IconProperty(IconProperty&& other); + IconProperty(IconProperty&& other) noexcept; IconProperty& operator=(IconProperty&& other); ~IconProperty(); - InstallableStatusCode error; - IconPurpose purpose; + InstallableStatusCode error = NO_ERROR_DETECTED; + IconPurpose purpose = blink::mojom::ManifestImageResource_Purpose::ANY; GURL url; std::unique_ptr<SkBitmap> icon; - bool fetched; + bool fetched = false; }; // Returns true if an icon for the given usage is fetched successfully, or // doesn't need to fallback to another icon purpose (i.e. MASKABLE icon // allback to ANY icon). - bool IsIconFetchComplete(const IconUsage usage) const; + bool IsIconFetchComplete(IconUsage usage) const; // Returns true if we have tried fetching maskable icon. Note that this also // returns true if the fallback icon(IconPurpose::ANY) is fetched. - bool IsMaskableIconFetched(const IconUsage usage) const; + bool IsMaskableIconFetched(IconUsage usage) const; // Sets the icon matching |usage| as fetched. - void SetIconFetched(const IconUsage usage); + void SetIconFetched(IconUsage usage); // Returns a vector with all errors encountered for the resources requested in // |params|, or an empty vector if there is no error. @@ -189,9 +189,9 @@ InstallableStatusCode valid_manifest_error() const; void set_valid_manifest_error(InstallableStatusCode error_code); InstallableStatusCode worker_error() const; - InstallableStatusCode icon_error(const IconUsage usage); - GURL& icon_url(const IconUsage usage); - const SkBitmap* icon(const IconUsage usage); + InstallableStatusCode icon_error(IconUsage usage); + GURL& icon_url(IconUsage usage); + const SkBitmap* icon(IconUsage usage); // Returns the WebContents to which this object is attached, or nullptr if the // WebContents doesn't exist or is currently being destroyed. @@ -237,14 +237,12 @@ void CheckAndFetchBestIcon(int ideal_icon_size_in_px, int minimum_icon_size_in_px, - const IconPurpose purpose, - const IconUsage usage); - void OnIconFetched(const GURL icon_url, - const IconUsage usage, - const SkBitmap& bitmap); + IconPurpose purpose, + IconUsage usage); + void OnIconFetched(GURL icon_url, IconUsage usage, const SkBitmap& bitmap); void CheckAndFetchScreenshots(); - void OnScreenshotFetched(const GURL screenshot_url, const SkBitmap& bitmap); + void OnScreenshotFetched(GURL screenshot_url, const SkBitmap& bitmap); // content::ServiceWorkerContextObserver overrides void OnRegistrationCompleted(const GURL& pattern) override;
diff --git a/components/webapps/browser/installable/installable_manager_unittest.cc b/components/webapps/browser/installable/installable_manager_unittest.cc index 71658691..c8c9b05 100644 --- a/components/webapps/browser/installable/installable_manager_unittest.cc +++ b/components/webapps/browser/installable/installable_manager_unittest.cc
@@ -33,7 +33,7 @@ blink::Manifest::ImageResource primary_icon; primary_icon.type = u"image/png"; - primary_icon.sizes.push_back(gfx::Size(144, 144)); + primary_icon.sizes.emplace_back(144, 144); primary_icon.purpose.push_back(IconPurpose::ANY); manifest->icons.push_back(primary_icon);
diff --git a/components/webapps/services/web_app_origin_association/web_app_origin_association_fetcher_unittest.cc b/components/webapps/services/web_app_origin_association/web_app_origin_association_fetcher_unittest.cc index 5471a0a..c8b7762 100644 --- a/components/webapps/services/web_app_origin_association/web_app_origin_association_fetcher_unittest.cc +++ b/components/webapps/services/web_app_origin_association/web_app_origin_association_fetcher_unittest.cc
@@ -93,7 +93,7 @@ auto handler = apps::UrlHandlerInfo(); handler.origin = url::Origin::Create(GURL(server_.base_url())); fetcher_->FetchWebAppOriginAssociationFile( - std::move(handler), shared_url_loader_factory_.get(), + handler, shared_url_loader_factory_.get(), base::BindLambdaForTesting( [&](std::unique_ptr<std::string> file_content) { ASSERT_FALSE(!file_content); @@ -112,7 +112,7 @@ GURL url = server_.GetURL("foo.com", "/"); handler.origin = url::Origin::Create(url); fetcher_->FetchWebAppOriginAssociationFile( - std::move(handler), shared_url_loader_factory_.get(), + handler, shared_url_loader_factory_.get(), base::BindLambdaForTesting( [&](std::unique_ptr<std::string> file_content) { ASSERT_TRUE(!file_content); @@ -131,7 +131,7 @@ auto handler = apps::UrlHandlerInfo(); handler.origin = url::Origin::Create(GURL("https://co.uk")); fetcher_->FetchWebAppOriginAssociationFile( - std::move(handler), shared_url_loader_factory_.get(), + handler, shared_url_loader_factory_.get(), base::BindLambdaForTesting( [&](std::unique_ptr<std::string> file_content) { ASSERT_TRUE(!file_content);
diff --git a/components/webapps/services/web_app_origin_association/web_app_origin_association_parser_unittest.cc b/components/webapps/services/web_app_origin_association/web_app_origin_association_parser_unittest.cc index db731da0..0b49c3d 100644 --- a/components/webapps/services/web_app_origin_association/web_app_origin_association_parser_unittest.cc +++ b/components/webapps/services/web_app_origin_association/web_app_origin_association_parser_unittest.cc
@@ -39,7 +39,7 @@ unsigned int GetErrorCount() const { return errors_.size(); } - bool failed() { return failed_; } + bool failed() const { return failed_; } private: std::vector<std::string> errors_;
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn index 56fdba5e8..247535b 100644 --- a/content/browser/BUILD.gn +++ b/content/browser/BUILD.gn
@@ -1343,6 +1343,8 @@ "net/cross_origin_embedder_policy_reporter.h", "net/cross_origin_opener_policy_reporter.cc", "net/cross_origin_opener_policy_reporter.h", + "net/http_cache_backend_file_operations_factory.cc", + "net/http_cache_backend_file_operations_factory.h", "permissions/permission_util.cc", "permissions/permission_util.h", "picture_in_picture/document_picture_in_picture_window_controller_impl.cc", @@ -2336,6 +2338,8 @@ if (is_linux || is_chromeos) { sources += [ + "accessibility/ax_screen_ai_annotator.cc", + "accessibility/ax_screen_ai_annotator.h", "child_process_launcher_helper_linux.cc", "compute_pressure/cpu_probe_linux.cc", "compute_pressure/cpu_probe_linux.h", @@ -2362,6 +2366,7 @@ deps += [ "//components/crash/content/browser/error_reporting", "//components/services/font:lib", + "//components/services/screen_ai", "//third_party/blink/public/mojom:memory_usage_monitor_linux_mojo_bindings", ] }
diff --git a/content/browser/DEPS b/content/browser/DEPS index 6bc85115..6c7ae7c 100644 --- a/content/browser/DEPS +++ b/content/browser/DEPS
@@ -17,6 +17,7 @@ "+components/services/font/ppapi_fontconfig_matching.h", "+components/services/quarantine/test_support.h", "+components/services/quarantine/quarantine.h", + "+components/services/screen_ai", "+components/services/storage", "+components/services/storage/public", "+components/session_manager/core",
diff --git a/content/browser/accessibility/ax_screen_ai_annotator.cc b/content/browser/accessibility/ax_screen_ai_annotator.cc new file mode 100644 index 0000000..d1adf1f --- /dev/null +++ b/content/browser/accessibility/ax_screen_ai_annotator.cc
@@ -0,0 +1,57 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "content/browser/accessibility/ax_screen_ai_annotator.h" + +#include "content/public/browser/render_frame_host.h" +#include "content/public/browser/web_contents.h" +#include "ui/gfx/image/image.h" +#include "ui/snapshot/snapshot.h" + +namespace content { + +AXScreenAIAnnotator::AXScreenAIAnnotator( + RenderFrameHost* const render_frame_host, + mojo::AssociatedRemote<screen_ai::mojom::ScreenAIAnnotator> + screen_ai_annotator) + : render_frame_host_(render_frame_host), + screen_ai_annotator_(std::move(screen_ai_annotator)) {} + +AXScreenAIAnnotator::~AXScreenAIAnnotator() = default; + +void AXScreenAIAnnotator::Run() { + DCHECK(render_frame_host_->IsInPrimaryMainFrame()); + + // Request screenshot from content area. + WebContents* web_contents = + WebContents::FromRenderFrameHost(render_frame_host_); + if (!web_contents) + return; + gfx::NativeWindow native_window = web_contents->GetContentNativeView(); + if (!native_window) + return; + ui::GrabViewSnapshotAsync( + native_window, gfx::Rect(web_contents->GetSize()), + base::BindOnce(&AXScreenAIAnnotator::OnScreenshotReceived, + weak_ptr_factory_.GetWeakPtr())); +} + +void AXScreenAIAnnotator::OnScreenshotReceived(gfx::Image snapshot) { + screen_ai_annotator_->Annotate( + snapshot.AsBitmap(), + base::BindOnce(&AXScreenAIAnnotator::OnAnnotationReceived, + weak_ptr_factory_.GetWeakPtr())); +} + +void AXScreenAIAnnotator::OnAnnotationReceived( + screen_ai::mojom::ErrorType error_type, + std::vector<screen_ai::mojom::NodePtr> annotation) { + if (error_type != screen_ai::mojom::ErrorType::kOK) + return; + + // TODO(https://crbug.com/1278249): Convert and send annotation through + // |render_frame_host_->AccessibilityPerformAction|. +} + +} // namespace content \ No newline at end of file
diff --git a/content/browser/accessibility/ax_screen_ai_annotator.h b/content/browser/accessibility/ax_screen_ai_annotator.h new file mode 100644 index 0000000..3616486 --- /dev/null +++ b/content/browser/accessibility/ax_screen_ai_annotator.h
@@ -0,0 +1,55 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_BROWSER_ACCESSIBILITY_AX_SCREEN_AI_ANNOTATOR_H_ +#define CONTENT_BROWSER_ACCESSIBILITY_AX_SCREEN_AI_ANNOTATOR_H_ + +#include "base/memory/raw_ptr.h" +#include "base/memory/weak_ptr.h" +#include "components/services/screen_ai/public/mojom/screen_ai_service.mojom.h" +#include "mojo/public/cpp/bindings/associated_remote.h" + +namespace gfx { +class Image; +} + +namespace content { + +class RenderFrameHost; + +class AXScreenAIAnnotator { + public: + AXScreenAIAnnotator( + RenderFrameHost* const render_frame_host, + mojo::AssociatedRemote<screen_ai::mojom::ScreenAIAnnotator> + screen_ai_annotator); + ~AXScreenAIAnnotator(); + AXScreenAIAnnotator(const AXScreenAIAnnotator&) = delete; + AXScreenAIAnnotator& operator=(const AXScreenAIAnnotator&) = delete; + + // Takes a screenshot and sends it to |OnScreenshotReceived| through an async + // call. + void Run(); + + private: + // Receives an screenshot and sends it to ScreenAI library for processing. + void OnScreenshotReceived(gfx::Image snapshot); + + // Receives the annotation from ScreenAI service, sends it to + // |render_frame_host_| as an accessibility action. + void OnAnnotationReceived(screen_ai::mojom::ErrorType error_type, + std::vector<screen_ai::mojom::NodePtr> annotation); + + // Owns us. + raw_ptr<RenderFrameHost> const render_frame_host_; + + mojo::AssociatedRemote<screen_ai::mojom::ScreenAIAnnotator> + screen_ai_annotator_; + + base::WeakPtrFactory<AXScreenAIAnnotator> weak_ptr_factory_{this}; +}; + +} // namespace content + +#endif // CONTENT_BROWSER_ACCESSIBILITY_AX_SCREEN_AI_ANNOTATOR_H_
diff --git a/content/browser/accessibility/dump_accessibility_events_browsertest.cc b/content/browser/accessibility/dump_accessibility_events_browsertest.cc index 6ec4e76..033b862 100644 --- a/content/browser/accessibility/dump_accessibility_events_browsertest.cc +++ b/content/browser/accessibility/dump_accessibility_events_browsertest.cc
@@ -504,11 +504,6 @@ } IN_PROC_BROWSER_TEST_P(DumpAccessibilityEventsTest, - AccessibilityEventsAnonymousBlockChildrenChanged) { - RunEventTest(FILE_PATH_LITERAL("anonymous-block-children-changed.html")); -} - -IN_PROC_BROWSER_TEST_P(DumpAccessibilityEventsTest, AccessibilityEventsChildrenChangedOnlyOnAncestor) { RunEventTest(FILE_PATH_LITERAL("children-changed-only-on-ancestor.html")); }
diff --git a/content/browser/accessibility/dump_accessibility_tree_browsertest.cc b/content/browser/accessibility/dump_accessibility_tree_browsertest.cc index ff79ece..076cc626 100644 --- a/content/browser/accessibility/dump_accessibility_tree_browsertest.cc +++ b/content/browser/accessibility/dump_accessibility_tree_browsertest.cc
@@ -2442,15 +2442,6 @@ RunHtmlTest(FILE_PATH_LITERAL("list.html")); } -IN_PROC_BROWSER_TEST_P(DumpAccessibilityTreeTest, AccessibilityListText) { - RunHtmlTest(FILE_PATH_LITERAL("list-text.html")); -} - -IN_PROC_BROWSER_TEST_P(DumpAccessibilityTreeTest, - AccessibilityListTextAddition) { - RunHtmlTest(FILE_PATH_LITERAL("list-text-addition.html")); -} - IN_PROC_BROWSER_TEST_P(DumpAccessibilityTreeTest, AccessibilityListTextRemoval) { RunHtmlTest(FILE_PATH_LITERAL("list-text-removal.html")); @@ -3237,12 +3228,6 @@ RunRegressionTest(FILE_PATH_LITERAL("add-click-ignored-changed.html")); } -IN_PROC_BROWSER_TEST_P(DumpAccessibilityTreeTest, - AnonymousBlockManyChildrenChanged) { - RunRegressionTest( - FILE_PATH_LITERAL("anonymous-block-many-children-changed.html")); -} - IN_PROC_BROWSER_TEST_P(DumpAccessibilityTreeTest, AriaHiddenTabindexChange) { RunRegressionTest(FILE_PATH_LITERAL("aria-hidden-tabindex-change.html")); }
diff --git a/content/browser/accessibility/snapshot_ax_tree_browsertest.cc b/content/browser/accessibility/snapshot_ax_tree_browsertest.cc index 4008438..623ca71 100644 --- a/content/browser/accessibility/snapshot_ax_tree_browsertest.cc +++ b/content/browser/accessibility/snapshot_ax_tree_browsertest.cc
@@ -142,7 +142,7 @@ EXPECT_TRUE(ExecJs( primary_rfh, JsReplace("document.querySelector('fencedframe').src = $1;", fenced_frame_url.spec()))); - fenced_frames.at(0)->WaitForDidStopLoadingForTesting(); + EXPECT_TRUE(WaitForLoadStop(web_contents)); AXTreeSnapshotWaiter waiter; web_contents->RequestAXTreeSnapshot(
diff --git a/content/browser/aggregation_service/aggregatable_report.cc b/content/browser/aggregation_service/aggregatable_report.cc index 8296e31..8a9e37b 100644 --- a/content/browser/aggregation_service/aggregatable_report.cc +++ b/content/browser/aggregation_service/aggregatable_report.cc
@@ -20,6 +20,7 @@ #include "base/rand_util.h" #include "base/ranges/algorithm.h" #include "base/strings/string_number_conversions.h" +#include "base/strings/string_util.h" #include "base/time/time.h" #include "base/values.h" #include "components/cbor/values.h" @@ -47,15 +48,16 @@ constexpr char kOperationKey[] = "operation"; std::vector<GURL> GetDefaultProcessingUrls( - AggregationServicePayloadContents::ProcessingType processing_type) { - switch (processing_type) { - case AggregationServicePayloadContents::ProcessingType::kTwoParty: + AggregationServicePayloadContents::AggregationMode aggregation_mode) { + switch (aggregation_mode) { + case AggregationServicePayloadContents::AggregationMode::kTeeBased: + return { + GURL(kPrivacySandboxAggregationServiceTrustedServerUrlParam.Get())}; + case AggregationServicePayloadContents::AggregationMode:: + kExperimentalPoplar: // TODO(crbug.com/1295705): Update default processing urls. return {GURL("https://server1.example.com"), GURL("https://server2.example.com")}; - case AggregationServicePayloadContents::ProcessingType::kSingleServer: - return { - GURL(kPrivacySandboxAggregationServiceTrustedServerUrlParam.Get())}; } } @@ -80,8 +82,9 @@ const AggregationServicePayloadContents& contents) { DCHECK_EQ(contents.operation, AggregationServicePayloadContents::Operation::kHistogram); - DCHECK_EQ(contents.processing_type, - AggregationServicePayloadContents::ProcessingType::kTwoParty); + DCHECK_EQ( + contents.aggregation_mode, + AggregationServicePayloadContents::AggregationMode::kExperimentalPoplar); DCHECK_EQ(contents.contributions.size(), 1u); // absl::StatusOr is not allowed in the codebase, but this minimal usage is @@ -115,7 +118,8 @@ // Returns a vector with a serialized CBOR map for each processing url. See // the AggregatableReport documentation for more detail on the expected format. // Returns an empty vector in case of error. -std::vector<std::vector<uint8_t>> ConstructUnencryptedTwoPartyPayloads( +std::vector<std::vector<uint8_t>> +ConstructUnencryptedExperimentalPoplarPayloads( const AggregationServicePayloadContents& payload_contents) { std::vector<DpfKey> dpf_keys = GenerateDpfKeys(payload_contents); if (dpf_keys.empty()) { @@ -163,8 +167,8 @@ // Returns a vector with a serialized CBOR map. See the AggregatableReport // documentation for more detail on the expected format. Returns an empty // vector in case of error. -// Note that a vector is returned to match the two party case. -std::vector<std::vector<uint8_t>> ConstructUnencryptedSingleServerPayload( +// Note that a vector is returned to match the `kExperimentalPoplar` case. +std::vector<std::vector<uint8_t>> ConstructUnencryptedTeeBasedPayload( const AggregationServicePayloadContents& payload_contents) { cbor::Value::MapValue value; value.emplace(kOperationKey, kHistogramValue); @@ -245,10 +249,10 @@ Operation operation, std::vector<AggregationServicePayloadContents::HistogramContribution> contributions, - ProcessingType processing_type) + AggregationMode aggregation_mode) : operation(operation), contributions(std::move(contributions)), - processing_type(processing_type) {} + aggregation_mode(aggregation_mode) {} AggregationServicePayloadContents::AggregationServicePayloadContents( const AggregationServicePayloadContents& other) = default; @@ -323,7 +327,7 @@ AggregationServicePayloadContents payload_contents, AggregatableReportSharedInfo shared_info) { std::vector<GURL> processing_urls = - GetDefaultProcessingUrls(payload_contents.processing_type); + GetDefaultProcessingUrls(payload_contents.aggregation_mode); return CreateInternal(std::move(processing_urls), std::move(payload_contents), std::move(shared_info)); } @@ -345,7 +349,7 @@ AggregationServicePayloadContents payload_contents, AggregatableReportSharedInfo shared_info) { if (!AggregatableReport::IsNumberOfProcessingUrlsValid( - processing_urls.size(), payload_contents.processing_type)) { + processing_urls.size(), payload_contents.aggregation_mode)) { return absl::nullopt; } @@ -356,7 +360,7 @@ if (!AggregatableReport::IsNumberOfHistogramContributionsValid( payload_contents.contributions.size(), - payload_contents.processing_type)) { + payload_contents.aggregation_mode)) { return absl::nullopt; } @@ -371,6 +375,11 @@ return absl::nullopt; } + if (!base::ranges::all_of(shared_info.privacy_budget_key, + &base::IsAsciiPrintable<char>)) { + return absl::nullopt; + } + // Ensure the ordering of urls is deterministic. This is required for // AggregatableReport construction later. base::ranges::sort(processing_urls); @@ -459,19 +468,21 @@ DCHECK_EQ(num_processing_urls, report_request.processing_urls().size()); // The urls must be sorted so we can ensure the ordering (and assignment of - // DpfKey parties for two-party processing types) is deterministic. + // DpfKey parties for the `kExperimentalPoplar` aggregation mode) is + // deterministic. DCHECK(base::ranges::is_sorted(report_request.processing_urls())); std::vector<std::vector<uint8_t>> unencrypted_payloads; - switch (report_request.payload_contents().processing_type) { - case AggregationServicePayloadContents::ProcessingType::kTwoParty: { - unencrypted_payloads = ConstructUnencryptedTwoPartyPayloads( + switch (report_request.payload_contents().aggregation_mode) { + case AggregationServicePayloadContents::AggregationMode::kTeeBased: { + unencrypted_payloads = ConstructUnencryptedTeeBasedPayload( report_request.payload_contents()); break; } - case AggregationServicePayloadContents::ProcessingType::kSingleServer: { - unencrypted_payloads = ConstructUnencryptedSingleServerPayload( + case AggregationServicePayloadContents::AggregationMode:: + kExperimentalPoplar: { + unencrypted_payloads = ConstructUnencryptedExperimentalPoplarPayloads( report_request.payload_contents()); break; } @@ -549,25 +560,27 @@ // static bool AggregatableReport::IsNumberOfProcessingUrlsValid( size_t number, - AggregationServicePayloadContents::ProcessingType processing_type) { - switch (processing_type) { - case AggregationServicePayloadContents::ProcessingType::kTwoParty: - return number == 2u; - case AggregationServicePayloadContents::ProcessingType::kSingleServer: + AggregationServicePayloadContents::AggregationMode aggregation_mode) { + switch (aggregation_mode) { + case AggregationServicePayloadContents::AggregationMode::kTeeBased: return number == 1u; + case AggregationServicePayloadContents::AggregationMode:: + kExperimentalPoplar: + return number == 2u; } } // static bool AggregatableReport::IsNumberOfHistogramContributionsValid( size_t number, - AggregationServicePayloadContents::ProcessingType processing_type) { + AggregationServicePayloadContents::AggregationMode aggregation_mode) { // Note: APIs using the aggregation service may impose their own limits. - switch (processing_type) { - case AggregationServicePayloadContents::ProcessingType::kTwoParty: - return number == 1u; - case AggregationServicePayloadContents::ProcessingType::kSingleServer: + switch (aggregation_mode) { + case AggregationServicePayloadContents::AggregationMode::kTeeBased: return number >= 1u; + case AggregationServicePayloadContents::AggregationMode:: + kExperimentalPoplar: + return number == 1u; } }
diff --git a/content/browser/aggregation_service/aggregatable_report.h b/content/browser/aggregation_service/aggregatable_report.h index 365764b9..0190347a 100644 --- a/content/browser/aggregation_service/aggregatable_report.h +++ b/content/browser/aggregation_service/aggregatable_report.h
@@ -33,14 +33,22 @@ struct CONTENT_EXPORT AggregationServicePayloadContents { // TODO(alexmt): Add kDistinctCount option. enum class Operation { - kHistogram = 0, - kMaxValue = kHistogram, + kHistogram, }; - enum class ProcessingType { - kTwoParty = 0, - kSingleServer = 1, - kMaxValue = kSingleServer, + // Corresponds to the 'alternative aggregation mode' optional setting, but + // also includes the default option (if no alternative is set). + enum class AggregationMode { + // Uses a server-side Trusted Execution Environment (TEE) to process the + // encrypted payloads, see + // https://github.com/WICG/conversion-measurement-api/blob/main/AGGREGATION_SERVICE_TEE.md. + kTeeBased, + + // Implements a protocol similar to poplar VDAF in the PPM Framework, see + // https://github.com/WICG/conversion-measurement-api/blob/main/AGGREGATE.md#choosing-among-aggregation-services. + kExperimentalPoplar, + + kDefault = kTeeBased, }; struct HistogramContribution { @@ -51,7 +59,7 @@ AggregationServicePayloadContents( Operation operation, std::vector<HistogramContribution> contributions, - ProcessingType processing_type); + AggregationMode aggregation_mode); AggregationServicePayloadContents( const AggregationServicePayloadContents& other); @@ -64,7 +72,7 @@ Operation operation; std::vector<HistogramContribution> contributions; - ProcessingType processing_type; + AggregationMode aggregation_mode; }; // Represents the information that will be provided to both the reporting @@ -119,9 +127,8 @@ // This payload is constructed using the data in the // AggregationServicePayloadContents and then encrypted with one of - // `url`'s public keys. For the `kSingleServer` processing type, the - // plaintext of the encrypted payload is a serialized CBOR map structured as - // follows: + // `url`'s public keys. For the `kTeeBased` aggregation mode, the plaintext + // of the encrypted payload is a serialized CBOR map structured as follows: // { // "operation": "<chosen operation as string>", // "data": [{ @@ -130,7 +137,8 @@ // }, ...], // } // Note that the "data" array may contain multiple contributions. - // For the `kTwoParty` processing type, the "data" field is replaced with: + // For the `kExperimentalPoplar` aggregation mode, the "data" field is + // replaced with: // "dpf_key": <binary serialization of the DPF key> std::vector<uint8_t> payload; @@ -215,16 +223,16 @@ // base::Value appears to represent a valid report. // Returns whether `number` is a valid number of processing URLs for the - // `processing_type`. + // `aggregation_mode`. static bool IsNumberOfProcessingUrlsValid( size_t number, - AggregationServicePayloadContents::ProcessingType processing_type); + AggregationServicePayloadContents::AggregationMode aggregation_mode); // Returns whether `number` is a valid number of histogram contributions for - // the `processing_type`. + // the `aggregation_mode`. static bool IsNumberOfHistogramContributionsValid( size_t number, - AggregationServicePayloadContents::ProcessingType processing_type); + AggregationServicePayloadContents::AggregationMode aggregation_mode); private: // This vector should have an entry for each processing URL specified in @@ -240,21 +248,25 @@ class CONTENT_EXPORT AggregatableReportRequest { public: // Returns `absl::nullopt` if `payload_contents.contributions.size()` is not - // valid for the `payload_contents.processing_type` (see + // valid for the `payload_contents.aggregation_mode` (see // `IsNumberOfHistogramContributionsValid()` above). Also returns // `absl::nullopt` if any contribution has a negative value or if - // `shared_info.report_id` is not valid. + // `shared_info.report_id` is not valid. Also returns `absl::nullopt` if + // `shared_info.privacy_budget_key` contains any character that isn't + // printable ASCII. static absl::optional<AggregatableReportRequest> Create( AggregationServicePayloadContents payload_contents, AggregatableReportSharedInfo shared_info); // Returns `absl::nullopt` if `payload_contents.contributions.size()` or // `processing_url.size()` is not valid for the - // `payload_contents.processing_type` (see + // `payload_contents.aggregation_mode` (see // `IsNumberOfHistogramContributionsValid()` and // `IsNumberOfProcessingUrlsValid`, respectively). Also returns // `absl::nullopt` if any contribution has a negative value or if - // `shared_info.report_id` is not valid. + // `shared_info.report_id` is not valid. Also returns `absl::nullopt` if + // `shared_info.privacy_budget_key` contains any character that isn't + // printable ASCII. static absl::optional<AggregatableReportRequest> CreateForTesting( std::vector<GURL> processing_urls, AggregationServicePayloadContents payload_contents,
diff --git a/content/browser/aggregation_service/aggregatable_report_assembler.cc b/content/browser/aggregation_service/aggregatable_report_assembler.cc index 64363272..77759c8 100644 --- a/content/browser/aggregation_service/aggregatable_report_assembler.cc +++ b/content/browser/aggregation_service/aggregatable_report_assembler.cc
@@ -114,7 +114,7 @@ DCHECK(base::ranges::is_sorted(report_request.processing_urls())); const size_t num_processing_urls = report_request.processing_urls().size(); DCHECK(AggregatableReport::IsNumberOfProcessingUrlsValid( - num_processing_urls, report_request.payload_contents().processing_type)); + num_processing_urls, report_request.payload_contents().aggregation_mode)); const AggregationServicePayloadContents& contents = report_request.payload_contents();
diff --git a/content/browser/aggregation_service/aggregatable_report_assembler_unittest.cc b/content/browser/aggregation_service/aggregatable_report_assembler_unittest.cc index b9824b8..1fc2ce5 100644 --- a/content/browser/aggregation_service/aggregatable_report_assembler_unittest.cc +++ b/content/browser/aggregation_service/aggregatable_report_assembler_unittest.cc
@@ -237,7 +237,7 @@ base::HistogramTester histograms; AggregatableReportRequest request = aggregation_service::CreateExampleRequest( - AggregationServicePayloadContents::ProcessingType::kSingleServer); + AggregationServicePayloadContents::AggregationMode::kTeeBased); PublicKey public_key = aggregation_service::GenerateKey("id123").public_key; @@ -273,7 +273,7 @@ base::HistogramTester histograms; AggregatableReportRequest request = aggregation_service::CreateExampleRequest( - AggregationServicePayloadContents::ProcessingType::kSingleServer); + AggregationServicePayloadContents::AggregationMode::kTeeBased); EXPECT_CALL(*fetcher(), GetPublicKey) .WillOnce(base::test::RunOnceCallback<1>(
diff --git a/content/browser/aggregation_service/aggregatable_report_unittest.cc b/content/browser/aggregation_service/aggregatable_report_unittest.cc index 1733c044..a2b432b 100644 --- a/content/browser/aggregation_service/aggregatable_report_unittest.cc +++ b/content/browser/aggregation_service/aggregatable_report_unittest.cc
@@ -141,18 +141,8 @@ EXPECT_EQ(payload_map.at(cbor::Value("operation")).GetString(), "histogram"); - switch (expected_payload_contents.processing_type) { - case AggregationServicePayloadContents::ProcessingType::kTwoParty: { - EXPECT_TRUE(CborMapContainsKeyAndType(payload_map, "dpf_key", - cbor::Value::Type::BYTE_STRING)); - - // TODO(crbug.com/1238459): Test the payload details (e.g. dpf key) in - // more depth against a minimal helper server implementation. - - EXPECT_FALSE(payload_map.contains(cbor::Value("data"))); - break; - } - case AggregationServicePayloadContents::ProcessingType::kSingleServer: { + switch (expected_payload_contents.aggregation_mode) { + case AggregationServicePayloadContents::AggregationMode::kTeeBased: { ASSERT_TRUE(CborMapContainsKeyAndType(payload_map, "data", cbor::Value::Type::ARRAY)); const cbor::Value::ArrayValue& data_array = @@ -186,6 +176,17 @@ EXPECT_FALSE(payload_map.contains(cbor::Value("dpf_key"))); break; } + case AggregationServicePayloadContents::AggregationMode:: + kExperimentalPoplar: { + EXPECT_TRUE(CborMapContainsKeyAndType(payload_map, "dpf_key", + cbor::Value::Type::BYTE_STRING)); + + // TODO(crbug.com/1238459): Test the payload details (e.g. dpf key) in + // more depth against a minimal helper server implementation. + + EXPECT_FALSE(payload_map.contains(cbor::Value("data"))); + break; + } } } } @@ -214,7 +215,7 @@ TEST(AggregatableReportTest, ValidSingleServerRequest_ValidReportReturned) { AggregatableReportRequest request = aggregation_service::CreateExampleRequest( - AggregationServicePayloadContents::ProcessingType::kSingleServer); + AggregationServicePayloadContents::AggregationMode::kTeeBased); AggregationServicePayloadContents expected_payload_contents = request.payload_contents(); @@ -237,7 +238,7 @@ ValidMultipleContributionsRequest_ValidReportReturned) { AggregatableReportRequest example_request = aggregation_service::CreateExampleRequest( - AggregationServicePayloadContents::ProcessingType::kSingleServer); + AggregationServicePayloadContents::AggregationMode::kTeeBased); AggregationServicePayloadContents expected_payload_contents = example_request.payload_contents(); @@ -335,10 +336,23 @@ EXPECT_FALSE(request.has_value()); } +TEST(AggregatableReportTest, RequestCreatedWithInvalidPrivacyBudgetKey_Failed) { + AggregatableReportRequest example_request = + aggregation_service::CreateExampleRequest(); + AggregatableReportSharedInfo shared_info = example_request.shared_info(); + shared_info.privacy_budget_key = {static_cast<char>(0xC0)}; + + absl::optional<AggregatableReportRequest> request = + AggregatableReportRequest::Create(example_request.payload_contents(), + std::move(shared_info)); + + EXPECT_FALSE(request.has_value()); +} + TEST(AggregatableReportTest, RequestCreatedWithZeroContributions) { AggregatableReportRequest example_request = aggregation_service::CreateExampleRequest( - AggregationServicePayloadContents::ProcessingType::kSingleServer); + AggregationServicePayloadContents::AggregationMode::kTeeBased); AggregationServicePayloadContents payload_contents = example_request.payload_contents(); @@ -353,7 +367,8 @@ TEST(AggregatableReportTest, RequestCreatedWithTooManyContributions) { AggregatableReportRequest example_request = aggregation_service::CreateExampleRequest( - AggregationServicePayloadContents::ProcessingType::kTwoParty); + AggregationServicePayloadContents::AggregationMode:: + kExperimentalPoplar); AggregationServicePayloadContents payload_contents = example_request.payload_contents();
diff --git a/content/browser/aggregation_service/aggregation_service_test_utils.cc b/content/browser/aggregation_service/aggregation_service_test_utils.cc index 79ba7f7..761ef74a 100644 --- a/content/browser/aggregation_service/aggregation_service_test_utils.cc +++ b/content/browser/aggregation_service/aggregation_service_test_utils.cc
@@ -142,10 +142,10 @@ << ", actual: " << actual.contributions[i].value; } } - if (expected.processing_type != actual.processing_type) { + if (expected.aggregation_mode != actual.aggregation_mode) { return testing::AssertionFailure() - << "Expected processing_type " << expected.processing_type - << ", actual: " << actual.processing_type; + << "Expected aggregation_mode " << expected.aggregation_mode + << ", actual: " << actual.aggregation_mode; } return testing::AssertionSuccess(); @@ -180,13 +180,13 @@ } AggregatableReportRequest CreateExampleRequest( - AggregationServicePayloadContents::ProcessingType processing_type) { + AggregationServicePayloadContents::AggregationMode aggregation_mode) { return AggregatableReportRequest::Create( AggregationServicePayloadContents( AggregationServicePayloadContents::Operation::kHistogram, {AggregationServicePayloadContents::HistogramContribution{ .bucket = 123, .value = 456}}, - processing_type), + aggregation_mode), AggregatableReportSharedInfo( /*scheduled_report_time=*/base::Time::Now(), /*privacy_budget_key=*/"example_budget_key", @@ -253,7 +253,7 @@ std::ostream& operator<<( std::ostream& out, - const AggregationServicePayloadContents::Operation& operation) { + AggregationServicePayloadContents::Operation operation) { switch (operation) { case AggregationServicePayloadContents::Operation::kHistogram: return out << "kHistogram"; @@ -262,18 +262,18 @@ std::ostream& operator<<( std::ostream& out, - const AggregationServicePayloadContents::ProcessingType& processing_type) { - switch (processing_type) { - case AggregationServicePayloadContents::ProcessingType::kTwoParty: - return out << "kTwoParty"; - case AggregationServicePayloadContents::ProcessingType::kSingleServer: - return out << "kSingleServer"; + AggregationServicePayloadContents::AggregationMode aggregation_mode) { + switch (aggregation_mode) { + case AggregationServicePayloadContents::AggregationMode::kTeeBased: + return out << "kTeeBased"; + case AggregationServicePayloadContents::AggregationMode:: + kExperimentalPoplar: + return out << "kExperimentalPoplar"; } } -std::ostream& operator<<( - std::ostream& out, - const AggregatableReportSharedInfo::DebugMode& debug_mode) { +std::ostream& operator<<(std::ostream& out, + AggregatableReportSharedInfo::DebugMode debug_mode) { switch (debug_mode) { case AggregatableReportSharedInfo::DebugMode::kDisabled: return out << "kDisabled";
diff --git a/content/browser/aggregation_service/aggregation_service_test_utils.h b/content/browser/aggregation_service/aggregation_service_test_utils.h index ca1abfd17..f9e8ffa 100644 --- a/content/browser/aggregation_service/aggregation_service_test_utils.h +++ b/content/browser/aggregation_service/aggregation_service_test_utils.h
@@ -55,9 +55,11 @@ const AggregatableReportSharedInfo& actual); // Returns an example report request, using the given parameters. +// TODO(crbug.com/1303041): Switch default aggregation mode to `kDefault`. AggregatableReportRequest CreateExampleRequest( - AggregationServicePayloadContents::ProcessingType processing_type = - AggregationServicePayloadContents::ProcessingType::kTwoParty); + AggregationServicePayloadContents::AggregationMode aggregation_mode = + AggregationServicePayloadContents::AggregationMode:: + kExperimentalPoplar); AggregatableReportRequest CloneReportRequest( const AggregatableReportRequest& request); @@ -95,13 +97,12 @@ // Only used for logging in tests. std::ostream& operator<<( std::ostream& out, - const AggregationServicePayloadContents::Operation& operation); + AggregationServicePayloadContents::Operation operation); std::ostream& operator<<( std::ostream& out, - const AggregationServicePayloadContents::ProcessingType& processing_type); -std::ostream& operator<<( - std::ostream& out, - const AggregatableReportSharedInfo::DebugMode& debug_mode); + AggregationServicePayloadContents::AggregationMode aggregation_mode); +std::ostream& operator<<(std::ostream& out, + AggregatableReportSharedInfo::DebugMode debug_mode); bool operator==(const PublicKey& a, const PublicKey& b);
diff --git a/content/browser/attribution_reporting/aggregatable_attribution_utils.cc b/content/browser/attribution_reporting/aggregatable_attribution_utils.cc index 5f3f7b2..78f8f7d 100644 --- a/content/browser/attribution_reporting/aggregatable_attribution_utils.cc +++ b/content/browser/attribution_reporting/aggregatable_attribution_utils.cc
@@ -42,14 +42,8 @@ // match for the given source, and if applicable modify the bucket based on // the given key piece. for (const auto& data : trigger.trigger_data()) { - if (!data.filters().filter_values().empty() && - !AttributionFilterDataMatch(source_filter_data, data.filters())) { - continue; - } - - if (!data.not_filters().filter_values().empty() && - !AttributionFilterDataMatch(source_filter_data, data.not_filters(), - /*negated*/ true)) { + if (!AttributionFiltersMatch(source_filter_data, data.filters(), + data.not_filters())) { continue; }
diff --git a/content/browser/attribution_reporting/attribution_internals.mojom b/content/browser/attribution_reporting/attribution_internals.mojom index 59519fb..588398a 100644 --- a/content/browser/attribution_reporting/attribution_internals.mojom +++ b/content/browser/attribution_reporting/attribution_internals.mojom
@@ -43,7 +43,10 @@ kProhibitedByBrowserPolicy, kSent, kNetworkError, + // TODO(apaseltiner): Remove this value once event-trigger matching is + // implemented. kNoMatchingEventTriggers, + kNoMatchingSourceFilterData, }; Status status; @@ -69,6 +72,7 @@ int64 priority; AttributionDebugKey? debug_key; array<uint64> dedup_keys; + map<string, array<string>> filter_data; // Union of `StorableSource::Result` and `StoredSource::AttributionLogic`, // and `AttributionStorage::DeactivatedSource::Reason`. @@ -77,7 +81,7 @@ // The source was dropped due to `CommonSourceInfo::AttributionLogic::kNever`. kNoised, kReplacedByNewerSource, - kReachedAttributionLimit, + kReachedEventLevelAttributionLimit, kInternalError, kInsufficientSourceCapacity, kInsufficientUniqueDestinationCapacity,
diff --git a/content/browser/attribution_reporting/attribution_internals_browsertest.cc b/content/browser/attribution_reporting/attribution_internals_browsertest.cc index 30f5846..64b3874 100644 --- a/content/browser/attribution_reporting/attribution_internals_browsertest.cc +++ b/content/browser/attribution_reporting/attribution_internals_browsertest.cc
@@ -13,6 +13,7 @@ #include "base/callback.h" #include "base/strings/utf_string_conversions.h" #include "base/time/time.h" +#include "content/browser/attribution_reporting/attribution_filter_data.h" #include "content/browser/attribution_reporting/attribution_manager.h" #include "content/browser/attribution_reporting/attribution_observer_types.h" #include "content/browser/attribution_reporting/attribution_report.h" @@ -233,14 +234,17 @@ .SetSourceType(AttributionSourceType::kEvent) .SetPriority(std::numeric_limits<int64_t>::max()) .SetDedupKeys({13, 17}) + .SetFilterData(*AttributionFilterData::FromSourceFilterValues( + {{"a", {"b", "c"}}})) + .BuildStored(), + SourceBuilder(now + base::Hours(2)) + .SetActiveState(StoredSource::ActiveState:: + kReachedEventLevelAttributionLimit) .BuildStored()})); manager_.NotifySourceDeactivated( - DeactivatedSource(SourceBuilder(now + base::Hours(2)).BuildStored(), - DeactivatedSource::Reason::kReplacedByNewerSource)); - manager_.NotifySourceDeactivated( DeactivatedSource(SourceBuilder(now + base::Hours(3)).BuildStored(), - DeactivatedSource::Reason::kReachedAttributionLimit)); + DeactivatedSource::Reason::kReplacedByNewerSource)); // This shouldn't result in a row, as registration succeeded. manager_.NotifySourceHandled(SourceBuilder(now).Build(), @@ -270,18 +274,20 @@ table.children[1].children[6].innerText === "Event" && table.children[0].children[7].innerText === "0" && table.children[1].children[7].innerText === $2 && - table.children[0].children[8].innerText === "19" && - table.children[1].children[8].innerText === "" && - table.children[0].children[9].innerText === "" && - table.children[1].children[9].innerText === "13, 17" && - table.children[0].children[10].innerText === "Unattributable: noised" && - table.children[1].children[10].innerText === "Attributable" && - table.children[2].children[10].innerText === "Unattributable: replaced by newer source" && - table.children[3].children[10].innerText === "Unattributable: reached attribution limit" && - table.children[4].children[10].innerText === "Rejected: internal error" && - table.children[5].children[10].innerText === "Rejected: insufficient source capacity" && - table.children[6].children[10].innerText === "Rejected: insufficient unique destination capacity" && - table.children[7].children[10].innerText === "Rejected: excessive reporting origins") { + table.children[0].children[8].innerText === "{}" && + table.children[1].children[8].innerText === '{\n "a": [\n "b",\n "c"\n ]\n}' && + table.children[0].children[9].innerText === "19" && + table.children[1].children[9].innerText === "" && + table.children[0].children[10].innerText === "" && + table.children[1].children[10].innerText === "13, 17" && + table.children[0].children[11].innerText === "Unattributable: noised" && + table.children[1].children[11].innerText === "Attributable" && + table.children[2].children[11].innerText === "Attributable: reached event-level attribution limit" && + table.children[3].children[11].innerText === "Unattributable: replaced by newer source" && + table.children[4].children[11].innerText === "Rejected: internal error" && + table.children[5].children[11].innerText === "Rejected: insufficient source capacity" && + table.children[6].children[11].innerText === "Rejected: insufficient unique destination capacity" && + table.children[7].children[11].innerText === "Rejected: excessive reporting origins") { document.title = $3; } }); @@ -461,7 +467,6 @@ manager_.NotifyTriggerHandled(CreateReportResult( AttributionTrigger::EventLevelResult::kSuccess, /*dropped_reports=*/{}, - /*dropped_report_source_deactivation_reason=*/absl::nullopt, /*new_reports=*/ {ReportBuilder( AttributionInfoBuilder(SourceBuilder().BuildStored()).Build())
diff --git a/content/browser/attribution_reporting/attribution_internals_handler_impl.cc b/content/browser/attribution_reporting/attribution_internals_handler_impl.cc index 32369c3e..175a934 100644 --- a/content/browser/attribution_reporting/attribution_internals_handler_impl.cc +++ b/content/browser/attribution_reporting/attribution_internals_handler_impl.cc
@@ -49,7 +49,7 @@ source.source_type(), source.priority(), source.debug_key() ? mojom::AttributionDebugKey::New(*source.debug_key()) : nullptr, - dedup_keys, attributability); + dedup_keys, source.filter_data().filter_values(), attributability); } void ForwardSourcesToWebUI( @@ -60,10 +60,22 @@ web_ui_sources.reserve(active_sources.size()); for (const StoredSource& source : active_sources) { - auto attributability = - source.attribution_logic() == StoredSource::AttributionLogic::kNever - ? Attributability::kNoised - : Attributability::kAttributable; + Attributability attributability; + if (source.attribution_logic() == StoredSource::AttributionLogic::kNever) { + attributability = Attributability::kNoised; + } else { + switch (source.active_state()) { + case StoredSource::ActiveState::kActive: + attributability = Attributability::kAttributable; + break; + case StoredSource::ActiveState::kReachedEventLevelAttributionLimit: + attributability = Attributability::kReachedEventLevelAttributionLimit; + break; + case StoredSource::ActiveState::kInactive: + NOTREACHED(); + return; + } + } web_ui_sources.push_back(WebUIAttributionSource( source.common_info(), attributability, source.dedup_keys())); @@ -211,9 +223,6 @@ case DeactivatedSource::Reason::kReplacedByNewerSource: attributability = Attributability::kReplacedByNewerSource; break; - case DeactivatedSource::Reason::kReachedAttributionLimit: - attributability = Attributability::kReachedAttributionLimit; - break; } auto source = WebUIAttributionSource(deactivated_source.source.common_info(), @@ -318,6 +327,10 @@ case AttributionTrigger::EventLevelResult::kNoMatchingEventTriggers: status = mojom::WebUIAttributionReport::Status::kNoMatchingEventTriggers; break; + case AttributionTrigger::EventLevelResult::kNoMatchingSourceFilterData: + status = + mojom::WebUIAttributionReport::Status::kNoMatchingSourceFilterData; + break; case AttributionTrigger::EventLevelResult::kInternalError: // `kInternalError` doesn't always have a dropped report. if (result.dropped_reports().empty())
diff --git a/content/browser/attribution_reporting/attribution_manager_impl.cc b/content/browser/attribution_reporting/attribution_manager_impl.cc index 9376832..587bebd 100644 --- a/content/browser/attribution_reporting/attribution_manager_impl.cc +++ b/content/browser/attribution_reporting/attribution_manager_impl.cc
@@ -449,11 +449,6 @@ NotifyReportsChanged(); } - if (absl::optional<DeactivatedSource> source = - result.GetDeactivatedSource()) { - NotifySourceDeactivated(*source); - } - for (auto& observer : observers_) observer.OnTriggerHandled(result); } @@ -747,7 +742,7 @@ AggregationServicePayloadContents( AggregationServicePayloadContents::Operation::kHistogram, std::move(contributions), - AggregationServicePayloadContents::ProcessingType::kSingleServer), + AggregationServicePayloadContents::AggregationMode::kDefault), AggregatableReportSharedInfo( report.report_time(), report.PrivacyBudgetKey(), report.external_report_id(),
diff --git a/content/browser/attribution_reporting/attribution_manager_impl_unittest.cc b/content/browser/attribution_reporting/attribution_manager_impl_unittest.cc index f94f11b..a8728e2 100644 --- a/content/browser/attribution_reporting/attribution_manager_impl_unittest.cc +++ b/content/browser/attribution_reporting/attribution_manager_impl_unittest.cc
@@ -1141,10 +1141,6 @@ EXPECT_CALL(observer, OnSourcesChanged); EXPECT_CALL(observer, OnReportsChanged); - EXPECT_CALL(observer, - OnSourceDeactivated(DeactivatedSource{ - builder.SetDefaultFilterData().BuildStored(), - DeactivatedSource::Reason::kReachedAttributionLimit})); } attribution_manager_->HandleSource(source);
diff --git a/content/browser/attribution_reporting/attribution_observer.h b/content/browser/attribution_reporting/attribution_observer.h index 656e19bf8..65134c3 100644 --- a/content/browser/attribution_reporting/attribution_observer.h +++ b/content/browser/attribution_reporting/attribution_observer.h
@@ -32,7 +32,8 @@ virtual void OnSourceHandled(const StorableSource& source, StorableSource::Result result) {} - // Called when a source is deactivated. + // Called when a source is deactivated. Note that this isn't called when a + // source reaches the attribution limit. virtual void OnSourceDeactivated(const DeactivatedSource& source) {} // Called when a report is sent, regardless of success, but not for attempts
diff --git a/content/browser/attribution_reporting/attribution_observer_types.cc b/content/browser/attribution_reporting/attribution_observer_types.cc index 816e407..b3506bd2 100644 --- a/content/browser/attribution_reporting/attribution_observer_types.cc +++ b/content/browser/attribution_reporting/attribution_observer_types.cc
@@ -14,13 +14,9 @@ CreateReportResult::CreateReportResult( AttributionTrigger::EventLevelResult event_level_status, std::vector<AttributionReport> dropped_reports, - absl::optional<DeactivatedSource::Reason> - dropped_report_source_deactivation_reason, std::vector<AttributionReport> new_reports) : event_level_status_(event_level_status), dropped_reports_(std::move(dropped_reports)), - dropped_report_source_deactivation_reason_( - dropped_report_source_deactivation_reason), new_reports_(std::move(new_reports)) { DCHECK( (event_level_status_ == AttributionTrigger::EventLevelResult::kSuccess && @@ -31,9 +27,6 @@ AttributionTrigger::EventLevelResult::kInternalError || !dropped_reports_.empty()); - DCHECK(!dropped_reports_.empty() || - !dropped_report_source_deactivation_reason_); - DCHECK_EQ( event_level_status_ == AttributionTrigger::EventLevelResult::kSuccess || event_level_status_ == AttributionTrigger::EventLevelResult:: @@ -54,15 +47,6 @@ CreateReportResult& CreateReportResult::operator=(CreateReportResult&&) = default; -absl::optional<DeactivatedSource> CreateReportResult::GetDeactivatedSource() - const { - if (dropped_report_source_deactivation_reason_) { - return DeactivatedSource(dropped_reports_.front().attribution_info().source, - *dropped_report_source_deactivation_reason_); - } - return absl::nullopt; -} - DeactivatedSource::DeactivatedSource(StoredSource source, Reason reason) : source(std::move(source)), reason(reason) {}
diff --git a/content/browser/attribution_reporting/attribution_observer_types.h b/content/browser/attribution_reporting/attribution_observer_types.h index 432f721..7d5e18fe 100644 --- a/content/browser/attribution_reporting/attribution_observer_types.h +++ b/content/browser/attribution_reporting/attribution_observer_types.h
@@ -11,14 +11,12 @@ #include "content/browser/attribution_reporting/attribution_trigger.h" #include "content/browser/attribution_reporting/stored_source.h" #include "content/common/content_export.h" -#include "third_party/abseil-cpp/absl/types/optional.h" namespace content { struct CONTENT_EXPORT DeactivatedSource { enum class Reason { kReplacedByNewerSource, - kReachedAttributionLimit, }; DeactivatedSource(StoredSource source, Reason reason); @@ -39,8 +37,6 @@ explicit CreateReportResult( AttributionTrigger::EventLevelResult event_level_status, std::vector<AttributionReport> dropped_reports = {}, - absl::optional<DeactivatedSource::Reason> - dropped_report_source_deactivation_reason = absl::nullopt, std::vector<AttributionReport> new_reports = {}); ~CreateReportResult(); @@ -64,8 +60,6 @@ std::vector<AttributionReport>& new_reports() { return new_reports_; } - absl::optional<DeactivatedSource> GetDeactivatedSource() const; - private: AttributionTrigger::EventLevelResult event_level_status_; @@ -74,10 +68,6 @@ // source-to-attribute logic. std::vector<AttributionReport> dropped_reports_; - // Null unless `dropped_report_`'s source was deactivated. - absl::optional<DeactivatedSource::Reason> - dropped_report_source_deactivation_reason_; - // Empty unless `event_level_status` is `kSuccess` or // `kSuccessDroppedLowerPriority`. std::vector<AttributionReport> new_reports_;
diff --git a/content/browser/attribution_reporting/attribution_report.cc b/content/browser/attribution_reporting/attribution_report.cc index dfcd6ae..369cd045 100644 --- a/content/browser/attribution_reporting/attribution_report.cc +++ b/content/browser/attribution_reporting/attribution_report.cc
@@ -4,19 +4,20 @@ #include "content/browser/attribution_reporting/attribution_report.h" -#include <memory> #include <string> #include <utility> +#include "base/base64.h" #include "base/check.h" #include "base/check_op.h" #include "base/memory/raw_ptr.h" #include "base/strings/strcat.h" #include "base/strings/string_number_conversions.h" #include "base/values.h" +#include "components/cbor/values.h" +#include "components/cbor/writer.h" #include "content/browser/attribution_reporting/attribution_source_type.h" #include "content/browser/attribution_reporting/common_source_info.h" -#include "crypto/secure_hash.h" #include "crypto/sha2.h" #include "net/base/schemeful_site.h" #include "third_party/abseil-cpp/absl/types/variant.h" @@ -224,39 +225,26 @@ std::string AttributionReport::PrivacyBudgetKey() const { DCHECK(absl::holds_alternative<AggregatableAttributionData>(data_)); - std::unique_ptr<crypto::SecureHash> ctx = - crypto::SecureHash::Create(crypto::SecureHash::Algorithm::SHA256); - const CommonSourceInfo& common_source_info = attribution_info_.source.common_info(); - const std::string serialized_reporting_origin = - common_source_info.reporting_origin().Serialize(); - const std::string serialized_source_site = - common_source_info.ImpressionSite().Serialize(); - const std::string serialized_attribution_destination = - common_source_info.ConversionDestination().Serialize(); - static constexpr char kDelimiter[] = ";"; - - ctx->Update(serialized_reporting_origin.data(), - serialized_reporting_origin.size()); - - ctx->Update(kDelimiter, sizeof(kDelimiter)); - ctx->Update(serialized_source_site.data(), serialized_source_site.size()); - - ctx->Update(kDelimiter, sizeof(kDelimiter)); - ctx->Update(serialized_attribution_destination.data(), - serialized_attribution_destination.size()); + // Use CBOR to be deterministic. + cbor::Value::MapValue value; + value.emplace("reporting_origin", + common_source_info.reporting_origin().Serialize()); + value.emplace("source_site", common_source_info.ImpressionSite().Serialize()); + value.emplace("destination", + common_source_info.ConversionDestination().Serialize()); // TODO(linnan): Replace with a real version once a version string is decided. - static constexpr char kVersion[] = "1.0"; - ctx->Update(kDelimiter, sizeof(kDelimiter)); - ctx->Update(kVersion, sizeof(kVersion)); + static constexpr char kVersion[] = ""; + value.emplace("version", kVersion); - std::string output(crypto::kSHA256Length, 0); - ctx->Finish(std::data(output), output.size()); + absl::optional<std::vector<uint8_t>> bytes = + cbor::Writer::Write(cbor::Value(std::move(value))); + DCHECK(bytes.has_value()); - return output; + return base::Base64Encode(crypto::SHA256Hash(*bytes)); } void AttributionReport::set_report_time(base::Time report_time) {
diff --git a/content/browser/attribution_reporting/attribution_report_unittest.cc b/content/browser/attribution_reporting/attribution_report_unittest.cc index 78f50446..7e9a20d4 100644 --- a/content/browser/attribution_reporting/attribution_report_unittest.cc +++ b/content/browser/attribution_reporting/attribution_report_unittest.cc
@@ -13,6 +13,7 @@ #include "base/time/time.h" #include "content/browser/aggregation_service/aggregatable_report.h" #include "content/browser/aggregation_service/aggregation_service_test_utils.h" +#include "content/browser/attribution_reporting/attribution_report.h" #include "content/browser/attribution_reporting/attribution_test_utils.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/abseil-cpp/absl/types/optional.h" @@ -79,4 +80,32 @@ } } +TEST(AttributionReportTest, PrivacyBudgetKey) { + // Pre-hashed CBOR bytes + // { 0xA4, 0x67, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x60, 0x6B, 0x64, + // 0x65, 0x73, 0x74, 0x69, 0x6E, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x77, 0x68, + // 0x74, 0x74, 0x70, 0x73, 0x3A, 0x2F, 0x2F, 0x63, 0x6F, 0x6E, 0x76, 0x65, + // 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x2E, 0x74, 0x65, 0x73, 0x74, 0x6B, 0x73, + // 0x6F, 0x75, 0x72, 0x63, 0x65, 0x5F, 0x73, 0x69, 0x74, 0x65, 0x77, 0x68, + // 0x74, 0x74, 0x70, 0x73, 0x3A, 0x2F, 0x2F, 0x69, 0x6D, 0x70, 0x72, 0x65, + // 0x73, 0x73, 0x69, 0x6F, 0x6E, 0x2E, 0x74, 0x65, 0x73, 0x74, 0x70, 0x72, + // 0x65, 0x70, 0x6F, 0x72, 0x74, 0x69, 0x6E, 0x67, 0x5F, 0x6F, 0x72, 0x69, + // 0x67, 0x69, 0x6E, 0x73, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3A, 0x2F, 0x2F, + // 0x72, 0x65, 0x70, 0x6F, 0x72, 0x74, 0x2E, 0x74, 0x65, 0x73, 0x74 } + + // base64 encoded SHA256 hash string of the bytes above. + const std::string kExpectedPrivacyBudgetKey( + "NOM7HGJIb2ReR2jRlz1E0WIywBdUB/qLC6nCFyDqmRQ="); + + AttributionReport report = + ReportBuilder(AttributionInfoBuilder( + SourceBuilder(base::Time::FromJavaTime(1234567890123)) + .BuildStored()) + .Build()) + .SetAggregatableHistogramContributions( + {AggregatableHistogramContribution(/*key=*/1, /*value=*/2)}) + .BuildAggregatableAttribution(); + EXPECT_EQ(report.PrivacyBudgetKey(), kExpectedPrivacyBudgetKey); +} + } // namespace content
diff --git a/content/browser/attribution_reporting/attribution_src_browsertest.cc b/content/browser/attribution_reporting/attribution_src_browsertest.cc index b1cc0f9..95c27f2 100644 --- a/content/browser/attribution_reporting/attribution_src_browsertest.cc +++ b/content/browser/attribution_reporting/attribution_src_browsertest.cc
@@ -15,6 +15,7 @@ #include "content/public/test/browser_test_utils.h" #include "content/public/test/content_browser_test.h" #include "content/public/test/content_browser_test_utils.h" +#include "content/public/test/prerender_test_util.h" #include "content/shell/browser/shell.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "net/dns/mock_host_resolver.h" @@ -743,6 +744,91 @@ EXPECT_THAT(source_data.back()->aggregatable_sources->sources, SizeIs(2)); } +class AttributionSrcPrerenderBrowserTest : public AttributionSrcBrowserTest { + public: + AttributionSrcPrerenderBrowserTest() + : prerender_helper_( + base::BindRepeating(&AttributionSrcBrowserTest::web_contents, + base::Unretained(this))) {} + + ~AttributionSrcPrerenderBrowserTest() override = default; + + protected: + content::test::PrerenderTestHelper prerender_helper_; +}; + +IN_PROC_BROWSER_TEST_F(AttributionSrcPrerenderBrowserTest, + SourceNotRegisteredOnPrerender) { + MockAttributionHost host(web_contents()); + EXPECT_CALL(host, RegisterDataHost).Times(0); + + const GURL kInitialUrl = + https_server()->GetURL("b.test", "/page_with_impression_creator.html"); + EXPECT_TRUE(NavigateToURL(web_contents(), kInitialUrl)); + + GURL page_url = + https_server()->GetURL("b.test", "/page_with_impression_creator.html"); + int host_id = prerender_helper_.AddPrerender(page_url); + content::test::PrerenderHostObserver host_observer(*web_contents(), host_id); + + prerender_helper_.WaitForPrerenderLoadCompletion(page_url); + content::RenderFrameHost* prerender_rfh = + prerender_helper_.GetPrerenderedMainFrameHost(host_id); + + EXPECT_TRUE(ExecJs( + prerender_rfh, + JsReplace( + "createAttributionSrcImg($1);", + https_server()->GetURL("c.test", "/register_source_headers.html")))); + + // If a data host were registered, it would arrive in the browser process + // before the navigation finished. + EXPECT_TRUE(NavigateToURL(web_contents(), kInitialUrl)); +} + +IN_PROC_BROWSER_TEST_F(AttributionSrcPrerenderBrowserTest, + SourceRegisteredOnActivatedPrerender) { + MockAttributionHost host(web_contents()); + std::unique_ptr<MockDataHost> data_host; + base::RunLoop loop; + EXPECT_CALL(host, RegisterDataHost) + .WillOnce( + [&](mojo::PendingReceiver<blink::mojom::AttributionDataHost> host) { + data_host = GetRegisteredDataHost(std::move(host)); + loop.Quit(); + }); + + const GURL kInitialUrl = + https_server()->GetURL("b.test", "/page_with_impression_creator.html"); + EXPECT_TRUE(NavigateToURL(web_contents(), kInitialUrl)); + + GURL page_url = + https_server()->GetURL("b.test", "/page_with_impression_creator.html"); + int host_id = prerender_helper_.AddPrerender(page_url); + content::test::PrerenderHostObserver host_observer(*web_contents(), host_id); + + prerender_helper_.WaitForPrerenderLoadCompletion(page_url); + content::RenderFrameHost* prerender_rfh = + prerender_helper_.GetPrerenderedMainFrameHost(host_id); + + EXPECT_TRUE(ExecJs( + prerender_rfh, + JsReplace( + "createAttributionSrcImg($1);", + https_server()->GetURL("c.test", "/register_source_headers.html")))); + + prerender_helper_.NavigatePrimaryPage(page_url); + ASSERT_EQ(page_url, web_contents()->GetLastCommittedURL()); + + if (!data_host) + loop.Run(); + data_host->WaitForSourceData(/*num_source_data=*/1); + const auto& source_data = data_host->source_data(); + + EXPECT_EQ(source_data.size(), 1u); + EXPECT_EQ(source_data.front()->source_event_id, 5UL); +} + class AttributionSrcInvalidFiltersBrowserTest : public AttributionSrcBrowserTest, public ::testing::WithParamInterface<const char*> {};
diff --git a/content/browser/attribution_reporting/attribution_storage_sql.cc b/content/browser/attribution_reporting/attribution_storage_sql.cc index acaa3e7..cfcaa1d1 100644 --- a/content/browser/attribution_reporting/attribution_storage_sql.cc +++ b/content/browser/attribution_reporting/attribution_storage_sql.cc
@@ -35,6 +35,7 @@ #include "content/browser/attribution_reporting/attribution_storage_delegate.h" #include "content/browser/attribution_reporting/attribution_storage_sql_migrations.h" #include "content/browser/attribution_reporting/attribution_trigger.h" +#include "content/browser/attribution_reporting/attribution_utils.h" #include "content/browser/attribution_reporting/common_source_info.h" #include "content/browser/attribution_reporting/rate_limit_result.h" #include "content/browser/attribution_reporting/sql_utils.h" @@ -53,18 +54,18 @@ namespace content { // Version number of the database. -const int AttributionStorageSql::kCurrentVersionNumber = 30; +const int AttributionStorageSql::kCurrentVersionNumber = 31; // Earliest version which can use a |kCurrentVersionNumber| database // without failing. -const int AttributionStorageSql::kCompatibleVersionNumber = 30; +const int AttributionStorageSql::kCompatibleVersionNumber = 31; // Latest version of the database that cannot be upgraded to // |kCurrentVersionNumber| without razing the database. // // Note that all versions >=15 were introduced during the transitional state of // the Attribution Reporting API and can be removed when done. -const int AttributionStorageSql::kDeprecatedVersionNumber = 29; +const int AttributionStorageSql::kDeprecatedVersionNumber = 30; namespace { @@ -117,7 +118,9 @@ prefix "num_conversions," \ prefix "aggregatable_budget_consumed," \ prefix "aggregatable_sources," \ - prefix "filter_data" + prefix "filter_data," \ + prefix "event_level_active," \ + prefix "aggregatable_active" #define ATTRIBUTION_SELECT_EVENT_LEVEL_REPORT_AND_SOURCE_COLUMNS_SQL \ "SELECT " \ @@ -186,6 +189,22 @@ } } +absl::optional<StoredSource::ActiveState> GetSourceActiveState( + bool event_level_active, + bool aggregatable_active) { + if (event_level_active && aggregatable_active) + return StoredSource::ActiveState::kActive; + + if (!event_level_active && !aggregatable_active) + return StoredSource::ActiveState::kInactive; + + if (!event_level_active) + return StoredSource::ActiveState::kReachedEventLevelAttributionLimit; + + // We haven't enforced aggregatable attribution limit yet. + return absl::nullopt; +} + void BindUint64OrNull(sql::Statement& statement, int col, absl::optional<uint64_t> value) { @@ -219,7 +238,7 @@ int64_t aggregatable_budget_consumed; }; -constexpr int kSourceColumnCount = 15; +constexpr int kSourceColumnCount = 17; // Helper to deserialize source rows. See `GetActiveSources()` for the // expected ordering of columns used for the input to this function. @@ -262,6 +281,13 @@ if (!filter_data) return absl::nullopt; + bool event_level_active = statement.ColumnBool(col++); + bool aggregatable_active = statement.ColumnBool(col++); + absl::optional<StoredSource::ActiveState> active_state = + GetSourceActiveState(event_level_active, aggregatable_active); + if (!active_state.has_value()) + return absl::nullopt; + return StoredSourceData{ .source = StoredSource( CommonSourceInfo(source_event_id, std::move(impression_origin), @@ -270,7 +296,7 @@ expiry_time, *source_type, priority, std::move(*filter_data), debug_key, std::move(*aggregatable_sources)), - *attribution_logic, source_id), + *attribution_logic, *active_state, source_id), .num_conversions = num_conversions, .aggregatable_budget_consumed = aggregatable_budget_consumed}; } @@ -348,7 +374,9 @@ " FROM impressions " DCHECK_SQL_INDEXED_BY("conversion_destination_idx") "WHERE conversion_destination = ? AND reporting_origin = ? AND " - "active = 1 AND num_conversions > 0 LIMIT ?"; // clang-format on + "((event_level_active = 1 AND num_conversions > 0) OR " + "(aggregatable_active = 1 AND aggregatable_budget_consumed > 0)) " + "LIMIT ?"; // clang-format on sql::Statement get_statement( db_->GetCachedStatement(SQL_FROM_HERE, kGetSourcesToReturnSql)); get_statement.BindString(0, serialized_conversion_destination); @@ -377,9 +405,10 @@ static constexpr char kDeactivateSourcesSql[] = "UPDATE impressions " DCHECK_SQL_INDEXED_BY("conversion_destination_idx") - "SET active = 0 " + "SET event_level_active = 0,aggregatable_active = 0 " "WHERE conversion_destination = ? AND reporting_origin = ? AND " - "active = 1 AND num_conversions > 0"; + "((event_level_active = 1 AND num_conversions > 0) OR " + "(aggregatable_active = 1 AND aggregatable_budget_consumed > 0))"; sql::Statement deactivate_statement( db_->GetCachedStatement(SQL_FROM_HERE, kDeactivateSourcesSql)); deactivate_statement.BindString(0, serialized_conversion_destination); @@ -489,9 +518,9 @@ "conversion_destination," "reporting_origin,impression_time,expiry_time,source_type," "attributed_truthfully,priority,impression_site," - "num_conversions,active,debug_key,aggregatable_budget_consumed," - "aggregatable_sources,filter_data)" - "VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,0,?,?)"; + "num_conversions,event_level_active,aggregatable_active,debug_key," + "aggregatable_budget_consumed,aggregatable_sources,filter_data)" + "VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,0,?,?)"; sql::Statement statement( db_->GetCachedStatement(SQL_FROM_HERE, kInsertImpressionSql)); statement.BindInt64(0, SerializeUint64(common_info.source_event_id())); @@ -507,19 +536,25 @@ statement.BindString(10, common_info.ImpressionSite().Serialize()); statement.BindInt(11, num_conversions); statement.BindBool(12, active); + statement.BindBool(13, active); - BindUint64OrNull(statement, 13, common_info.debug_key()); + BindUint64OrNull(statement, 14, common_info.debug_key()); + + absl::optional<StoredSource::ActiveState> active_state = + GetSourceActiveState(/*event_level_active=*/active, + /*aggregatable_active=*/active); + DCHECK(active_state.has_value()); statement.BindBlob( - 14, common_info.aggregatable_sources().proto().SerializeAsString()); - statement.BindBlob(15, common_info.filter_data().Serialize()); + 15, common_info.aggregatable_sources().proto().SerializeAsString()); + statement.BindBlob(16, common_info.filter_data().Serialize()); if (!statement.Run()) return StoreSourceResult(StorableSource::Result::kInternalError); const StoredSource::Id source_id(db_->GetLastInsertRowId()); const StoredSource stored_source(source.common_info(), attribution_logic, - source_id); + *active_state, source_id); if (!rate_limit_table_.AddRateLimitForSource(db_.get(), stored_source)) return StoreSourceResult(StorableSource::Result::kInternalError); @@ -601,11 +636,11 @@ if (!min_priority_statement.Succeeded()) return MaybeReplaceLowerPriorityEventLevelReportResult::kError; - // Deactivate the source as a new report will never be generated in the - // future. + // Deactivate the source at event-level as a new report will never be + // generated in the future. if (!has_matching_report) { static constexpr char kDeactivateSql[] = - "UPDATE impressions SET active = 0 WHERE impression_id = ?"; + "UPDATE impressions SET event_level_active = 0 WHERE impression_id = ?"; sql::Statement deactivate_statement( db_->GetCachedStatement(SQL_FROM_HERE, kDeactivateSql)); deactivate_statement.BindInt64(0, *source.source_id()); @@ -673,11 +708,17 @@ AttributionTrigger::EventLevelResult::kInternalError); } + const bool top_level_filters_match = AttributionFiltersMatch( + source_to_attribute->source.common_info().filter_data(), + trigger.filters(), + /*trigger_not_filters=*/AttributionFilterData()); + absl::optional<AttributionReport> report; absl::optional<uint64_t> dedup_key; AttributionTrigger::EventLevelResult result = MaybeCreateEventLevelReport( - std::move(source_to_attribute->source), trigger, report, dedup_key); + std::move(source_to_attribute->source), trigger, top_level_filters_match, + report, dedup_key); if (result != AttributionTrigger::EventLevelResult::kSuccess) return CreateReportResult( result, @@ -739,10 +780,9 @@ } absl::optional<AttributionReport> replaced_report; - absl::optional<DeactivatedSource::Reason> source_deactivation_reason; - result = MaybeStoreEventLevelReport( - *report, dedup_key, source_to_attribute->num_conversions, replaced_report, - source_deactivation_reason); + result = MaybeStoreEventLevelReport(*report, dedup_key, + source_to_attribute->num_conversions, + replaced_report); if (result == AttributionTrigger::EventLevelResult::kInternalError) return CreateReportResult(result, @@ -759,8 +799,7 @@ AttributionTrigger::EventLevelResult::kInternalError, /*dropped_reports=*/{std::move(*report)}); } - return CreateReportResult(result, /*dropped_reports=*/{std::move(*report)}, - std::move(source_deactivation_reason)); + return CreateReportResult(result, /*dropped_reports=*/{std::move(*report)}); } // Delete all unattributed sources. @@ -804,7 +843,6 @@ result, /*dropped_reports=*/replaced_report.has_value() ? std::vector<AttributionReport>{std::move(*replaced_report)} : std::vector<AttributionReport>(), - /*dropped_report_source_deactivation_reason=*/absl::nullopt, /*new_reports=*/{std::move(*report)}); } @@ -819,6 +857,8 @@ const url::Origin& reporting_origin = trigger.reporting_origin(); DCHECK(!reporting_origin.opaque()); + // TODO(linnan): Update the query to handle aggregatable report properly. + // Get all sources that match this <reporting_origin, // conversion_destination> pair. Only get sources that are active and not // past their expiry time. The sources are fetched in order so that the @@ -827,7 +867,7 @@ "SELECT impression_id FROM impressions " DCHECK_SQL_INDEXED_BY("conversion_destination_idx") "WHERE conversion_destination = ? AND reporting_origin = ? " - "AND active = 1 AND expiry_time > ? " + "AND event_level_active = 1 AND expiry_time > ? " "ORDER BY priority DESC,impression_time DESC"; sql::Statement statement( @@ -855,6 +895,7 @@ AttributionStorageSql::MaybeCreateEventLevelReport( StoredSource source, const AttributionTrigger& trigger, + const bool top_level_filters_match, absl::optional<AttributionReport>& report, absl::optional<uint64_t>& dedup_key) { const AttributionSourceType source_type = source.common_info().source_type(); @@ -901,6 +942,9 @@ randomized_response_rate, /*id=*/absl::nullopt)); + if (!top_level_filters_match) + return AttributionTrigger::EventLevelResult::kNoMatchingSourceFilterData; + // Note that this cannot currently occur outside of tests, because all // triggers have two event triggers, one for each source type, one of which // must match. In the future, when we have general filtering based on strings, @@ -927,8 +971,7 @@ const AttributionReport& report, absl::optional<uint64_t> dedup_key, int num_conversions, - absl::optional<AttributionReport>& replaced_report, - absl::optional<DeactivatedSource::Reason>& source_deactivation_reason) { + absl::optional<AttributionReport>& replaced_report) { sql::Transaction transaction(db_.get()); if (!transaction.Begin()) return AttributionTrigger::EventLevelResult::kInternalError; @@ -952,12 +995,6 @@ if (!transaction.Commit()) return AttributionTrigger::EventLevelResult::kInternalError; - if (maybe_replace_lower_priority_report_result == - MaybeReplaceLowerPriorityEventLevelReportResult:: - kDropNewReportSourceDeactivated) { - source_deactivation_reason = - DeactivatedSource::Reason::kReachedAttributionLimit; - } return AttributionTrigger::EventLevelResult::kPriorityTooLow; } @@ -1056,7 +1093,7 @@ // ordering of columns used for the input to this function. absl::optional<AttributionReport> AttributionStorageSql::ReadReportFromStatement(sql::Statement& statement) { - DCHECK_EQ(statement.ColumnCount(), 23); + DCHECK_EQ(statement.ColumnCount(), kSourceColumnCount + 8); absl::optional<StoredSourceData> source_data = ReadSourceFromStatement(statement); @@ -1280,7 +1317,7 @@ static constexpr char kSelectInactiveSourcesSql[] = "SELECT impression_id FROM impressions " DCHECK_SQL_INDEXED_BY("conversion_destination_idx") - "WHERE active = 0 AND " + "WHERE event_level_active = 0 AND aggregatable_active = 0 AND " "impression_id NOT IN(" "SELECT impression_id FROM conversions" DCHECK_SQL_INDEXED_BY("conversion_impression_id_idx") @@ -1646,13 +1683,16 @@ // Therefore the second column in the index should be very well-sorted. // // Note: to take advantage of this, we need to hint to the query planner that - // |active| is a boolean, so include it in the conditional. + // |event_level_active| and |aggregatable_active| are booleans, so include + // them in the conditional. static constexpr char kCountReportsSql[] = "SELECT COUNT(conversion_id)FROM conversions C " "JOIN impressions I " DCHECK_SQL_INDEXED_BY("conversion_destination_idx") "ON I.impression_id = C.impression_id " - "WHERE I.conversion_destination = ? AND(active BETWEEN 0 AND 1)"; + "WHERE I.conversion_destination = ? AND " + "(event_level_active BETWEEN 0 AND 1) AND " + "(aggregatable_active BETWEEN 0 AND 1)"; sql::Statement statement( db_->GetCachedStatement(SQL_FROM_HERE, kCountReportsSql)); statement.BindString(0, serialized_origin); @@ -1675,8 +1715,8 @@ // clang-format off "SELECT " ATTRIBUTION_SOURCE_COLUMNS_SQL("") " FROM impressions " - "WHERE active = 1 and expiry_time > ? " - "LIMIT ?"; // clang-format on + "WHERE (event_level_active = 1 OR aggregatable_active = 1) AND " + "expiry_time > ? LIMIT ?"; // clang-format on sql::Statement statement( db_->GetCachedStatement(SQL_FROM_HERE, kGetActiveSourcesSql)); @@ -1840,13 +1880,15 @@ // Origins usually aren't _that_ big compared to a 64 bit integer(8 bytes). // // All of the columns in this table are designed to be "const" except for - // |num_conversions|, |aggregatable_budget_consumed| and |active| which are - // updated when a new trigger is received. |num_conversions| is the number of - // times an event-level report has been created for a given source. - // |aggregatable_budget_consumed| is the aggregatable budget that has been - // consumed for a given source. |delegate_| can choose to enforce a maximum - // limit on them. |active| indicates whether a source is able to create new - // associated reports. |active| can be unset on a number of conditions: + // |num_conversions|, |aggregatable_budget_consumed|, |event_level_active| + // and |aggregatable_active| which are updated when a new trigger is + // received. |num_conversions| is the number of times an event-level report + // has been created for a given source. |aggregatable_budget_consumed| is the + // aggregatable budget that has been consumed for a given source. |delegate_| + // can choose to enforce a maximum limit on them. |event_level_active| and + // |aggregatable_active| indicate whether a source is able to create new + // associated event-level and aggregatable reports. |event_level_active| and + // |aggregatable_active| can be unset on a number of conditions: // - A source converted too many times. // - A new source was stored after a source converted, making it // ineligible for new sources due to the attribution model documented @@ -1874,7 +1916,8 @@ "impression_time INTEGER NOT NULL," "expiry_time INTEGER NOT NULL," "num_conversions INTEGER NOT NULL," - "active INTEGER NOT NULL," + "event_level_active INTEGER NOT NULL," + "aggregatable_active INTEGER NOT NULL," "conversion_destination TEXT NOT NULL," "source_type INTEGER NOT NULL," "attributed_truthfully INTEGER NOT NULL," @@ -1892,10 +1935,11 @@ // `StoreSource()`, `DeleteExpiredSources()`. Sources and // triggers are considered matching if they share this pair. These calls // need to distinguish between active and inactive reports, so include - // |active| in the index. + // |event_level_active| and |aggregatable_active| in the index. static constexpr char kConversionDestinationIndexSql[] = "CREATE INDEX IF NOT EXISTS conversion_destination_idx " - "ON impressions(active,conversion_destination,reporting_origin)"; + "ON impressions(event_level_active,aggregatable_active," + "conversion_destination,reporting_origin)"; if (!db_->Execute(kConversionDestinationIndexSql)) return false; @@ -1921,7 +1965,8 @@ static constexpr char kImpressionSiteReportingOriginIndexSql[] = "CREATE INDEX IF NOT EXISTS impression_site_reporting_origin_idx " "ON impressions(impression_site,reporting_origin)" - "WHERE active=1 AND num_conversions=0"; + "WHERE event_level_active=1 AND num_conversions=0 AND " + "aggregatable_active=1 AND aggregatable_budget_consumed=0"; if (!db_->Execute(kImpressionSiteReportingOriginIndexSql)) return false; @@ -2123,7 +2168,8 @@ "SELECT conversion_destination FROM impressions " DCHECK_SQL_INDEXED_BY("impression_site_reporting_origin_idx") "WHERE impression_site=? AND reporting_origin=? " - "AND active=1 AND num_conversions=0"; + "AND event_level_active=1 AND num_conversions=0 AND " + "aggregatable_active=1 AND aggregatable_budget_consumed=0"; sql::Statement statement( db_->GetCachedStatement(SQL_FROM_HERE, kSelectSourcesSql)); statement.BindString(0, source.common_info().ImpressionSite().Serialize());
diff --git a/content/browser/attribution_reporting/attribution_storage_sql.h b/content/browser/attribution_reporting/attribution_storage_sql.h index cd82d9b..ae6bb62 100644 --- a/content/browser/attribution_reporting/attribution_storage_sql.h +++ b/content/browser/attribution_reporting/attribution_storage_sql.h
@@ -15,7 +15,6 @@ #include "base/memory/weak_ptr.h" #include "base/sequence_checker.h" #include "base/thread_annotations.h" -#include "content/browser/attribution_reporting/attribution_observer_types.h" #include "content/browser/attribution_reporting/attribution_storage.h" #include "content/browser/attribution_reporting/attribution_trigger.h" #include "content/browser/attribution_reporting/rate_limit_table.h" @@ -252,6 +251,7 @@ AttributionTrigger::EventLevelResult MaybeCreateEventLevelReport( StoredSource source, const AttributionTrigger& trigger, + bool top_level_filters_match, absl::optional<AttributionReport>& report, absl::optional<uint64_t>& dedup_key) VALID_CONTEXT_REQUIRED(sequence_checker_); @@ -260,8 +260,7 @@ const AttributionReport& report, absl::optional<uint64_t> dedup_key, int num_conversions, - absl::optional<AttributionReport>& replaced_report, - absl::optional<DeactivatedSource::Reason>& source_deactivation_reason) + absl::optional<AttributionReport>& replaced_report) VALID_CONTEXT_REQUIRED(sequence_checker_); // Initializes the database if necessary, and returns whether the database is
diff --git a/content/browser/attribution_reporting/attribution_storage_sql_unittest.cc b/content/browser/attribution_reporting/attribution_storage_sql_unittest.cc index 02205d0d..5d00ff6 100644 --- a/content/browser/attribution_reporting/attribution_storage_sql_unittest.cc +++ b/content/browser/attribution_reporting/attribution_storage_sql_unittest.cc
@@ -608,18 +608,6 @@ .Build())); EXPECT_THAT(storage()->GetActiveSources(), SizeIs(1)); - // Force the impression to be deactivated by ensuring that the next report is - // in a different window. - delegate()->set_report_delay(base::Milliseconds(1)); - EXPECT_EQ( - AttributionTrigger::EventLevelResult::kPriorityTooLow, - MaybeCreateAndStoreEventLevelReport( - TriggerBuilder() - .SetConversionDestination(net::SchemefulSite(conversion_origin)) - .SetReportingOrigin(reporting_origin) - .Build())); - EXPECT_THAT(storage()->GetActiveSources(), IsEmpty()); - task_environment_.FastForwardBy(base::Days(1)); EXPECT_TRUE( storage()->DeleteReport(AttributionReport::EventLevelData::Id(1))); @@ -666,18 +654,6 @@ .Build())); EXPECT_THAT(storage()->GetActiveSources(), SizeIs(1)); - // Force the impression to be deactivated by ensuring that the next report is - // in a different window. - delegate()->set_report_delay(base::Milliseconds(1)); - EXPECT_EQ( - AttributionTrigger::EventLevelResult::kPriorityTooLow, - MaybeCreateAndStoreEventLevelReport( - TriggerBuilder() - .SetConversionDestination(net::SchemefulSite(conversion_origin)) - .SetReportingOrigin(reporting_origin) - .Build())); - EXPECT_THAT(storage()->GetActiveSources(), IsEmpty()); - task_environment_.FastForwardBy(base::Days(1)); EXPECT_TRUE( storage()->DeleteReport(AttributionReport::EventLevelData::Id(1)));
diff --git a/content/browser/attribution_reporting/attribution_storage_unittest.cc b/content/browser/attribution_reporting/attribution_storage_unittest.cc index 0779daa..e48e85e 100644 --- a/content/browser/attribution_reporting/attribution_storage_unittest.cc +++ b/content/browser/attribution_reporting/attribution_storage_unittest.cc
@@ -270,11 +270,10 @@ } // No additional conversion reports should be created. - EXPECT_THAT( - storage()->MaybeCreateAndStoreReport(DefaultTrigger()), - AllOf(CreateReportEventLevelStatusIs( - AttributionTrigger::EventLevelResult::kPriorityTooLow), - DroppedReportsAre(SizeIs(1)), DeactivatedSourceIs(absl::nullopt))); + EXPECT_THAT(storage()->MaybeCreateAndStoreReport(DefaultTrigger()), + AllOf(CreateReportEventLevelStatusIs( + AttributionTrigger::EventLevelResult::kPriorityTooLow), + DroppedReportsAre(SizeIs(1)))); } TEST_F(AttributionStorageTest, OneConversion_OneReportScheduled) { @@ -912,7 +911,10 @@ MaybeCreateAndStoreEventLevelReport(conversion)); const AttributionReport expected_report = GetExpectedEventLevelReport( - builder.SetDefaultFilterData().BuildStored(), conversion); + builder.SetDefaultFilterData() + .SetActiveState(StoredSource::ActiveState::kInactive) + .BuildStored(), + conversion); task_environment_.FastForwardBy(kReportDelay); @@ -1020,43 +1022,6 @@ } TEST_F(AttributionStorageTest, - MaxAttributionDestinationsPerSource_IgnoresInactiveImpressions) { - delegate()->set_max_attributions_per_source(1); - delegate()->set_max_destinations_per_source_site_reporting_origin(INT_MAX); - - const auto origin_a = url::Origin::Create(GURL("https://a.example")); - - storage()->StoreSource(SourceBuilder().SetConversionOrigin(origin_a).Build()); - EXPECT_THAT(storage()->GetActiveSources(), SizeIs(1)); - - const auto trigger = - TriggerBuilder() - .SetConversionDestination(net::SchemefulSite(origin_a)) - .Build(); - - EXPECT_EQ(AttributionTrigger::EventLevelResult::kSuccess, - MaybeCreateAndStoreEventLevelReport(trigger)); - EXPECT_THAT(storage()->GetActiveSources(), SizeIs(1)); - - // Force the impression to be deactivated by ensuring that the next report is - // in a different window. - delegate()->set_report_delay(kReportDelay + base::Milliseconds(1)); - EXPECT_EQ(AttributionTrigger::EventLevelResult::kPriorityTooLow, - MaybeCreateAndStoreEventLevelReport(trigger)); - EXPECT_THAT(storage()->GetActiveSources(), IsEmpty()); - - delegate()->set_max_destinations_per_source_site_reporting_origin(1); - storage()->StoreSource( - SourceBuilder() - .SetConversionOrigin(url::Origin::Create(GURL("https://b.example"))) - .Build()); - - EXPECT_THAT(storage()->GetActiveSources(), - ElementsAre(ConversionOriginIs( - url::Origin::Create(GURL("https://b.example"))))); -} - -TEST_F(AttributionStorageTest, MultipleImpressionsPerConversion_MostRecentAttributesForSamePriority) { storage()->StoreSource(SourceBuilder().SetSourceEventId(3).Build()); @@ -1136,6 +1101,7 @@ builder .SetAttributionLogic(StoredSource::AttributionLogic::kFalsely) .SetDefaultFilterData() + .SetActiveState(StoredSource::ActiveState::kInactive) .BuildStored()) .SetTime(base::Time::Now()) .Build()) @@ -1316,8 +1282,12 @@ MaybeCreateAndStoreEventLevelReport( TriggerBuilder().SetPriority(2).Build())); - // As a result, the impression with data 5 should also be deactivated. - EXPECT_THAT(storage()->GetActiveSources(), IsEmpty()); + // As a result, the impression with data 5 should have reached event-level + // attribution limit. + EXPECT_THAT( + storage()->GetActiveSources(), + ElementsAre(SourceActiveStateIs( + StoredSource::ActiveState::kReachedEventLevelAttributionLimit))); } TEST_F(AttributionStorageTest, DedupKey_Dedups) { @@ -1613,10 +1583,11 @@ AllOf(CreateReportEventLevelStatusIs( AttributionTrigger::EventLevelResult::kPriorityTooLow), DroppedReportsAre(ElementsAre(ReportSourceIs( - builder.SetDefaultFilterData().BuildStored()))), - DeactivatedSourceIs(DeactivatedSource( - builder.SetDefaultFilterData().BuildStored(), - DeactivatedSource::Reason::kReachedAttributionLimit)))); + builder.SetDefaultFilterData().BuildStored()))))); + EXPECT_THAT( + storage()->GetActiveSources(), + ElementsAre(SourceActiveStateIs( + StoredSource::ActiveState::kReachedEventLevelAttributionLimit))); } TEST_F(AttributionStorageTest, ReportID_RoundTrips) { @@ -2181,6 +2152,7 @@ AttributionTrigger::EventLevelResult::kNoMatchingEventTriggers, MaybeCreateAndStoreEventLevelReport(AttributionTrigger( net::SchemefulSite(origin), origin, + /*filters=*/AttributionFilterData(), /*debug_key=*/absl::nullopt, {AttributionTrigger::EventTriggerData( /*data=*/0, @@ -2190,6 +2162,7 @@ EXPECT_EQ(AttributionTrigger::EventLevelResult::kSuccess, MaybeCreateAndStoreEventLevelReport( AttributionTrigger(net::SchemefulSite(origin), origin, + /*filters=*/AttributionFilterData(), /*debug_key=*/absl::nullopt, {AttributionTrigger::EventTriggerData( /*data=*/0, @@ -2198,4 +2171,43 @@ AttributionSourceType::kNavigation)}))); } +TEST_F(AttributionStorageTest, TopLevelTriggerFiltering) { + const auto origin = url::Origin::Create(GURL("https://r.test")); + + storage()->StoreSource( + SourceBuilder() + .SetConversionOrigin(origin) + .SetReportingOrigin(origin) + .SetFilterData(*AttributionFilterData::FromSourceFilterValues( + {{"abc", {"123"}}})) + .Build()); + + const std::vector<AttributionTrigger::EventTriggerData> event_triggers = { + AttributionTrigger::EventTriggerData( + /*data=*/0, + /*priority=*/0, + /*dedup_key=*/absl::nullopt, AttributionSourceType::kNavigation), + }; + + AttributionTrigger trigger1(net::SchemefulSite(origin), origin, + /*filters=*/ + *AttributionFilterData::FromTriggerFilterValues({ + {"abc", {"456"}}, + }), + /*debug_key=*/absl::nullopt, event_triggers); + + AttributionTrigger trigger2(net::SchemefulSite(origin), origin, + /*filters=*/ + *AttributionFilterData::FromTriggerFilterValues({ + {"abc", {"123"}}, + }), + /*debug_key=*/absl::nullopt, event_triggers); + + EXPECT_EQ(AttributionTrigger::EventLevelResult::kNoMatchingSourceFilterData, + MaybeCreateAndStoreEventLevelReport(trigger1)); + + EXPECT_EQ(AttributionTrigger::EventLevelResult::kSuccess, + MaybeCreateAndStoreEventLevelReport(trigger2)); +} + } // namespace content
diff --git a/content/browser/attribution_reporting/attribution_test_utils.cc b/content/browser/attribution_reporting/attribution_test_utils.cc index b9fc7c63..84ce729e 100644 --- a/content/browser/attribution_reporting/attribution_test_utils.cc +++ b/content/browser/attribution_reporting/attribution_test_utils.cc
@@ -447,6 +447,12 @@ return *this; } +SourceBuilder& SourceBuilder::SetActiveState( + StoredSource::ActiveState active_state) { + active_state_ = active_state; + return *this; +} + SourceBuilder& SourceBuilder::SetSourceId(StoredSource::Id source_id) { source_id_ = source_id; return *this; @@ -476,7 +482,8 @@ } StoredSource SourceBuilder::BuildStored() const { - StoredSource source(BuildCommonInfo(), attribution_logic_, source_id_); + StoredSource source(BuildCommonInfo(), attribution_logic_, active_state_, + source_id_); source.SetDedupKeys(dedup_keys_); return source; } @@ -745,7 +752,7 @@ bool operator==(const StoredSource& a, const StoredSource& b) { const auto tie = [](const StoredSource& source) { return std::make_tuple(source.common_info(), source.attribution_logic(), - source.dedup_keys()); + source.active_state(), source.dedup_keys()); }; return tie(a) == tie(b); } @@ -841,6 +848,9 @@ case AttributionTrigger::EventLevelResult::kNoMatchingEventTriggers: out << "noMatchingEventTriggers"; break; + case AttributionTrigger::EventLevelResult::kNoMatchingSourceFilterData: + out << "noMatchingSourceFilterData"; + break; } return out; } @@ -850,9 +860,6 @@ case DeactivatedSource::Reason::kReplacedByNewerSource: out << "kReplacedByNewerSource"; break; - case DeactivatedSource::Reason::kReachedAttributionLimit: - out << "kReachedAttributionLimit"; - break; } return out; } @@ -904,6 +911,22 @@ } std::ostream& operator<<(std::ostream& out, + StoredSource::ActiveState active_state) { + switch (active_state) { + case StoredSource::ActiveState::kActive: + out << "kActive"; + break; + case StoredSource::ActiveState::kInactive: + out << "kInactive"; + break; + case StoredSource::ActiveState::kReachedEventLevelAttributionLimit: + out << "kReachedEventLevelAttributionLimit"; + break; + } + return out; +} + +std::ostream& operator<<(std::ostream& out, const AttributionTrigger& conversion) { out << "{conversion_destination=" << conversion.conversion_destination().Serialize() @@ -981,6 +1004,7 @@ std::ostream& operator<<(std::ostream& out, const StoredSource& source) { out << "{common_info=" << source.common_info() << ",attribution_logic=" << source.attribution_logic() + << ",active_state=" << source.active_state() << ",source_id=" << *source.source_id() << ",dedup_keys=["; const char* separator = "";
diff --git a/content/browser/attribution_reporting/attribution_test_utils.h b/content/browser/attribution_reporting/attribution_test_utils.h index f90008f6..74be691 100644 --- a/content/browser/attribution_reporting/attribution_test_utils.h +++ b/content/browser/attribution_reporting/attribution_test_utils.h
@@ -354,6 +354,8 @@ // Sets the filter data to the autogenerated "source_type" filter. SourceBuilder& SetDefaultFilterData(); + SourceBuilder& SetActiveState(StoredSource::ActiveState active_state); + SourceBuilder& SetDebugKey(absl::optional<uint64_t> debug_key); SourceBuilder& SetSourceId(StoredSource::Id source_id); @@ -381,6 +383,7 @@ StoredSource::AttributionLogic attribution_logic_ = StoredSource::AttributionLogic::kTruthfully; AttributionFilterData filter_data_; + StoredSource::ActiveState active_state_ = StoredSource::ActiveState::kActive; absl::optional<uint64_t> debug_key_; // `base::StrongAlias` does not automatically initialize the value here. // Ensure that we don't use uninitialized memory. @@ -626,6 +629,9 @@ StoredSource::AttributionLogic attribution_logic); std::ostream& operator<<(std::ostream& out, + StoredSource::ActiveState active_state); + +std::ostream& operator<<(std::ostream& out, const DeactivatedSource& deactivated_source); std::ostream& operator<<(std::ostream& out, StorableSource::Result status); @@ -696,6 +702,10 @@ result_listener); } +MATCHER_P(SourceActiveStateIs, matcher, "") { + return ExplainMatchResult(matcher, arg.active_state(), result_listener); +} + // Trigger matchers. MATCHER_P(TriggerConversionDestinationIs, matcher, "") {
diff --git a/content/browser/attribution_reporting/attribution_trigger.cc b/content/browser/attribution_reporting/attribution_trigger.cc index be95377..be37764 100644 --- a/content/browser/attribution_reporting/attribution_trigger.cc +++ b/content/browser/attribution_reporting/attribution_trigger.cc
@@ -23,10 +23,12 @@ AttributionTrigger::AttributionTrigger( net::SchemefulSite conversion_destination, url::Origin reporting_origin, + AttributionFilterData filters, absl::optional<uint64_t> debug_key, std::vector<EventTriggerData> event_triggers) : conversion_destination_(std::move(conversion_destination)), reporting_origin_(std::move(reporting_origin)), + filters_(std::move(filters)), debug_key_(debug_key), event_triggers_(std::move(event_triggers)) { DCHECK(!reporting_origin_.opaque()); @@ -44,6 +46,7 @@ : AttributionTrigger( std::move(conversion_destination), std::move(reporting_origin), + /*filters=*/AttributionFilterData(), debug_key, std::vector<EventTriggerData>( {EventTriggerData(trigger_data,
diff --git a/content/browser/attribution_reporting/attribution_trigger.h b/content/browser/attribution_reporting/attribution_trigger.h index 7d164f0f..fb00de0 100644 --- a/content/browser/attribution_reporting/attribution_trigger.h +++ b/content/browser/attribution_reporting/attribution_trigger.h
@@ -9,6 +9,7 @@ #include <vector> +#include "content/browser/attribution_reporting/attribution_filter_data.h" #include "content/browser/attribution_reporting/attribution_source_type.h" #include "content/common/content_export.h" #include "net/base/schemeful_site.h" @@ -39,8 +40,11 @@ kPriorityTooLow = 7, kDroppedForNoise = 8, kExcessiveReportingOrigins = 9, + // TODO(apaseltiner): Remove this value once event-trigger matching is + // implemented. kNoMatchingEventTriggers = 10, - kMaxValue = kNoMatchingEventTriggers, + kNoMatchingSourceFilterData = 11, + kMaxValue = kNoMatchingSourceFilterData, }; struct CONTENT_EXPORT EventTriggerData { @@ -74,6 +78,7 @@ // known by the browser process. AttributionTrigger(net::SchemefulSite conversion_destination, url::Origin reporting_origin, + AttributionFilterData filters, absl::optional<uint64_t> debug_key, std::vector<EventTriggerData> event_triggers); @@ -105,6 +110,8 @@ const url::Origin& reporting_origin() const { return reporting_origin_; } + const AttributionFilterData& filters() const { return filters_; } + absl::optional<uint64_t> debug_key() const { return debug_key_; } void ClearDebugKey() { debug_key_ = absl::nullopt; } @@ -121,6 +128,8 @@ // reports. url::Origin reporting_origin_; + AttributionFilterData filters_; + absl::optional<uint64_t> debug_key_; std::vector<EventTriggerData> event_triggers_;
diff --git a/content/browser/attribution_reporting/attribution_utils.cc b/content/browser/attribution_reporting/attribution_utils.cc index a1345d96..5af0a7b 100644 --- a/content/browser/attribution_reporting/attribution_utils.cc +++ b/content/browser/attribution_reporting/attribution_utils.cc
@@ -136,9 +136,6 @@ // If the filters are negated, the behavior should be that every single filter // key does not match between the two (negating the function result is not // sufficient by the API definition). - // - // TODO(apaseltiner, linnan): Figure out how to incorporate the implicitly - // generated source_type filter data. return base::ranges::all_of( trigger.filter_values(), [&](const auto& trigger_filter) { auto source_filter = source.filter_values().find(trigger_filter.first); @@ -164,4 +161,21 @@ }); } +bool AttributionFiltersMatch(const AttributionFilterData& source_filter_data, + const AttributionFilterData& trigger_filters, + const AttributionFilterData& trigger_not_filters) { + if (!trigger_filters.filter_values().empty() && + !AttributionFilterDataMatch(source_filter_data, trigger_filters)) { + return false; + } + + if (!trigger_not_filters.filter_values().empty() && + !AttributionFilterDataMatch(source_filter_data, trigger_not_filters, + /*negated=*/true)) { + return false; + } + + return true; +} + } // namespace content
diff --git a/content/browser/attribution_reporting/attribution_utils.h b/content/browser/attribution_reporting/attribution_utils.h index 170904a4..ae462d1 100644 --- a/content/browser/attribution_reporting/attribution_utils.h +++ b/content/browser/attribution_reporting/attribution_utils.h
@@ -43,6 +43,11 @@ const AttributionFilterData& trigger, bool negated = false); +CONTENT_EXPORT bool AttributionFiltersMatch( + const AttributionFilterData& source_filter_data, + const AttributionFilterData& trigger_filters, + const AttributionFilterData& trigger_not_filters); + } // namespace content #endif // CONTENT_BROWSER_ATTRIBUTION_REPORTING_ATTRIBUTION_UTILS_H_
diff --git a/content/browser/attribution_reporting/stored_source.cc b/content/browser/attribution_reporting/stored_source.cc index ea5f50b..f818cc6 100644 --- a/content/browser/attribution_reporting/stored_source.cc +++ b/content/browser/attribution_reporting/stored_source.cc
@@ -10,9 +10,11 @@ StoredSource::StoredSource(CommonSourceInfo common_info, AttributionLogic attribution_logic, + ActiveState active_state, Id source_id) : common_info_(std::move(common_info)), attribution_logic_(attribution_logic), + active_state_(active_state), source_id_(source_id) {} StoredSource::~StoredSource() = default;
diff --git a/content/browser/attribution_reporting/stored_source.h b/content/browser/attribution_reporting/stored_source.h index efcd066f..819ff42 100644 --- a/content/browser/attribution_reporting/stored_source.h +++ b/content/browser/attribution_reporting/stored_source.h
@@ -30,8 +30,16 @@ kMaxValue = kFalsely, }; + enum class ActiveState { + kActive = 0, + kInactive = 1, + kReachedEventLevelAttributionLimit = 2, + kMaxValue = kReachedEventLevelAttributionLimit, + }; + StoredSource(CommonSourceInfo common_info, AttributionLogic attribution_logic, + ActiveState active_state, Id source_id); ~StoredSource(); @@ -46,6 +54,8 @@ AttributionLogic attribution_logic() const { return attribution_logic_; } + ActiveState active_state() const { return active_state_; } + Id source_id() const { return source_id_; } const std::vector<uint64_t>& dedup_keys() const { return dedup_keys_; } @@ -59,6 +69,8 @@ AttributionLogic attribution_logic_; + ActiveState active_state_; + Id source_id_; // Dedup keys associated with the source. Only set in values returned from
diff --git a/content/browser/bluetooth/web_bluetooth_service_impl.cc b/content/browser/bluetooth/web_bluetooth_service_impl.cc index 3091c08..96357838 100644 --- a/content/browser/bluetooth/web_bluetooth_service_impl.cc +++ b/content/browser/bluetooth/web_bluetooth_service_impl.cc
@@ -963,6 +963,27 @@ weak_ptr_factory_.GetWeakPtr(), std::move(callback))); } +void WebBluetoothServiceImpl::ForgetDevice( + const blink::WebBluetoothDeviceId& device_id, + ForgetDeviceCallback callback) { + if (!base::FeatureList::IsEnabled( + features::kWebBluetoothNewPermissionsBackend)) { + auto device_address = allowed_devices().GetDeviceAddress(device_id); + allowed_devices().RemoveDevice(device_address); + std::move(callback).Run(); + return; + } + + BluetoothDelegate* delegate = + GetContentClient()->browser()->GetBluetoothDelegate(); + if (delegate && + delegate->HasDevicePermission(render_frame_host(), device_id)) { + delegate->RevokeDevicePermissionWebInitiated(render_frame_host(), + device_id); + } + std::move(callback).Run(); +} + void WebBluetoothServiceImpl::RemoteServerConnect( const blink::WebBluetoothDeviceId& device_id, mojo::PendingAssociatedRemote<blink::mojom::WebBluetoothServerClient>
diff --git a/content/browser/bluetooth/web_bluetooth_service_impl.h b/content/browser/bluetooth/web_bluetooth_service_impl.h index 53223d2b..9ba03bc 100644 --- a/content/browser/bluetooth/web_bluetooth_service_impl.h +++ b/content/browser/bluetooth/web_bluetooth_service_impl.h
@@ -213,6 +213,8 @@ void RequestDevice(blink::mojom::WebBluetoothRequestDeviceOptionsPtr options, RequestDeviceCallback callback) override; void GetDevices(GetDevicesCallback callback) override; + void ForgetDevice(const blink::WebBluetoothDeviceId& device_id, + ForgetDeviceCallback callback) override; void RemoteServerConnect( const blink::WebBluetoothDeviceId& device_id, mojo::PendingAssociatedRemote<blink::mojom::WebBluetoothServerClient>
diff --git a/content/browser/bluetooth/web_bluetooth_service_impl_browsertest.cc b/content/browser/bluetooth/web_bluetooth_service_impl_browsertest.cc index ee8440e..f1e5a563c 100644 --- a/content/browser/bluetooth/web_bluetooth_service_impl_browsertest.cc +++ b/content/browser/bluetooth/web_bluetooth_service_impl_browsertest.cc
@@ -194,6 +194,9 @@ const blink::WebBluetoothDeviceId& device_id) override { return false; } + void RevokeDevicePermissionWebInitiated( + RenderFrameHost* frame, + const blink::WebBluetoothDeviceId& device_id) override {} bool IsAllowedToAccessService(RenderFrameHost* frame, const blink::WebBluetoothDeviceId& device_id, const device::BluetoothUUID& service) override {
diff --git a/content/browser/bluetooth/web_bluetooth_service_impl_unittest.cc b/content/browser/bluetooth/web_bluetooth_service_impl_unittest.cc index ad2b868..c18c549 100644 --- a/content/browser/bluetooth/web_bluetooth_service_impl_unittest.cc +++ b/content/browser/bluetooth/web_bluetooth_service_impl_unittest.cc
@@ -321,6 +321,9 @@ const blink::WebBluetoothDeviceId& device_id) override { return false; } + void RevokeDevicePermissionWebInitiated( + RenderFrameHost* frame, + const blink::WebBluetoothDeviceId& device_id) override {} bool IsAllowedToAccessService(RenderFrameHost* frame, const blink::WebBluetoothDeviceId& device_id, const device::BluetoothUUID& service) override {
diff --git a/content/browser/cache_storage/cache_storage_blob_to_disk_cache_unittest.cc b/content/browser/cache_storage/cache_storage_blob_to_disk_cache_unittest.cc index c377bcf..6d6c4aa 100644 --- a/content/browser/cache_storage/cache_storage_blob_to_disk_cache_unittest.cc +++ b/content/browser/cache_storage/cache_storage_blob_to_disk_cache_unittest.cc
@@ -121,7 +121,8 @@ void InitCache() { int rv = CreateCacheBackend( - net::MEMORY_CACHE, net::CACHE_BACKEND_DEFAULT, base::FilePath(), + net::MEMORY_CACHE, net::CACHE_BACKEND_DEFAULT, + /*file_operations=*/nullptr, base::FilePath(), (CacheStorageBlobToDiskCache::kBufferSize * 100) /* max bytes */, disk_cache::ResetHandling::kNeverReset, nullptr /* net log */, &cache_backend_, base::DoNothing());
diff --git a/content/browser/cache_storage/legacy/legacy_cache_storage_cache.cc b/content/browser/cache_storage/legacy/legacy_cache_storage_cache.cc index 1d5e661e..5f95e12 100644 --- a/content/browser/cache_storage/legacy/legacy_cache_storage_cache.cc +++ b/content/browser/cache_storage/legacy/legacy_cache_storage_cache.cc
@@ -2502,8 +2502,8 @@ DCHECK(scheduler_->IsRunningExclusiveOperation()); int rv = disk_cache::CreateCacheBackend( - cache_type, net::CACHE_BACKEND_SIMPLE, path_, max_bytes, - disk_cache::ResetHandling::kNeverReset, nullptr, backend, + cache_type, net::CACHE_BACKEND_SIMPLE, /*file_operations=*/nullptr, path_, + max_bytes, disk_cache::ResetHandling::kNeverReset, nullptr, backend, base::BindOnce(&LegacyCacheStorageCache::DeleteBackendCompletedIO, weak_ptr_factory_.GetWeakPtr()), std::move(split_callback.first));
diff --git a/content/browser/code_cache/generated_code_cache.cc b/content/browser/code_cache/generated_code_cache.cc index b15a04e4..0cb91f9b 100644 --- a/content/browser/code_cache/generated_code_cache.cc +++ b/content/browser/code_cache/generated_code_cache.cc
@@ -478,7 +478,8 @@ // all the contents and recreates a new one. int rv = disk_cache::CreateCacheBackend( CodeCacheTypeToNetCacheType(cache_type_), net::CACHE_BACKEND_SIMPLE, - path_, max_size_bytes_, disk_cache::ResetHandling::kResetOnError, nullptr, + /*file_operations=*/nullptr, path_, max_size_bytes_, + disk_cache::ResetHandling::kResetOnError, nullptr, &shared_backend_ptr->data, std::move(create_backend_complete)); if (rv != net::ERR_IO_PENDING) { DidCreateBackend(shared_backend_ptr, rv);
diff --git a/content/browser/compositor/image_transport_factory_browsertest.cc b/content/browser/compositor/image_transport_factory_browsertest.cc index 71843f4..334eac4 100644 --- a/content/browser/compositor/image_transport_factory_browsertest.cc +++ b/content/browser/compositor/image_transport_factory_browsertest.cc
@@ -28,8 +28,8 @@ MOCK_METHOD0(OnContextLost, void()); }; -// Flaky on ChromeOS: crbug.com/394083 -#if BUILDFLAG(IS_CHROMEOS_ASH) +// TODO(crbug.com/394083, crbug.com/1305007): Flaky on ChromeOS and Linux. +#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_LINUX) #define MAYBE_TestLostContext DISABLED_TestLostContext #else #define MAYBE_TestLostContext TestLostContext
diff --git a/content/browser/fenced_frame/fenced_frame.cc b/content/browser/fenced_frame/fenced_frame.cc index b24ce87..7cca77b 100644 --- a/content/browser/fenced_frame/fenced_frame.cc +++ b/content/browser/fenced_frame/fenced_frame.cc
@@ -111,11 +111,6 @@ /*impression=*/absl::nullopt, navigation_start_time); } -void FencedFrame::DidStopLoading() { - if (on_did_finish_loading_callback_for_testing_) - std::move(on_did_finish_loading_callback_for_testing_).Run(); -} - bool FencedFrame::IsHidden() { return web_contents_->IsHidden(); } @@ -192,15 +187,6 @@ return frame_tree_->GetMainFrame()->GetDevToolsFrameToken(); } -void FencedFrame::WaitForDidStopLoadingForTesting() { - if (!frame_tree_->IsLoading()) - return; - - base::RunLoop run_loop; - on_did_finish_loading_callback_for_testing_ = run_loop.QuitClosure(); - run_loop.Run(); -} - void FencedFrame::NotifyNavigationStateChanged(InvalidateTypes changed_flags) {} void FencedFrame::NotifyBeforeFormRepostWarningShow() {
diff --git a/content/browser/fenced_frame/fenced_frame.h b/content/browser/fenced_frame/fenced_frame.h index 517750a..a046c9c 100644 --- a/content/browser/fenced_frame/fenced_frame.h +++ b/content/browser/fenced_frame/fenced_frame.h
@@ -50,7 +50,7 @@ // FrameTree::Delegate. void DidStartLoading(FrameTreeNode* frame_tree_node, bool should_show_loading_ui) override {} - void DidStopLoading() override; + void DidStopLoading() override {} void DidChangeLoadProgress() override {} bool IsHidden() override; void NotifyPageChanged(PageImpl& page) override {} @@ -64,9 +64,6 @@ // main frame. const base::UnguessableToken& GetDevToolsFrameToken() const; - // For testing only. - void WaitForDidStopLoadingForTesting(); - RenderFrameHostImpl* GetInnerRoot() { return frame_tree_->GetMainFrame(); } private: @@ -116,8 +113,6 @@ // The FrameTree that we create to host the "inner" fenced frame contents. std::unique_ptr<FrameTree> frame_tree_; - base::OnceClosure on_did_finish_loading_callback_for_testing_; - // Receives messages from the frame owner element in Blink. mojo::AssociatedReceiver<blink::mojom::FencedFrameOwnerHost> receiver_{this}; };
diff --git a/content/browser/fenced_frame/fenced_frame_browsertest.cc b/content/browser/fenced_frame/fenced_frame_browsertest.cc index 7ca87bf4..bf46850 100644 --- a/content/browser/fenced_frame/fenced_frame_browsertest.cc +++ b/content/browser/fenced_frame/fenced_frame_browsertest.cc
@@ -27,6 +27,7 @@ #include "content/test/content_browser_test_utils_internal.h" #include "mojo/public/cpp/test_support/test_utils.h" #include "net/dns/mock_host_resolver.h" +#include "net/test/embedded_test_server/controllable_http_response.h" #include "net/test/embedded_test_server/embedded_test_server.h" #include "testing/gmock/include/gmock/gmock.h" #include "third_party/blink/public/common/features.h" @@ -42,12 +43,10 @@ void SetUpOnMainThread() override { host_resolver()->AddRule("*", "127.0.0.1"); ContentBrowserTest::SetUpOnMainThread(); - ASSERT_TRUE(embedded_test_server()->Start()); https_server()->AddDefaultHandlers(GetTestDataFilePath()); https_server()->SetSSLConfig(net::EmbeddedTestServer::CERT_TEST_NAMES); SetupCrossSiteRedirector(https_server()); - ASSERT_TRUE(https_server()->Start()); } WebContentsImpl* web_contents() { @@ -72,6 +71,7 @@ // Tests that the renderer can create a <fencedframe> that results in a // browser-side content::FencedFrame also being created. IN_PROC_BROWSER_TEST_F(FencedFrameBrowserTest, CreateFromScriptAndDestroy) { + ASSERT_TRUE(https_server()->Start()); const GURL main_url = https_server()->GetURL("c.test", "/fenced_frames/title1.html"); EXPECT_TRUE( @@ -111,6 +111,7 @@ } IN_PROC_BROWSER_TEST_F(FencedFrameBrowserTest, CreateFromParser) { + ASSERT_TRUE(https_server()->Start()); const GURL top_level_url = https_server()->GetURL("c.test", "/fenced_frames/basic.html"); EXPECT_TRUE(NavigateToURL(shell(), top_level_url)); @@ -126,6 +127,7 @@ } IN_PROC_BROWSER_TEST_F(FencedFrameBrowserTest, Navigation) { + ASSERT_TRUE(https_server()->Start()); const GURL main_url = https_server()->GetURL("c.test", "/title1.html"); EXPECT_TRUE(NavigateToURL(shell(), main_url)); @@ -156,6 +158,7 @@ } IN_PROC_BROWSER_TEST_F(FencedFrameBrowserTest, AboutBlankNavigation) { + ASSERT_TRUE(https_server()->Start()); const GURL main_url = https_server()->GetURL("a.test", "/title1.html"); EXPECT_TRUE(NavigateToURL(shell(), main_url)); @@ -178,17 +181,18 @@ // We can't use `NavigateFrameInFencedFrameTree` because that navigates // from the inner frame tree and we want the navigation to occur from // the outer frame tree. + TestFrameNavigationObserver observer(fenced_frame->GetInnerRoot()); EXPECT_TRUE( ExecJs(primary_rfh, "document.querySelector('fencedframe').src = 'about:blank';")); + observer.Wait(); - fenced_frame->WaitForDidStopLoadingForTesting(); EXPECT_TRUE(!fenced_frame->GetInnerRoot()->IsErrorDocument()); - EXPECT_EQ("null", EvalJs(fenced_frame->GetInnerRoot(), "self.origin;")); } IN_PROC_BROWSER_TEST_F(FencedFrameBrowserTest, FrameIteration) { + ASSERT_TRUE(https_server()->Start()); const GURL main_url = https_server()->GetURL("c.test", "/title1.html"); EXPECT_TRUE(NavigateToURL(shell(), main_url)); RenderFrameHostImplWrapper primary_rfh(primary_main_frame_host()); @@ -301,6 +305,7 @@ } // namespace IN_PROC_BROWSER_TEST_F(FencedFrameBrowserTest, NavigationStartTime) { + ASSERT_TRUE(https_server()->Start()); const GURL main_url = https_server()->GetURL("a.test", "/title1.html"); EXPECT_TRUE(NavigateToURL(shell(), main_url)); @@ -326,7 +331,7 @@ std::vector<FencedFrame*> fenced_frames = primary_rfh->GetFencedFrames(); ASSERT_EQ(1U, fenced_frames.size()); FencedFrame* fenced_frame = fenced_frames[0]; - fenced_frame->WaitForDidStopLoadingForTesting(); + WaitForLoadStop(web_contents()); // The duration between navigationStart (measured in the renderer process) and // requestStart (measured in the browser process due to PlzNavigate) must be @@ -341,6 +346,7 @@ // Test that ensures we can post from an cross origin iframe into the // fenced frame root. IN_PROC_BROWSER_TEST_F(FencedFrameBrowserTest, CrossOriginMessagePost) { + ASSERT_TRUE(https_server()->Start()); const GURL main_url = https_server()->GetURL("c.test", "/fenced_frames/title1.html"); const GURL cross_origin_iframe_url = @@ -390,6 +396,7 @@ // for fenced frames as it is only invoked for primary main frames. IN_PROC_BROWSER_TEST_F(FencedFrameBrowserTest, DocumentOnLoadCompletedInPrimaryMainFrame) { + ASSERT_TRUE(https_server()->Start()); // Initialize a MockWebContentsObserver to ensure that // DocumentOnLoadCompletedInPrimaryMainFrame is only invoked for primary main // RenderFrameHosts. @@ -425,6 +432,7 @@ // fenced frames as it is only invoked for primary main frames. IN_PROC_BROWSER_TEST_F(FencedFrameBrowserTest, PrimaryMainDocumentElementAvailable) { + ASSERT_TRUE(https_server()->Start()); // Initialize a MockWebContentsObserver to ensure that // PrimaryMainDocumentElementAvailable is only invoked for primary main // RenderFrameHosts. @@ -458,6 +466,7 @@ // viewport behaviors like zoom-out-to-fit-content or parsing the viewport // <meta>. IN_PROC_BROWSER_TEST_F(FencedFrameBrowserTest, ViewportSettings) { + ASSERT_TRUE(https_server()->Start()); const GURL top_level_url = https_server()->GetURL("c.test", "/fenced_frames/viewport.html"); EXPECT_TRUE(NavigateToURL(shell(), top_level_url)); @@ -467,7 +476,7 @@ ASSERT_EQ(1ul, fenced_frames.size()); FencedFrame* fenced_frame = fenced_frames.back(); - fenced_frame->WaitForDidStopLoadingForTesting(); + EXPECT_TRUE(WaitForLoadStop(web_contents())); // Ensure various dimensions and properties in the fenced frame // match the dimensions of the <fencedframe> in the parent and do @@ -491,14 +500,14 @@ // Test that FrameTree::CollectNodesForIsLoading doesn't include inner // WebContents nodes. IN_PROC_BROWSER_TEST_F(FencedFrameBrowserTest, NodesForIsLoading) { - GURL url_a(embedded_test_server()->GetURL("a.com", "/page_with_iframe.html")); - GURL url_b(embedded_test_server()->GetURL("b.com", "/title1.html")); - GURL fenced_frame_url(embedded_test_server()->GetURL( - "fencedframe.test", "/fenced_frames/title1.html")); + ASSERT_TRUE(https_server()->Start()); + GURL url_a(https_server()->GetURL("c.test", "/page_with_iframe.html")); + GURL url_b(https_server()->GetURL("c.test", "/title1.html")); + GURL fenced_frame_url( + https_server()->GetURL("c.test", "/fenced_frames/title1.html")); // 1. Navigate to an initial primary page. - EXPECT_TRUE(NavigateToURL(shell(), embedded_test_server()->GetURL( - "a.com", "/page_with_iframe.html"))); + EXPECT_TRUE(NavigateToURL(shell(), url_a)); RenderFrameHostImplWrapper primary_rfh(primary_main_frame_host()); FrameTree& primary_frame_tree = web_contents()->GetPrimaryFrameTree(); @@ -560,10 +569,10 @@ IN_PROC_BROWSER_TEST_F(FencedFrameBrowserTest, NoErrorPageOnEmptyFrameHttpError) { - const GURL kInitialUrl( - embedded_test_server()->GetURL("a.com", "/title1.html")); + ASSERT_TRUE(https_server()->Start()); + const GURL kInitialUrl(https_server()->GetURL("c.test", "/title1.html")); const GURL kEmpty404Url( - embedded_test_server()->GetURL("a.com", "/fenced_frames/empty404.html")); + https_server()->GetURL("c.test", "/fenced_frames/empty404.html")); // Load an initial page. EXPECT_TRUE(NavigateToURL(shell(), kInitialUrl)); @@ -582,6 +591,141 @@ EXPECT_EQ(contents, std::string()); } +// Test that when the documents inside the fenced frame tree are loading, then +// `WebContents::IsLoading`, `FrameTree::IsLoading`, and +// `FrameTreeNode::IsLoading` should return true. Primary `FrameTree::IsLoading` +// value should reflect the loading state of descendant fenced frames. +IN_PROC_BROWSER_TEST_F(FencedFrameBrowserTest, IsLoading) { + // Create a HTTP response to control fenced frame navigation. + net::test_server::ControllableHttpResponse fenced_frame_response( + https_server(), "/fenced_frames/title2.html"); + ASSERT_TRUE(https_server()->Start()); + + // Navigate to primary url. + EXPECT_TRUE( + NavigateToURL(shell(), https_server()->GetURL("c.test", "/title1.html"))); + RenderFrameHostImpl* fenced_frame_parent_rfh = primary_main_frame_host(); + + // Create a fenced frame for fenced_frame_url. + const GURL fenced_frame_url = + https_server()->GetURL("c.test", "/fenced_frames/title2.html"); + fenced_frame_test_helper().CreateFencedFrameAsync(fenced_frame_parent_rfh, + fenced_frame_url); + + std::vector<FencedFrame*> fenced_frames = + fenced_frame_parent_rfh->GetFencedFrames(); + EXPECT_EQ(fenced_frames.size(), 1ul); + FencedFrame* fenced_frame = fenced_frames.back(); + + RenderFrameHostImplWrapper inner_fenced_frame_rfh( + fenced_frame->GetInnerRoot()); + FrameTreeNode* fenced_frame_root_node = + inner_fenced_frame_rfh->frame_tree_node(); + FrameTree* fenced_frame_tree = fenced_frame_root_node->frame_tree(); + + // All WebContents::IsLoading, FrameTree::IsLoading, and + // FrameTreeNode::IsLoading should return true when the fenced frame is + // loading along with primary FrameTree::IsLoading as we check for inner frame + // trees loading state. + EXPECT_TRUE(web_contents()->IsLoading()); + EXPECT_TRUE(primary_main_frame_host()->frame_tree()->IsLoading()); + EXPECT_TRUE(fenced_frame_root_node->IsLoading()); + EXPECT_TRUE(fenced_frame_tree->IsLoading()); + + // Complete the fenced frame response and finish fenced frame navigation. + fenced_frame_response.WaitForRequest(); + fenced_frame_response.Send( + "HTTP/1.1 200 OK\r\n" + "Content-Type: text/html; charset=utf-8\r\n" + "Supports-Loading-Mode: fenced-frame\r\n" + "\r\n"); + fenced_frame_response.Done(); + + // Check that all the above loading states should return false once the fenced + // frame stops loading. + EXPECT_TRUE(WaitForLoadStop(web_contents())); + EXPECT_FALSE(web_contents()->IsLoading()); + EXPECT_FALSE(primary_main_frame_host()->frame_tree()->IsLoading()); + EXPECT_FALSE(fenced_frame_root_node->IsLoading()); + EXPECT_FALSE(fenced_frame_tree->IsLoading()); +} + +// Test that when the documents inside the fenced frame tree are loading, +// WebContentsObserver::DidStartLoading is fired and when document stops loading +// WebContentsObserver::DidStopLoading is fired. In this test primary page +// completed loading before fenced frame starts loading and we test the loading +// state in the end when both primary page and fenced frame completed loading. +IN_PROC_BROWSER_TEST_F(FencedFrameBrowserTest, DidStartAndDidStopLoading) { + // Create a HTTP response to control fenced frame navigation. + net::test_server::ControllableHttpResponse fenced_frame_response( + https_server(), "/fenced_frames/title2.html"); + ASSERT_TRUE(https_server()->Start()); + + // Navigate to primary url. + EXPECT_TRUE( + NavigateToURL(shell(), https_server()->GetURL("c.test", "/title1.html"))); + EXPECT_FALSE(web_contents()->IsLoading()); + RenderFrameHostImpl* fenced_frame_parent_rfh = primary_main_frame_host(); + EXPECT_EQ(fenced_frame_parent_rfh->GetFencedFrames().size(), 0ul); + + // Initialize a MockWebContentsObserver and ensure that + // DidStartLoading and DidStopLoading are invoked. + testing::NiceMock<MockWebContentsObserver> web_contents_observer( + web_contents()); + testing::InSequence s; + + // Create a fenced frame for fenced_frame_url. This will result in invoking + // DidStartLoading callback once. + EXPECT_CALL(web_contents_observer, DidStartLoading()).Times(1); + const GURL fenced_frame_url = + https_server()->GetURL("c.test", "/fenced_frames/title2.html"); + fenced_frame_test_helper().CreateFencedFrameAsync(fenced_frame_parent_rfh, + fenced_frame_url); + std::vector<FencedFrame*> fenced_frames = + fenced_frame_parent_rfh->GetFencedFrames(); + EXPECT_EQ(fenced_frame_parent_rfh->GetFencedFrames().size(), 1ul); + EXPECT_TRUE(web_contents()->IsLoading()); + + // Complete the fenced frame response and finish fenced frame navigation. + fenced_frame_response.WaitForRequest(); + fenced_frame_response.Send( + "HTTP/1.1 200 OK\r\n" + "Content-Type: text/html; charset=utf-8\r\n" + "Supports-Loading-Mode: fenced-frame\r\n" + "\r\n"); + fenced_frame_response.Done(); + + // Once the fenced frame stops loading, this should result in invoking + // the DidStopLoading callback once. + EXPECT_CALL(web_contents_observer, DidStopLoading()).Times(1); + EXPECT_TRUE(WaitForLoadStop(web_contents())); +} + +// Ensure that WebContentsObserver::LoadProgressChanged is not invoked when +// there is a change in load state of fenced frame as LoadProgressChanged is +// attributed to only primary main frame load progress change. +IN_PROC_BROWSER_TEST_F(FencedFrameBrowserTest, LoadProgressChanged) { + ASSERT_TRUE(https_server()->Start()); + const GURL fenced_frame_url = + https_server()->GetURL("c.test", "/fenced_frames/title1.html"); + const GURL main_url = https_server()->GetURL("c.test", "/title1.html"); + + // Navigate to primary url. + EXPECT_TRUE(NavigateToURL(shell(), main_url)); + RenderFrameHostImplWrapper primary_rfh(primary_main_frame_host()); + + // Initialize a MockWebContentsObserver and ensure that LoadProgressChanged is + // not invoked for fenced frames. + testing::NiceMock<MockWebContentsObserver> web_contents_observer( + web_contents()); + + // Create a fenced frame for fenced_frame_url. This shouldn't call + // LoadProgressChanged. + EXPECT_CALL(web_contents_observer, LoadProgressChanged(testing::_)).Times(0); + fenced_frame_test_helper().CreateFencedFrame(primary_rfh.get(), + fenced_frame_url); +} + namespace { enum class FrameTypeWithOrigin { @@ -790,6 +934,7 @@ // Tests that NavigationHandle::GetNavigatingFrameType() returns the correct // type. IN_PROC_BROWSER_TEST_F(FencedFrameBrowserTest, NavigationHandleFrameType) { + ASSERT_TRUE(https_server()->Start()); { DidFinishNavigationObserver observer( web_contents(),
diff --git a/content/browser/fenced_frame/fenced_frame_url_mapping.cc b/content/browser/fenced_frame/fenced_frame_url_mapping.cc index 4a52b79..45be7e3 100644 --- a/content/browser/fenced_frame/fenced_frame_url_mapping.cc +++ b/content/browser/fenced_frame/fenced_frame_url_mapping.cc
@@ -115,10 +115,12 @@ return AddMappingForUrl(url)->first; } -GURL FencedFrameURLMapping::AddFencedFrameURLWithInterestGroupAdComponentUrls( +GURL FencedFrameURLMapping::AddFencedFrameURLWithInterestGroupInfo( const GURL& url, + AdAuctionData ad_auction_data, std::vector<GURL> ad_component_urls) { UrnUuidToUrlMap::iterator it = AddMappingForUrl(url); + it->second.ad_auction_data = std::move(ad_auction_data); it->second.ad_component_urls = std::move(ad_component_urls); return it->first; } @@ -153,6 +155,7 @@ } absl::optional<GURL> result_url; + absl::optional<AdAuctionData> result_ad_auction_data; absl::optional<PendingAdComponentsMap> result_ad_components; auto it = urn_uuid_to_url_map_.find(urn_uuid); @@ -162,9 +165,11 @@ PendingAdComponentsMap(*it->second.ad_component_urls)); } result_url = it->second.mapped_url; + result_ad_auction_data = it->second.ad_auction_data; } observer->OnFencedFrameURLMappingComplete(std::move(result_url), + std::move(result_ad_auction_data), std::move(result_ad_components)); } @@ -196,6 +201,7 @@ for (raw_ptr<MappingResultObserver> observer : observers) { observer->OnFencedFrameURLMappingComplete( mapped_url, + /*ad_auction_data=*/absl::nullopt, /*pending_ad_components_map=*/absl::nullopt); }
diff --git a/content/browser/fenced_frame/fenced_frame_url_mapping.h b/content/browser/fenced_frame/fenced_frame_url_mapping.h index 3ccf9c7b..a1e842f 100644 --- a/content/browser/fenced_frame/fenced_frame_url_mapping.h +++ b/content/browser/fenced_frame/fenced_frame_url_mapping.h
@@ -14,11 +14,17 @@ #include "content/common/content_export.h" #include "third_party/abseil-cpp/absl/types/optional.h" #include "url/gurl.h" +#include "url/origin.h" namespace content { extern const char kURNUUIDprefix[]; +struct AdAuctionData { + url::Origin interest_group_owner; + std::string interest_group_name; +}; + // Keeps a mapping of fenced frames URN:UUID and URL. Also keeps a set of // pending mapped URN:UUIDs to support asynchronous mapping. See // https://github.com/shivanigithub/fenced-frame/blob/master/OpaqueSrc.md @@ -87,7 +93,8 @@ // possible when the initial URN is already mapped, and the // `OnFencedFrameURLMappingComplete` is invoked synchronously), // `pending_ad_components_map` will be populated with a - // `PendingAdComponentsMap`. In that case, the observer needs to use the + // `PendingAdComponentsMap` and `ad_auction_data` will contain + // AdAuctionData. In that case, the observer needs to use the // `PendingAdComponentsMap` to provide ad component URNs to the fenced frame // via its commit parameters, and to add those URNs to the // `FencedFrameURLMapping` of the committed frame. @@ -96,6 +103,7 @@ // absl::nullopt. virtual void OnFencedFrameURLMappingComplete( absl::optional<GURL> mapped_url, + absl::optional<AdAuctionData> ad_auction_data, absl::optional<PendingAdComponentsMap> pending_ad_components_map) = 0; }; @@ -109,14 +117,15 @@ // "potentially trustworthy URLs". GURL AddFencedFrameURL(const GURL& url); - // Just like AddFencedFrameURL, but also takes an ordered list of ad component - // URLs, as provided by a bidder running an auction. These will to be made - // available to any fenced frame navigated to the returned URN, via the - // InterestGroup API. + // Just like AddFencedFrameURL, but also takes additional ad auction data as + // well as an ordered list of ad component URLs, as provided by a bidder + // running an auction. These will to be made available to any fenced frame + // navigated to the returned URN, via the InterestGroup API. // // See https://github.com/WICG/turtledove/blob/main/FLEDGE.md - GURL AddFencedFrameURLWithInterestGroupAdComponentUrls( + GURL AddFencedFrameURLWithInterestGroupInfo( const GURL& url, + AdAuctionData auction_data, std::vector<GURL> ad_component_urls); static bool IsValidUrnUuidURL(const GURL& url); @@ -172,6 +181,10 @@ GURL mapped_url; + // Extra data set if `mapped_url` is the result of a FLEDGE auction. Used + // to fill in `AdAuctionDocumentData` for the fenced frame that navigates + // to `mapped_url`. + absl::optional<AdAuctionData> ad_auction_data; // Ad component URLs if `mapped_url` is the result of a FLEDGE auction. When // a fenced frame navigates to `mapped_url`, these will be mapped to URNs // themselves, and those URNs will be provided to the fenced frame.
diff --git a/content/browser/fenced_frame/fenced_frame_url_mapping_unittest.cc b/content/browser/fenced_frame/fenced_frame_url_mapping_unittest.cc index d6406be1..6deb1e3 100644 --- a/content/browser/fenced_frame/fenced_frame_url_mapping_unittest.cc +++ b/content/browser/fenced_frame/fenced_frame_url_mapping_unittest.cc
@@ -201,19 +201,26 @@ // Test the case `ad_component_urls` is empty. In this case, it should be filled // with URNs that are mapped to about:blank. TEST(FencedFrameURLMappingTest, - AddFencedFrameURLWithInterestGroupAdComponentUrlsNoAdComponentsUrls) { + AddFencedFrameURLWithInterestGroupInfoNoAdComponentsUrls) { FencedFrameURLMapping fenced_frame_url_mapping; GURL top_level_url("https://foo.test"); + url::Origin interest_group_owner = url::Origin::Create(top_level_url); + std::string interest_group_name = "bars"; std::vector<GURL> ad_component_urls; - GURL urn_uuid = fenced_frame_url_mapping - .AddFencedFrameURLWithInterestGroupAdComponentUrls( - top_level_url, ad_component_urls); + GURL urn_uuid = + fenced_frame_url_mapping.AddFencedFrameURLWithInterestGroupInfo( + top_level_url, {interest_group_owner, interest_group_name}, + ad_component_urls); TestFencedFrameURLMappingResultObserver observer; fenced_frame_url_mapping.ConvertFencedFrameURNToURL(urn_uuid, &observer); EXPECT_TRUE(observer.mapping_complete_observed()); EXPECT_EQ(top_level_url, observer.mapped_url()); + EXPECT_EQ(interest_group_owner, + observer.ad_auction_data()->interest_group_owner); + EXPECT_EQ(interest_group_name, + observer.ad_auction_data()->interest_group_name); EXPECT_TRUE(observer.pending_ad_components_map()); // Call with `add_to_new_map` set to false and true, to simulate ShadowDOM @@ -230,19 +237,26 @@ // Test the case `ad_component_urls` has a single URL. TEST(FencedFrameURLMappingTest, - AddFencedFrameURLWithInterestGroupAdComponentUrlsOneAdComponentUrl) { + AddFencedFrameURLWithInterestGroupInfoOneAdComponentUrl) { FencedFrameURLMapping fenced_frame_url_mapping; GURL top_level_url("https://foo.test"); + url::Origin interest_group_owner = url::Origin::Create(top_level_url); + std::string interest_group_name = "bars"; std::vector<GURL> ad_component_urls{GURL("https://bar.test")}; - GURL urn_uuid = fenced_frame_url_mapping - .AddFencedFrameURLWithInterestGroupAdComponentUrls( - top_level_url, ad_component_urls); + GURL urn_uuid = + fenced_frame_url_mapping.AddFencedFrameURLWithInterestGroupInfo( + top_level_url, {interest_group_owner, interest_group_name}, + ad_component_urls); TestFencedFrameURLMappingResultObserver observer; fenced_frame_url_mapping.ConvertFencedFrameURNToURL(urn_uuid, &observer); EXPECT_TRUE(observer.mapping_complete_observed()); EXPECT_EQ(top_level_url, observer.mapped_url()); + EXPECT_EQ(interest_group_owner, + observer.ad_auction_data()->interest_group_owner); + EXPECT_EQ(interest_group_name, + observer.ad_auction_data()->interest_group_name); EXPECT_TRUE(observer.pending_ad_components_map()); // Call with `add_to_new_map` set to false and true, to simulate ShadowDOM @@ -260,23 +274,30 @@ // Test the case `ad_component_urls` has the maximum number of allowed ad // component URLs. TEST(FencedFrameURLMappingTest, - AddFencedFrameURLWithInterestGroupAdComponentUrlsMaxAdComponentUrl) { + AddFencedFrameURLWithInterestGroupInfoMaxAdComponentUrl) { FencedFrameURLMapping fenced_frame_url_mapping; GURL top_level_url("https://foo.test"); + url::Origin interest_group_owner = url::Origin::Create(top_level_url); + std::string interest_group_name = "bars"; std::vector<GURL> ad_component_urls; for (size_t i = 0; i < blink::kMaxAdAuctionAdComponents; ++i) { ad_component_urls.emplace_back( GURL(base::StringPrintf("https://%zu.test/", i))); } - GURL urn_uuid = fenced_frame_url_mapping - .AddFencedFrameURLWithInterestGroupAdComponentUrls( - top_level_url, ad_component_urls); + GURL urn_uuid = + fenced_frame_url_mapping.AddFencedFrameURLWithInterestGroupInfo( + top_level_url, {interest_group_owner, interest_group_name}, + ad_component_urls); TestFencedFrameURLMappingResultObserver observer; fenced_frame_url_mapping.ConvertFencedFrameURNToURL(urn_uuid, &observer); EXPECT_TRUE(observer.mapping_complete_observed()); EXPECT_EQ(top_level_url, observer.mapped_url()); + EXPECT_EQ(interest_group_owner, + observer.ad_auction_data()->interest_group_owner); + EXPECT_EQ(interest_group_name, + observer.ad_auction_data()->interest_group_name); EXPECT_TRUE(observer.pending_ad_components_map()); // Call with `add_to_new_map` set to false and true, to simulate ShadowDOM @@ -294,22 +315,28 @@ // Test the case `ad_component_urls` has the maximum number of allowed ad // component URLs, and they're all identical. The main purpose of this test is // to make sure they receive unique URNs, despite being identical URLs. -TEST( - FencedFrameURLMappingTest, - AddFencedFrameURLWithInterestGroupAdComponentUrlsMaxIdenticalAdComponentUrl) { +TEST(FencedFrameURLMappingTest, + AddFencedFrameURLWithInterestGroupInfoMaxIdenticalAdComponentUrl) { FencedFrameURLMapping fenced_frame_url_mapping; GURL top_level_url("https://foo.test"); + url::Origin interest_group_owner = url::Origin::Create(top_level_url); + std::string interest_group_name = "bars"; std::vector<GURL> ad_component_urls(blink::kMaxAdAuctionAdComponents, GURL("https://bar.test/")); - GURL urn_uuid = fenced_frame_url_mapping - .AddFencedFrameURLWithInterestGroupAdComponentUrls( - top_level_url, ad_component_urls); + GURL urn_uuid = + fenced_frame_url_mapping.AddFencedFrameURLWithInterestGroupInfo( + top_level_url, {interest_group_owner, interest_group_name}, + ad_component_urls); TestFencedFrameURLMappingResultObserver observer; fenced_frame_url_mapping.ConvertFencedFrameURNToURL(urn_uuid, &observer); EXPECT_TRUE(observer.mapping_complete_observed()); EXPECT_EQ(top_level_url, observer.mapped_url()); + EXPECT_EQ(interest_group_owner, + observer.ad_auction_data()->interest_group_owner); + EXPECT_EQ(interest_group_name, + observer.ad_auction_data()->interest_group_name); EXPECT_TRUE(observer.pending_ad_components_map()); // Call with `add_to_new_map` set to false and true, to simulate ShadowDOM
diff --git a/content/browser/file_system_access/file_system_access_capacity_allocation_host_impl_browsertest.cc b/content/browser/file_system_access/file_system_access_capacity_allocation_host_impl_browsertest.cc index 21088e3..4ac52a2 100644 --- a/content/browser/file_system_access/file_system_access_capacity_allocation_host_impl_browsertest.cc +++ b/content/browser/file_system_access/file_system_access_capacity_allocation_host_impl_browsertest.cc
@@ -158,8 +158,14 @@ EXPECT_EQ(usage_before_operation, usage_after_operation + 100); } +// TODO(crbug.com/1304977): Failing on Mac builders. +#if BUILDFLAG(IS_MAC) +#define MAYBE_QuotaUsageOverallocation DISABLED_QuotaUsageOverallocation +#else +#define MAYBE_QuotaUsageOverallocation QuotaUsageOverallocation +#endif IN_PROC_BROWSER_TEST_F(FileSystemAccessCapacityAllocationHostImplBrowserTest, - QuotaUsageOverallocation) { + MAYBE_QuotaUsageOverallocation) { // TODO(https://crbug.com/1240056): Implement a more sophisticated test suite // for this feature. const GURL& test_url =
diff --git a/content/browser/interest_group/ad_auction_service_impl.cc b/content/browser/interest_group/ad_auction_service_impl.cc index ed37e53..e77def90 100644 --- a/content/browser/interest_group/ad_auction_service_impl.cc +++ b/content/browser/interest_group/ad_auction_service_impl.cc
@@ -312,6 +312,7 @@ void OnFencedFrameURLMappingComplete( absl::optional<GURL> mapped_url, + absl::optional<AdAuctionData> ad_auction_data, absl::optional<FencedFrameURLMapping::PendingAdComponentsMap> pending_ad_components_map) override { mapped_url_ = mapped_url; @@ -436,8 +437,9 @@ void AdAuctionServiceImpl::OnAuctionComplete( RunAdAuctionCallback callback, AuctionRunner* auction, + absl::optional<AuctionRunner::InterestGroupKey> winning_group_id, absl::optional<GURL> render_url, - absl::optional<std::vector<GURL>> ad_component_urls, + std::vector<GURL> ad_component_urls, std::vector<GURL> report_urls, std::vector<GURL> debug_loss_report_urls, std::vector<GURL> debug_win_report_urls, @@ -465,20 +467,14 @@ AdAuctionResultMetrics::AuctionResult::kFailed); return; } - + DCHECK(winning_group_id); // Should always be present with a render_url render_url = GetFrame() ->GetPage() .fenced_frame_urls_map() - .AddFencedFrameURLWithInterestGroupAdComponentUrls( - *render_url, - // Always pass in non-empty component URL vector, to avoid - // leaking any data to fenced frame. - // - // TODO(mmenke): Make `ad_component_urls` non-optional - // everywhere instead of preserving the empty vs null - // distinction, only to discard it here. - std::move(ad_component_urls).value_or(std::vector<GURL>())); + .AddFencedFrameURLWithInterestGroupInfo( + *render_url, {winning_group_id->owner, winning_group_id->name}, + ad_component_urls); DCHECK(render_url->is_valid()); std::move(callback).Run(render_url);
diff --git a/content/browser/interest_group/ad_auction_service_impl.h b/content/browser/interest_group/ad_auction_service_impl.h index ae6eb37..8b8cc86 100644 --- a/content/browser/interest_group/ad_auction_service_impl.h +++ b/content/browser/interest_group/ad_auction_service_impl.h
@@ -9,6 +9,7 @@ #include <set> #include "base/containers/unique_ptr_adapters.h" +#include "content/browser/interest_group/auction_runner.h" #include "content/browser/interest_group/auction_worklet_manager.h" #include "content/common/content_export.h" #include "content/public/browser/content_browser_client.h" @@ -25,7 +26,6 @@ namespace content { -class AuctionRunner; class InterestGroupManagerImpl; class RenderFrameHost; class RenderFrameHostImpl; @@ -84,14 +84,16 @@ const url::Origin& origin) const; // Deletes `auction`. - void OnAuctionComplete(RunAdAuctionCallback callback, - AuctionRunner* auction, - absl::optional<GURL> render_url, - absl::optional<std::vector<GURL>> ad_component_urls, - std::vector<GURL> report_urls, - std::vector<GURL> debug_loss_report_urls, - std::vector<GURL> debug_win_report_urls, - std::vector<std::string> errors); + void OnAuctionComplete( + RunAdAuctionCallback callback, + AuctionRunner* auction, + absl::optional<AuctionRunner::InterestGroupKey> winning_group_id, + absl::optional<GURL> render_url, + std::vector<GURL> ad_component_urls, + std::vector<GURL> report_urls, + std::vector<GURL> debug_loss_report_urls, + std::vector<GURL> debug_win_report_urls, + std::vector<std::string> errors); InterestGroupManagerImpl& GetInterestGroupManager() const;
diff --git a/content/browser/interest_group/auction_runner.cc b/content/browser/interest_group/auction_runner.cc index 277f6a1..09e1b3d8 100644 --- a/content/browser/interest_group/auction_runner.cc +++ b/content/browser/interest_group/auction_runner.cc
@@ -77,7 +77,7 @@ AuctionRunner::Bid::Bid(std::string ad_metadata, double bid, GURL render_url, - absl::optional<std::vector<GURL>> ad_components, + std::vector<GURL> ad_components, base::TimeDelta bid_duration, absl::optional<uint32_t> bidding_signals_data_version, const blink::InterestGroup::Ad* bid_ad, @@ -322,8 +322,8 @@ for (const BidState& bid_state : bid_states_) { if (bid_state.made_bid) { - interest_groups.emplace(std::pair(bid_state.bidder.interest_group.owner, - bid_state.bidder.interest_group.name)); + interest_groups.emplace(bid_state.bidder.interest_group.owner, + bid_state.bidder.interest_group.name); } } @@ -738,8 +738,7 @@ bid_raw->ad_metadata, bid_raw->bid, config_->auction_ad_config_non_shared_params.Clone(), GetOtherSellerParam(*bid_raw), bid_raw->interest_group->owner, - bid_raw->render_url, - bid_raw->ad_components ? *bid_raw->ad_components : std::vector<GURL>(), + bid_raw->render_url, bid_raw->ad_components, bid_raw->bid_duration.InMilliseconds(), SellerTimeout(), base::BindOnce(&Auction::OnBidScored, weak_ptr_factory_.GetWeakPtr(), std::move(bid))); @@ -1181,7 +1180,8 @@ std::move(callback_).Run( this, /*render_url=*/absl::nullopt, - /*ad_component_urls=*/absl::nullopt, + /*winning_group_key=*/absl::nullopt, + /*ad_component_urls=*/{}, /*report_urls=*/{}, std::move(debug_loss_report_urls), std::move(debug_win_report_urls), auction_.TakeErrors()); } @@ -1224,6 +1224,7 @@ return nullptr; } + std::vector<GURL> ad_components; // Validate `ad_component` URLs, if present. if (mojo_bid->ad_components) { // Only InterestGroups with ad components should return bids with ad @@ -1247,6 +1248,7 @@ return nullptr; } } + ad_components = *std::move(mojo_bid->ad_components); } // Validate `debug_loss_report_url` and `debug_win_report_url`, if present. @@ -1263,7 +1265,7 @@ return std::make_unique<Bid>( std::move(mojo_bid->ad), mojo_bid->bid, std::move(mojo_bid->render_url), - std::move(mojo_bid->ad_components), mojo_bid->bid_duration, + std::move(ad_components), mojo_bid->bid_duration, bidding_signals_data_version, matching_ad, &bid_state, this); } @@ -1291,9 +1293,8 @@ InterestGroupSet interest_groups_that_bid; auction_.GetInterestGroupsThatBid(interest_groups_that_bid); for (const auto& interest_group : interest_groups_that_bid) { - interest_group_manager_->RecordInterestGroupBid( - /*owner=*/interest_group.first, - /*name=*/interest_group.second); + interest_group_manager_->RecordInterestGroupBid(interest_group.owner, + interest_group.name); } if (!success) { FailAuction(); @@ -1333,8 +1334,12 @@ std::vector<GURL> debug_loss_report_urls; auction_.TakeDebugReportUrls(debug_win_report_urls, debug_loss_report_urls); + DCHECK(auction_.top_bid()->bid->interest_group); + const blink::InterestGroup& winning_group = + *auction_.top_bid()->bid->interest_group; + InterestGroupKey winning_group_key({winning_group.owner, winning_group.name}); std::move(callback_).Run( - this, auction_.top_bid()->bid->render_url, + this, std::move(winning_group_key), auction_.top_bid()->bid->render_url, auction_.top_bid()->bid->ad_components, auction_.TakeReportUrls(), std::move(debug_loss_report_urls), std::move(debug_win_report_urls), auction_.TakeErrors());
diff --git a/content/browser/interest_group/auction_runner.h b/content/browser/interest_group/auction_runner.h index 0982e76..564a10c 100644 --- a/content/browser/interest_group/auction_runner.h +++ b/content/browser/interest_group/auction_runner.h
@@ -35,8 +35,24 @@ // their reporting phases and produces the result via a callback. class CONTENT_EXPORT AuctionRunner { public: + // TODO(behamilton@google.com): Make this struct more broadly available to + // the rest of interest group code and adjust them to use it where + // appropriate. + struct InterestGroupKey { + InterestGroupKey(url::Origin o, std::string n) : owner(o), name(n) {} + constexpr bool operator<(const InterestGroupKey& other) const { + return owner != other.owner ? owner < other.owner : name < other.name; + } + constexpr bool operator==(const InterestGroupKey& other) const { + return owner == other.owner && name == other.name; + } + url::Origin owner; + std::string name; + }; // Invoked when a FLEDGE auction is complete. // + // `winning_group_id` owner and name of the winning interest group (if any). + // // `render_url` URL of auction winning ad to render. Null if there is no // winner. // @@ -54,14 +70,15 @@ // // `errors` are various error messages to be used for debugging. These are too // sensitive for the renderers to see. - using RunAuctionCallback = base::OnceCallback<void( - AuctionRunner* auction_runner, - absl::optional<GURL> render_url, - absl::optional<std::vector<GURL>> ad_component_urls, - std::vector<GURL> report_urls, - std::vector<GURL> debug_loss_report_urls, - std::vector<GURL> debug_win_report_urls, - std::vector<std::string> errors)>; + using RunAuctionCallback = + base::OnceCallback<void(AuctionRunner* auction_runner, + absl::optional<InterestGroupKey> winning_group_id, + absl::optional<GURL> render_url, + std::vector<GURL> ad_component_urls, + std::vector<GURL> report_urls, + std::vector<GURL> debug_loss_report_urls, + std::vector<GURL> debug_win_report_urls, + std::vector<std::string> errors)>; // Returns true if `origin` is allowed to use the interest group API. Will be // called on worklet / interest group origins before using them in any @@ -158,7 +175,7 @@ // interest groups bid in an auction. A sets is used to avoid double-counting // interest groups that bid in multiple components auctions in a component // auction. - using InterestGroupSet = std::set<std::pair<url::Origin, std::string>>; + using InterestGroupSet = std::set<InterestGroupKey>; class Auction; @@ -210,7 +227,7 @@ Bid(std::string ad_metadata, double bid, GURL render_url, - absl::optional<std::vector<GURL>> ad_components, + std::vector<GURL> ad_components, base::TimeDelta bid_duration, absl::optional<uint32_t> bidding_signals_data_version, const blink::InterestGroup::Ad* bid_ad, @@ -226,7 +243,7 @@ const std::string ad_metadata; const double bid; const GURL render_url; - const absl::optional<std::vector<GURL>> ad_components; + const std::vector<GURL> ad_components; const base::TimeDelta bid_duration; const absl::optional<uint32_t> bidding_signals_data_version;
diff --git a/content/browser/interest_group/auction_runner_unittest.cc b/content/browser/interest_group/auction_runner_unittest.cc index 8065d2f8..f803b717 100644 --- a/content/browser/interest_group/auction_runner_unittest.cc +++ b/content/browser/interest_group/auction_runner_unittest.cc
@@ -55,6 +55,8 @@ namespace content { namespace { +using InterestGroupKey = AuctionRunner::InterestGroupKey; + const std::string kBidder1Name{"Ad Platform"}; const char kBidder1DebugLossReportUrl[] = "https://bidder1-debug-loss-reporting.com/"; @@ -1088,8 +1090,9 @@ Result(const Result&) = delete; Result& operator=(const Result&) = delete; + absl::optional<InterestGroupKey> winning_group_id; absl::optional<GURL> ad_url; - absl::optional<std::vector<GURL>> ad_component_urls; + std::vector<GURL> ad_component_urls; std::vector<GURL> report_urls; std::vector<GURL> debug_loss_report_urls; std::vector<GURL> debug_win_report_urls; @@ -1260,8 +1263,9 @@ } void OnAuctionComplete(AuctionRunner* auction_runner, + absl::optional<InterestGroupKey> winning_group_id, absl::optional<GURL> ad_url, - absl::optional<std::vector<GURL>> ad_component_urls, + std::vector<GURL> ad_component_urls, std::vector<GURL> report_urls, std::vector<GURL> debug_loss_report_urls, std::vector<GURL> debug_win_report_urls, @@ -1274,6 +1278,7 @@ auction_runner_.reset(); auction_complete_ = true; + result_.winning_group_id = std::move(winning_group_id); result_.ad_url = std::move(ad_url); result_.ad_component_urls = std::move(ad_component_urls); result_.report_urls = std::move(report_urls); @@ -1665,8 +1670,9 @@ interest_group_buyers_->clear(); RunAuctionAndWait(kSellerUrl, std::vector<StorageInterestGroup>()); + EXPECT_FALSE(result_.winning_group_id); EXPECT_FALSE(result_.ad_url); - EXPECT_FALSE(result_.ad_component_urls); + EXPECT_TRUE(result_.ad_component_urls.empty()); EXPECT_THAT(result_.report_urls, testing::UnorderedElementsAre()); EXPECT_EQ(-1, result_.bidder1_bid_count); EXPECT_EQ(0u, result_.bidder1_prev_wins.size()); @@ -1685,8 +1691,9 @@ CreateAuctionConfig(kComponentSeller1Url, /*buyers=*/absl::nullopt)); RunAuctionAndWait(kSellerUrl, std::vector<StorageInterestGroup>()); + EXPECT_FALSE(result_.winning_group_id); EXPECT_FALSE(result_.ad_url); - EXPECT_FALSE(result_.ad_component_urls); + EXPECT_TRUE(result_.ad_component_urls.empty()); EXPECT_THAT(result_.report_urls, testing::UnorderedElementsAre()); EXPECT_EQ(-1, result_.bidder1_bid_count); EXPECT_EQ(0u, result_.bidder1_prev_wins.size()); @@ -1703,8 +1710,9 @@ interest_group_buyers_->clear(); RunAuctionAndWait(kSellerUrl, std::vector<StorageInterestGroup>()); + EXPECT_FALSE(result_.winning_group_id); EXPECT_FALSE(result_.ad_url); - EXPECT_FALSE(result_.ad_component_urls); + EXPECT_TRUE(result_.ad_component_urls.empty()); EXPECT_THAT(result_.report_urls, testing::UnorderedElementsAre()); EXPECT_EQ(-1, result_.bidder1_bid_count); EXPECT_EQ(0u, result_.bidder1_prev_wins.size()); @@ -1723,8 +1731,9 @@ CreateAuctionConfig(kComponentSeller1Url, /*buyers=*/{})); RunAuctionAndWait(kSellerUrl, std::vector<StorageInterestGroup>()); + EXPECT_FALSE(result_.winning_group_id); EXPECT_FALSE(result_.ad_url); - EXPECT_FALSE(result_.ad_component_urls); + EXPECT_TRUE(result_.ad_component_urls.empty()); EXPECT_THAT(result_.report_urls, testing::UnorderedElementsAre()); EXPECT_EQ(-1, result_.bidder1_bid_count); EXPECT_EQ(0u, result_.bidder1_prev_wins.size()); @@ -1741,8 +1750,9 @@ TEST_F(AuctionRunnerTest, NoInterestGroups) { RunAuctionAndWait(kSellerUrl, std::vector<StorageInterestGroup>()); + EXPECT_FALSE(result_.winning_group_id); EXPECT_FALSE(result_.ad_url); - EXPECT_FALSE(result_.ad_component_urls); + EXPECT_TRUE(result_.ad_component_urls.empty()); EXPECT_THAT(result_.report_urls, testing::UnorderedElementsAre()); EXPECT_EQ(-1, result_.bidder1_bid_count); EXPECT_EQ(0u, result_.bidder1_prev_wins.size()); @@ -1763,8 +1773,9 @@ CreateAuctionConfig(kComponentSeller2Url, {{kBidder2}})); RunAuctionAndWait(kSellerUrl, std::vector<StorageInterestGroup>()); + EXPECT_FALSE(result_.winning_group_id); EXPECT_FALSE(result_.ad_url); - EXPECT_FALSE(result_.ad_component_urls); + EXPECT_TRUE(result_.ad_component_urls.empty()); EXPECT_THAT(result_.report_urls, testing::UnorderedElementsAre()); EXPECT_EQ(-1, result_.bidder1_bid_count); EXPECT_EQ(0u, result_.bidder1_prev_wins.size()); @@ -1785,8 +1796,9 @@ RunAuctionAndWait(kSellerUrl, std::move(bidders)); + EXPECT_FALSE(result_.winning_group_id); EXPECT_FALSE(result_.ad_url); - EXPECT_FALSE(result_.ad_component_urls); + EXPECT_TRUE(result_.ad_component_urls.empty()); EXPECT_THAT(result_.report_urls, testing::UnorderedElementsAre()); EXPECT_EQ(5, result_.bidder1_bid_count); EXPECT_EQ(3u, result_.bidder1_prev_wins.size()); @@ -1807,8 +1819,9 @@ RunAuctionAndWait(kSellerUrl, std::move(bidders)); + EXPECT_FALSE(result_.winning_group_id); EXPECT_FALSE(result_.ad_url); - EXPECT_FALSE(result_.ad_component_urls); + EXPECT_TRUE(result_.ad_component_urls.empty()); EXPECT_THAT(result_.report_urls, testing::UnorderedElementsAre()); EXPECT_EQ(5, result_.bidder1_bid_count); EXPECT_EQ(3u, result_.bidder1_prev_wins.size()); @@ -1829,8 +1842,9 @@ RunAuctionAndWait(kSellerUrl, std::move(bidders)); + EXPECT_FALSE(result_.winning_group_id); EXPECT_FALSE(result_.ad_url); - EXPECT_FALSE(result_.ad_component_urls); + EXPECT_TRUE(result_.ad_component_urls.empty()); EXPECT_THAT(result_.report_urls, testing::UnorderedElementsAre()); EXPECT_EQ(5, result_.bidder1_bid_count); EXPECT_EQ(3u, result_.bidder1_prev_wins.size()); @@ -1863,8 +1877,9 @@ RunAuctionAndWait(kSellerUrl, std::move(bidders)); + EXPECT_EQ(InterestGroupKey(kBidder1, kBidder1Name), result_.winning_group_id); EXPECT_EQ(GURL("https://ad1.com/"), result_.ad_url); - EXPECT_FALSE(result_.ad_component_urls); + EXPECT_TRUE(result_.ad_component_urls.empty()); EXPECT_THAT(result_.report_urls, testing::UnorderedElementsAre( GURL("https://reporting.example.com/1"), @@ -1912,6 +1927,7 @@ R"({"l1":"a", "l2": "b", "extra": "c"})"); const Result& res = RunStandardAuction(); + EXPECT_EQ(InterestGroupKey(kBidder2, kBidder2Name), result_.winning_group_id); EXPECT_EQ(GURL("https://ad2.com/"), res.ad_url); EXPECT_EQ(std::vector<GURL>{GURL("https://ad2.com-component1.com")}, res.ad_component_urls); @@ -2071,6 +2087,8 @@ // Let it finish --- result should as in Basic test since this didn't // actually change anything. auction_run_loop_->Run(); + EXPECT_EQ(InterestGroupKey(kBidder2, kBidder2Name), + result_.winning_group_id); EXPECT_EQ(GURL("https://ad2.com/"), result_.ad_url); EXPECT_THAT(result_.report_urls, testing::UnorderedElementsAre( @@ -2123,6 +2141,7 @@ process_manager_impl->ResumeAllPaused(); auction_run_loop_->Run(); + EXPECT_EQ(InterestGroupKey(kBidder2, kBidder2Name), result_.winning_group_id); EXPECT_EQ(GURL("https://ad2.com/"), result_.ad_url); EXPECT_EQ(std::vector<GURL>{GURL("https://ad2.com-component1.com")}, result_.ad_component_urls); @@ -2173,6 +2192,7 @@ process_manager_impl->ResumeAllPaused(); auction_run_loop_->Run(); + EXPECT_EQ(InterestGroupKey(kBidder2, kBidder2Name), result_.winning_group_id); EXPECT_EQ(GURL("https://ad2.com/"), result_.ad_url); EXPECT_EQ(std::vector<GURL>{GURL("https://ad2.com-component1.com")}, result_.ad_component_urls); @@ -2466,8 +2486,9 @@ // script URLs are incorrectly requested. RunStandardAuction(); + EXPECT_FALSE(result_.winning_group_id); EXPECT_FALSE(result_.ad_url); - EXPECT_FALSE(result_.ad_component_urls); + EXPECT_TRUE(result_.ad_component_urls.empty()); EXPECT_THAT(result_.report_urls, testing::UnorderedElementsAre()); EXPECT_EQ(5, result_.bidder1_bid_count); EXPECT_EQ(3u, result_.bidder1_prev_wins.size()); @@ -2496,8 +2517,9 @@ // script URLs are incorrectly requested. RunStandardAuction(); + EXPECT_FALSE(result_.winning_group_id); EXPECT_FALSE(result_.ad_url); - EXPECT_FALSE(result_.ad_component_urls); + EXPECT_TRUE(result_.ad_component_urls.empty()); EXPECT_THAT(result_.report_urls, testing::UnorderedElementsAre()); EXPECT_EQ(5, result_.bidder1_bid_count); EXPECT_EQ(3u, result_.bidder1_prev_wins.size()); @@ -2559,8 +2581,9 @@ // script URLs are incorrectly requested. RunStandardAuction(); + EXPECT_FALSE(result_.winning_group_id); EXPECT_FALSE(result_.ad_url); - EXPECT_FALSE(result_.ad_component_urls); + EXPECT_TRUE(result_.ad_component_urls.empty()); EXPECT_THAT(result_.report_urls, testing::UnorderedElementsAre()); EXPECT_EQ(5, result_.bidder1_bid_count); EXPECT_EQ(3u, result_.bidder1_prev_wins.size()); @@ -2595,6 +2618,7 @@ disallowed_buyers_.insert(kBidder2); RunStandardAuction(); + EXPECT_EQ(InterestGroupKey(kBidder1, kBidder1Name), result_.winning_group_id); EXPECT_EQ(GURL("https://ad1.com/"), result_.ad_url); EXPECT_EQ(std::vector<GURL>{GURL("https://ad1.com-component1.com")}, result_.ad_component_urls); @@ -2632,8 +2656,9 @@ // script URLs are incorrectly requested. RunStandardAuction(); + EXPECT_FALSE(result_.winning_group_id); EXPECT_FALSE(result_.ad_url); - EXPECT_FALSE(result_.ad_component_urls); + EXPECT_TRUE(result_.ad_component_urls.empty()); EXPECT_THAT(result_.report_urls, testing::UnorderedElementsAre()); EXPECT_EQ(5, result_.bidder1_bid_count); EXPECT_EQ(3u, result_.bidder1_prev_wins.size()); @@ -2709,6 +2734,7 @@ R"({"l1":"a", "l2": "b", "extra": "c"})"); RunStandardAuction(); + EXPECT_EQ(InterestGroupKey(kBidder2, kBidder2Name), result_.winning_group_id); EXPECT_EQ(GURL("https://ad2.com/"), result_.ad_url); EXPECT_THAT(result_.errors, testing::ElementsAre()); CheckHistograms(AuctionRunner::AuctionResult::kSuccess, @@ -2735,6 +2761,7 @@ R"({"l1":"a", "l2": "b", "extra": "c"})"); const Result& res = RunStandardAuction(); + EXPECT_EQ(InterestGroupKey(kBidder1, kBidder1Name), result_.winning_group_id); EXPECT_EQ(GURL("https://ad1.com/"), res.ad_url); EXPECT_EQ(std::vector<GURL>{GURL("https://ad1.com-component1.com")}, res.ad_component_urls); @@ -2821,6 +2848,7 @@ R"({"l1":"a", "l2": "b", "extra": "c"})"); const Result& res = RunStandardAuction(); + EXPECT_EQ(InterestGroupKey(kBidder1, kBidder1Name), result_.winning_group_id); EXPECT_EQ(GURL("https://ad1.com/"), res.ad_url); EXPECT_EQ(std::vector<GURL>{GURL("https://ad1.com-component1.com")}, res.ad_component_urls); @@ -2857,8 +2885,9 @@ R"({"l1":"a", "l2": "b", "extra":"c"})"); const Result& res = RunStandardAuction(); + EXPECT_FALSE(res.winning_group_id); EXPECT_FALSE(res.ad_url); - EXPECT_FALSE(res.ad_component_urls); + EXPECT_TRUE(res.ad_component_urls.empty()); EXPECT_THAT(res.report_urls, testing::UnorderedElementsAre()); EXPECT_EQ(5, res.bidder1_bid_count); EXPECT_EQ(3u, res.bidder1_prev_wins.size()); @@ -2893,8 +2922,9 @@ R"({"l1":"a", "l2": "b", "extra":"c"})"); const Result& res = RunStandardAuction(); + EXPECT_FALSE(res.winning_group_id); EXPECT_FALSE(res.ad_url); - EXPECT_FALSE(res.ad_component_urls); + EXPECT_TRUE(res.ad_component_urls.empty()); EXPECT_THAT(res.report_urls, testing::UnorderedElementsAre()); EXPECT_EQ(5, res.bidder1_bid_count); EXPECT_EQ(3u, res.bidder1_prev_wins.size()); @@ -2937,8 +2967,9 @@ R"({"l1":"a", "l2": "b", "extra":"c"})"); const Result& res = RunStandardAuction(); + EXPECT_FALSE(res.winning_group_id); EXPECT_FALSE(res.ad_url); - EXPECT_FALSE(res.ad_component_urls); + EXPECT_TRUE(res.ad_component_urls.empty()); EXPECT_THAT(res.report_urls, testing::UnorderedElementsAre()); EXPECT_EQ(6, res.bidder1_bid_count); EXPECT_EQ(3u, res.bidder1_prev_wins.size()); @@ -2977,6 +3008,7 @@ R"({"l1":"a", "l2": "b", "extra": "c"})"); const Result& res = RunStandardAuction(); + EXPECT_EQ(InterestGroupKey(kBidder1, kBidder1Name), result_.winning_group_id); EXPECT_EQ(GURL("https://ad1.com/"), res.ad_url); EXPECT_EQ(std::vector<GURL>{GURL("https://ad1.com-component1.com")}, res.ad_component_urls); @@ -3001,8 +3033,9 @@ // cancelled, too. url_loader_factory_.AddResponse(kSellerUrl.spec(), "", net::HTTP_NOT_FOUND); const Result& res = RunStandardAuction(); + EXPECT_FALSE(res.winning_group_id); EXPECT_FALSE(res.ad_url); - EXPECT_FALSE(res.ad_component_urls); + EXPECT_TRUE(res.ad_component_urls.empty()); EXPECT_THAT(res.report_urls, testing::UnorderedElementsAre()); EXPECT_EQ(0, url_loader_factory_.NumPending()); @@ -3043,8 +3076,9 @@ const Result& res = RunAuctionAndWait(kSellerUrl, std::move(bidders)); + EXPECT_EQ(InterestGroupKey(kBidder2, kBidder2Name), result_.winning_group_id); EXPECT_EQ(GURL("https://ad2.com/"), res.ad_url); - EXPECT_FALSE(result_.ad_component_urls); + EXPECT_TRUE(result_.ad_component_urls.empty()); EXPECT_THAT(res.report_urls, testing::UnorderedElementsAre( GURL("https://reporting.example.com/2"), @@ -3082,6 +3116,7 @@ MakeAuctionScript()); const Result& res = RunStandardAuction(); + EXPECT_EQ(InterestGroupKey(kBidder2, kBidder2Name), result_.winning_group_id); EXPECT_EQ(GURL("https://ad2.com/"), res.ad_url); EXPECT_EQ(std::vector<GURL>{GURL("https://ad2.com-component1.com")}, res.ad_component_urls); @@ -3132,6 +3167,7 @@ R"({"l1":"a", "l2": "b", "extra": "c"})"); const Result& res = RunStandardAuction(); + EXPECT_EQ(InterestGroupKey(kBidder2, kBidder2Name), result_.winning_group_id); EXPECT_EQ(GURL("https://ad2.com/"), res.ad_url); EXPECT_EQ(std::vector<GURL>{GURL("https://ad2.com-component1.com")}, res.ad_component_urls); @@ -3174,6 +3210,7 @@ R"({"l1":"a", "l2": "b", "extra": "c"})"); const Result& res = RunStandardAuction(); + EXPECT_EQ(InterestGroupKey(kBidder2, kBidder2Name), result_.winning_group_id); EXPECT_EQ(GURL("https://ad2.com/"), res.ad_url); EXPECT_EQ(std::vector<GURL>{GURL("https://ad2.com-component1.com")}, res.ad_component_urls); @@ -3216,6 +3253,7 @@ R"({"l1":"a", "l2": "b", "extra": "c"})"); const Result& res = RunStandardAuction(); + EXPECT_EQ(InterestGroupKey(kBidder2, kBidder2Name), result_.winning_group_id); EXPECT_EQ(GURL("https://ad2.com/"), res.ad_url); EXPECT_EQ(std::vector<GURL>{GURL("https://ad2.com-component1.com")}, res.ad_component_urls); @@ -3264,6 +3302,7 @@ R"({"l1":"a", "l2": "b", "extra": "c"})"); const Result& res = RunStandardAuction(); + EXPECT_EQ(InterestGroupKey(kBidder2, kBidder2Name), result_.winning_group_id); EXPECT_EQ(GURL("https://ad2.com/"), res.ad_url); EXPECT_EQ(std::vector<GURL>{GURL("https://ad2.com-component1.com")}, res.ad_component_urls); @@ -3348,6 +3387,7 @@ /*data_version=*/2); RunStandardAuction(); + EXPECT_EQ(InterestGroupKey(kBidder1, kBidder1Name), result_.winning_group_id); EXPECT_EQ(GURL("https://ad1.com/"), result_.ad_url); EXPECT_EQ(std::vector<GURL>{GURL("https://ad1.com-component1.com")}, result_.ad_component_urls); @@ -3488,7 +3528,8 @@ auction_run_loop_->Run(); } EXPECT_TRUE(auction_complete_); - + EXPECT_EQ(InterestGroupKey(kBidder2, kBidder2Name), + result_.winning_group_id); EXPECT_EQ(GURL("https://ad2.com/"), result_.ad_url); EXPECT_EQ(std::vector<GURL>{GURL("https://ad2.com-component1.com")}, result_.ad_component_urls); @@ -3695,6 +3736,7 @@ RunStandardAuction(); + EXPECT_FALSE(result_.winning_group_id); EXPECT_FALSE(result_.ad_url); EXPECT_EQ(5, result_.bidder1_bid_count); EXPECT_EQ(3u, result_.bidder1_prev_wins.size()); @@ -3869,8 +3911,9 @@ auction_run_loop_->Run(); EXPECT_TRUE(auction_complete_); + EXPECT_EQ(InterestGroupKey(kBidder1, "0"), result_.winning_group_id); EXPECT_EQ(GURL("https://ad1.com/"), result_.ad_url); - EXPECT_FALSE(result_.ad_component_urls); + EXPECT_TRUE(result_.ad_component_urls.empty()); EXPECT_THAT(result_.report_urls, testing::UnorderedElementsAre()); EXPECT_THAT(result_.errors, testing::ElementsAre()); } @@ -3918,8 +3961,9 @@ auction_run_loop_->Run(); + EXPECT_FALSE(result_.winning_group_id); EXPECT_FALSE(result_.ad_url); - EXPECT_FALSE(result_.ad_component_urls); + EXPECT_TRUE(result_.ad_component_urls.empty()); EXPECT_THAT(result_.report_urls, testing::UnorderedElementsAre()); EXPECT_EQ(5, result_.bidder1_bid_count); EXPECT_EQ(3u, result_.bidder1_prev_wins.size()); @@ -4015,8 +4059,10 @@ // Bidder2 won, Bidder1 crashed. auction_run_loop_->Run(); + EXPECT_EQ(InterestGroupKey(kBidder2, kBidder2Name), + result_.winning_group_id); EXPECT_EQ(GURL("https://ad2.com/"), result_.ad_url); - EXPECT_FALSE(result_.ad_component_urls); + EXPECT_TRUE(result_.ad_component_urls.empty()); EXPECT_THAT(result_.report_urls, testing::UnorderedElementsAre()); EXPECT_EQ(5, result_.bidder1_bid_count); EXPECT_EQ(3u, result_.bidder1_prev_wins.size()); @@ -4087,8 +4133,9 @@ auction_run_loop_->Run(); // No bidder won, Bidder1 crashed. + EXPECT_FALSE(result_.winning_group_id); EXPECT_FALSE(result_.ad_url); - EXPECT_FALSE(result_.ad_component_urls); + EXPECT_TRUE(result_.ad_component_urls.empty()); EXPECT_THAT(result_.report_urls, testing::UnorderedElementsAre()); EXPECT_EQ(6, result_.bidder1_bid_count); EXPECT_EQ(3u, result_.bidder1_prev_wins.size()); @@ -4124,6 +4171,7 @@ const Result& res = RunStandardAuction(); // Bidder 2 won the auction. + EXPECT_EQ(InterestGroupKey(kBidder2, kBidder2Name), result_.winning_group_id); EXPECT_EQ(GURL("https://ad2.com/"), res.ad_url); EXPECT_EQ(0u, res.debug_loss_report_urls.size()); @@ -4206,8 +4254,9 @@ auction_run_loop_->Run(); // No bidder won, seller crashed. + EXPECT_FALSE(result_.winning_group_id); EXPECT_FALSE(result_.ad_url); - EXPECT_FALSE(result_.ad_component_urls); + EXPECT_TRUE(result_.ad_component_urls.empty()); EXPECT_THAT(result_.report_urls, testing::UnorderedElementsAre()); if (crash_phase != CrashPhase::kReportResult) { EXPECT_EQ(5, result_.bidder1_bid_count); @@ -4592,8 +4641,10 @@ auction_run_loop_->Run(); // The bidder should win the auction. + EXPECT_EQ(InterestGroupKey(kBidder1, kBidder1Name), + result_.winning_group_id); EXPECT_EQ(GURL("https://ad1.com/"), result_.ad_url); - EXPECT_FALSE(result_.ad_component_urls); + EXPECT_TRUE(result_.ad_component_urls.empty()); EXPECT_THAT(result_.report_urls, testing::UnorderedElementsAre()); EXPECT_EQ(6, result_.bidder1_bid_count); ASSERT_EQ(4u, result_.bidder1_prev_wins.size()); @@ -4611,8 +4662,9 @@ EXPECT_EQ("Unexpected non-null ad component list", TakeBadMessage()); // No bidder won. + EXPECT_FALSE(result_.winning_group_id); EXPECT_FALSE(result_.ad_url); - EXPECT_FALSE(result_.ad_component_urls); + EXPECT_TRUE(result_.ad_component_urls.empty()); EXPECT_THAT(result_.report_urls, testing::UnorderedElementsAre()); EXPECT_EQ(5, result_.bidder1_bid_count); EXPECT_EQ(3u, result_.bidder1_prev_wins.size()); @@ -4675,6 +4727,8 @@ auction_run_loop_->Run(); // The bidder should win the auction. + EXPECT_EQ(InterestGroupKey(kBidder1, kBidder1Name), + result_.winning_group_id); EXPECT_EQ(GURL("https://ad1.com/"), result_.ad_url); EXPECT_EQ(ad_component_urls, result_.ad_component_urls); EXPECT_THAT(result_.report_urls, testing::UnorderedElementsAre()); @@ -4694,8 +4748,9 @@ EXPECT_EQ("Too many ad component URLs", TakeBadMessage()); // No bidder won. + EXPECT_FALSE(result_.winning_group_id); EXPECT_FALSE(result_.ad_url); - EXPECT_FALSE(result_.ad_component_urls); + EXPECT_TRUE(result_.ad_component_urls.empty()); EXPECT_THAT(result_.report_urls, testing::UnorderedElementsAre()); EXPECT_EQ(5, result_.bidder1_bid_count); EXPECT_EQ(3u, result_.bidder1_prev_wins.size()); @@ -4842,8 +4897,9 @@ EXPECT_EQ(test_case.expected_error_message, TakeBadMessage()); // No bidder won. + EXPECT_FALSE(result_.winning_group_id); EXPECT_FALSE(result_.ad_url); - EXPECT_FALSE(result_.ad_component_urls); + EXPECT_TRUE(result_.ad_component_urls.empty()); EXPECT_THAT(result_.report_urls, testing::UnorderedElementsAre()); EXPECT_EQ(5, result_.bidder1_bid_count); EXPECT_EQ(3u, result_.bidder1_prev_wins.size()); @@ -4892,8 +4948,9 @@ EXPECT_EQ("Invalid seller report URL", TakeBadMessage()); // No bidder won. + EXPECT_FALSE(result_.winning_group_id); EXPECT_FALSE(result_.ad_url); - EXPECT_FALSE(result_.ad_component_urls); + EXPECT_TRUE(result_.ad_component_urls.empty()); EXPECT_THAT(result_.report_urls, testing::UnorderedElementsAre()); EXPECT_EQ(6, result_.bidder1_bid_count); EXPECT_EQ(3u, result_.bidder1_prev_wins.size()); @@ -4968,8 +5025,9 @@ EXPECT_EQ("Invalid seller report URL", TakeBadMessage()); // No bidder won. + EXPECT_FALSE(result_.winning_group_id); EXPECT_FALSE(result_.ad_url); - EXPECT_FALSE(result_.ad_component_urls); + EXPECT_TRUE(result_.ad_component_urls.empty()); EXPECT_THAT(result_.report_urls, testing::UnorderedElementsAre()); EXPECT_EQ(6, result_.bidder1_bid_count); EXPECT_EQ(3u, result_.bidder1_prev_wins.size()); @@ -5021,8 +5079,9 @@ EXPECT_EQ("Invalid bidder report URL", TakeBadMessage()); // No bidder won. + EXPECT_FALSE(result_.winning_group_id); EXPECT_FALSE(result_.ad_url); - EXPECT_FALSE(result_.ad_component_urls); + EXPECT_TRUE(result_.ad_component_urls.empty()); EXPECT_THAT(result_.report_urls, testing::UnorderedElementsAre()); EXPECT_EQ(6, result_.bidder1_bid_count); EXPECT_EQ(3u, result_.bidder1_prev_wins.size()); @@ -5075,8 +5134,9 @@ auction_run_loop_->Run(); // Bidder2 won. + EXPECT_EQ(InterestGroupKey(kBidder2, kBidder2Name), result_.winning_group_id); EXPECT_EQ(GURL("https://ad2.com/"), result_.ad_url); - EXPECT_FALSE(result_.ad_component_urls); + EXPECT_TRUE(result_.ad_component_urls.empty()); EXPECT_THAT(result_.report_urls, testing::UnorderedElementsAre()); EXPECT_EQ(5, result_.bidder1_bid_count); EXPECT_EQ(3u, result_.bidder1_prev_wins.size()); @@ -5151,8 +5211,10 @@ bidder1_worklet->InvokeReportWinCallback(); auction_run_loop_->Run(); + EXPECT_EQ(InterestGroupKey(kBidder1, kBidder1Name), + result_.winning_group_id); EXPECT_EQ(GURL("https://ad1.com/"), result_.ad_url); - EXPECT_FALSE(result_.ad_component_urls); + EXPECT_TRUE(result_.ad_component_urls.empty()); ASSERT_EQ(4u, result_.bidder1_prev_wins.size()); EXPECT_EQ(3u, result_.bidder2_prev_wins.size()); EXPECT_EQ(R"({"render_url":"https://ad1.com/","metadata":{"ads": true}})", @@ -5165,8 +5227,10 @@ bidder2_worklet->InvokeReportWinCallback(); auction_run_loop_->Run(); + EXPECT_EQ(InterestGroupKey(kBidder2, kBidder2Name), + result_.winning_group_id); EXPECT_EQ(GURL("https://ad2.com/"), result_.ad_url); - EXPECT_FALSE(result_.ad_component_urls); + EXPECT_TRUE(result_.ad_component_urls.empty()); EXPECT_EQ(3u, result_.bidder1_prev_wins.size()); ASSERT_EQ(4u, result_.bidder2_prev_wins.size()); EXPECT_EQ(R"({"render_url":"https://ad2.com/"})", @@ -5279,10 +5343,14 @@ EXPECT_THAT(result_.errors, testing::ElementsAre()); if (bidder1_wins) { + EXPECT_EQ(InterestGroupKey(kBidder1, kBidder1Name), + result_.winning_group_id); EXPECT_EQ(GURL("https://ad1.com/"), result_.ad_url); EXPECT_EQ(4u, result_.bidder1_prev_wins.size()); ASSERT_EQ(3u, result_.bidder2_prev_wins.size()); } else { + EXPECT_EQ(InterestGroupKey(kBidder2, kBidder2Name), + result_.winning_group_id); EXPECT_EQ(GURL("https://ad2.com/"), result_.ad_url); EXPECT_EQ(3u, result_.bidder1_prev_wins.size()); ASSERT_EQ(4u, result_.bidder2_prev_wins.size()); @@ -5327,6 +5395,7 @@ const Result& res = RunStandardAuction(); // Bidder 2 won the auction. + EXPECT_EQ(InterestGroupKey(kBidder2, kBidder2Name), result_.winning_group_id); EXPECT_EQ(GURL("https://ad2.com/"), res.ad_url); EXPECT_EQ(2u, res.debug_loss_report_urls.size()); @@ -5366,6 +5435,7 @@ const Result& res = RunStandardAuction(); // No winner since both bidders are rejected by seller. + EXPECT_FALSE(res.winning_group_id); EXPECT_FALSE(res.ad_url); EXPECT_EQ(4u, res.debug_loss_report_urls.size()); @@ -5691,6 +5761,7 @@ EXPECT_EQ(test_case.expected_error_message, TakeBadMessage()); // No bidder won. + EXPECT_FALSE(result_.winning_group_id); EXPECT_FALSE(result_.ad_url); EXPECT_EQ(5, result_.bidder1_bid_count); EXPECT_EQ(3u, result_.bidder1_prev_wins.size()); @@ -5759,6 +5830,7 @@ EXPECT_EQ(test_case.expected_error_message, TakeBadMessage()); // No bidder won. + EXPECT_FALSE(result_.winning_group_id); EXPECT_FALSE(result_.ad_url); EXPECT_EQ(5, result_.bidder1_bid_count); EXPECT_EQ(3u, result_.bidder1_prev_wins.size()); @@ -5824,6 +5896,7 @@ // Bidder1 won. Bidder2 was filtered out as an invalid bid because its debug // loss report url is not a valid HTTPS URL. + EXPECT_EQ(InterestGroupKey(kBidder1, kBidder1Name), result_.winning_group_id); EXPECT_EQ(GURL("https://ad1.com/"), result_.ad_url); EXPECT_EQ(6, result_.bidder1_bid_count); EXPECT_EQ(4u, result_.bidder1_prev_wins.size());
diff --git a/content/browser/interest_group/interest_group_browsertest.cc b/content/browser/interest_group/interest_group_browsertest.cc index eed8c283..87fe480 100644 --- a/content/browser/interest_group/interest_group_browsertest.cc +++ b/content/browser/interest_group/interest_group_browsertest.cc
@@ -882,17 +882,8 @@ ASSERT_EQ(GURL(url::kAboutBlankURL), expected_url); } - switch (GetParam()) { - case blink::features::FencedFramesImplementationType::kShadowDOM: { - observer.Wait(); - break; - } - case blink::features::FencedFramesImplementationType::kMPArch: { - // Wait for the load to complete. - FencedFrame* fenced_frame = GetFencedFrame(execution_target); - fenced_frame->WaitForDidStopLoadingForTesting(); - } - } + // Wait for the load to complete. + observer.Wait(); RenderFrameHost* fenced_frame_host = GetFencedFrameRenderFrameHost(execution_target); @@ -3262,17 +3253,7 @@ WaitForURL(new_url); // Wait for the load to complete. - switch (GetParam()) { - case blink::features::FencedFramesImplementationType::kShadowDOM: { - observer.Wait(); - break; - } - case blink::features::FencedFramesImplementationType::kMPArch: { - // Wait for the load to complete. - FencedFrame* fenced_frame = GetFencedFrame(shell()); - fenced_frame->WaitForDidStopLoadingForTesting(); - } - } + observer.Wait(); // Navigating the ad fenced frame may result in it using a new // RenderFrameHost, invalidating the old `ad_frame`.
diff --git a/content/browser/loader/navigation_url_loader_impl.cc b/content/browser/loader/navigation_url_loader_impl.cc index 4ae0235..5a7fb3e 100644 --- a/content/browser/loader/navigation_url_loader_impl.cc +++ b/content/browser/loader/navigation_url_loader_impl.cc
@@ -1279,10 +1279,10 @@ header_client; // `frame_tree_node` may be null in some unit test environments. if (frame_tree_node) { - // Initialize proxied factory remote/receiver if necessary. - // This also populates `bypass_redirect_checks_`. DCHECK(frame_tree_node->navigation_request()); + // Initialize proxied factory remote/receiver if necessary. + // This also populates `bypass_redirect_checks_`. GetContentClient() ->browser() ->RegisterNonNetworkNavigationURLLoaderFactories(
diff --git a/content/browser/loader/navigation_url_loader_impl_unittest.cc b/content/browser/loader/navigation_url_loader_impl_unittest.cc index 88a0c76..73d6138 100644 --- a/content/browser/loader/navigation_url_loader_impl_unittest.cc +++ b/content/browser/loader/navigation_url_loader_impl_unittest.cc
@@ -30,8 +30,11 @@ #include "content/public/common/content_features.h" #include "content/public/common/content_switches.h" #include "content/public/test/browser_task_environment.h" +#include "content/public/test/navigation_simulator.h" #include "content/public/test/test_browser_context.h" +#include "content/public/test/test_renderer_host.h" #include "content/test/test_navigation_url_loader_delegate.h" +#include "content/test/test_web_contents.h" #include "ipc/ipc_message.h" #include "net/base/load_flags.h" #include "net/base/mock_network_change_notifier.h" @@ -52,7 +55,6 @@ #include "third_party/blink/public/common/navigation/navigation_params.h" #include "third_party/blink/public/mojom/loader/mixed_content.mojom.h" #include "third_party/blink/public/mojom/navigation/navigation_params.mojom.h" - #if BUILDFLAG(ENABLE_PLUGINS) #include "content/public/browser/plugin_service.h" #endif @@ -178,6 +180,23 @@ task_environment_.reset(); } + void SetUp() override { + // Do not create TestNavigationURLLoaderFactory as this tests creates + // NavigationURLLoaders explicitly and TestNavigationURLLoaderFactory + // interferes with that. + rvh_test_enabler_ = std::make_unique<RenderViewHostTestEnabler>( + RenderViewHostTestEnabler::NavigationURLLoaderFactoryType::kNone); + web_contents_ = TestWebContents::Create( + browser_context_.get(), + SiteInstanceImpl::Create(browser_context_.get())); + } + + void TearDown() override { + pending_navigation_.reset(); + web_contents_.reset(); + rvh_test_enabler_.reset(); + } + std::unique_ptr<NavigationURLLoader> CreateTestLoader( const GURL& url, const std::string& headers, @@ -187,6 +206,12 @@ blink::NavigationDownloadPolicy(), bool is_main_frame = true, bool upgrade_if_insecure = false) { + // NavigationURLLoader assumes that the corresponding FrameTreeNode has an + // associated NavigationRequest. + pending_navigation_ = NavigationSimulator::CreateBrowserInitiated( + GURL("https://example.com"), web_contents_.get()); + pending_navigation_->Start(); + blink::mojom::BeginNavigationParamsPtr begin_params = blink::mojom::BeginNavigationParams::New( absl::nullopt /* initiator_frame_token */, headers, @@ -213,6 +238,9 @@ network::mojom::RequestDestination::kDocument; url::Origin origin = url::Origin::Create(url); + uint32_t frame_tree_node_id = + web_contents_->GetMainFrame()->GetFrameTreeNodeId(); + std::unique_ptr<NavigationRequestInfo> request_info( std::make_unique<NavigationRequestInfo>( std::move(common_params), std::move(begin_params), @@ -221,8 +249,7 @@ net::IsolationInfo::RequestType::kMainFrame, origin, origin, net::SiteForCookies::FromUrl(url)), true /* is_primary_main_frame */, is_main_frame, - false /* are_ancestors_secure */, - FrameTreeNode::kFrameTreeNodeInvalidId /* frame_tree_node_id */, + false /* are_ancestors_secure */, frame_tree_node_id, false /* report_raw_headers */, upgrade_if_insecure /* upgrade_if_insecure */, nullptr /* blob_url_loader_factory */, @@ -327,6 +354,11 @@ std::unique_ptr<TestBrowserContext> browser_context_; net::EmbeddedTestServer http_test_server_; absl::optional<network::ResourceRequest> most_recent_resource_request_; + std::unique_ptr<RenderViewHostTestEnabler> rvh_test_enabler_; + std::unique_ptr<TestWebContents> web_contents_; + // NavigationURLLoaderImpl relies on the existence of the + // |frame_tree_node->navigation_request()|. + std::unique_ptr<NavigationSimulator> pending_navigation_; }; TEST_F(NavigationURLLoaderImplTest, IsolationInfoOfMainFrameNavigation) {
diff --git a/content/browser/loader/navigation_url_loader_unittest.cc b/content/browser/loader/navigation_url_loader_unittest.cc index af23c96..11ae46c 100644 --- a/content/browser/loader/navigation_url_loader_unittest.cc +++ b/content/browser/loader/navigation_url_loader_unittest.cc
@@ -19,8 +19,10 @@ #include "content/public/browser/storage_partition.h" #include "content/public/common/content_switches.h" #include "content/public/test/browser_task_environment.h" +#include "content/public/test/navigation_simulator.h" #include "content/public/test/test_browser_context.h" #include "content/test/test_navigation_url_loader_delegate.h" +#include "content/test/test_web_contents.h" #include "ipc/ipc_message.h" #include "net/base/load_flags.h" #include "net/base/net_errors.h" @@ -47,6 +49,27 @@ base::RunLoop().RunUntilIdle(); } + void SetUp() override { + // Do not create TestNavigationURLLoaderFactory as this tests creates + // NavigationURLLoaders explicitly and TestNavigationURLLoaderFactory + // interferes with that. + rvh_test_enabler_ = std::make_unique<RenderViewHostTestEnabler>( + RenderViewHostTestEnabler::NavigationURLLoaderFactoryType::kNone); + web_contents_ = TestWebContents::Create( + browser_context_.get(), + SiteInstanceImpl::Create(browser_context_.get())); + // NavigationURLLoader assumes that the corresponding FrameTreeNode has an + // associated NavigationRequest. + pending_navigation_ = NavigationSimulator::CreateBrowserInitiated( + GURL("https://example.com"), web_contents_.get()); + pending_navigation_->Start(); + } + + void TearDown() override { + pending_navigation_.reset(); + web_contents_.reset(); + } + std::unique_ptr<NavigationURLLoader> MakeTestLoader( const GURL& url, NavigationURLLoaderDelegate* delegate) { @@ -82,6 +105,9 @@ StoragePartition* storage_partition = browser_context_->GetDefaultStoragePartition(); + uint32_t frame_tree_node_id = + web_contents_->GetMainFrame()->GetFrameTreeNodeId(); + url::Origin origin = url::Origin::Create(url); std::unique_ptr<NavigationRequestInfo> request_info( std::make_unique<NavigationRequestInfo>( @@ -91,8 +117,7 @@ net::IsolationInfo::RequestType::kMainFrame, origin, origin, net::SiteForCookies::FromUrl(url)), true /* is_primary_main_frame */, true /* is_main_frame */, - false /* are_ancestors_secure */, - FrameTreeNode::kFrameTreeNodeInvalidId /* frame_tree_node_id */, + false /* are_ancestors_secure */, frame_tree_node_id, false /* report_raw_headers */, false /* upgrade_if_insecure */, nullptr /* blob_url_loader_factory */, base::UnguessableToken::Create() /* devtools_navigation_token */, @@ -108,13 +133,18 @@ nullptr, nullptr, nullptr, delegate, NavigationURLLoader::LoaderType::kRegular, mojo::NullRemote(), storage_partition->CreateURLLoaderNetworkObserverForNavigationRequest( - FrameTreeNode::kFrameTreeNodeInvalidId /* frame_tree_node_id */), + frame_tree_node_id), /*devtools_observer=*/mojo::NullRemote()); } protected: BrowserTaskEnvironment task_environment_; std::unique_ptr<TestBrowserContext> browser_context_; + std::unique_ptr<RenderViewHostTestEnabler> rvh_test_enabler_; + std::unique_ptr<TestWebContents> web_contents_; + // NavigationURLLoaderImpl relies on the existence of the + // |frame_tree_node->navigation_request()|. + std::unique_ptr<NavigationSimulator> pending_navigation_; }; // Tests that request failures are propagated correctly. @@ -146,7 +176,7 @@ // Wait for the request to fail as expected. delegate.WaitForRequestFailed(); - ASSERT_EQ(net::ERR_CERT_COMMON_NAME_INVALID, delegate.net_error()); + EXPECT_EQ(net::ERR_CERT_COMMON_NAME_INVALID, delegate.net_error()); net::SSLInfo ssl_info = delegate.ssl_info(); EXPECT_TRUE(ssl_info.is_valid()); EXPECT_TRUE(
diff --git a/content/browser/media/cdm_registry_impl.cc b/content/browser/media/cdm_registry_impl.cc index 02ae231..a9b66ed 100644 --- a/content/browser/media/cdm_registry_impl.cc +++ b/content/browser/media/cdm_registry_impl.cc
@@ -39,14 +39,14 @@ CdmRegistryImpl::~CdmRegistryImpl() {} void CdmRegistryImpl::Init() { - base::AutoLock auto_lock(lock_); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); // Let embedders register CDMs. GetContentClient()->AddContentDecryptionModules(&cdms_, nullptr); } void CdmRegistryImpl::RegisterCdm(const CdmInfo& info) { - base::AutoLock auto_lock(lock_); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); // Always register new CDMs at the end of the list, so that the behavior is // consistent across the browser process's lifetime. For example, we'll always @@ -59,7 +59,8 @@ std::unique_ptr<CdmInfo> CdmRegistryImpl::GetCdmInfo( const std::string& key_system, CdmInfo::Robustness robustness) { - base::AutoLock auto_lock(lock_); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + for (const auto& cdm : cdms_) { if (cdm.robustness == robustness && MatchKeySystem(cdm, key_system)) return std::make_unique<CdmInfo>(cdm); @@ -72,7 +73,7 @@ const std::string& key_system, CdmInfo::Robustness robustness, absl::optional<media::CdmCapability> cdm_capability) { - base::AutoLock auto_lock(lock_); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); auto itr = cdms_.begin(); for (; itr != cdms_.end(); itr++) { @@ -101,12 +102,12 @@ } const std::vector<CdmInfo>& CdmRegistryImpl::GetRegisteredCdms() { - base::AutoLock auto_lock(lock_); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); return cdms_; } void CdmRegistryImpl::ResetForTesting() { - base::AutoLock auto_lock(lock_); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); cdms_.clear(); }
diff --git a/content/browser/media/cdm_registry_impl.h b/content/browser/media/cdm_registry_impl.h index e360cc3..8475e81 100644 --- a/content/browser/media/cdm_registry_impl.h +++ b/content/browser/media/cdm_registry_impl.h
@@ -7,7 +7,7 @@ #include <vector> -#include "base/synchronization/lock.h" +#include "base/sequence_checker.h" #include "base/thread_annotations.h" #include "content/common/content_export.h" #include "content/public/browser/cdm_registry.h" @@ -61,8 +61,9 @@ // Resets `this` to a clean state for testing. void ResetForTesting(); - base::Lock lock_; - std::vector<CdmInfo> cdms_ GUARDED_BY(lock_); + std::vector<CdmInfo> cdms_ GUARDED_BY_CONTEXT(sequence_checker_); + + SEQUENCE_CHECKER(sequence_checker_); }; } // namespace content
diff --git a/content/browser/native_io/native_io_manager.h b/content/browser/native_io/native_io_manager.h index eb549bc8340..73c80528 100644 --- a/content/browser/native_io/native_io_manager.h +++ b/content/browser/native_io/native_io_manager.h
@@ -123,8 +123,8 @@ // `host` must be owned by this manager. `host` may be deleted. void DidDeleteHostData(NativeIOHost* host, base::PassKey<NativeIOHost>); - storage::QuotaManagerProxy* quota_manager_proxy() const { - return quota_manager_proxy_.get(); + const scoped_refptr<storage::QuotaManagerProxy>& quota_manager_proxy() const { + return quota_manager_proxy_; } private:
diff --git a/content/browser/net/http_cache_backend_file_operations_factory.cc b/content/browser/net/http_cache_backend_file_operations_factory.cc new file mode 100644 index 0000000..73ed23e --- /dev/null +++ b/content/browser/net/http_cache_backend_file_operations_factory.cc
@@ -0,0 +1,165 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "content/browser/net/http_cache_backend_file_operations_factory.h" + +#include "base/files/file.h" +#include "base/files/file_util.h" +#include "base/task/thread_pool.h" +#include "mojo/public/cpp/bindings/self_owned_receiver.h" + +namespace content { + +namespace { + +class HttpCacheBackendFileOperations final + : public network::mojom::HttpCacheBackendFileOperations { + public: + // All the operations must be performed under `path`. + explicit HttpCacheBackendFileOperations(const base::FilePath& path) + : path_(path) { + DCHECK(path.IsAbsolute()); + } + ~HttpCacheBackendFileOperations() override = default; + + void CreateDirectory(const base::FilePath& path, + CreateDirectoryCallback callback) override { + if (!IsValid(path, "CreateDirectory")) { + std::move(callback).Run(false); + return; + } + + bool result = base::CreateDirectory(path); + DVLOG(1) << "CreateDirectory: path = " << path << " => " << result; + std::move(callback).Run(result); + } + + void PathExists(const base::FilePath& path, + PathExistsCallback callback) override { + if (!IsValid(path, "PathExists")) { + std::move(callback).Run(false); + return; + } + + bool result = base::PathExists(path); + DVLOG(1) << "PathExists: path = " << path << " => " << result; + std::move(callback).Run(result); + } + + void OpenFile(const base::FilePath& path, + uint32_t flags, + OpenFileCallback callback) override { + if (!IsValid(path, "OpenFile")) { + std::move(callback).Run(base::File(), + base::File::FILE_ERROR_ACCESS_DENIED); + return; + } + + base::File file(path, flags); + base::File::Error error = file.error_details(); + DVLOG(1) << "OpenFile: path = " << path << ", flags = " << flags + << " => file.IsValid() = " << file.IsValid(); + std::move(callback).Run(std::move(file), error); + } + + void DeleteFile(const base::FilePath& path, + DeleteFileCallback callback) override { + if (!IsValid(path, "DeleteFile")) { + std::move(callback).Run(false); + return; + } + + bool result = base::DeleteFile(path); + DVLOG(1) << "DeleteFile: path = " << path << " => " << result; + std::move(callback).Run(result); + } + + void RenameFile(const base::FilePath& from_path, + const base::FilePath& to_path, + RenameFileCallback callback) override { + if (!IsValid(from_path, "RenameFile (from)")) { + std::move(callback).Run(base::File::FILE_ERROR_ACCESS_DENIED); + return; + } + if (!IsValid(to_path, "RenameFile (to)")) { + std::move(callback).Run(base::File::FILE_ERROR_ACCESS_DENIED); + return; + } + + base::File::Error error; + base::ReplaceFile(from_path, to_path, &error); + DVLOG(1) << "DeleteFile: from_path = " << from_path + << ", to_path = " << to_path << " => " << error; + std::move(callback).Run(error); + } + + void GetFileInfo(const base::FilePath& path, + GetFileInfoCallback callback) override { + if (!IsValid(path, "GetFileInfo")) { + std::move(callback).Run(absl::nullopt); + return; + } + + base::File::Info file_info; + bool ok = base::GetFileInfo(path, &file_info); + DVLOG(1) << "GetFileInfo: path = " << path << " => " << ok; + + std::move(callback).Run(ok ? absl::make_optional(file_info) + : absl::nullopt); + } + + private: + bool IsValid(const base::FilePath& path, base::StringPiece tag) const { + if (!path.IsAbsolute()) { + mojo::ReportBadMessage(static_cast<std::string>(tag) + + ": The path is not an absolute path."); + return false; + } + if (!path_.IsParent(path)) { + mojo::ReportBadMessage(static_cast<std::string>(tag) + + ": The path is not in the specified area."); + return false; + } + if (path.ReferencesParent()) { + mojo::ReportBadMessage( + static_cast<std::string>(tag) + + ": The path contains a parent directory traversal attempt."); + return false; + } + return true; + } + + const base::FilePath path_; +}; + +} // namespace + +HttpCacheBackendFileOperationsFactory::HttpCacheBackendFileOperationsFactory( + mojo::PendingReceiver<network::mojom::HttpCacheBackendFileOperationsFactory> + receiver, + const base::FilePath& path) + : receiver_(this, std::move(receiver)), path_(path) {} +HttpCacheBackendFileOperationsFactory:: + ~HttpCacheBackendFileOperationsFactory() = default; + +void HttpCacheBackendFileOperationsFactory::Create( + mojo::PendingReceiver<network::mojom::HttpCacheBackendFileOperations> + receiver) { + auto task_runner = base::ThreadPool::CreateSequencedTaskRunner( + {base::MayBlock(), base::TaskPriority::USER_BLOCKING, + base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN}); + task_runner->PostTask( + FROM_HERE, + base::BindOnce( + [](mojo::PendingReceiver< + network::mojom::HttpCacheBackendFileOperations> receiver, + const base::FilePath& path) { + mojo::MakeSelfOwnedReceiver( + std::make_unique<HttpCacheBackendFileOperations>(path), + std::move(receiver), nullptr); + }, + std::move(receiver), path_)); +} + +} // namespace content
diff --git a/content/browser/net/http_cache_backend_file_operations_factory.h b/content/browser/net/http_cache_backend_file_operations_factory.h new file mode 100644 index 0000000..f4f989a --- /dev/null +++ b/content/browser/net/http_cache_backend_file_operations_factory.h
@@ -0,0 +1,41 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_BROWSER_NET_HTTP_CACHE_BACKEND_FILE_OPERATIONS_FACTORY_H_ +#define CONTENT_BROWSER_NET_HTTP_CACHE_BACKEND_FILE_OPERATIONS_FACTORY_H_ + +#include "base/files/file_path.h" +#include "content/common/content_export.h" +#include "mojo/public/cpp/bindings/pending_receiver.h" +#include "mojo/public/cpp/bindings/receiver.h" +#include "services/network/public/mojom/http_cache_backend_file_operations.mojom.h" + +namespace content { + +// A network::mojom::HttpCacheBackendFileOperationsFactory that creates +// network::mojom::HttpCacheBackendFileOperations that run file operations +// on the browser process. +class CONTENT_EXPORT HttpCacheBackendFileOperationsFactory final + : public network::mojom::HttpCacheBackendFileOperationsFactory { + public: + // All the operations must be performed under `path`. + HttpCacheBackendFileOperationsFactory( + mojo::PendingReceiver< + network::mojom::HttpCacheBackendFileOperationsFactory> receiver, + const base::FilePath& path); + ~HttpCacheBackendFileOperationsFactory() override; + + void Create( + mojo::PendingReceiver<network::mojom::HttpCacheBackendFileOperations> + receiver) override; + + private: + mojo::Receiver<network::mojom::HttpCacheBackendFileOperationsFactory> + receiver_; + const base::FilePath path_; +}; + +} // namespace content + +#endif // CONTENT_BROWSER_NET_HTTP_CACHE_BACKEND_FILE_OPERATIONS_FACTORY_H_
diff --git a/content/browser/net/sandboxed_http_cache_browsertest.cc b/content/browser/net/sandboxed_http_cache_browsertest.cc index 8aa139b..7ac0f54 100644 --- a/content/browser/net/sandboxed_http_cache_browsertest.cc +++ b/content/browser/net/sandboxed_http_cache_browsertest.cc
@@ -3,9 +3,11 @@ // found in the LICENSE file. #include "base/feature_list.h" +#include "base/files/scoped_temp_dir.h" #include "base/test/bind.h" #include "base/test/scoped_feature_list.h" #include "build/build_config.h" +#include "content/browser/net/http_cache_backend_file_operations_factory.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/network_service_instance.h" #include "content/public/browser/page.h" @@ -28,6 +30,8 @@ namespace content { namespace { +using network::mojom::SimpleCache; + class SandboxedHttpCacheBrowserTest : public ContentBrowserTest { public: SandboxedHttpCacheBrowserTest() { @@ -57,33 +61,117 @@ ASSERT_TRUE(IsOutOfProcessNetworkService()); ASSERT_TRUE(sandbox::policy::features::IsNetworkSandboxEnabled()); + ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); + ContentBrowserTest::SetUp(); } + void SetUpOnMainThread() override { + ContentBrowserTest::SetUpOnMainThread(); + + content::GetNetworkService()->BindTestInterface( + network_service_test_.BindNewPipeAndPassReceiver()); + } + + mojo::Remote<network::mojom::NetworkServiceTest>& network_service_test() { + return network_service_test_; + } + + const base::FilePath& GetTempDirPath() const { return temp_dir_.GetPath(); } + private: base::test::ScopedFeatureList scoped_feature_list_; + base::ScopedTempDir temp_dir_; + mojo::Remote<network::mojom::NetworkServiceTest> network_service_test_; }; IN_PROC_BROWSER_TEST_F(SandboxedHttpCacheBrowserTest, OpeningFileIsProhibited) { base::RunLoop run_loop; - mojo::Remote<network::mojom::NetworkServiceTest> network_service_test; - content::GetNetworkService()->BindTestInterface( - network_service_test.BindNewPipeAndPassReceiver()); absl::optional<bool> result; - network_service_test.set_disconnect_handler(run_loop.QuitClosure()); + network_service_test().set_disconnect_handler(run_loop.QuitClosure()); const base::FilePath path = GetTestDataFilePath().Append(FILE_PATH_LITERAL("blank.jpg")); - network_service_test->OpenFile(path, base::BindLambdaForTesting([&](bool b) { - result = b; - run_loop.Quit(); - })); + network_service_test()->OpenFile(path, + base::BindLambdaForTesting([&](bool b) { + result = b; + run_loop.Quit(); + })); run_loop.Run(); EXPECT_EQ(result, absl::make_optional(false)); } -// TODO(yhirano): Add more tests. +IN_PROC_BROWSER_TEST_F(SandboxedHttpCacheBrowserTest, CreateSimpleCache) { + base::RunLoop run_loop; + + network_service_test().set_disconnect_handler(run_loop.QuitClosure()); + const base::FilePath root_path = GetTempDirPath(); + const base::FilePath path = root_path.AppendASCII("foobar"); + mojo::Remote<SimpleCache> simple_cache; + mojo::PendingRemote<network::mojom::HttpCacheBackendFileOperationsFactory> + factory_remote; + HttpCacheBackendFileOperationsFactory factory( + factory_remote.InitWithNewPipeAndPassReceiver(), root_path); + + network_service_test()->CreateSimpleCache( + std::move(factory_remote), path, + base::BindLambdaForTesting([&](mojo::PendingRemote<SimpleCache> cache) { + if (cache) { + simple_cache.Bind(std::move(cache)); + } + run_loop.Quit(); + })); + run_loop.Run(); + + ASSERT_TRUE(simple_cache.is_bound()); +} + +IN_PROC_BROWSER_TEST_F(SandboxedHttpCacheBrowserTest, + CreateSimpleCacheOnParentDirectory) { + base::RunLoop run_loop; + + const base::FilePath path = GetTempDirPath(); + const base::FilePath root_path = path.AppendASCII("foobar"); + mojo::PendingRemote<network::mojom::HttpCacheBackendFileOperationsFactory> + factory_remote; + HttpCacheBackendFileOperationsFactory factory( + factory_remote.InitWithNewPipeAndPassReceiver(), root_path); + + // We expect the network service to crash due to a bad mojo message. + IgnoreNetworkServiceCrashes(); + network_service_test().set_disconnect_handler(run_loop.QuitClosure()); + network_service_test()->CreateSimpleCache( + std::move(factory_remote), path, + base::BindOnce([](mojo::PendingRemote<SimpleCache> cache) { + ADD_FAILURE() << "NOTREACHED"; + })); + run_loop.Run(); +} + +IN_PROC_BROWSER_TEST_F(SandboxedHttpCacheBrowserTest, + CreateSimpleCacheWithParentDirectory) { + base::RunLoop run_loop; + + const base::FilePath root_path = GetTempDirPath(); + const base::FilePath path = root_path.AppendASCII("foo") + .Append(base::FilePath::kParentDirectory) + .AppendASCII("bar"); + mojo::PendingRemote<network::mojom::HttpCacheBackendFileOperationsFactory> + factory_remote; + HttpCacheBackendFileOperationsFactory factory( + factory_remote.InitWithNewPipeAndPassReceiver(), root_path); + + // We expect the network service to crash due to a bad mojo message. + IgnoreNetworkServiceCrashes(); + network_service_test().set_disconnect_handler(run_loop.QuitClosure()); + network_service_test()->CreateSimpleCache( + std::move(factory_remote), path, + base::BindOnce([](mojo::PendingRemote<SimpleCache> cache) { + ADD_FAILURE() << "NOTREACHED"; + })); + run_loop.Run(); +} } // namespace } // namespace content
diff --git a/content/browser/prerender/prerender_browsertest.cc b/content/browser/prerender/prerender_browsertest.cc index dd10db12..7a4647cc 100644 --- a/content/browser/prerender/prerender_browsertest.cc +++ b/content/browser/prerender/prerender_browsertest.cc
@@ -2107,14 +2107,12 @@ // 5. Activate the prerendered page and listen to the DidFinishNavigation // event, to ensure the Activate IPC is sent. - TestNavigationManager prerendered_activation_navigation(web_contents(), + TestActivationManager prerendered_activation_navigation(web_contents(), prerendering_url); ASSERT_TRUE(ExecJs(web_contents()->GetMainFrame(), JsReplace("location = $1", prerendering_url))); prerendered_activation_navigation.WaitForNavigationFinished(); - EXPECT_TRUE( - prerendered_activation_navigation.was_prerendered_page_activation()); - EXPECT_TRUE(prerendered_activation_navigation.was_successful()); + EXPECT_TRUE(prerendered_activation_navigation.was_activated()); // 6. Renderers attempt to build Mojo connections for kCancel interfaces. // This part simulates some subframe documents start sending kCancel @@ -2424,7 +2422,7 @@ // frame tree commits. { // Start navigation in primary page to kPrerenderingUrl. - TestNavigationManager primary_page_manager(shell()->web_contents(), + TestActivationManager primary_page_manager(shell()->web_contents(), kPrerenderingUrl); ASSERT_TRUE(ExecJs(shell()->web_contents()->GetMainFrame(), JsReplace("location = $1", kPrerenderingUrl))); @@ -2433,9 +2431,11 @@ web_contents_impl()->GetPrimaryFrameTree().root()->navigation_request(); // Wait until the navigation is deferred by CommitDeferringCondition. - // TODO(nhiroki): Avoid using base::RunUntilIdle() and instead use some - // explicit signal of the running condition. - base::RunLoop().RunUntilIdle(); + ASSERT_TRUE(primary_page_manager.WaitForBeforeChecks()); + primary_page_manager.ResumeActivation(); + + // TODO(bokan): This could be any CommitDeferringCondition, we should have + // a way to pause on a specific CommitDeferringCondition. EXPECT_TRUE(request->IsCommitDeferringConditionDeferredForTesting()); // The navigation should not have proceeded past NOT_STARTED because the @@ -3342,7 +3342,9 @@ // The prerender host for the URL should be deleted as DidFailLoad cancels // prerendering. - TestNavigationManager activation_observer(shell()->web_contents(), + test::PrerenderHostObserver prerender_observer(*web_contents(), + kPrerenderingUrl); + TestNavigationManager navigation_observer(shell()->web_contents(), kPrerenderingUrl); EXPECT_FALSE(HasHostForUrl(kPrerenderingUrl)); @@ -3350,8 +3352,8 @@ // prerender disables the activation due to DidFailLoad. ASSERT_TRUE(ExecJs(web_contents()->GetMainFrame(), JsReplace("location = $1", kPrerenderingUrl))); - activation_observer.WaitForNavigationFinished(); - EXPECT_FALSE(activation_observer.was_prerendered_page_activation()); + navigation_observer.WaitForNavigationFinished(); + EXPECT_FALSE(prerender_observer.was_activated()); ExpectFinalStatusForSpeculationRule(PrerenderHost::FinalStatus::kDidFailLoad); } @@ -5216,10 +5218,9 @@ EXPECT_EQ(current_frame_host()->GetFrameName(), ""); // 4. Activate prerender. - TestNavigationManager activation_manager(web_contents(), kPrerenderingUrl); + test::PrerenderHostObserver host_observer(*web_contents(), kPrerenderingUrl); NavigatePrimaryPage(kPrerenderingUrl); - activation_manager.WaitForNavigationFinished(); - EXPECT_TRUE(activation_manager.was_prerendered_page_activation()); + EXPECT_TRUE(host_observer.was_activated()); EXPECT_EQ(web_contents()->GetLastCommittedURL(), kPrerenderingUrl); // 5. Ensure that the window.name is preserved. @@ -5371,10 +5372,9 @@ network::mojom::WebSandboxFlags::kNone); } - TestNavigationManager activation_manager(web_contents(), kPrerenderingUrl); + test::PrerenderHostObserver host_observer(*web_contents(), kPrerenderingUrl); NavigatePrimaryPage(kPrerenderingUrl); - activation_manager.WaitForNavigationFinished(); - EXPECT_TRUE(activation_manager.was_prerendered_page_activation()); + EXPECT_TRUE(host_observer.was_activated()); EXPECT_EQ(web_contents()->GetLastCommittedURL(), kPrerenderingUrl); // Check that CSP was set on the prerendered page after activation. @@ -5424,10 +5424,9 @@ ~network::mojom::WebSandboxFlags::kAutomaticFeatures); } - TestNavigationManager activation_manager(web_contents(), kPrerenderingUrl); + test::PrerenderHostObserver host_observer(*web_contents(), kPrerenderingUrl); NavigatePrimaryPage(kPrerenderingUrl); - activation_manager.WaitForNavigationFinished(); - EXPECT_TRUE(activation_manager.was_prerendered_page_activation()); + EXPECT_TRUE(host_observer.was_activated()); EXPECT_EQ(web_contents()->GetLastCommittedURL(), kPrerenderingUrl); // Check that CSP was set on the prerendered page after activation. @@ -5472,10 +5471,9 @@ EXPECT_TRUE(prerender_process_host->IsProcessBackgrounded()); // Activate the prerendered page. - TestNavigationManager activation_manager(web_contents(), kPrerenderingUrl); + test::PrerenderHostObserver host_observer(*web_contents(), kPrerenderingUrl); NavigatePrimaryPage(kPrerenderingUrl); - activation_manager.WaitForNavigationFinished(); - EXPECT_TRUE(activation_manager.was_prerendered_page_activation()); + EXPECT_TRUE(host_observer.was_activated()); // Expect the change in the ChildProcessLauncherPriority to become visible. EXPECT_FALSE(prerender_process_host->IsProcessBackgrounded()); } @@ -5607,10 +5605,9 @@ EXPECT_TRUE(TestPurposePrefetchHeader(cross_origin_url1)); // Activate the prerendered page. - TestNavigationManager activation_manager(web_contents(), kPrerenderingUrl); + test::PrerenderHostObserver host_observer(*web_contents(), kPrerenderingUrl); NavigatePrimaryPage(kPrerenderingUrl); - activation_manager.WaitForNavigationFinished(); - EXPECT_TRUE(activation_manager.was_prerendered_page_activation()); + EXPECT_TRUE(host_observer.was_activated()); // Issue iframe and subresource requests in the activated page. EXPECT_TRUE(ExecJs(prerender_main_frame.get(), "run('after');",
diff --git a/content/browser/prerender/prerender_host.cc b/content/browser/prerender/prerender_host.cc index 45e41a66..df42bb44 100644 --- a/content/browser/prerender/prerender_host.cc +++ b/content/browser/prerender/prerender_host.cc
@@ -182,6 +182,11 @@ std::vector<FrameTreeNode*> subframe_nodes(std::next(node_range.begin()), node_range.end()); + // Before the root's current_frame_host is cleared, collect the replication + // state so that it can be used for post-activation validation. + blink::mojom::FrameReplicationState prior_replication_state = + frame_tree_->root()->current_replication_state(); + // NOTE: TakePrerenderedPage() clears the current_frame_host value of // frame_tree_->root(). Do not add any code between here and // frame_tree_.reset() that calls into observer functions to minimize the @@ -200,7 +205,7 @@ ->CloneWithoutSharing(context.get()); navigation_request.SetPrerenderActivationNavigationState( - std::move(nav_entry), frame_tree_->root()->current_replication_state()); + std::move(nav_entry), prior_replication_state); FrameTree& target_frame_tree = GetPrimaryFrameTree(); DCHECK_EQ(&target_frame_tree, @@ -217,10 +222,10 @@ // TODO(https://crbug.com/1237091): Copying frame name here is suboptimal // and ideally we'd do this at the same time when transferring the proxies // from the StoredPage into RenderFrameHostManager. However, this is a - // temporary solution until we move this into BrowsingInstanceFrameState, + // temporary solution until we move this into BrowsingContextState, // along with RenderFrameProxyHost. page->render_frame_host->frame_tree_node()->set_frame_name_for_activation( - frame_tree_->root()->unique_name(), frame_tree_->root()->frame_name()); + prior_replication_state.unique_name, prior_replication_state.name); for (auto& it : page->proxy_hosts) { it.second->set_frame_tree_node(*(target_frame_tree.root())); }
diff --git a/content/browser/renderer_host/browsing_context_state.cc b/content/browser/renderer_host/browsing_context_state.cc index 8529514..2eb45a78 100644 --- a/content/browser/renderer_host/browsing_context_state.cc +++ b/content/browser/renderer_host/browsing_context_state.cc
@@ -31,8 +31,11 @@ BrowsingContextState::BrowsingContextState( blink::mojom::FrameReplicationStatePtr replication_state, - raw_ptr<RenderFrameHostImpl> parent) - : replication_state_(std::move(replication_state)), parent_(parent) {} + raw_ptr<RenderFrameHostImpl> parent, + absl::optional<BrowsingInstanceId> browsing_instance_id) + : replication_state_(std::move(replication_state)), + parent_(parent), + browsing_instance_id_(browsing_instance_id) {} BrowsingContextState::~BrowsingContextState() = default; @@ -249,6 +252,20 @@ frame_tree_node->current_frame_host()->browsing_context_state()); } + if (features::GetBrowsingContextMode() == + features::BrowsingContextStateImplementationType:: + kSwapForCrossBrowsingInstanceNavigations) { + // CHECK to verify that the proxy is being created in the correct + // BrowsingContextState. BrowsingContextState in non-legacy mode is tied to + // the BrowsingInstance, as well as proxies (via SiteInstance) and the right + // BrowsingContextState is needed to be selected to be able to access the + // proxies. As there will be many BrowsingContextState objects, there is + // greater likelihood of the incorrect BrowsingContextState being selected. + // TODO(crbug.com/1270671): Add exception here for outer delegate proxies. + CHECK(browsing_instance_id_.value() == + site_instance->GetBrowsingInstanceId()); + } + auto site_instance_group_id = static_cast<SiteInstanceImpl*>(site_instance)->group()->GetId(); CHECK(proxy_hosts_.find(site_instance_group_id) == proxy_hosts_.end()) @@ -265,4 +282,11 @@ return proxy_host; } +void BrowsingContextState::ResetProxyHosts() { + for (const auto& pair : proxy_hosts_) { + pair.second->site_instance_group()->RemoveObserver(this); + } + proxy_hosts_.clear(); +} + } // namespace content \ No newline at end of file
diff --git a/content/browser/renderer_host/browsing_context_state.h b/content/browser/renderer_host/browsing_context_state.h index ad3b58a..ca51e754 100644 --- a/content/browser/renderer_host/browsing_context_state.h +++ b/content/browser/renderer_host/browsing_context_state.h
@@ -73,8 +73,15 @@ std::unique_ptr<RenderFrameProxyHost>, SiteInstanceGroupId::Hasher>; + // Currently browsing_instance_id| will be null iff the legacy mode is + // enabled, as is the legacy mode BrowsingContextState is 1:1 with + // FrameTreeNode and therefore doesn't have a dedicated associated + // BrowsingInstance. + // TODO(crbug.com/1270671): Make |browsing_instance_id| non-optional when the + // legacy path is removed. BrowsingContextState(blink::mojom::FrameReplicationStatePtr replication_state, - raw_ptr<RenderFrameHostImpl> parent); + raw_ptr<RenderFrameHostImpl> parent, + absl::optional<BrowsingInstanceId> browsing_instance_id); // Returns a const reference to the map of proxy hosts. The keys are // SiteInstanceGroup IDs, the values are RenderFrameProxyHosts. @@ -197,6 +204,10 @@ const scoped_refptr<RenderViewHostImpl>& rvh, FrameTreeNode* frame_tree_node); + // Deletes any proxy hosts associated with this node. Used during destruction + // of WebContentsImpl. + void ResetProxyHosts(); + protected: friend class base::RefCounted<BrowsingContextState>; @@ -214,6 +225,15 @@ // Parent document of this BrowsingContextState, might be null if this is a // main frame BrowsingContextState. const raw_ptr<RenderFrameHostImpl> parent_; + + // ID of the BrowsingInstance to which this BrowsingContextState belongs. + // Currently browsing_instance_id| will be null iff the legacy mode is + // enabled, as is the legacy mode BrowsingContextState is 1:1 with + // FrameTreeNode and therefore doesn't have a dedicated associated + // BrowsingInstance. + // TODO(crbug.com/1270671): Make |browsing_instance_id| non-optional when the + // legacy path is removed. + const absl::optional<BrowsingInstanceId> browsing_instance_id_; }; } // namespace content
diff --git a/content/browser/renderer_host/frame_tree.cc b/content/browser/renderer_host/frame_tree.cc index 0db8fd4b..8d1a0959 100644 --- a/content/browser/renderer_host/frame_tree.cc +++ b/content/browser/renderer_host/frame_tree.cc
@@ -196,8 +196,6 @@ // The top-level frame must always be in a // document scope. blink::mojom::TreeScopeType::kDocument, - std::string(), - std::string(), false, base::UnguessableToken::Create(), blink::mojom::FrameOwnerProperties(), @@ -354,8 +352,8 @@ CHECK_EQ(parent->GetProcess()->GetID(), process_id); std::unique_ptr<FrameTreeNode> new_node = base::WrapUnique(new FrameTreeNode( - this, parent, scope, frame_name, frame_unique_name, is_created_by_script, - devtools_frame_token, frame_owner_properties, owner_type, frame_policy)); + this, parent, scope, is_created_by_script, devtools_frame_token, + frame_owner_properties, owner_type, frame_policy)); // Set sandbox flags and container policy and make them effective immediately, // since initial sandbox flags and permissions policy should apply to the @@ -371,9 +369,9 @@ new_node->set_was_discarded(); // Add the new node to the FrameTree, creating the RenderFrameHost. - FrameTreeNode* added_node = - parent->AddChild(std::move(new_node), new_routing_id, - std::move(frame_remote), frame_token, frame_policy); + FrameTreeNode* added_node = parent->AddChild( + std::move(new_node), new_routing_id, std::move(frame_remote), frame_token, + frame_policy, frame_name, frame_unique_name); added_node->SetFencedFrameNonceIfNeeded(); @@ -640,7 +638,7 @@ // Ensure frames that are about to be deleted aren't visible from the other // processes anymore. - frame->render_manager()->ResetProxyHosts(); + frame->GetBrowsingContextStateForSubframe()->ResetProxyHosts(); } void FrameTree::FrameRemoved(FrameTreeNode* frame) { @@ -656,7 +654,8 @@ } bool FrameTree::IsLoading() const { - for (const FrameTreeNode* node : const_cast<FrameTree*>(this)->Nodes()) { + for (const FrameTreeNode* node : + const_cast<FrameTree*>(this)->CollectNodesForIsLoading()) { if (node->IsLoading()) return true; } @@ -843,7 +842,9 @@ // Destroy all subframes now. This notifies observers. root_manager->current_frame_host()->ResetChildren(); - root_manager->ResetProxyHosts(); + root_manager->current_frame_host() + ->browsing_context_state() + ->ResetProxyHosts(); // Manually call the observer methods for the root FrameTreeNode. It is // necessary to manually delete all objects tracking navigations
diff --git a/content/browser/renderer_host/frame_tree.h b/content/browser/renderer_host/frame_tree.h index 319e919..48d18b3 100644 --- a/content/browser/renderer_host/frame_tree.h +++ b/content/browser/renderer_host/frame_tree.h
@@ -427,7 +427,11 @@ // is navigating returns `blink::kInitialLoadProgress`. double GetLoadProgress(); - // Returns true if at least one of the nodes in this FrameTree is loading. + // Returns true if at least one of the nodes in this frame tree or nodes in + // any inner frame tree of the same WebContents is loading. + // + // TODO(crbug.com/1293846): Rename to IsLoadingIncludingInnerFrameTrees() to + // adapt to new logic. bool IsLoading() const; // Set page-level focus in all SiteInstances involved in rendering
diff --git a/content/browser/renderer_host/frame_tree_browsertest.cc b/content/browser/renderer_host/frame_tree_browsertest.cc index f954334..4ba8386 100644 --- a/content/browser/renderer_host/frame_tree_browsertest.cc +++ b/content/browser/renderer_host/frame_tree_browsertest.cc
@@ -879,15 +879,10 @@ RenderFrameHostImpl* fenced_frame_rfh, const std::string& script, net::Error expected_net_error_code = net::OK) { - FencedFrameNavigationObserver observer(fenced_frame_rfh); + TestFrameNavigationObserver observer(fenced_frame_rfh); EXPECT_TRUE(ExecJs(target_rfh, script)); - observer.Wait(expected_net_error_code); - } - - void WaitForDidStopLoadingForTesting(RenderFrameHostImpl* fenced_frame_rfh) { - FencedFrame* fenced_frame = - GetMatchingFencedFrameInOuterFrameTree(fenced_frame_rfh); - fenced_frame->WaitForDidStopLoadingForTesting(); + observer.Wait(); + EXPECT_EQ(observer.last_net_error_code(), expected_net_error_code); } FrameTreeNode* AddIframeInFencedFrame(FrameTreeNode* fenced_frame, @@ -1117,7 +1112,7 @@ https_server()->GetURL("a.test", "/fenced_frames/title1.html"); std::string navigate_urn_script = JsReplace("f.src = $1;", urn_uuid.spec()); - FencedFrameNavigationObserver observer( + TestFrameNavigationObserver observer( fenced_frame_root_node->current_frame_host()); EXPECT_EQ(urn_uuid.spec(), EvalJs(root, navigate_urn_script)); @@ -1142,7 +1137,7 @@ EXPECT_FALSE(url_mapping.HasObserverForTesting(urn_uuid, request)); - observer.Wait(net::OK); + observer.Wait(); EXPECT_EQ( mapped_url, @@ -1177,7 +1172,7 @@ const GURL urn_uuid = url_mapping.GeneratePendingMappedURN(); std::string navigate_urn_script = JsReplace("f.src = $1;", urn_uuid.spec()); - FencedFrameNavigationObserver observer( + TestFrameNavigationObserver observer( fenced_frame_root_node->current_frame_host()); EXPECT_EQ(urn_uuid.spec(), EvalJs(root, navigate_urn_script)); @@ -1202,7 +1197,8 @@ EXPECT_FALSE(url_mapping.HasObserverForTesting(urn_uuid, request)); - observer.Wait(net::ERR_INVALID_URL); + observer.Wait(); + EXPECT_EQ(observer.last_net_error_code(), net::ERR_INVALID_URL); } IN_PROC_BROWSER_TEST_P( @@ -1235,7 +1231,7 @@ https_server()->GetURL("a.test", "/fenced_frames/title1.html"); std::string navigate_urn_script = JsReplace("f.src = $1;", urn_uuid.spec()); - FencedFrameNavigationObserver observer( + TestFrameNavigationObserver observer( fenced_frame_root_node->current_frame_host()); EXPECT_EQ(urn_uuid.spec(), EvalJs(root, navigate_urn_script)); @@ -1264,7 +1260,7 @@ EXPECT_FALSE(url_mapping.HasObserverForTesting(urn_uuid, request)); - observer.Wait(net::OK); + observer.Wait(); EXPECT_EQ( new_url, @@ -2081,7 +2077,7 @@ EXPECT_EQ(root->navigator().controller().GetEntryCount(), fenced_frame->navigator().controller().GetEntryCount()); } else { - WaitForDidStopLoadingForTesting(fenced_frame->current_frame_host()); + EXPECT_TRUE(WaitForLoadStop(shell()->web_contents())); EXPECT_EQ(1, fenced_frame->navigator().controller().GetEntryCount()); } EXPECT_EQ(fenced_frame_url_1, @@ -2132,7 +2128,7 @@ EXPECT_EQ(fenced_frame_url_2, fenced_frame->current_frame_host()->GetLastCommittedURL()); } else { - WaitForDidStopLoadingForTesting(fenced_frame->current_frame_host()); + EXPECT_TRUE(WaitForLoadStop(shell()->web_contents())); EXPECT_EQ(1, fenced_frame->navigator().controller().GetEntryCount()); EXPECT_EQ(fenced_frame_url_1, fenced_frame->current_frame_host()->GetLastCommittedURL());
diff --git a/content/browser/renderer_host/frame_tree_node.cc b/content/browser/renderer_host/frame_tree_node.cc index 1ffa17f3..6b8be41b 100644 --- a/content/browser/renderer_host/frame_tree_node.cc +++ b/content/browser/renderer_host/frame_tree_node.cc
@@ -108,8 +108,6 @@ FrameTree* frame_tree, RenderFrameHostImpl* parent, blink::mojom::TreeScopeType tree_scope_type, - const std::string& name, - const std::string& unique_name, bool is_created_by_script, const base::UnguessableToken& devtools_frame_token, const blink::mojom::FrameOwnerProperties& frame_owner_properties, @@ -125,11 +123,7 @@ devtools_frame_token_(devtools_frame_token), frame_owner_properties_(frame_owner_properties), blame_context_(frame_tree_node_id_, FrameTreeNode::From(parent)), - render_manager_(this, - frame_tree->manager_delegate(), - name, - unique_name, - frame_policy) { + render_manager_(this, frame_tree->manager_delegate()) { std::pair<FrameTreeNodeIdMap::iterator, bool> result = g_frame_tree_node_id_map.Get().insert( std::make_pair(frame_tree_node_id_, this)); @@ -395,7 +389,7 @@ } void FrameTreeNode::SetCollapsed(bool collapsed) { - DCHECK(!IsMainFrame()); + DCHECK(!IsMainFrame() || IsFencedFrameRoot()); if (is_collapsed_ == collapsed) return; @@ -488,7 +482,7 @@ DCHECK(!navigation_request->common_params().url.SchemeIs( url::kJavaScriptScheme)); - bool was_previously_loading = frame_tree()->IsLoading(); + bool was_previously_loading = frame_tree()->LoadingTree()->IsLoading(); // There's no need to reset the state: there's still an ongoing load, and the // RenderFrameHostManager will take care of updates to the speculative @@ -537,12 +531,17 @@ "should_show_loading_ui ", should_show_loading_ui); base::ElapsedTimer timer; - frame_tree_->DidStartLoadingNode(*this, should_show_loading_ui, - was_previously_loading); + frame_tree()->LoadingTree()->DidStartLoadingNode( + *this, should_show_loading_ui, was_previously_loading); // Set initial load progress and update overall progress. This will notify // the WebContents of the load progress change. - DidChangeLoadProgress(blink::kInitialLoadProgress); + // + // Only notify when the load is triggered from primary/prerender main frame as + // we only update load progress for these nodes which happens when the frame + // tree matches the loading tree. + if (frame_tree() == frame_tree()->LoadingTree()) + DidChangeLoadProgress(blink::kInitialLoadProgress); // Notify the RenderFrameHostManager of the event. render_manager()->OnDidStartLoading(); @@ -557,12 +556,22 @@ frame_tree_node_id()); // Set final load progress and update overall progress. This will notify // the WebContents of the load progress change. - DidChangeLoadProgress(blink::kFinalLoadProgress); + // + // Only notify when the load is triggered from primary/prerender main frame as + // we only update load progress for these nodes which happens when the frame + // tree matches the loading tree. + if (frame_tree() == frame_tree()->LoadingTree()) + DidChangeLoadProgress(blink::kFinalLoadProgress); // Notify the RenderFrameHostManager of the event. render_manager()->OnDidStopLoading(); - frame_tree_->DidStopLoadingNode(*this); + FrameTree* loading_tree = frame_tree()->LoadingTree(); + // When loading tree is null, ignore invoking DidStopLoadingNode as the frame + // tree is already deleted. This can happen when prerendering gets cancelled + // and DidStopLoading is called during FrameTree destruction. + if (loading_tree) + loading_tree->DidStopLoadingNode(*this); } void FrameTreeNode::DidChangeLoadProgress(double load_progress) { @@ -639,7 +648,8 @@ } } - render_manager_.browsing_context_state()->set_has_active_user_gesture(true); + current_frame_host()->browsing_context_state()->set_has_active_user_gesture( + true); absl::optional<base::UnguessableToken> originator_nonce = fenced_frame_nonce(); @@ -692,14 +702,16 @@ node->user_activation_state_.ConsumeIfActive(); } - render_manager_.browsing_context_state()->set_has_active_user_gesture(false); + current_frame_host()->browsing_context_state()->set_has_active_user_gesture( + false); return was_active; } bool FrameTreeNode::ClearUserActivation() { for (FrameTreeNode* node : frame_tree()->SubtreeNodes(this)) node->user_activation_state_.Clear(); - render_manager_.browsing_context_state()->set_has_active_user_gesture(false); + current_frame_host()->browsing_context_state()->set_has_active_user_gesture( + false); return true; } @@ -806,42 +818,11 @@ } bool FrameTreeNode::IsFencedFrameRoot() const { - if (!blink::features::IsFencedFramesEnabled()) - return false; - - switch (blink::features::kFencedFramesImplementationTypeParam.Get()) { - case blink::features::FencedFramesImplementationType::kMPArch: { - return IsMainFrame() && - frame_tree()->type() == FrameTree::Type::kFencedFrame; - } - case blink::features::FencedFramesImplementationType::kShadowDOM: { - return effective_frame_policy().is_fenced; - } - default: - return false; - } + return current_frame_host()->IsFencedFrameRootNoStatus(); } bool FrameTreeNode::IsInFencedFrameTree() const { - if (!blink::features::IsFencedFramesEnabled()) - return false; - - switch (blink::features::kFencedFramesImplementationTypeParam.Get()) { - case blink::features::FencedFramesImplementationType::kMPArch: - return frame_tree()->type() == FrameTree::Type::kFencedFrame; - case blink::features::FencedFramesImplementationType::kShadowDOM: { - auto* node = this; - while (node) { - if (node->effective_frame_policy().is_fenced) { - return true; - } - node = node->parent() ? node->parent()->frame_tree_node() : nullptr; - } - return false; - } - default: - return false; - } + return current_frame_host()->IsInFencedFrameTree(); } void FrameTreeNode::SetFencedFrameNonceIfNeeded() {
diff --git a/content/browser/renderer_host/frame_tree_node.h b/content/browser/renderer_host/frame_tree_node.h index 2383cde..1bd43bb 100644 --- a/content/browser/renderer_host/frame_tree_node.h +++ b/content/browser/renderer_host/frame_tree_node.h
@@ -91,8 +91,6 @@ FrameTree* frame_tree, RenderFrameHostImpl* parent, blink::mojom::TreeScopeType tree_scope_type, - const std::string& name, - const std::string& unique_name, bool is_created_by_script, const base::UnguessableToken& devtools_frame_token, const blink::mojom::FrameOwnerProperties& frame_owner_properties, @@ -231,6 +229,9 @@ return render_manager_.current_replication_state().origin; } + // Set the current name and notify proxies about the update. + void SetFrameName(const std::string& name, const std::string& unique_name); + // Returns the latest frame policy (sandbox flags and container policy) for // this frame. This includes flags inherited from parent frames and the latest // flags from the <iframe> element hosting this frame. The returned policies @@ -520,7 +521,8 @@ // is implemented to utilize the new path. void set_frame_name_for_activation(const std::string& unique_name, const std::string& name) { - render_manager_.browsing_context_state()->set_frame_name(unique_name, name); + current_frame_host()->browsing_context_state()->set_frame_name(unique_name, + name); } // Returns true if error page isolation is enabled.
diff --git a/content/browser/renderer_host/navigation_controller_impl_unittest.cc b/content/browser/renderer_host/navigation_controller_impl_unittest.cc index ae00576..15e6346 100644 --- a/content/browser/renderer_host/navigation_controller_impl_unittest.cc +++ b/content/browser/renderer_host/navigation_controller_impl_unittest.cc
@@ -1460,13 +1460,11 @@ } // Tests that webkit preferences are updated when user agent override changes. -// Fails on linux-bfcache-rel: crbug.com/1244109 -#if BUILDFLAG(IS_LINUX) -#define MAYBE_GoBackWithUserAgentOverrideChange DISABLED_GoBackWithUserAgentOverrideChange -#else -#define MAYBE_GoBackWithUserAgentOverrideChange GoBackWithUserAgentOverrideChange -#endif -TEST_F(NavigationControllerTest, MAYBE_GoBackWithUserAgentOverrideChange) { +TEST_F(NavigationControllerTest, GoBackWithUserAgentOverrideChange) { + // The test requires that going back will load a new document instead of + // restoring an old one from the back/forward cache. + DisableBackForwardCacheForTesting(RenderViewHostTestHarness::web_contents(), + BackForwardCache::TEST_REQUIRES_NO_CACHING); NavigationControllerImpl& controller = controller_impl(); // Set up a simple NavigationEntry stack of two pages.
diff --git a/content/browser/renderer_host/navigation_request.cc b/content/browser/renderer_host/navigation_request.cc index c2aee0a..18d0555 100644 --- a/content/browser/renderer_host/navigation_request.cc +++ b/content/browser/renderer_host/navigation_request.cc
@@ -1915,6 +1915,7 @@ void NavigationRequest::OnFencedFrameURLMappingComplete( absl::optional<GURL> mapped_url, + absl::optional<AdAuctionData> ad_auction_data, absl::optional<FencedFrameURLMapping::PendingAdComponentsMap> pending_ad_components_map) { is_deferred_on_fenced_frame_url_mapping_ = false; @@ -3010,8 +3011,12 @@ // response yet and don't have the final `sandbox_flags_to_commit_`, and // if the state of the kOrigin flag changes, we'll detect the change and // recompute the target SiteInstance elsewhere. + // Note: We don't try to process-isolate about:blank URLs since that would + // prevent the parent frame from interacting with them, and they would be + // stuck as empty content. bool is_origin_restricted_sandbox = false; - if (SiteIsolationPolicy::AreIsolatedSandboxedIframesEnabled()) { + if (SiteIsolationPolicy::AreIsolatedSandboxedIframesEnabled() && + !GetURL().IsAboutBlank()) { if (state_ >= WILL_PROCESS_RESPONSE) { is_origin_restricted_sandbox = (policy_container_navigation_bundle_->FinalPolicies().sandbox_flags & @@ -3631,15 +3636,8 @@ return; if (collapse_frame) { - bool is_inner_frame_tree = - frame_tree_node_->frame_tree()->type() == FrameTree::Type::kFencedFrame; - FrameTreeNode* node_to_collapse = - is_inner_frame_tree - ? frame_tree_node_->render_manager()->GetOuterDelegateNode() - : frame_tree_node_; - DCHECK_EQ(net::ERR_BLOCKED_BY_CLIENT, status.error_code); - node_to_collapse->SetCollapsed(true); + frame_tree_node_->SetCollapsed(true); } is_mhtml_or_subframe_ = false;
diff --git a/content/browser/renderer_host/navigation_request.h b/content/browser/renderer_host/navigation_request.h index 3f3df63..6c23187e 100644 --- a/content/browser/renderer_host/navigation_request.h +++ b/content/browser/renderer_host/navigation_request.h
@@ -983,6 +983,7 @@ // resume the deferred navigation. void OnFencedFrameURLMappingComplete( absl::optional<GURL> mapped_url, + absl::optional<AdAuctionData> ad_auction_data, absl::optional<FencedFrameURLMapping::PendingAdComponentsMap> pending_ad_components_map) override;
diff --git a/content/browser/renderer_host/navigation_request_browsertest.cc b/content/browser/renderer_host/navigation_request_browsertest.cc index 5f73afd..6dfe3c361 100644 --- a/content/browser/renderer_host/navigation_request_browsertest.cc +++ b/content/browser/renderer_host/navigation_request_browsertest.cc
@@ -3591,7 +3591,7 @@ EXPECT_TRUE(navigation_handle->ShouldUpdateHistory()); })); - // Navigate the primary pagea. + // Navigate the primary page. EXPECT_TRUE( NavigateToURL(shell(), embedded_test_server()->GetURL("/title1.html"))); }
diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc index 4c37ccc..5bd6efc 100644 --- a/content/browser/renderer_host/render_frame_host_impl.cc +++ b/content/browser/renderer_host/render_frame_host_impl.cc
@@ -272,6 +272,11 @@ #include "content/browser/renderer_host/render_view_host_delegate_view.h" #endif +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#include "content/browser/accessibility/ax_screen_ai_annotator.h" +#include "ui/accessibility/accessibility_features.h" +#endif + namespace content { #if defined(AX_FAIL_FAST_BUILD) @@ -1390,8 +1395,8 @@ code_cache_host_receivers_( GetProcess()->GetStoragePartition()->GetGeneratedCodeCacheContext()), fenced_frame_status_( - frame_tree_node_->IsInFencedFrameTree() - ? (frame_tree_node_->IsFencedFrameRoot() + IsInFencedFrameTree() + ? (IsFencedFrameRootNoStatus() ? FencedFrameStatus::kFencedFrameRoot : FencedFrameStatus::kIframeNestedWithinFencedFrame) : FencedFrameStatus::kNotNestedInFencedFrame) { @@ -1919,6 +1924,57 @@ return fenced_frame_status_ == FencedFrameStatus::kFencedFrameRoot; } +bool RenderFrameHostImpl::IsFencedFrameRootNoStatus() { + if (!blink::features::IsFencedFramesEnabled()) + return false; + + switch (blink::features::kFencedFramesImplementationTypeParam.Get()) { + case blink::features::FencedFramesImplementationType::kMPArch: { + return is_main_frame() && + frame_tree()->type() == FrameTree::Type::kFencedFrame; + } + case blink::features::FencedFramesImplementationType::kShadowDOM: { + // Different from the MPArch case, the ShadowDOM implementation of fenced + // frame lives in the same FrameTree as its parent, so we need to check + // its effective frame policy instead. + return browsing_context_state_->effective_frame_policy().is_fenced; + } + default: + return false; + } +} + +bool RenderFrameHostImpl::IsInFencedFrameTree() { + if (!blink::features::IsFencedFramesEnabled()) + return false; + + switch (blink::features::kFencedFramesImplementationTypeParam.Get()) { + case blink::features::FencedFramesImplementationType::kMPArch: + return frame_tree()->type() == FrameTree::Type::kFencedFrame; + case blink::features::FencedFramesImplementationType::kShadowDOM: { + // FrameTreeNode may not necessarily be initialized in which case, + // determining fenced frame information will require a valid + // RenderFrameHost. + if (browsing_context_state_->effective_frame_policy().is_fenced) { + return true; + } + + RenderFrameHostImpl* node = GetParent(); + while (node) { + if (node->browsing_context_state() + ->effective_frame_policy() + .is_fenced) { + return true; + } + node = node->GetParent() ? node->GetParent() : nullptr; + } + return false; + } + default: + return false; + } +} + bool RenderFrameHostImpl::IsNestedWithinFencedFrame() { switch (fenced_frame_status_) { case FencedFrameStatus::kNotNestedInFencedFrame: @@ -2571,9 +2627,33 @@ view->SetLastPointerType(ui::EventPointerType::kTouch); } +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) + if (action_data.action == ax::mojom::Action::kRunScreenAi) { + RunScreenAIAnnotator(); + return; + } +#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) + render_accessibility_->PerformAction(action_data); } +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +void RenderFrameHostImpl::RunScreenAIAnnotator() { + if (!features::IsScreenAIEnabled()) + return; + if (!ax_screen_ai_annotator_) { + mojo::AssociatedRemote<screen_ai::mojom::ScreenAIAnnotator> + screen_ai_annotator; + GetRemoteAssociatedInterfaces()->GetInterface(&screen_ai_annotator); + + ax_screen_ai_annotator_ = std::make_unique<AXScreenAIAnnotator>( + this, std::move(screen_ai_annotator)); + } + + ax_screen_ai_annotator_->Run(); +} +#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) + bool RenderFrameHostImpl::AccessibilityViewHasFocus() { RenderWidgetHostView* view = render_view_host_->GetWidget()->GetView(); if (view) @@ -3814,13 +3894,15 @@ int frame_routing_id, mojo::PendingAssociatedRemote<mojom::Frame> frame_remote, const blink::LocalFrameToken& frame_token, - const blink::FramePolicy& frame_policy) { + const blink::FramePolicy& frame_policy, + std::string frame_name, + std::string frame_unique_name) { // Initialize the RenderFrameHost for the new node. We always create child // frames in the same SiteInstance as the current frame, and they can swap to // a different one if they navigate away. - child->render_manager()->InitChild(GetSiteInstance(), frame_routing_id, - std::move(frame_remote), frame_token, - frame_policy); + child->render_manager()->InitChild( + GetSiteInstance(), frame_routing_id, std::move(frame_remote), frame_token, + frame_policy, frame_name, frame_unique_name); // Other renderer processes in this BrowsingInstance may need to find out // about the new frame. Create a proxy for the child frame in all @@ -4022,8 +4104,8 @@ void RenderFrameHostImpl::DidFocusFrame() { TRACE_EVENT("navigation", "RenderFrameHostImpl::DidFocusFrame", ChromeTrackEvent::kRenderFrameHost, *this, - ChromeTrackEvent::kSiteInstance, - *static_cast<SiteInstanceImpl*>(GetSiteInstance())); + ChromeTrackEvent::kSiteInstanceGroup, + *GetSiteInstance()->group()); // We don't handle this IPC signal for non-active RenderFrameHost. if (!IsActive()) return; @@ -5720,7 +5802,10 @@ } void RenderFrameHostImpl::DidChangeLoadProgress(double load_progress) { - if (!is_main_frame()) + // We should not be invoking DidChangeLoadProgress for subframes or fenced + // frames as we only update the observers for primary/ prerender main frame + // load progress change. + if (!is_main_frame() || IsFencedFrameRoot()) return; if (load_progress < GetPage().load_progress()) @@ -8564,7 +8649,7 @@ // the renderer process is done handling the URL. // TODO(crbug.com/1254130): Remove the test dependency on this behavior. if (!url.SchemeIs(url::kJavaScriptScheme)) { - bool was_loading = frame_tree()->IsLoading(); + bool was_loading = frame_tree()->LoadingTree()->IsLoading(); is_loading_ = true; frame_tree_node()->DidStartLoading(true /* should_show_loading_ui */, was_loading); @@ -10753,7 +10838,6 @@ // racy DidStopLoading Mojo method resets the loading state that was set to // true in CommitNavigation. if (!is_loading()) { - bool was_loading = frame_tree()->IsLoading(); // In general, loading ui is only shown for cross-document navigations, // because same-document navigations are already complete by the time the // renderer notifies the browser process of the navigation. @@ -10764,6 +10848,8 @@ same_document_params->same_document_navigation_type == blink::mojom::SameDocumentNavigationType:: kAppHistoryTransitionWhile; + + bool was_loading = frame_tree()->LoadingTree()->IsLoading(); is_loading_ = true; frame_tree_node()->DidStartLoading(should_show_loading_ui, was_loading); } @@ -12703,11 +12789,13 @@ } RenderFrameHostImpl* RenderFrameHostImpl::GetParentOrOuterDocument() { - return frame_tree_node()->GetParentOrOuterDocument(); + return frame_tree_node()->GetParentOrOuterDocumentHelper( + /*escape_guest_view=*/false); } RenderFrameHostImpl* RenderFrameHostImpl::GetParentOrOuterDocumentOrEmbedder() { - return frame_tree_node()->GetParentOrOuterDocumentOrEmbedder(); + return frame_tree_node()->GetParentOrOuterDocumentHelper( + /*escape_guest_view=*/true); } RenderFrameHostImpl* RenderFrameHostImpl::GetOutermostMainFrameOrEmbedder() { @@ -13105,8 +13193,9 @@ switch (features::GetBrowsingContextMode()) { case (features::BrowsingContextStateImplementationType:: kLegacyOneToOneWithFrameTreeNode): - browsing_context_state_ = - frame_tree_node_->render_manager()->browsing_context_state(); + browsing_context_state_ = frame_tree_node_->render_manager() + ->current_frame_host() + ->browsing_context_state(); break; case (features::BrowsingContextStateImplementationType:: kSwapForCrossBrowsingInstanceNavigations):
diff --git a/content/browser/renderer_host/render_frame_host_impl.h b/content/browser/renderer_host/render_frame_host_impl.h index 14751c9a..e25974b 100644 --- a/content/browser/renderer_host/render_frame_host_impl.h +++ b/content/browser/renderer_host/render_frame_host_impl.h
@@ -197,6 +197,7 @@ } // namespace internal class AgentSchedulingGroupHost; +class AXScreenAIAnnotator; class BrowsingContextState; class CodeCacheHostImpl; class CrossOriginEmbedderPolicyReporter; @@ -634,7 +635,9 @@ int frame_routing_id, mojo::PendingAssociatedRemote<mojom::Frame> frame_remote, const blink::LocalFrameToken& frame_token, - const blink::FramePolicy& frame_policy); + const blink::FramePolicy& frame_policy, + std::string frame_name, + std::string frame_unique_name); void RemoveChild(FrameTreeNode* child); void ResetChildren(); @@ -2415,7 +2418,7 @@ // Returns the BrowsingContextState associated with this RenderFrameHostImpl. // See class comments in BrowsingContextState for a more detailed description. - scoped_refptr<BrowsingContextState>& browsing_context_state() { + const scoped_refptr<BrowsingContextState>& browsing_context_state() const { return browsing_context_state_; } @@ -2443,6 +2446,19 @@ // TODO(https://crbug.com/1262098): used to track down crash. std::unique_ptr<CheckOnDeleteRef> EnableCheckIfDeleted(); + // TODO: While FencedFrame shadow DOM implementation exists and is dependent + // on the effective frame policy in BrowsingContextState, fenced frame status + // is dependent on FrameTreeNode being initialized and associated with a + // RenderFrameHostImpl. However, it may need to be accessed before node + // initialization, which is the reason for these methods. For example, + // RenderFrameHostImpl needs to have access to the effective frame policy + // (which is stored in FrameReplicationState), and we need to call this + // inside RenderFrameHostImpl's constructor (where FrameTreeNode doesn't + // have current RenderFrameHost yet). Remove these methods when shadow DOM is + // also removed. + bool IsFencedFrameRootNoStatus(); + bool IsInFencedFrameTree(); + protected: friend class RenderFrameHostFactory; @@ -3303,6 +3319,10 @@ perfetto::protos::pbzero::RenderFrameHost::LifecycleState LifecycleStateToProto(); +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) + void RunScreenAIAnnotator(); +#endif + // The RenderViewHost that this RenderFrameHost is associated with. // // It is kept alive as long as any RenderFrameHosts or RenderFrameProxyHosts @@ -4131,6 +4151,11 @@ int check_if_deleted_request_count_ = 0; +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) + // Manages the snapshot processing by Screen AI, if enabled. + std::unique_ptr<AXScreenAIAnnotator> ax_screen_ai_annotator_; +#endif + // BrowserInterfaceBroker implementation through which this // RenderFrameHostImpl exposes document-scoped Mojo services to the currently // active document in the corresponding RenderFrame.
diff --git a/content/browser/renderer_host/render_frame_host_manager.cc b/content/browser/renderer_host/render_frame_host_manager.cc index dc16d0d..1a53ff8 100644 --- a/content/browser/renderer_host/render_frame_host_manager.cc +++ b/content/browser/renderer_host/render_frame_host_manager.cc
@@ -274,45 +274,31 @@ } // namespace -RenderFrameHostManager::RenderFrameHostManager( - FrameTreeNode* frame_tree_node, - Delegate* delegate, - const std::string& name, - const std::string& unique_name, - const blink::FramePolicy& frame_policy) - : frame_tree_node_(frame_tree_node), - delegate_(delegate), - browsing_context_state_(base::MakeRefCounted<BrowsingContextState>( - blink::mojom::FrameReplicationState::New( - url::Origin(), - name, - unique_name, - blink::ParsedPermissionsPolicy(), - network::mojom::WebSandboxFlags::kNone, - frame_policy, - // should enforce strict mixed content checking - blink::mojom::InsecureRequestPolicy::kLeaveInsecureRequestsAlone, - // hashes of hosts for insecure request upgrades - std::vector<uint32_t>(), - false /* has_potentially_trustworthy_unique_origin */, - false /* has_active_user_gesture */, - false /* has_received_user_gesture_before_nav */, - false /* is_ad_subframe */), - frame_tree_node_->parent())) { +RenderFrameHostManager::RenderFrameHostManager(FrameTreeNode* frame_tree_node, + Delegate* delegate) + : frame_tree_node_(frame_tree_node), delegate_(delegate) { DCHECK(frame_tree_node_); } RenderFrameHostManager::~RenderFrameHostManager() { DCHECK(!speculative_render_frame_host_); + // If the current RenderFrameHost doesn't exist, then there is no need to + // destroy proxies, as they are only accessible via RenderFrameHost. This + // only occurs in MPArch activation, as frame trees are destroyed even when + // the root has no associated RenderFrameHost, specifically when + // RenderFrameHost has been moved during activation and the source + // FrameTreeNode is being destroyed. + if (!render_frame_host_) { + return; + } // Delete any RenderFrameProxyHosts. It is important to delete those prior to // deleting the current RenderFrameHost, since the CrossProcessFrameConnector // (owned by RenderFrameProxyHost) points to the RenderWidgetHostView // associated with the current RenderFrameHost and uses it during its // destructor. - ResetProxyHosts(); + render_frame_host_->browsing_context_state()->ResetProxyHosts(); - // We should always have a current RenderFrameHost except in some tests. SetRenderFrameHost(nullptr); } @@ -321,13 +307,32 @@ bool renderer_initiated_creation, blink::FramePolicy initial_main_frame_policy, const std::string& name) { - browsing_context_state_->CommitFramePolicy(initial_main_frame_policy); - browsing_context_state_->SetFrameName(name, ""); + scoped_refptr<BrowsingContextState> browsing_context_state = + base::MakeRefCounted<BrowsingContextState>( + blink::mojom::FrameReplicationState::New( + url::Origin(), name, "", blink::ParsedPermissionsPolicy(), + network::mojom::WebSandboxFlags::kNone, initial_main_frame_policy, + // should enforce strict mixed content checking + blink::mojom::InsecureRequestPolicy::kLeaveInsecureRequestsAlone, + // hashes of hosts for insecure request upgrades + std::vector<uint32_t>(), + false /* has_potentially_trustworthy_unique_origin */, + false /* has_active_user_gesture */, + false /* has_received_user_gesture_before_nav */, + false /* is_ad_subframe */), + frame_tree_node_->parent(), + features::GetBrowsingContextMode() == + features::BrowsingContextStateImplementationType:: + kLegacyOneToOneWithFrameTreeNode + ? static_cast<absl::optional<BrowsingInstanceId>>(absl::nullopt) + : site_instance->GetBrowsingInstanceId()); + browsing_context_state->CommitFramePolicy(initial_main_frame_policy); + browsing_context_state->SetFrameName(name, ""); SetRenderFrameHost(CreateRenderFrameHost( CreateFrameCase::kInitRoot, site_instance, /*frame_routing_id=*/MSG_ROUTING_NONE, mojo::PendingAssociatedRemote<mojom::Frame>(), blink::LocalFrameToken(), - renderer_initiated_creation, browsing_context_state_)); + renderer_initiated_creation, browsing_context_state)); // Creating a main RenderFrameHost also creates a new Page, so notify the // delegate about this. @@ -340,12 +345,34 @@ int32_t frame_routing_id, mojo::PendingAssociatedRemote<mojom::Frame> frame_remote, const blink::LocalFrameToken& frame_token, - blink::FramePolicy frame_policy) { - browsing_context_state_->CommitFramePolicy(frame_policy); + blink::FramePolicy frame_policy, + std::string frame_name, + std::string frame_unique_name) { + scoped_refptr<BrowsingContextState> browsing_context_state = + base::MakeRefCounted<BrowsingContextState>( + blink::mojom::FrameReplicationState::New( + url::Origin(), frame_name, frame_unique_name, + blink::ParsedPermissionsPolicy(), + network::mojom::WebSandboxFlags::kNone, frame_policy, + // should enforce strict mixed content checking + blink::mojom::InsecureRequestPolicy::kLeaveInsecureRequestsAlone, + // hashes of hosts for insecure request upgrades + std::vector<uint32_t>(), + false /* has_potentially_trustworthy_unique_origin */, + false /* has_active_user_gesture */, + false /* has_received_user_gesture_before_nav */, + false /* is_ad_subframe */), + frame_tree_node_->parent(), + features::GetBrowsingContextMode() == + features::BrowsingContextStateImplementationType:: + kLegacyOneToOneWithFrameTreeNode + ? static_cast<absl::optional<BrowsingInstanceId>>(absl::nullopt) + : site_instance->GetBrowsingInstanceId()); + browsing_context_state->CommitFramePolicy(frame_policy); SetRenderFrameHost(CreateRenderFrameHost( CreateFrameCase::kInitChild, site_instance, frame_routing_id, std::move(frame_remote), frame_token, - /*renderer_initiated_creation=*/false, browsing_context_state_)); + /*renderer_initiated_creation=*/false, browsing_context_state)); } RenderWidgetHostViewBase* RenderFrameHostManager::GetRenderWidgetHostView() @@ -497,8 +524,9 @@ // policy not to introduce a communication channel. CHECK(frame_tree_node_->IsFencedFrameRoot()); } else { - browsing_context_state_->SendFramePolicyUpdatesToProxies( - frame_tree_node_->parent()->GetSiteInstance(), frame_policy); + render_frame_host_->browsing_context_state() + ->SendFramePolicyUpdatesToProxies( + frame_tree_node_->parent()->GetSiteInstance(), frame_policy); } } } @@ -574,7 +602,8 @@ frame_tree_node_->SetOpener(opener); - for (const auto& pair : browsing_context_state_->proxy_hosts()) { + for (const auto& pair : + render_frame_host_->browsing_context_state()->proxy_hosts()) { if (pair.second->GetSiteInstance() == source_site_instance) continue; pair.second->UpdateOpener(); @@ -616,7 +645,8 @@ kSwapForCrossBrowsingInstanceNavigations) { return; } - for (auto& it : browsing_context_state_->proxy_hosts()) { + for (auto& it : + main_render_frame_host->browsing_context_state()->proxy_hosts()) { // This avoids including the proxy created when starting a // new cross-process, cross-BrowsingInstance navigation, as well as any // restored proxies which are also in a different BrowsingInstance. @@ -625,11 +655,12 @@ (*proxy_hosts)[it.first] = std::move(it.second); } } - // Remove the previously extracted proxies from the RenderFrameHostManager, - // which also removes their respective SiteInstanceGroup::Observer. + // Remove the previously extracted proxies from the + // RenderFrameHostManager, which also removes their respective + // SiteInstanceGroup::Observer. for (auto& it : *proxy_hosts) { - browsing_context_state_->DeleteRenderFrameProxyHost( - it.second->site_instance_group()); + main_render_frame_host->browsing_context_state() + ->DeleteRenderFrameProxyHost(it.second->site_instance_group()); } } @@ -853,18 +884,6 @@ stored_page_to_restore_ = std::move(stored_page); } -// TODO(crbug.com/1270671): When this method is migrated to BrowsingContextState -// we need to determine where/when we need to reset proxy hosts. In particular -// we should consider how pending-delete RenderFrameHosts are handled after -// cross-BCG navigations. -void RenderFrameHostManager::ResetProxyHosts() { - for (const auto& pair : browsing_context_state_->proxy_hosts()) { - pair.second->site_instance_group()->RemoveObserver( - browsing_context_state_.get()); - } - browsing_context_state_->proxy_hosts().clear(); -} - void RenderFrameHostManager::ClearRFHsPendingShutdown() { pending_delete_hosts_.clear(); } @@ -1351,16 +1370,27 @@ } void RenderFrameHostManager::OnDidStartLoading() { - for (const auto& pair : browsing_context_state_->proxy_hosts()) + for (const auto& pair : + render_frame_host_->browsing_context_state()->proxy_hosts()) pair.second->GetAssociatedRemoteFrame()->DidStartLoading(); } void RenderFrameHostManager::OnDidStopLoading() { - for (const auto& pair : browsing_context_state_->proxy_hosts()) + for (const auto& pair : + render_frame_host_->browsing_context_state()->proxy_hosts()) pair.second->GetAssociatedRemoteFrame()->DidStopLoading(); } void RenderFrameHostManager::OnDidChangeCollapsedState(bool collapsed) { + // If we are a MPArch fenced frame root then ask the outer delegate node + // to collapse the frame. Note `IsFencedFrameRoot` returns true for + // ShadowDOM as well so we need to check the `FrameTree::Type` as well. + if (frame_tree_node_->IsFencedFrameRoot() && + frame_tree_node_->frame_tree()->type() == FrameTree::Type::kFencedFrame) { + GetProxyToOuterDelegate()->GetAssociatedRemoteFrame()->Collapse(collapsed); + return; + } + DCHECK(frame_tree_node_->parent()); SiteInstanceImpl* parent_site_instance = frame_tree_node_->parent()->GetSiteInstance(); @@ -1401,7 +1431,8 @@ // // TODO(alexmos): It would be sufficient to only send this update to proxies // in the current FrameTree. - for (const auto& pair : browsing_context_state_->proxy_hosts()) { + for (const auto& pair : + render_frame_host_->browsing_context_state()->proxy_hosts()) { if (pair.second->site_instance_group() != parent_instance->group()) { auto properties_for_remote_frame = properties.Clone(); RenderFrameProxyHost* proxy = pair.second.get(); @@ -1445,7 +1476,8 @@ return; } - for (const auto& pair : browsing_context_state_->proxy_hosts()) { + for (const auto& pair : + render_frame_host_->browsing_context_state()->proxy_hosts()) { RenderFrameProxyHost* proxy = pair.second.get(); proxy->GetAssociatedRemoteFrame()->UpdateUserActivationState( update_type, notification_type); @@ -2699,7 +2731,7 @@ if (features::GetBrowsingContextMode() == features::BrowsingContextStateImplementationType:: kLegacyOneToOneWithFrameTreeNode) { - browsing_context_state = browsing_context_state_; + browsing_context_state = render_frame_host_->browsing_context_state(); } else { // For speculative frame hosts, we will need to create a new // BrowsingContextState when we have a cross-BrowsingInstance navigation, @@ -2716,8 +2748,11 @@ new_instance) ? render_frame_host_->browsing_context_state() : base::MakeRefCounted<BrowsingContextState>( - browsing_context_state_->current_replication_state().Clone(), - frame_tree_node_->parent()); + render_frame_host_->browsing_context_state() + ->current_replication_state() + .Clone(), + frame_tree_node_->parent(), + new_instance->GetBrowsingInstanceId()); } CreateProxiesForNewRenderFrameHost(old_instance, new_instance, @@ -2846,8 +2881,7 @@ // If a proxy already exists and is alive, nothing needs to be done. SiteInstanceGroup* group = static_cast<SiteInstanceImpl*>(instance)->group(); RenderFrameProxyHost* proxy = - render_frame_host_->browsing_context_state()->GetRenderFrameProxyHost( - group); + browsing_context_state->GetRenderFrameProxyHost(group); if (proxy && proxy->is_render_frame_proxy_live()) return; @@ -2893,7 +2927,14 @@ ChromeTrackEvent::kFrameTreeNodeInfo, *child); RenderFrameProxyHost* outer_delegate_proxy = IsMainFrameForInnerDelegate() ? GetProxyToOuterDelegate() : nullptr; - for (const auto& pair : browsing_context_state_->proxy_hosts()) { + + // Initial document in the child frame always belongs to the same SiteInstance + // as its parent document, so we iterate over the proxies in the parent frame + // to get a list of SiteInstances to create proxies in for in the child frame. + DCHECK_EQ(render_frame_host_.get(), child->parent()); + + for (const auto& pair : + render_frame_host_->browsing_context_state()->proxy_hosts()) { TRACE_EVENT_INSTANT( "navigation", "RenderFrameHostManager::CreateProxiesForChildFrame_ProxyHost", @@ -3222,7 +3263,7 @@ // Recreate the opener chain. CreateOpenerProxies(render_frame_host->GetSiteInstance(), frame_tree_node_, - browsing_context_state_); + render_frame_host_->browsing_context_state()); // Main frames need both the RenderView and RenderFrame reinitialized, so // use InitRenderView. @@ -3371,14 +3412,16 @@ for (auto& proxy : proxy_hosts_to_restore) { // We only cache pages when swapping BrowsingInstance, so we should // never be reusing SiteInstanceGroups. - CHECK(!base::Contains(browsing_context_state_->proxy_hosts(), - proxy.second->site_instance_group()->GetId())); + CHECK(!base::Contains( + render_frame_host_->browsing_context_state()->proxy_hosts(), + proxy.second->site_instance_group()->GetId())); proxy.second->site_instance_group()->AddObserver( - browsing_context_state_.get()); + render_frame_host_->browsing_context_state().get()); TRACE_EVENT_INSTANT( "navigation", "RenderFrameHostManager::CommitPending_RestoreProxy", ChromeTrackEvent::kRenderFrameProxyHost, *proxy.second); - browsing_context_state_->proxy_hosts().insert(std::move(proxy)); + render_frame_host_->browsing_context_state()->proxy_hosts().insert( + std::move(proxy)); } } @@ -3548,7 +3591,7 @@ // Since the new RenderFrameHost is now committed, there must be no proxies // for its SiteInstance. Delete any existing ones. - old_browsing_context_state->DeleteRenderFrameProxyHost( + render_frame_host_->browsing_context_state()->DeleteRenderFrameProxyHost( render_frame_host_->GetSiteInstance()->group()); // If this is a top-level frame, and COOP triggered a BrowsingInstance swap, @@ -3570,7 +3613,8 @@ } std::vector<RenderFrameProxyHost*> removed_proxies; - for (auto& it : browsing_context_state_->proxy_hosts()) { + for (auto& it : + render_frame_host_->browsing_context_state()->proxy_hosts()) { const auto& proxy = it.second; // The outer delegate proxy is *always* cross-browsing context group, but // it is the only proxy we must preserve. @@ -3592,7 +3636,7 @@ // view to the proxy that belongs to the parent frame's SiteInstance. If this // navigation causes an out-of-process frame to return to the same process as // its parent, the proxy would have been removed from - // browsing_context_state_->proxy_hosts() above. + // render_frame_host_->browsing_context_state()->proxy_hosts() above. // Note: We do this after unloading the old RFH because that may create // the proxy we're looking for. RenderFrameProxyHost* proxy_to_parent_or_outer_delegate = @@ -3824,7 +3868,8 @@ // want to also call it for the outer WebContent's frame as well. RenderFrameProxyHost* outer_delegate_proxy = IsMainFrameForInnerDelegate() ? GetProxyToOuterDelegate() : nullptr; - for (const auto& pair : browsing_context_state_->proxy_hosts()) { + for (const auto& pair : + render_frame_host_->browsing_context_state()->proxy_hosts()) { if (outer_delegate_proxy == pair.second.get()) continue; if (pair.second->GetSiteInstance() == instance_to_skip) @@ -3852,7 +3897,8 @@ // frame as well. RenderFrameProxyHost* outer_delegate_proxy = IsMainFrameForInnerDelegate() ? GetProxyToOuterDelegate() : nullptr; - for (const auto& pair : browsing_context_state_->proxy_hosts()) { + for (const auto& pair : + render_frame_host_->browsing_context_state()->proxy_hosts()) { if (outer_delegate_proxy == pair.second.get()) continue; if (pair.second->GetSiteInstance() == instance_to_skip)
diff --git a/content/browser/renderer_host/render_frame_host_manager.h b/content/browser/renderer_host/render_frame_host_manager.h index e75567c..0f38225 100644 --- a/content/browser/renderer_host/render_frame_host_manager.h +++ b/content/browser/renderer_host/render_frame_host_manager.h
@@ -17,6 +17,7 @@ #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "content/browser/renderer_host/browsing_context_state.h" +#include "content/browser/renderer_host/render_frame_host_impl.h" #include "content/browser/renderer_host/should_swap_browsing_instance.h" #include "content/browser/renderer_host/stored_page.h" #include "content/browser/site_instance_group.h" @@ -172,11 +173,7 @@ // must outlive this class. // // You must call one of the Init*() methods before using this class. - RenderFrameHostManager(FrameTreeNode* frame_tree_node, - Delegate* delegate, - const std::string& name, - const std::string& unique_name, - const blink::FramePolicy& frame_policy); + RenderFrameHostManager(FrameTreeNode* frame_tree_node, Delegate* delegate); RenderFrameHostManager(const RenderFrameHostManager&) = delete; RenderFrameHostManager& operator=(const RenderFrameHostManager&) = delete; @@ -194,7 +191,9 @@ int32_t frame_routing_id, mojo::PendingAssociatedRemote<mojom::Frame> frame_remote, const blink::LocalFrameToken& frame_token, - blink::FramePolicy frame_policy); + blink::FramePolicy frame_policy, + std::string frame_name, + std::string frame_unique_name); // Returns the currently active RenderFrameHost. // @@ -327,10 +326,6 @@ // activations. void ActivatePrerender(std::unique_ptr<StoredPage>); - // Deletes any proxy hosts associated with this node. Used during destruction - // of WebContentsImpl. - void ResetProxyHosts(); - void ClearRFHsPendingShutdown(); void ClearWebUIInstances(); @@ -483,7 +478,7 @@ // SiteInstanceGroup IDs, the values are RenderFrameProxyHosts. const BrowsingContextState::RenderFrameProxyHostMap& GetAllProxyHostsForTesting() const { - return browsing_context_state_->proxy_hosts(); + return render_frame_host_->browsing_context_state()->proxy_hosts(); } // Cancels and destroys the pending or speculative RenderFrameHost if they @@ -555,12 +550,9 @@ // FrameTree immediately after this call. std::unique_ptr<StoredPage> TakePrerenderedPage(); - const scoped_refptr<BrowsingContextState>& browsing_context_state() { - return browsing_context_state_; - } - const blink::mojom::FrameReplicationState& current_replication_state() const { - return browsing_context_state_->current_replication_state(); + return render_frame_host_->browsing_context_state() + ->current_replication_state(); } private: @@ -922,16 +914,6 @@ // Eventually, RenderViewHost will be replaced with a page context. std::unique_ptr<RenderFrameHostImpl> render_frame_host_; - // Temporarily store BrowsingContextState here while it is 1:1 with - // FrameTreeNode and RenderFrameHostManager so we can do an in-place migration - // before starting to create a new BrowsingContextState for - // cross-BrowsingInstance navigations after transitioning the code to get the - // appropriate BrowsingContextState from RenderFrameHost or - // RenderFrameProxyHost. - // TODO(crbug.com/1270671): remove once legacy mode is removed. This work is - // intended to be deprecated quickly. - const scoped_refptr<BrowsingContextState> browsing_context_state_; - // A set of RenderFrameHosts waiting to shut down after swapping out. using RFHPendingDeleteSet = std::set<std::unique_ptr<RenderFrameHostImpl>, base::UniquePtrComparator>;
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc index 6075a250..2afcba9d 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -2275,7 +2275,9 @@ // perfetto::TracedValue` and the one taking `perfetto::TracedProto<...>`). auto dict = std::move(context).WriteDictionary(); dict.Add("id", GetID()); - dict.Add("process_lock", GetProcessLock().ToString()); + // Can be null in the unittests. + if (ChildProcessSecurityPolicyImpl::GetInstance()) + dict.Add("process_lock", GetProcessLock().ToString()); } void RenderProcessHostImpl::EnableBlinkRuntimeFeatures( @@ -2486,8 +2488,8 @@ #endif #if BUILDFLAG(ENABLE_LIBRARY_CDMS) || BUILDFLAG(IS_WIN) - registry->AddInterface( - base::BindRepeating(&KeySystemSupportImpl::BindReceiver)); + AddUIThreadInterface( + registry.get(), base::BindRepeating(&KeySystemSupportImpl::BindReceiver)); #endif AddUIThreadInterface(
diff --git a/content/browser/resources/attribution_reporting/attribution_internals.js b/content/browser/resources/attribution_reporting/attribution_internals.js index e39693f..2b479890 100644 --- a/content/browser/resources/attribution_reporting/attribution_internals.js +++ b/content/browser/resources/attribution_reporting/attribution_internals.js
@@ -426,6 +426,7 @@ this.expiryTime = new Date(mojo.expiryTime); this.sourceType = SourceTypeToText(mojo.sourceType); this.priority = mojo.priority; + this.filterData = JSON.stringify(mojo.filterData, null, ' '); this.debugKey = mojo.debugKey ? mojo.debugKey.value : ''; this.dedupKeys = mojo.dedupKeys.join(', '); this.status = AttributabilityToText(mojo.attributability); @@ -446,6 +447,7 @@ new DateColumn('Expiry Time', (e) => e.expiryTime), new ValueColumn('Source Type', (e) => e.sourceType), new ValueColumn('Priority', (e) => e.priority), + new CodeColumn('Filter Data', (e) => e.filterData), new ValueColumn('Debug Key', (e) => e.debugKey), new ValueColumn('Dedup Keys', (e) => e.dedupKeys, /*compare=*/ null), new ValueColumn('Status', (e) => e.status), @@ -553,6 +555,9 @@ case WebUIAttributionReport_Status.kNoMatchingEventTriggers: this.status = 'Dropped due to no matching event triggers'; break; + case WebUIAttributionReport_Status.kNoMatchingSourceFilterData: + this.status = 'Dropped due to no matching source filter data'; + break; } } } @@ -688,8 +693,8 @@ return 'Unattributable: noised'; case WebUIAttributionSource_Attributability.kReplacedByNewerSource: return 'Unattributable: replaced by newer source'; - case WebUIAttributionSource_Attributability.kReachedAttributionLimit: - return 'Unattributable: reached attribution limit'; + case WebUIAttributionSource_Attributability.kReachedEventLevelAttributionLimit: + return 'Attributable: reached event-level attribution limit'; case WebUIAttributionSource_Attributability.kInternalError: return 'Rejected: internal error'; case WebUIAttributionSource_Attributability.kInsufficientSourceCapacity:
diff --git a/content/browser/shared_storage/shared_storage_browsertest.cc b/content/browser/shared_storage/shared_storage_browsertest.cc index 3803a9fc..16549cd 100644 --- a/content/browser/shared_storage/shared_storage_browsertest.cc +++ b/content/browser/shared_storage/shared_storage_browsertest.cc
@@ -19,6 +19,7 @@ #include "content/public/test/browser_test_utils.h" #include "content/public/test/content_browser_test.h" #include "content/public/test/content_browser_test_utils.h" +#include "content/public/test/test_frame_navigation_observer.h" #include "content/shell/browser/shell.h" #include "content/test/content_browser_test_utils_internal.h" #include "content/test/fenced_frame_test_utils.h" @@ -1010,12 +1011,12 @@ std::string navigate_fenced_frame_to_urn_script = JsReplace("f.src = $1;", urn_uuid); - FencedFrameNavigationObserver observer( + TestFrameNavigationObserver observer( fenced_frame_root_node->current_frame_host()); EXPECT_EQ(urn_uuid, EvalJs(root, navigate_fenced_frame_to_urn_script)); - observer.Wait(net::OK); + observer.Wait(); EXPECT_EQ( https_server()->GetURL("a.test", "/fenced_frames/title1.html"), @@ -1071,7 +1072,7 @@ std::string navigate_fenced_frame_to_urn_script = JsReplace("f.src = $1;", urn_uuid); - FencedFrameNavigationObserver observer( + TestFrameNavigationObserver observer( fenced_frame_root_node->current_frame_host()); EXPECT_EQ(urn_uuid, EvalJs(root, navigate_fenced_frame_to_urn_script)); @@ -1100,7 +1101,7 @@ .GetAttachedWorkletHost() ->ExecutePendingWorkletMessages(); - observer.Wait(net::OK); + observer.Wait(); EXPECT_EQ( https_server()->GetURL("a.test", "/fenced_frames/title1.html"), @@ -1158,12 +1159,12 @@ std::string navigate_fenced_frame_to_urn_script = JsReplace("f.src = $1;", urn_uuid); - FencedFrameNavigationObserver observer1( + TestFrameNavigationObserver observer1( fenced_frame_root_node->current_frame_host()); EXPECT_EQ(urn_uuid, EvalJs(root, navigate_fenced_frame_to_urn_script)); - observer1.Wait(net::OK); + observer1.Wait(); EXPECT_EQ( https_server()->GetURL("a.test", "/fenced_frames/title1.html"), @@ -1185,12 +1186,13 @@ EXPECT_EQ(1U, root->child_count()); fenced_frame_root_node = GetFencedFrameRootNode(root->child_at(0)); - FencedFrameNavigationObserver observer2( + TestFrameNavigationObserver observer2( fenced_frame_root_node->current_frame_host()); EXPECT_EQ(urn_uuid, EvalJs(root, navigate_fenced_frame_to_urn_script)); - observer2.Wait(net::ERR_INVALID_URL); + observer2.Wait(); + EXPECT_EQ(observer2.last_net_error_code(), net::ERR_INVALID_URL); } // Tests that if the URN mapping is not finished before the keep-alive timeout, @@ -1262,7 +1264,7 @@ std::string navigate_fenced_frame_to_urn_script = JsReplace("f.src = $1;", urn_uuid); - FencedFrameNavigationObserver observer( + TestFrameNavigationObserver observer( fenced_frame_root_node->current_frame_host()); EXPECT_EQ(urn_uuid, EvalJs(root, navigate_fenced_frame_to_urn_script)); @@ -1289,7 +1291,8 @@ EXPECT_EQ(0u, test_worklet_host_manager().GetAttachedWorkletHostsCount()); EXPECT_EQ(0u, test_worklet_host_manager().GetKeepAliveWorkletHostsCount()); - observer.Wait(net::ERR_INVALID_URL); + observer.Wait(); + EXPECT_EQ(observer.last_net_error_code(), net::ERR_INVALID_URL); } IN_PROC_BROWSER_TEST_F(SharedStorageBrowserTest, @@ -1340,12 +1343,13 @@ std::string navigate_fenced_frame_to_urn_script = JsReplace("f.src = $1;", urn_uuid); - FencedFrameNavigationObserver observer( + TestFrameNavigationObserver observer( fenced_frame_root_node->current_frame_host()); EXPECT_EQ(urn_uuid, EvalJs(root, navigate_fenced_frame_to_urn_script)); - observer.Wait(net::ERR_INVALID_URL); + observer.Wait(); + EXPECT_EQ(observer.last_net_error_code(), net::ERR_INVALID_URL); } } // namespace content
diff --git a/content/browser/site_instance_group.cc b/content/browser/site_instance_group.cc index 4e88c0c..57ab9a6c 100644 --- a/content/browser/site_instance_group.cc +++ b/content/browser/site_instance_group.cc
@@ -28,7 +28,7 @@ process_->Cleanup(); } -SiteInstanceGroupId SiteInstanceGroup::GetId() { +SiteInstanceGroupId SiteInstanceGroup::GetId() const { return id_; } @@ -83,10 +83,22 @@ observer.RenderProcessGone(this, info); } -void SiteInstanceGroup::WriteIntoTrace(perfetto::TracedValue context) { +void SiteInstanceGroup::WriteIntoTrace(perfetto::TracedValue context) const { auto dict = std::move(context).WriteDictionary(); dict.Add("id", GetId().value()); dict.Add("active_frame_count", active_frame_count_); + dict.Add("process_id", process()->GetID()); +} + +void SiteInstanceGroup::WriteIntoTrace( + perfetto::TracedProto<perfetto::protos::pbzero::SiteInstanceGroup> proto) + const { + proto->set_site_instance_group_id(GetId().value()); + proto->set_active_frame_count(active_frame_count()); + if (process()) { + process()->WriteIntoTrace(proto.WriteNestedMessage( + perfetto::protos::pbzero::SiteInstanceGroup::kProcess)); + } } } // namespace content
diff --git a/content/browser/site_instance_group.h b/content/browser/site_instance_group.h index 848b42d..ee9d06a 100644 --- a/content/browser/site_instance_group.h +++ b/content/browser/site_instance_group.h
@@ -12,6 +12,11 @@ #include "content/browser/renderer_host/agent_scheduling_group_host.h" #include "content/common/content_export.h" #include "content/public/browser/render_process_host_observer.h" +#include "third_party/perfetto/include/perfetto/tracing/traced_proto.h" + +namespace perfetto::protos::pbzero { +class SiteInstanceGroup; +} // namespace perfetto::protos::pbzero namespace content { @@ -75,7 +80,7 @@ SiteInstanceGroup(const SiteInstanceGroup&) = delete; SiteInstanceGroup& operator=(const SiteInstanceGroup&) = delete; - SiteInstanceGroupId GetId(); + SiteInstanceGroupId GetId() const; void AddObserver(Observer* observer); void RemoveObserver(Observer* observer); @@ -92,7 +97,7 @@ // Get the number of active frames which belong to this SiteInstanceGroup. If // there are no active frames left, all frames in this SiteInstanceGroup can // be safely discarded. - size_t active_frame_count() { return active_frame_count_; } + size_t active_frame_count() const { return active_frame_count_; } // `process_` and `agent_scheduling_group_` have to be set together. See // `process_` for more details. @@ -100,8 +105,8 @@ // `process`. void SetProcessAndAgentSchedulingGroup(RenderProcessHost* process); - RenderProcessHost* process() { return process_; } - bool has_process() { return process_ != nullptr; } + RenderProcessHost* process() const { return process_; } + bool has_process() const { return process_ != nullptr; } AgentSchedulingGroupHost& agent_scheduling_group() { DCHECK(agent_scheduling_group_); @@ -112,7 +117,11 @@ return agent_scheduling_group_ != nullptr; } - void WriteIntoTrace(perfetto::TracedValue context); + // Write a representation of this object into a trace. + void WriteIntoTrace(perfetto::TracedValue context) const; + void WriteIntoTrace( + perfetto::TracedProto<perfetto::protos::pbzero::SiteInstanceGroup> proto) + const; private: friend class RefCounted<SiteInstanceGroup>;
diff --git a/content/browser/site_instance_impl.cc b/content/browser/site_instance_impl.cc index 545876d26..fec114f 100644 --- a/content/browser/site_instance_impl.cc +++ b/content/browser/site_instance_impl.cc
@@ -1321,8 +1321,8 @@ dict.Add("browsing_instance_id", GetBrowsingInstanceId().value()); dict.Add("is_default", IsDefaultSiteInstance()); dict.Add("site_info", site_info_); - if (site_instance_group_) - dict.Add("active_rfh_count", site_instance_group_->active_frame_count()); + if (group()) + dict.Add("site_instance_group", group()); } void SiteInstanceImpl::WriteIntoTrace( @@ -1332,8 +1332,11 @@ proto->set_is_default(IsDefaultSiteInstance()); proto->set_has_process(HasProcess()); proto->set_related_active_contents_count(GetRelatedActiveContentsCount()); - if (site_instance_group_) + if (group()) { proto->set_active_rfh_count(site_instance_group_->active_frame_count()); + group()->WriteIntoTrace(proto.WriteNestedMessage( + perfetto::protos::pbzero::SiteInstance::kSiteInstanceGroup)); + } } int SiteInstanceImpl::EstimateOriginAgentClusterOverheadForMetrics() {
diff --git a/content/browser/site_per_process_browsertest.cc b/content/browser/site_per_process_browsertest.cc index fc5909d..f5a11247 100644 --- a/content/browser/site_per_process_browsertest.cc +++ b/content/browser/site_per_process_browsertest.cc
@@ -2579,6 +2579,75 @@ } } +// A test to make sure that about:blank in a sandboxed iframe doesn't get +// process isolation. If it did, it would be impossible for the parent to inject +// any content, and it would be stuck as empty content. +IN_PROC_BROWSER_TEST_P(SitePerProcessIsolatedSandboxedIframeTest, + NotIsolatedSandboxAboutBlankSubframe) { + GURL main_url(embedded_test_server()->GetURL("a.com", "/title1.html")); + EXPECT_TRUE(NavigateToURL(shell(), main_url)); + + // Create sandboxed child frame, with about:blank content. + { + std::string js_str( + "var frame = document.createElement('iframe'); " + "frame.id = 'child_frame'; " + "frame.sandbox = ''; " + "frame.src = 'about:blank'; " + "document.body.appendChild(frame);"); + EXPECT_TRUE(ExecJs(shell(), js_str)); + ASSERT_TRUE(WaitForLoadStop(shell()->web_contents())); + } + + FrameTreeNode* root = web_contents()->GetPrimaryFrameTree().root(); + ASSERT_EQ(1U, root->child_count()); + FrameTreeNode* child = root->child_at(0); + // Verify that the child has no permissions set. + EXPECT_EQ(child->effective_frame_policy().sandbox_flags, + network::mojom::WebSandboxFlags::kAll); + EXPECT_EQ(GURL(url::kAboutBlankURL), + child->current_frame_host()->GetLastCommittedURL()); + EXPECT_TRUE(child->current_frame_host()->GetLastCommittedOrigin().opaque()); + // Verify that the child's precursor origin matches 'a.com'. Note: we create + // the expected value using `main_url` so that the test server port will be + // correctly matched. + EXPECT_EQ(url::SchemeHostPort(main_url), + child->current_origin().GetTupleOrPrecursorTupleIfOpaque()); + // The child needs to be in the parent's SiteInstance. + EXPECT_EQ(root->current_frame_host()->GetSiteInstance(), + child->current_frame_host()->GetSiteInstance()); + EXPECT_FALSE(root->current_frame_host() + ->GetSiteInstance() + ->GetSiteInfo() + .is_sandboxed()); + + // Navigate to a page that should get process isolation. + GURL isolated_child_url( + embedded_test_server()->GetURL("a.com", "/title1.html")); + EXPECT_TRUE(NavigateFrameToURL(child, isolated_child_url)); + EXPECT_NE(root->current_frame_host()->GetSiteInstance(), + child->current_frame_host()->GetSiteInstance()); + EXPECT_TRUE(child->current_frame_host() + ->GetSiteInstance() + ->GetSiteInfo() + .is_sandboxed()); + + // Navigate back to about:blank, and verify it's put back into the parent's + // SiteInstance. + scoped_refptr<SiteInstanceImpl> child_previous_site_instance = + child->current_frame_host()->GetSiteInstance(); + EXPECT_TRUE(NavigateIframeToURL(shell()->web_contents(), "child_frame", + GURL("about:blank"))); + EXPECT_EQ(root->current_frame_host()->GetSiteInstance(), + child->current_frame_host()->GetSiteInstance()); + EXPECT_NE(child_previous_site_instance, + child->current_frame_host()->GetSiteInstance()); + EXPECT_FALSE(child->current_frame_host() + ->GetSiteInstance() + ->GetSiteInfo() + .is_sandboxed()); +} + // Test to make sure that an iframe with a data:url is appropriately sandboxed. IN_PROC_BROWSER_TEST_P(SitePerProcessIsolatedSandboxedIframeTest, SandboxedIframeWithDataURL) {
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc index c6f027a..d3818fa 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc
@@ -119,6 +119,7 @@ #include "content/public/browser/download_manager.h" #include "content/public/browser/file_select_listener.h" #include "content/public/browser/focused_node_details.h" +#include "content/public/browser/frame_type.h" #include "content/public/browser/global_routing_id.h" #include "content/public/browser/invalidate_type.h" #include "content/public/browser/javascript_dialog_manager.h" @@ -7317,8 +7318,10 @@ bool should_show_loading_ui) { OPTIONAL_TRACE_EVENT1("content", "WebContentsImpl::DidStartLoading", "frame_tree_node", frame_tree_node); - LoadingStateChanged(frame_tree_node->IsMainFrame() && should_show_loading_ui, - nullptr); + LoadingStateChanged( + frame_tree_node->GetFrameType() == FrameType::kPrimaryMainFrame && + should_show_loading_ui, + nullptr); // Reset the focus state from DidStartNavigation to false if a new load starts // afterward, in case loading logic triggers a FocusLocationBarByDefault call.
diff --git a/content/browser/web_contents/web_contents_impl_browsertest.cc b/content/browser/web_contents/web_contents_impl_browsertest.cc index e89f092..2656f84 100644 --- a/content/browser/web_contents/web_contents_impl_browsertest.cc +++ b/content/browser/web_contents/web_contents_impl_browsertest.cc
@@ -73,6 +73,7 @@ #include "content/public/test/content_browser_test.h" #include "content/public/test/content_browser_test_utils.h" #include "content/public/test/fenced_frame_test_util.h" +#include "content/public/test/mock_client_hints_controller_delegate.h" #include "content/public/test/mock_web_contents_observer.h" #include "content/public/test/no_renderer_crashes_assertion.h" #include "content/public/test/prerender_test_util.h" @@ -83,7 +84,6 @@ #include "content/shell/browser/shell_browser_context.h" #include "content/shell/browser/shell_content_browser_client.h" #include "content/test/content_browser_test_utils_internal.h" -#include "content/test/mock_client_hints_controller_delegate.h" #include "content/test/resource_load_observer.h" #include "content/test/test_content_browser_client.h" #include "mojo/public/cpp/test_support/test_utils.h"
diff --git a/content/browser/webid/federated_auth_request_impl.cc b/content/browser/webid/federated_auth_request_impl.cc index 195cef85..4a001a9 100644 --- a/content/browser/webid/federated_auth_request_impl.cc +++ b/content/browser/webid/federated_auth_request_impl.cc
@@ -532,8 +532,8 @@ } } - GURL revoke_url = ResolveManifestUrl(endpoints.revoke); - if (!IsEndpointUrlValid(revoke_url)) { + GURL revocation_url = ResolveManifestUrl(endpoints.revocation); + if (!IsEndpointUrlValid(revocation_url)) { RecordRevokeStatus(RevokeStatusForMetrics::kRevokeUrlIsCrossOrigin, render_frame_host_->GetPageUkmSourceId()); CompleteRevokeRequest(RevokeStatus::kError, @@ -541,7 +541,7 @@ return; } network_manager_->SendRevokeRequest( - revoke_url, client_id_, account_id_, + revocation_url, client_id_, account_id_, base::BindOnce(&FederatedAuthRequestImpl::OnRevokeResponse, weak_ptr_factory_.GetWeakPtr())); }
diff --git a/content/browser/webid/federated_auth_request_impl_unittest.cc b/content/browser/webid/federated_auth_request_impl_unittest.cc index 923c996..9f59b13 100644 --- a/content/browser/webid/federated_auth_request_impl_unittest.cc +++ b/content/browser/webid/federated_auth_request_impl_unittest.cc
@@ -74,7 +74,7 @@ constexpr char kTokenEndpoint[] = "https://idp.example/token"; constexpr char kClientMetadataEndpoint[] = "https://idp.example/client_metadata"; -constexpr char kRevokeEndpoint[] = "https://idp.example/revoke"; +constexpr char kRevocationEndpoint[] = "https://idp.example/revoke"; constexpr char kPrivacyPolicyUrl[] = "https://rp.example/pp"; constexpr char kTermsOfServiceUrl[] = "https://rp.example/tos"; constexpr char kClientId[] = "client_id_123"; @@ -1106,7 +1106,7 @@ Invoke([&](absl::optional<int>, absl::optional<int>, IdpNetworkRequestManager::FetchManifestCallback callback) { IdpNetworkRequestManager::Endpoints endpoints; - endpoints.revoke = kRevokeEndpoint; + endpoints.revocation = kRevocationEndpoint; std::move(callback).Run(FetchStatus::kSuccess, endpoints, IdentityProviderMetadata()); })); @@ -1114,7 +1114,7 @@ .WillOnce(Invoke([&](const GURL& revoke_url, const std::string& client_id, const std::string& account_id, IdpNetworkRequestManager::RevokeCallback callback) { - EXPECT_EQ(kRevokeEndpoint, revoke_url.spec()); + EXPECT_EQ(kRevocationEndpoint, revoke_url.spec()); EXPECT_EQ(kClientId, client_id); EXPECT_EQ(kAccountId, account_id); std::move(callback).Run(RevokeResponse::kSuccess);
diff --git a/content/browser/webid/idp_network_request_manager.cc b/content/browser/webid/idp_network_request_manager.cc index 044b16b6..7277658b 100644 --- a/content/browser/webid/idp_network_request_manager.cc +++ b/content/browser/webid/idp_network_request_manager.cc
@@ -42,7 +42,7 @@ constexpr char kTokenEndpointKey[] = "id_token_endpoint"; constexpr char kAccountsEndpointKey[] = "accounts_endpoint"; constexpr char kClientMetadataEndpointKey[] = "client_metadata_endpoint"; -constexpr char kRevokeEndpoint[] = "revoke_endpoint"; +constexpr char kRevocationEndpoint[] = "revocation_endpoint"; // Keys in fedcm.json 'branding' dictionary. constexpr char kIdpBrandingBackgroundColor[] = "background_color"; @@ -625,7 +625,7 @@ endpoints.token = ExtractEndpoint(kTokenEndpointKey); endpoints.accounts = ExtractEndpoint(kAccountsEndpointKey); endpoints.client_metadata = ExtractEndpoint(kClientMetadataEndpointKey); - endpoints.revoke = ExtractEndpoint(kRevokeEndpoint); + endpoints.revocation = ExtractEndpoint(kRevocationEndpoint); const base::Value* idp_metadata_value = response.FindKey(kIdpBrandingKey); IdentityProviderMetadata idp_metadata; @@ -872,7 +872,13 @@ auto resource_request = std::make_unique<network::ResourceRequest>(); resource_request->url = target_url; - resource_request->credentials_mode = network::mojom::CredentialsMode::kOmit; + // TODO(yigu): credentials_mode should be kOmit, but for prototyping + // purposes it is useful to be able to run test IdPs on services that always + // require cookies. This needs to be changed back when a better solution is + // found or those test IdPs are no longer required. + // See https://crbug.com/1159177. + resource_request->credentials_mode = + network::mojom::CredentialsMode::kInclude; resource_request->headers.SetHeader(net::HttpRequestHeaders::kAccept, kRequestBodyContentType); AddCsrfHeader(resource_request.get());
diff --git a/content/browser/webid/idp_network_request_manager.h b/content/browser/webid/idp_network_request_manager.h index b5257e1..5b7ca77 100644 --- a/content/browser/webid/idp_network_request_manager.h +++ b/content/browser/webid/idp_network_request_manager.h
@@ -95,7 +95,7 @@ std::string token; std::string accounts; std::string client_metadata; - std::string revoke; + std::string revocation; }; struct ClientMetadata {
diff --git a/content/browser/webid/idp_network_request_manager_unittest.cc b/content/browser/webid/idp_network_request_manager_unittest.cc index 033739d..6784754 100644 --- a/content/browser/webid/idp_network_request_manager_unittest.cc +++ b/content/browser/webid/idp_network_request_manager_unittest.cc
@@ -48,7 +48,7 @@ const char kTestTokenEndpoint[] = "https://idp.test/token_endpoint"; const char kTestClientMetadataEndpoint[] = "https://idp.test/client_metadata_endpoint"; -const char kTestRevokeEndpoint[] = "https://idp.test/revoke_endpoint"; +const char kTestRevocationEndpoint[] = "https://idp.test/revocation_endpoint"; class IdpNetworkRequestManagerTest : public ::testing::Test { public: @@ -156,8 +156,8 @@ const char* client_id, const char* account_id, net::HttpStatusCode http_status = net::HTTP_NO_CONTENT) { - GURL revoke_endpoint(kTestRevokeEndpoint); - test_url_loader_factory().AddResponse(revoke_endpoint.spec(), "", + GURL revocation_endpoint(kTestRevocationEndpoint); + test_url_loader_factory().AddResponse(revocation_endpoint.spec(), "", http_status); RevokeResponse status; @@ -167,7 +167,7 @@ status = revoke_status; run_loop.Quit(); }); - manager().SendRevokeRequest(revoke_endpoint, client_id, account_id, + manager().SendRevokeRequest(revocation_endpoint, client_id, account_id, std::move(callback)); run_loop.Run(); return status;
diff --git a/content/common/web_ui.mojom b/content/common/web_ui.mojom index 3edbbca..2d7f0cb 100644 --- a/content/common/web_ui.mojom +++ b/content/common/web_ui.mojom
@@ -14,7 +14,7 @@ // Because `args` may be an arbitrarily complex object, we tag this with // [UnlimitedSize] to ignore soft message length limits within Mojo. [UnlimitedSize] - Send(string message, mojo_base.mojom.ListValue args); + Send(string message, mojo_base.mojom.DeprecatedListValue args); }; // For adding a property to the WebUI binding object, implemented by renderer.
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/accessibility/WebContentsAccessibilityEventsTest.java b/content/public/android/javatests/src/org/chromium/content/browser/accessibility/WebContentsAccessibilityEventsTest.java index 9630ed8..aba3d1b 100644 --- a/content/public/android/javatests/src/org/chromium/content/browser/accessibility/WebContentsAccessibilityEventsTest.java +++ b/content/public/android/javatests/src/org/chromium/content/browser/accessibility/WebContentsAccessibilityEventsTest.java
@@ -205,12 +205,6 @@ @Test @SmallTest - public void test_anonymousBlockChildrenChanged() { - performTest("anonymous-block-children-changed.html", EMPTY_EXPECTATIONS_FILE); - } - - @Test - @SmallTest public void test_ariaAtomicChanged() { performTest("aria-atomic-changed.html", EMPTY_EXPECTATIONS_FILE); }
diff --git a/content/public/browser/bluetooth_delegate.h b/content/public/browser/bluetooth_delegate.h index 336618b..e2796ae9 100644 --- a/content/public/browser/bluetooth_delegate.h +++ b/content/public/browser/bluetooth_delegate.h
@@ -133,6 +133,11 @@ RenderFrameHost* frame, const blink::WebBluetoothDeviceId& device_id) = 0; + // Revokes |frame| access to the Bluetooth device ordered by website. + virtual void RevokeDevicePermissionWebInitiated( + RenderFrameHost* frame, + const blink::WebBluetoothDeviceId& device_id) = 0; + // This should return true if |frame| has permission to access |service| from // the device with |device_id|. virtual bool IsAllowedToAccessService(
diff --git a/content/public/common/alternative_error_page_override_info.mojom b/content/public/common/alternative_error_page_override_info.mojom index 609e0a5..0d4401d 100644 --- a/content/public/common/alternative_error_page_override_info.mojom +++ b/content/public/common/alternative_error_page_override_info.mojom
@@ -13,5 +13,5 @@ uint32 resource_id; // A dictionary containing information needed by alternative error page. - mojo_base.mojom.DictionaryValue alternative_error_page_params; + mojo_base.mojom.DeprecatedDictionaryValue alternative_error_page_params; }; \ No newline at end of file
diff --git a/content/public/test/browser_test_utils.cc b/content/public/test/browser_test_utils.cc index 141b411..7c97b64 100644 --- a/content/public/test/browser_test_utils.cc +++ b/content/public/test/browser_test_utils.cc
@@ -3092,23 +3092,17 @@ if (!ShouldMonitorNavigation(handle)) return; - was_prerendered_page_activation_ = handle->IsPrerenderedPageActivation(); + DCHECK(!handle->IsPageActivation()) + << "For PageActivating navigations, use TestActivationManager."; request_ = NavigationRequest::From(handle); - if (request_->IsPageActivation()) { - // For activating navigations, we have no way of stopping at - // WillStartRequest since we don't run throttles. Callers should use - // WaitForResponse() or WaitForFirstYieldAfterDidStartNavigation(). - DCHECK_NE(desired_state_, NavigationState::STARTED); - } else { - auto throttle = std::make_unique<TestNavigationManagerThrottle>( - request_, - base::BindOnce(&TestNavigationManager::OnWillStartRequest, - weak_factory_.GetWeakPtr()), - base::BindOnce(&TestNavigationManager::OnWillProcessResponse, - weak_factory_.GetWeakPtr())); - request_->RegisterThrottleForTesting(std::move(throttle)); - } + auto throttle = std::make_unique<TestNavigationManagerThrottle>( + request_, + base::BindOnce(&TestNavigationManager::OnWillStartRequest, + weak_factory_.GetWeakPtr()), + base::BindOnce(&TestNavigationManager::OnWillProcessResponse, + weak_factory_.GetWeakPtr())); + request_->RegisterThrottleForTesting(std::move(throttle)); current_state_ = NavigationState::WILL_START; @@ -3130,8 +3124,6 @@ return; was_committed_ = handle->HasCommitted(); was_successful_ = was_committed_ && !handle->IsErrorPage(); - DCHECK_EQ(was_prerendered_page_activation_.value(), - request_->IsPrerenderedPageActivation()); current_state_ = NavigationState::FINISHED; navigation_paused_ = false; request_ = nullptr; @@ -3156,14 +3148,6 @@ OnNavigationStateChanged(); } -void TestNavigationManager::OnRunningCommitDeferringConditions( - base::OnceClosure resume_closure) { - current_state_ = NavigationState::RESPONSE; - commit_deferring_condition_resume_closure_ = std::move(resume_closure); - navigation_paused_ = true; - OnNavigationStateChanged(); -} - // TODO(csharrison): Remove CallResumeForTesting method calls in favor of doing // it through the throttle. bool TestNavigationManager::WaitForDesiredState() { @@ -3191,12 +3175,6 @@ TRACE_EVENT("test", "TestNavigationManager::OnNavigationStateChanged", "this", this); - if (request_ && request_->IsPageActivation()) { - DCHECK_NE(desired_state_, NavigationState::STARTED) - << "Cannot use WaitForRequestStart() when managing an activating " - "navigation. Use either WaitForFirstYieldAfterDidStartNavigation() " - "or WaitForResponse()"; - } // If the state the user was waiting for has been reached, exit the message // loop. if (current_state_ >= desired_state_) { @@ -3217,10 +3195,7 @@ navigation_paused_ = false; - if (!request_->IsPageActivation()) - request_->GetNavigationThrottleRunnerForTesting()->CallResumeForTesting(); - else if (commit_deferring_condition_resume_closure_) - std::move(commit_deferring_condition_resume_closure_).Run(); + request_->GetNavigationThrottleRunnerForTesting()->CallResumeForTesting(); } bool TestNavigationManager::ShouldMonitorNavigation(NavigationHandle* handle) {
diff --git a/content/public/test/browser_test_utils.h b/content/public/test/browser_test_utils.h index f6b2bc3..9b660ae 100644 --- a/content/public/test/browser_test_utils.h +++ b/content/public/test/browser_test_utils.h
@@ -1581,23 +1581,9 @@ // navigation it will ignore all subsequent navigations. Explicitly create // multiple instances of this class if you want to pause multiple navigations. // -// Note2: For a prerender activation, this class cannot pause the navigation as -// the activation doesn't run NavigationThrottles and runs -// CommitDeferringConditions before StartNavigation() that WebContentsObserver -// cannot observe. Use TestActivationManager in these cases instead. -// -// Note3: For a BFCache restore navigation, the navigation will not run -// NavigationThrottles. The manager in this case uses a -// CommitDeferringCondition for pausing the navigation at the equivalent of -// WillProcessResponse. However, in this navigation you cannot use -// WaitForRequestStart; if you want to yield before WillProcessResponse, use -// WaitForFirstYieldAfterDidStartNavigation. -// TODO(bokan): Hopefully BFCache will soon work like prerender activation -// does. Prefer TestActivationManager for BFCache activations as well. -// https://crbug.com/1226442. -// -// TODO(bokan): Remove uses of this class for page activations and add a DCHECK -// that the navigation isn't page activating. +// Note2: This class cannot be used with page activating navigations (e.g. +// BFCache, prerendering, etc.) as the activation doesn't run +// NavigationThrottles. Use TestActivationManager in these cases instead. class TestNavigationManager : public WebContentsObserver { public: // Monitors any frame in WebContents. @@ -1612,19 +1598,14 @@ // WaitForRequestStart, this can be used to wait for a pause in cases where a // test expects a NavigationThrottle to defer in WillStartRequest. In cases // where throttles run and none defer, this will break at the same time as - // WaitForRequestStart. Also unlike WaitForRequestStart, this can be used to - // wait on a page activating navigation to start. Note: since we won't know - // which throttle deferred, don't use ResumeNavigation() after this call since - // it assumes we paused from the TestNavigationManagerThrottle. + // WaitForRequestStart. Note: since we won't know which throttle deferred, + // don't use ResumeNavigation() after this call since it assumes we paused + // from the TestNavigationManagerThrottle. void WaitForFirstYieldAfterDidStartNavigation(); // Waits until the navigation request is ready to be sent to the network // stack. This will wait until all NavigationThrottles have proceeded through // WillStartRequest. Returns false if the request was aborted before starting. - // Note: RequestStart is never reached for page activating navigations (e.g. - // prerender activation, BFCache restore). In those cases you should either - // use WaitForFirstYieldAfterDidStartNavigation or WaitForResponse. See - // TestNavigationManager class comment for more detail. [[nodiscard]] bool WaitForRequestStart(); // Waits until the navigation response's headers have been received. This @@ -1652,11 +1633,6 @@ // Whether the navigation successfully committed and was not an error page. bool was_successful() const { return was_successful_; } - // Whether the navigation activated a prerendered page. - bool was_prerendered_page_activation() const { - return was_prerendered_page_activation_.value(); - } - // Allows nestable tasks when running a message loop in the Wait* functions. // This is useful for utilizing this class from within another message loop. void AllowNestableTasks(); @@ -1690,10 +1666,6 @@ // WillProcessResponse. void OnWillProcessResponse(); - // Called when the navigation pauses in the MockCommitDeferringCondition. This - // happens only for page activating navigations like a prerender activation. - void OnRunningCommitDeferringConditions(base::OnceClosure resume_closure); - // Waits for the desired state. Returns false if the desired state cannot be // reached (eg the navigation finishes before reaching this state). bool WaitForDesiredState(); @@ -1712,16 +1684,9 @@ NavigationState desired_state_ = NavigationState::WILL_START; bool was_committed_ = false; bool was_successful_ = false; - absl::optional<bool> was_prerendered_page_activation_; base::OnceClosure quit_closure_; base::RunLoop::Type message_loop_type_ = base::RunLoop::Type::kDefault; - // In a page activating navigation (prerender activation, back-forward cache - // activation), the navigation will be stopped in a commit deferring condition - // (since NavigationThrottles aren't run in a page activation). When that - // happens, the navigation can be resumed using this closure. - base::OnceClosure commit_deferring_condition_resume_closure_; - base::WeakPtrFactory<TestNavigationManager> weak_factory_{this}; };
diff --git a/content/public/test/fenced_frame_test_util.cc b/content/public/test/fenced_frame_test_util.cc index 1baf1212..c1d1436 100644 --- a/content/public/test/fenced_frame_test_util.cc +++ b/content/public/test/fenced_frame_test_util.cc
@@ -9,6 +9,7 @@ #include "content/browser/renderer_host/render_frame_host_impl.h" #include "content/browser/web_contents/web_contents_impl.h" #include "content/public/test/browser_test_utils.h" +#include "content/public/test/test_frame_navigation_observer.h" #include "content/test/fenced_frame_test_utils.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/blink/public/common/features.h" @@ -23,6 +24,12 @@ document.body.appendChild(fenced_frame); })"; +constexpr char kAddAndNavigateFencedFrameScript[] = R"({ + const fenced_frame = document.createElement('fencedframe'); + fenced_frame.src = $1; + document.body.appendChild(fenced_frame); + })"; + constexpr char kNavigateFrameScript[] = R"({location.href = $1;})"; } // namespace @@ -46,8 +53,7 @@ size_t previous_fenced_frame_count = fenced_frame_parent_rfh->GetFencedFrames().size(); - EXPECT_TRUE(ExecJs(fenced_frame_parent_rfh, - JsReplace(kAddFencedFrameScript, url), + EXPECT_TRUE(ExecJs(fenced_frame_parent_rfh, JsReplace(kAddFencedFrameScript), EvalJsOptions::EXECUTE_SCRIPT_NO_USER_GESTURE)); std::vector<FencedFrame*> fenced_frames = @@ -65,6 +71,14 @@ expected_error_code); } +void FencedFrameTestHelper::CreateFencedFrameAsync( + RenderFrameHost* fenced_frame_parent_rfh, + const GURL& url) { + EXPECT_TRUE(ExecJs(fenced_frame_parent_rfh, + JsReplace(kAddAndNavigateFencedFrameScript, url), + EvalJsOptions::EXECUTE_SCRIPT_NO_USER_GESTURE)); +} + RenderFrameHost* FencedFrameTestHelper::NavigateFrameInFencedFrameTree( RenderFrameHost* rfh, const GURL& url, @@ -78,12 +92,12 @@ FrameTreeNode* target_node = static_cast<RenderFrameHostImpl*>(rfh)->frame_tree_node(); - FencedFrameNavigationObserver observer( - static_cast<RenderFrameHostImpl*>(rfh)); + TestFrameNavigationObserver fenced_frame_observer(rfh); EXPECT_EQ(url.spec(), EvalJs(rfh, JsReplace(kNavigateFrameScript, url))); - observer.Wait(expected_error_code); + fenced_frame_observer.Wait(); - EXPECT_EQ(target_node->current_frame_host()->GetLastCommittedURL(), url); + EXPECT_EQ(target_node->current_frame_host()->IsErrorDocument(), + expected_error_code != net::OK); return target_node->current_frame_host(); }
diff --git a/content/public/test/fenced_frame_test_util.h b/content/public/test/fenced_frame_test_util.h index 4b96b498..be1329f 100644 --- a/content/public/test/fenced_frame_test_util.h +++ b/content/public/test/fenced_frame_test_util.h
@@ -37,18 +37,19 @@ const GURL& url, net::Error expected_error_code = net::OK); + // This method is similar to `FencedFrameTestUtil::CreateFencedFrame` but + // doesn't wait until the fenced frame completes loading. + void CreateFencedFrameAsync(RenderFrameHost* fenced_frame_parent_rfh, + const GURL& url); + // This method provides a way to navigate frames within a fenced frame's tree, - // and synchronously wait for the load to finish. The reason we have this - // method is because navigations inside of a fenced frame's tree cannot be - // synchronously waited on via the traditional means of using e.g., - // `TestFrameNavigationObserver`. This method returns the `RenderFrameHost` - // that the navigation committed to if it was successful (which may be - // different from the one that navigation started in), and `nullptr` - // otherwise. It takes an `expected_error_code` in case the navigation to - // `url` fails, which can be detected on a per-error-code basis. - // TODO(crbug.com/1199682): Fix the underlying reason why we cannot use - // traditional means of waiting for a navigation to finish loading inside a - // fenced frame tree. + // and synchronously wait for the load to finish. This method returns the + // `RenderFrameHost` that the navigation committed to if it was successful + // (which may be different from the one that navigation started in), and + // `nullptr` otherwise. It takes an `expected_error_code` in case the + // navigation to `url` fails, which can be detected on a per-error-code basis. + // TODO(crbug.com/1294189): Directly use TestFrameNavigationObserver instead + // of relying on this method. RenderFrameHost* NavigateFrameInFencedFrameTree( RenderFrameHost* rfh, const GURL& url,
diff --git a/content/test/mock_client_hints_controller_delegate.h b/content/public/test/mock_client_hints_controller_delegate.h similarity index 86% rename from content/test/mock_client_hints_controller_delegate.h rename to content/public/test/mock_client_hints_controller_delegate.h index 89d4489..702a0fe 100644 --- a/content/test/mock_client_hints_controller_delegate.h +++ b/content/public/test/mock_client_hints_controller_delegate.h
@@ -2,11 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CONTENT_TEST_MOCK_CLIENT_HINTS_CONTROLLER_DELEGATE_H_ -#define CONTENT_TEST_MOCK_CLIENT_HINTS_CONTROLLER_DELEGATE_H_ +#ifndef CONTENT_PUBLIC_TEST_MOCK_CLIENT_HINTS_CONTROLLER_DELEGATE_H_ +#define CONTENT_PUBLIC_TEST_MOCK_CLIENT_HINTS_CONTROLLER_DELEGATE_H_ #include "content/public/browser/client_hints_controller_delegate.h" -#include "content/test/mock_client_hints_utils.h" #include "services/network/public/cpp/network_quality_tracker.h" #include "third_party/blink/public/common/client_hints/enabled_client_hints.h" #include "third_party/blink/public/common/user_agent/user_agent_metadata.h" @@ -14,6 +13,9 @@ namespace content { +using ClientHintsContainer = + std::map<const url::Origin, blink::EnabledClientHints>; + class MockClientHintsControllerDelegate : public ClientHintsControllerDelegate { public: explicit MockClientHintsControllerDelegate( @@ -56,4 +58,4 @@ }; } // end namespace content -#endif // CONTENT_TEST_MOCK_CLIENT_HINTS_CONTROLLER_DELEGATE_H_ +#endif // CONTENT_PUBLIC_TEST_MOCK_CLIENT_HINTS_CONTROLLER_DELEGATE_H_
diff --git a/content/public/test/network_service_test_helper.cc b/content/public/test/network_service_test_helper.cc index cb79005..38c299e 100644 --- a/content/public/test/network_service_test_helper.cc +++ b/content/public/test/network_service_test_helper.cc
@@ -13,6 +13,7 @@ #include "base/environment.h" #include "base/feature_list.h" #include "base/logging.h" +#include "base/memory/weak_ptr.h" #include "base/metrics/field_trial.h" #include "base/process/process.h" #include "base/task/current_thread.h" @@ -20,18 +21,23 @@ #include "content/public/common/content_features.h" #include "content/public/common/content_switches.h" #include "content/public/test/test_host_resolver.h" +#include "mojo/public/cpp/bindings/pending_remote.h" #include "mojo/public/cpp/bindings/receiver_set.h" +#include "mojo/public/cpp/bindings/self_owned_receiver.h" #include "net/base/ip_address.h" #include "net/cert/ev_root_ca_metadata.h" #include "net/cert/mock_cert_verifier.h" +#include "net/disk_cache/disk_cache.h" #include "net/dns/mock_host_resolver.h" #include "net/dns/public/dns_over_https_server_config.h" #include "net/http/transport_security_state.h" #include "net/http/transport_security_state_test_util.h" +#include "net/log/net_log.h" #include "net/nqe/network_quality_estimator.h" #include "net/test/test_data_directory.h" #include "sandbox/policy/sandbox_type.h" #include "services/network/cookie_manager.h" +#include "services/network/disk_cache/mojo_backend_file_operations_factory.h" #include "services/network/host_resolver.h" #include "services/network/network_context.h" #include "services/network/network_service.h" @@ -67,6 +73,17 @@ if (host_to_crash == host) base::Process::TerminateCurrentProcessImmediately(1); } + +class SimpleCache : public network::mojom::SimpleCache { + public: + explicit SimpleCache(std::unique_ptr<disk_cache::Backend> backend) + : backend_(std::move(backend)) {} + ~SimpleCache() override = default; + + private: + std::unique_ptr<disk_cache::Backend> backend_; +}; + } // namespace class NetworkServiceTestHelper::NetworkServiceTestImpl @@ -298,12 +315,52 @@ std::move(callback).Run(file.IsValid()); } + void CreateSimpleCache( + mojo::PendingRemote<network::mojom::HttpCacheBackendFileOperationsFactory> + factory, + const base::FilePath& path, + CreateSimpleCacheCallback callback) override { + auto backend_holder = base::MakeRefCounted< + base::RefCountedData<std::unique_ptr<disk_cache::Backend>>>(); + int rv = disk_cache::CreateCacheBackend( + net::DISK_CACHE, net::CACHE_BACKEND_SIMPLE, + base::MakeRefCounted<network::MojoBackendFileOperationsFactory>( + std::move(factory)), + path, 64 * 1024 * 1024, disk_cache::ResetHandling::kResetOnError, + net::NetLog::Get(), &backend_holder->data, + base::BindOnce(&NetworkServiceTestImpl::OnCacheCreated, + weak_factory_.GetWeakPtr(), backend_holder, + std::move(callback))); + DCHECK_EQ(rv, net::ERR_IO_PENDING); + } + private: void OnMemoryPressure( base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level) { latest_memory_pressure_level_ = memory_pressure_level; } + void OnCacheCreated( + scoped_refptr<base::RefCountedData<std::unique_ptr<disk_cache::Backend>>> + backend_holder, + CreateSimpleCacheCallback callback, + int rv) { + DCHECK(backend_holder); + std::unique_ptr<disk_cache::Backend> backend = + std::move(backend_holder->data); + if (rv != net::OK) { + DCHECK(!backend); + std::move(callback).Run(mojo::NullRemote()); + return; + } + DCHECK(backend); + mojo::PendingRemote<network::mojom::SimpleCache> remote; + mojo::MakeSelfOwnedReceiver( + std::make_unique<SimpleCache>(std::move(backend)), + remote.InitWithNewPipeAndPassReceiver()); + std::move(callback).Run(std::move(remote)); + } + bool registered_as_destruction_observer_ = false; bool have_test_doh_servers_ = false; mojo::ReceiverSet<network::mojom::NetworkServiceTest> receivers_; @@ -315,6 +372,9 @@ base::MemoryPressureListener::MemoryPressureLevel latest_memory_pressure_level_ = base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_NONE; + std::unique_ptr<disk_cache::Backend> disk_cache_backend_; + + base::WeakPtrFactory<NetworkServiceTestImpl> weak_factory_{this}; }; NetworkServiceTestHelper::NetworkServiceTestHelper()
diff --git a/content/public/test/test_aggregation_service.cc b/content/public/test/test_aggregation_service.cc index 805ae82f..f4228ac3 100644 --- a/content/public/test/test_aggregation_service.cc +++ b/content/public/test/test_aggregation_service.cc
@@ -17,7 +17,7 @@ Operation operation, int bucket, int value, - ProcessingType processing_type, + AggregationMode aggregation_mode, url::Origin reporting_origin, std::string privacy_budget_key, std::vector<GURL> processing_urls, @@ -25,7 +25,7 @@ : operation(operation), bucket(bucket), value(value), - processing_type(processing_type), + aggregation_mode(aggregation_mode), reporting_origin(std::move(reporting_origin)), privacy_budget_key(std::move(privacy_budget_key)), processing_urls(std::move(processing_urls)),
diff --git a/content/public/test/test_aggregation_service.h b/content/public/test/test_aggregation_service.h index 5331758..eb3cc957 100644 --- a/content/public/test/test_aggregation_service.h +++ b/content/public/test/test_aggregation_service.h
@@ -37,15 +37,14 @@ // This is 1-1 mapping of AggregationServicePayloadContents::Operation. enum class Operation { - kHistogram = 0, - kMaxValue = kHistogram, + kHistogram, }; - // This is 1-1 mapping of AggregationServicePayloadContent::ProcessingType. - enum class ProcessingType { - kTwoParty = 0, - kSingleServer = 1, - kMaxValue = kSingleServer, + // This is 1-1 mapping of AggregationServicePayloadContent::AggregationMode. + enum class AggregationMode { + kTeeBased, + kExperimentalPoplar, + kDefault = kTeeBased, }; // Represents a request to assemble an aggregatable report. @@ -53,7 +52,7 @@ AssembleRequest(Operation operation, int bucket, int value, - ProcessingType processing_type, + AggregationMode aggregation_mode, url::Origin reporting_origin, std::string privacy_budget_key, std::vector<GURL> processing_urls, @@ -68,8 +67,8 @@ int bucket; // Specifies the bucket value of the histogram contribution. int value; - // Indicates whether the aggregation servers run an MPC protocol or not. - ProcessingType processing_type; + // Specifies the aggregation mode to use. + AggregationMode aggregation_mode; // Specifies the endpoint reporting origin. url::Origin reporting_origin; // Specifies the key for the aggregation servers to do privacy budgeting.
diff --git a/content/public/test/test_renderer_host.cc b/content/public/test/test_renderer_host.cc index e2a71eac..aa30f0c 100644 --- a/content/public/test/test_renderer_host.cc +++ b/content/public/test/test_renderer_host.cc
@@ -113,14 +113,18 @@ // RenderViewHostTestEnabler -------------------------------------------------- -RenderViewHostTestEnabler::RenderViewHostTestEnabler() +RenderViewHostTestEnabler::RenderViewHostTestEnabler( + NavigationURLLoaderFactoryType url_loader_factory_type) : rph_factory_(new MockRenderProcessHostFactory()), asgh_factory_(new MockAgentSchedulingGroupHostFactory()), rvh_factory_(new TestRenderViewHostFactory(rph_factory_.get(), asgh_factory_.get())), rfh_factory_(new TestRenderFrameHostFactory()), rwhi_factory_(new TestRenderWidgetHostFactory()), - loader_factory_(new TestNavigationURLLoaderFactory()) { + loader_factory_(url_loader_factory_type == + NavigationURLLoaderFactoryType::kTest + ? new TestNavigationURLLoaderFactory() + : nullptr) { // A TaskEnvironment is needed on the main thread for Mojo bindings to // graphics services. Some tests have their own, so this only creates one // (single-threaded) when none exists. This means tests must ensure any
diff --git a/content/public/test/test_renderer_host.h b/content/public/test/test_renderer_host.h index f784e9e0..2e76323b 100644 --- a/content/public/test/test_renderer_host.h +++ b/content/public/test/test_renderer_host.h
@@ -175,7 +175,18 @@ // RenderViewHostTester and RenderFrameHostTester respectively. class RenderViewHostTestEnabler { public: - RenderViewHostTestEnabler(); + // Whether this RenderViewHostTestEnabler should create + // TestNavigationURLLoaderFactory or not. + enum class NavigationURLLoaderFactoryType { + // Create TestNavigationURLLoaderFactory. + kTest, + // Do not create TestRenderViewHostFactory. Useful for the tests which want + // to mock or customise the NavigationURLLoader creation logic themselves. + kNone, + }; + explicit RenderViewHostTestEnabler( + NavigationURLLoaderFactoryType navigation_url_loader_factory_type = + NavigationURLLoaderFactoryType::kTest); RenderViewHostTestEnabler(const RenderViewHostTestEnabler&) = delete; RenderViewHostTestEnabler& operator=(const RenderViewHostTestEnabler&) =
diff --git a/content/renderer/BUILD.gn b/content/renderer/BUILD.gn index 717ec6b3..6adaa80 100644 --- a/content/renderer/BUILD.gn +++ b/content/renderer/BUILD.gn
@@ -201,11 +201,7 @@ } if (is_linux || is_chromeos) { - sources += [ - "accessibility/ax_screen_ai_annotator.cc", - "accessibility/ax_screen_ai_annotator.h", - "renderer_main_platform_delegate_linux.cc", - ] + sources += [ "renderer_main_platform_delegate_linux.cc" ] } if (is_mac) { @@ -347,11 +343,7 @@ } if (is_linux || is_chromeos) { - deps += [ - "//components/services/font/public/cpp", - "//components/services/screen_ai", - "//ui/gfx/codec", - ] + deps += [ "//components/services/font/public/cpp" ] } if (is_fuchsia) {
diff --git a/content/renderer/DEPS b/content/renderer/DEPS index 798358f..87e50ab 100644 --- a/content/renderer/DEPS +++ b/content/renderer/DEPS
@@ -7,7 +7,6 @@ "+components/discardable_memory/client", "+components/metrics", "+components/metrics:single_sample_metrics", - "+components/services/screen_ai", "+components/url_formatter", "+components/viz/client", "+components/viz/common",
diff --git a/content/renderer/accessibility/ax_screen_ai_annotator.cc b/content/renderer/accessibility/ax_screen_ai_annotator.cc deleted file mode 100644 index c4b7c824..0000000 --- a/content/renderer/accessibility/ax_screen_ai_annotator.cc +++ /dev/null
@@ -1,108 +0,0 @@ -// Copyright 2022 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "content/renderer/accessibility/ax_screen_ai_annotator.h" - -#include "net/base/data_url.h" -#include "third_party/blink/public/platform/web_string.h" -#include "third_party/blink/public/web/web_ax_object.h" -#include "third_party/skia/include/core/SkBitmap.h" -#include "ui/accessibility/ax_node_data.h" -#include "ui/gfx/codec/png_codec.h" -#include "ui/gfx/geometry/size.h" - -namespace { -bool GetImageFromWebAXObject(const blink::WebAXObject& object, - SkBitmap& bitmap) { - const std::string image_data_url = object.ImageDataUrl(gfx::Size()).Utf8(); - if (image_data_url.empty()) { - VLOG(1) << "Screen AI could not get image for " << object.ToString().Utf8(); - return false; - } - - std::string mimetype; - std::string charset; - std::string png_data; - - if (!net::DataURL::Parse(GURL(image_data_url), &mimetype, &charset, - &png_data)) { - VLOG(1) << "Screen AI could not parse image."; - return false; - } - - if (!gfx::PNGCodec::Decode( - reinterpret_cast<const unsigned char*>(png_data.data()), - png_data.size(), &bitmap)) { - VLOG(2) << "Screen AI could not decode image."; - return false; - } - - return true; -} -} // namespace - -namespace content { - -AXScreenAIAnnotator::AXScreenAIAnnotator( - RenderAccessibilityImpl* const render_accessibility, - mojo::PendingRemote<screen_ai::mojom::ScreenAIAnnotator> - screen_ai_annotator) - : render_accessibility_(render_accessibility), - screen_ai_annotator_(std::move(screen_ai_annotator)) {} - -AXScreenAIAnnotator::~AXScreenAIAnnotator() = default; - -bool AXScreenAIAnnotator::ShouldAnnotateObject( - const blink::WebAXObject& object) { - // TODO(https://crbug.com/1278249): Add snapshot archiving and comparison to - // prevent re-annotating an object unless its image is modified. - - // TODO(https://crbug.com/1278249): Update heuristic. - return object.Role() == ax::mojom::Role::kRootWebArea; -} - -bool AXScreenAIAnnotator::ApplyAnnotationsIfAvailable( - const blink::WebAXObject& src, - ui::AXNodeData& dst) { - const auto lookup = annotations_.find(src.AxID()); - if (lookup == annotations_.end()) - return false; - - // TODO(https://crbug.com/1278249): Apply annotations. - return true; -} - -void AXScreenAIAnnotator::MaybeRunScreenAI(const blink::WebAXObject& object) { - if (ShouldAnnotateObject(object)) { - SkBitmap bitmap; - if (!GetImageFromWebAXObject(object, bitmap)) - return; - - annotations_[object.AxID()] = std::vector<screen_ai::mojom::Node>(); - screen_ai_annotator_->Annotate( - bitmap, base::BindOnce(&AXScreenAIAnnotator::OnAnnotationReceived, - weak_ptr_factory_.GetWeakPtr(), object.AxID())); - } -} - -void AXScreenAIAnnotator::OnAnnotationReceived( - ui::AXNodeID ax_id, - screen_ai::mojom::ErrorType error_type, - std::vector<screen_ai::mojom::NodePtr> annotation) { - if (error_type != screen_ai::mojom::ErrorType::kOK) - return; - - // TODO(https://crbug.com/1278249): Perform required conversions on members of - // |annotation| and store them in |annotations_| - - // TODO(https://crbug.com/1278249): Apply received annotation on |object|. - // Depending on the data received from Screen AI library, we may decide to - // update the node here, or just add the data during serialization. - blink::WebAXObject object = blink::WebAXObject::FromWebDocumentByID( - render_accessibility_->GetMainDocument(), ax_id); - - render_accessibility_->MarkWebAXObjectDirty(object, true /* subtree */); -} - -} // namespace content \ No newline at end of file
diff --git a/content/renderer/accessibility/ax_screen_ai_annotator.h b/content/renderer/accessibility/ax_screen_ai_annotator.h deleted file mode 100644 index 6572a4d..0000000 --- a/content/renderer/accessibility/ax_screen_ai_annotator.h +++ /dev/null
@@ -1,63 +0,0 @@ -// Copyright 2022 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CONTENT_RENDERER_ACCESSIBILITY_AX_SCREEN_AI_ANNOTATOR_H_ -#define CONTENT_RENDERER_ACCESSIBILITY_AX_SCREEN_AI_ANNOTATOR_H_ - -#include "base/memory/weak_ptr.h" -#include "components/services/screen_ai/public/mojom/screen_ai_service.mojom.h" -#include "content/renderer/accessibility/render_accessibility_impl.h" -#include "mojo/public/cpp/bindings/remote.h" - -namespace blink { -class WebAXObject; -} - -namespace ui { -struct AXNodeData; -} - -namespace content { - -class AXScreenAIAnnotator { - public: - AXScreenAIAnnotator(RenderAccessibilityImpl* const render_accessibility, - mojo::PendingRemote<screen_ai::mojom::ScreenAIAnnotator> - screen_ai_annotator); - ~AXScreenAIAnnotator(); - AXScreenAIAnnotator(const AXScreenAIAnnotator&) = delete; - AXScreenAIAnnotator& operator=(const AXScreenAIAnnotator&) = delete; - - // If |src| is already annotated, updates |dst| and returns true. Otherwise - // returns false. - bool ApplyAnnotationsIfAvailable(const blink::WebAXObject& src, - ui::AXNodeData& dst); - - // If validated by heuristics, |object|'s image is sent to ScreenAI service. - void MaybeRunScreenAI(const blink::WebAXObject& object); - - private: - // Heuristic based assessment if an object needs annotation. - bool ShouldAnnotateObject(const blink::WebAXObject& object); - - // Receives the annotation from ScreenAI service, stores them in - // |annotations_|, and marks the respective object dirty. - void OnAnnotationReceived(ui::AXNodeID ax_id, - screen_ai::mojom::ErrorType error_type, - std::vector<screen_ai::mojom::NodePtr> annotation); - - std::unordered_map<ui::AXNodeID, std::vector<screen_ai::mojom::Node>> - annotations_; - - // Weak, owns us. - RenderAccessibilityImpl* const render_accessibility_; - - mojo::Remote<screen_ai::mojom::ScreenAIAnnotator> screen_ai_annotator_; - - base::WeakPtrFactory<AXScreenAIAnnotator> weak_ptr_factory_{this}; -}; - -} // namespace content - -#endif // CONTENT_RENDERER_ACCESSIBILITY_AX_SCREEN_AI_ANNOTATOR_H_
diff --git a/content/renderer/accessibility/blink_ax_tree_source.cc b/content/renderer/accessibility/blink_ax_tree_source.cc index 7218fb79..e693e63 100644 --- a/content/renderer/accessibility/blink_ax_tree_source.cc +++ b/content/renderer/accessibility/blink_ax_tree_source.cc
@@ -49,10 +49,6 @@ #include "url/gurl.h" #include "url/url_constants.h" -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) -#include "content/renderer/accessibility/ax_screen_ai_annotator.h" -#endif - using base::ASCIIToUTF16; using base::UTF16ToUTF8; using blink::WebAXObject; @@ -591,13 +587,6 @@ element.GetAttribute("type").Utf8()); } } - -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) - if (screen_ai_annotator_ && - !screen_ai_annotator_->ApplyAnnotationsIfAvailable(src, *dst)) { - screen_ai_annotator_->MaybeRunScreenAI(src); - } -#endif } blink::WebDocument BlinkAXTreeSource::GetMainDocument() const {
diff --git a/content/renderer/accessibility/blink_ax_tree_source.h b/content/renderer/accessibility/blink_ax_tree_source.h index cee34de..82a6cb4 100644 --- a/content/renderer/accessibility/blink_ax_tree_source.h +++ b/content/renderer/accessibility/blink_ax_tree_source.h
@@ -24,7 +24,6 @@ namespace content { class AXImageAnnotator; -class AXScreenAIAnnotator; class BlinkAXTreeSource; class RenderFrameImpl; @@ -96,12 +95,6 @@ first_unlabeled_image_id_ = absl::nullopt; } - // The following method add or remove Screen AI annotator that is used to - // analyze the image of the nodes and provide additional metadata. - void set_screen_ai_annotator(AXScreenAIAnnotator* annotator) { - screen_ai_annotator_ = annotator; - } - // Query or update a set of IDs for which we should load inline text boxes. bool ShouldLoadInlineTextBoxes(const blink::WebAXObject& obj) const; void SetLoadInlineTextBoxesForId(int32_t id); @@ -197,11 +190,6 @@ // The class instance that retrieves and manages automatic labels for images. AXImageAnnotator* image_annotator_ = nullptr; - // The class instance that uses Screen AI library to analyze snapshots. - // |screen_ai_annotator_| belongs to RenderAccessibilityImpl which owns - // |BlinkAXTreeSource|. - AXScreenAIAnnotator* screen_ai_annotator_ = nullptr; - // Whether we should highlight annotation results visually on the page // for debugging. bool image_annotation_debugging_ = false;
diff --git a/content/renderer/accessibility/render_accessibility_impl.cc b/content/renderer/accessibility/render_accessibility_impl.cc index 498cc0a..40a9cf8 100644 --- a/content/renderer/accessibility/render_accessibility_impl.cc +++ b/content/renderer/accessibility/render_accessibility_impl.cc
@@ -45,7 +45,6 @@ #include "third_party/blink/public/web/web_page_popup.h" #include "third_party/blink/public/web/web_settings.h" #include "third_party/blink/public/web/web_view.h" -#include "ui/accessibility/accessibility_features.h" #include "ui/accessibility/accessibility_switches.h" #include "ui/accessibility/ax_enum_util.h" #include "ui/accessibility/ax_event_intent.h" @@ -53,10 +52,6 @@ #include "ui/accessibility/ax_role_properties.h" #include "ui/accessibility/ax_tree_id.h" -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) -#include "content/renderer/accessibility/ax_screen_ai_annotator.h" -#endif - using blink::WebAXContext; using blink::WebAXObject; using blink::WebDocument; @@ -173,10 +168,6 @@ image_annotation_debugging_ = base::CommandLine::ForCurrentProcess()->HasSwitch( ::switches::kEnableExperimentalAccessibilityLabelsDebugging); - -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) - StartOrStopScreenAIAnnotator(mode); -#endif } RenderAccessibilityImpl::~RenderAccessibilityImpl() = default; @@ -249,9 +240,6 @@ event_schedule_mode_ = EventScheduleMode::kProcessEventsImmediately; ScheduleSendPendingAccessibilityEvents(); } -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) - StartOrStopScreenAIAnnotator(mode); -#endif } void RenderAccessibilityImpl::HitTest( @@ -406,6 +394,7 @@ case ax::mojom::Action::kHitTest: case ax::mojom::Action::kReplaceSelectedText: case ax::mojom::Action::kNone: + case ax::mojom::Action::kRunScreenAi: NOTREACHED(); break; case ax::mojom::Action::kGetTextLocation: @@ -1257,33 +1246,6 @@ } } -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) -void RenderAccessibilityImpl::StartOrStopScreenAIAnnotator( - ui::AXMode new_mode) { - if (!features::IsScreenAIEnabled()) - return; - - if (new_mode.has_mode(ui::AXMode::kScreenReader) && - !ax_screen_ai_annotator_.get()) { - mojo::PendingRemote<screen_ai::mojom::ScreenAIAnnotator> - screen_ai_annotator; - render_frame_->GetBrowserInterfaceBroker()->GetInterface( - screen_ai_annotator.InitWithNewPipeAndPassReceiver()); - - ax_screen_ai_annotator_ = std::make_unique<AXScreenAIAnnotator>( - this, std::move(screen_ai_annotator)); - tree_source_->set_screen_ai_annotator(ax_screen_ai_annotator_.get()); - return; - } - - if (ax_screen_ai_annotator_.get() && - !new_mode.has_mode(ui::AXMode::kScreenReader)) { - tree_source_->set_screen_ai_annotator(nullptr); - ax_screen_ai_annotator_.reset(); - } -} -#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) - void RenderAccessibilityImpl::MarkAllAXObjectsDirty( ax::mojom::Role role, ax::mojom::Action event_from_action) {
diff --git a/content/renderer/accessibility/render_accessibility_impl.h b/content/renderer/accessibility/render_accessibility_impl.h index 92cd85c..61ce661 100644 --- a/content/renderer/accessibility/render_accessibility_impl.h +++ b/content/renderer/accessibility/render_accessibility_impl.h
@@ -50,7 +50,6 @@ namespace content { class AXImageAnnotator; -class AXScreenAIAnnotator; class RenderFrameImpl; class RenderAccessibilityManager; @@ -211,14 +210,6 @@ // any automatic annotations that might have been added before. void StartOrStopLabelingImages(ui::AXMode old_mode, ui::AXMode new_mode); -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) - // If new mode includes screen reader, initializes Screen AI service - // connection that processes snapshots to get more metadata. - // If new mode does not includes screen reader and Screen AI is enabled, turns - // it off. - void StartOrStopScreenAIAnnotator(ui::AXMode new_mode); -#endif - // Marks all AXObjects with the given role in the current tree dirty. void MarkAllAXObjectsDirty(ax::mojom::Role role, ax::mojom::Action event_from_action); @@ -279,11 +270,6 @@ // Manages the automatic image annotations, if enabled. std::unique_ptr<AXImageAnnotator> ax_image_annotator_; -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) - // Manages the snapshot processing, if enabled. - std::unique_ptr<AXScreenAIAnnotator> ax_screen_ai_annotator_; -#endif - // Events from Blink are collected until they are ready to be // sent to the browser. std::vector<ui::AXEvent> pending_events_;
diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn index 6d45e7b..ea578c81 100644 --- a/content/test/BUILD.gn +++ b/content/test/BUILD.gn
@@ -176,6 +176,7 @@ "../public/test/media_start_stop_observer.h", "../public/test/mock_browsing_data_remover_delegate.cc", "../public/test/mock_browsing_data_remover_delegate.h", + "../public/test/mock_client_hints_controller_delegate.h", "../public/test/mock_download_manager.cc", "../public/test/mock_download_manager.h", "../public/test/mock_navigation_handle.cc", @@ -322,9 +323,6 @@ "mock_badge_service.cc", "mock_badge_service.h", "mock_client_hints_controller_delegate.cc", - "mock_client_hints_controller_delegate.h", - "mock_client_hints_utils.cc", - "mock_client_hints_utils.h", "mock_clipboard_host.cc", "mock_clipboard_host.h", "mock_commit_deferring_condition.cc",
diff --git a/content/test/attribution_simulator_impl.cc b/content/test/attribution_simulator_impl.cc index 544130b..a026b4e 100644 --- a/content/test/attribution_simulator_impl.cc +++ b/content/test/attribution_simulator_impl.cc
@@ -239,6 +239,7 @@ case AttributionTrigger::EventLevelResult::kDroppedForNoise: case AttributionTrigger::EventLevelResult::kExcessiveReportingOrigins: case AttributionTrigger::EventLevelResult::kNoMatchingEventTriggers: + case AttributionTrigger::EventLevelResult::kNoMatchingSourceFilterData: reason << result.event_level_status(); break; }
diff --git a/content/test/attribution_simulator_input_parser.cc b/content/test/attribution_simulator_input_parser.cc index 36909fe..4f567035b 100644 --- a/content/test/attribution_simulator_input_parser.cc +++ b/content/test/attribution_simulator_input_parser.cc
@@ -104,17 +104,19 @@ static constexpr char kKeySources[] = "sources"; if (base::Value* sources = input.FindKey(kKeySources)) { auto context = PushContext(kKeySources); - ParseList(*sources, base::BindRepeating( - &AttributionSimulatorInputParser::ParseSource, + ParseList( + std::move(*sources), + base::BindRepeating(&AttributionSimulatorInputParser::ParseSource, base::Unretained(this))); } static constexpr char kKeyTriggers[] = "triggers"; if (base::Value* triggers = input.FindKey(kKeyTriggers)) { auto context = PushContext(kKeyTriggers); - ParseList(*triggers, base::BindRepeating( - &AttributionSimulatorInputParser::ParseTrigger, - base::Unretained(this))); + ParseList( + std::move(*triggers), + base::BindRepeating(&AttributionSimulatorInputParser::ParseTrigger, + base::Unretained(this))); } if (has_error_) @@ -150,22 +152,23 @@ return writer; } - void ParseList(base::Value& values, - base::RepeatingCallback<void(base::Value)> callback) { + template <typename T> + void ParseList(T&& values, + base::RepeatingCallback<void(decltype(values))> callback) { if (!values.is_list()) { *Error() << "must be a list"; return; } size_t index = 0; - for (base::Value& value : values.GetList()) { + for (auto&& value : values.GetList()) { auto index_context = PushContext(index); - callback.Run(std::move(value)); + callback.Run(std::forward<T>(value)); index++; } } - void ParseSource(base::Value source) { + void ParseSource(base::Value&& source) { if (!EnsureDictionary(source)) return; @@ -174,16 +177,24 @@ url::Origin reporting_origin = ParseOrigin(source, "reporting_origin"); absl::optional<AttributionSourceType> source_type = ParseSourceType(source); - base::Value* cfg = ParseRegistrationConfig(source); - if (!cfg) - return; + uint64_t source_event_id = 0; + url::Origin destination_origin; + absl::optional<uint64_t> debug_key; + int64_t priority = 0; + base::TimeDelta expiry; + AttributionFilterData filter_data; - uint64_t source_event_id = ParseRequiredUint64(*cfg, "source_event_id"); - url::Origin destination_origin = ParseOrigin(*cfg, "destination"); - absl::optional<uint64_t> debug_key = ParseOptionalUint64(*cfg, "debug_key"); - int64_t priority = ParseOptionalInt64(*cfg, "priority").value_or(0); - base::TimeDelta expiry = ParseSourceExpiry(*cfg).value_or(base::Days(30)); - AttributionFilterData filter_data = ParseFilterData(*cfg, "filter_data"); + if (!ParseRegistrationConfig( + source, base::BindLambdaForTesting([&](const base::Value& cfg) { + source_event_id = ParseRequiredUint64(cfg, "source_event_id"); + destination_origin = ParseOrigin(cfg, "destination"); + debug_key = ParseOptionalUint64(cfg, "debug_key"); + priority = ParseOptionalInt64(cfg, "priority").value_or(0); + expiry = ParseSourceExpiry(cfg).value_or(base::Days(30)); + filter_data = ParseFilterData(cfg, "filter_data"); + }))) { + return; + } // TODO(linnan): Support aggregatable reports in the simulator. @@ -201,7 +212,7 @@ std::move(source)); } - void ParseTrigger(base::Value trigger) { + void ParseTrigger(base::Value&& trigger) { if (!EnsureDictionary(trigger)) return; @@ -209,18 +220,25 @@ url::Origin reporting_origin = ParseOrigin(trigger, "reporting_origin"); net::SchemefulSite destination(ParseOrigin(trigger, "destination")); - const base::Value* cfg = ParseRegistrationConfig(trigger); - if (!cfg) - return; + uint64_t trigger_data = 0; + uint64_t event_source_trigger_data = 0; + absl::optional<uint64_t> debug_key; + absl::optional<uint64_t> dedup_key; + int64_t priority = 0; - uint64_t trigger_data = - ParseOptionalUint64(*cfg, "trigger_data").value_or(0); - uint64_t event_source_trigger_data = - ParseOptionalUint64(*cfg, "event_source_trigger_data").value_or(0); - absl::optional<uint64_t> debug_key = ParseOptionalUint64(*cfg, "debug_key"); - absl::optional<uint64_t> dedup_key = - ParseOptionalUint64(*cfg, "deduplication_key"); - int64_t priority = ParseOptionalInt64(*cfg, "priority").value_or(0); + if (!ParseRegistrationConfig( + trigger, base::BindLambdaForTesting([&](const base::Value& cfg) { + trigger_data = + ParseOptionalUint64(cfg, "trigger_data").value_or(0); + event_source_trigger_data = + ParseOptionalUint64(cfg, "event_source_trigger_data") + .value_or(0); + debug_key = ParseOptionalUint64(cfg, "debug_key"); + dedup_key = ParseOptionalUint64(cfg, "deduplication_key"); + priority = ParseOptionalInt64(cfg, "priority").value_or(0); + }))) { + return; + } if (has_error_) return; @@ -332,28 +350,31 @@ return source_type; } - base::Value* ParseRegistrationConfig(base::Value& dict) { + bool ParseRegistrationConfig( + base::Value& dict, + base::OnceCallback<void(const base::Value&)> callback) { static constexpr char kKey[] = "registration_config"; auto context = PushContext(kKey); - base::Value* cfg = dict.FindKey(kKey); + const base::Value* cfg = dict.FindKey(kKey); if (!cfg) { *Error() << "must be present"; - return nullptr; + return false; } if (!EnsureDictionary(*cfg)) - return nullptr; + return false; - return cfg; + std::move(callback).Run(*cfg); + return true; } - AttributionFilterData ParseFilterData(base::Value& dict, + AttributionFilterData ParseFilterData(const base::Value& dict, base::StringPiece key) { auto context = PushContext(key); - base::Value* value = dict.FindKey(key); + const base::Value* value = dict.FindKey(key); if (!value) return AttributionFilterData(); @@ -361,19 +382,20 @@ return AttributionFilterData(); AttributionFilterData::FilterValues::container_type container; - for (auto [filter, values_list] : std::move(value->GetDict())) { + for (auto [filter, values_list] : value->GetDict()) { auto filter_context = PushContext(filter); std::vector<std::string> values; - ParseList(values_list, base::BindLambdaForTesting([&](base::Value value) { + ParseList(values_list, + base::BindLambdaForTesting([&](const base::Value& value) { if (!value.is_string()) { *Error() << "must be a string"; } else { - values.emplace_back(std::move(value.GetString())); + values.emplace_back(value.GetString()); } })); - container.emplace_back(std::move(filter), std::move(values)); + container.emplace_back(filter, std::move(values)); } absl::optional<AttributionFilterData> filter_data =
diff --git a/content/test/attribution_simulator_input_parser_unittest.cc b/content/test/attribution_simulator_input_parser_unittest.cc index 5bd580d..683e876 100644 --- a/content/test/attribution_simulator_input_parser_unittest.cc +++ b/content/test/attribution_simulator_input_parser_unittest.cc
@@ -164,6 +164,50 @@ EXPECT_THAT(error_stream.str(), IsEmpty()); } +TEST(AttributionSimulatorInputParserTest, OutputRetainsInputJSON) { + constexpr char kJson[] = R"json({ + "sources": [ + { + "source_type": "navigation", + "source_time": 1643235574, + "reporting_origin": "https://r.test", + "source_origin": "https://s.test", + "registration_config": { + "source_event_id": "123", + "destination": "https://d.test", + "filter_data": {"a": ["b", "c"]}, + "expiry": "864000000", + "priority": "-5", + "debug_key": "14" + } + } + ], + "triggers": [ + { + "trigger_time": 1643235576, + "reporting_origin": "https://a.r.test", + "destination": " https://a.d1.test", + "registration_config": { + "trigger_data": "10", + "event_source_trigger_data": "3", + "priority": "-5", + "deduplication_key": "123", + "debug_key": "14" + } + } + ]})json"; + + const base::Value value = base::test::ParseJson(kJson); + std::stringstream error_stream; + EXPECT_THAT( + ParseAttributionSimulationInput(value.Clone(), kOffsetTime, error_stream), + Optional(ElementsAre( + Pair(_, base::test::IsJson( + value.FindKey("sources")->GetIfList()->front())), + Pair(_, base::test::IsJson( + value.FindKey("triggers")->GetIfList()->front()))))); +} + TEST(AttributionSimulatorInputParserTest, ValidTriggerParses) { constexpr char kJson[] = R"json({"triggers": [ { @@ -350,7 +394,7 @@ }]})json", }, { - R"(["sources"][0]["source_event_id"]: must be a uint64 formatted)", + R"(["sources"][0]["registration_config"]["source_event_id"]: must be a uint64 formatted)", R"json({"sources": [{ "source_type": "navigation", "source_time": 1643235574, @@ -362,7 +406,7 @@ }]})json", }, { - R"(["sources"][0]["destination"]: must be a valid origin)", + R"(["sources"][0]["registration_config"]["destination"]: must be a valid origin)", R"json({"sources": [{ "source_type": "navigation", "source_time": 1643235574, @@ -387,7 +431,7 @@ }]})json", }, { - R"(["sources"][0]["expiry"]: must be a positive number of)", + R"(["sources"][0]["registration_config"]["expiry"]: must be a positive number of)", R"json({"sources": [{ "source_type": "navigation", "source_time": 1643235574, @@ -401,7 +445,7 @@ }]})json", }, { - R"(["sources"][0]["priority"]: must be an int64)", + R"(["sources"][0]["registration_config"]["priority"]: must be an int64)", R"json({"sources": [{ "source_type": "navigation", "source_time": 1643235574, @@ -415,7 +459,7 @@ }]})json", }, { - R"(["sources"][0]["source_event_id"]: must be a uint64 formatted)", + R"(["sources"][0]["registration_config"]["source_event_id"]: must be a uint64 formatted)", R"json({"sources": [{ "source_type": "navigation", "source_time": 1643235574, @@ -428,7 +472,7 @@ }]})json", }, { - R"(["sources"][0]["filter_data"]: must be a dictionary)", + R"(["sources"][0]["registration_config"]["filter_data"]: must be a dictionary)", R"json({"sources": [{ "source_type": "navigation", "source_time": 1643235574, @@ -442,7 +486,7 @@ }]})json", }, { - R"(["sources"][0]["filter_data"]["a"]: must be a list)", + R"(["sources"][0]["registration_config"]["filter_data"]["a"]: must be a list)", R"json({"sources": [{ "source_type": "navigation", "source_time": 1643235574, @@ -458,7 +502,7 @@ }]})json", }, { - R"(["sources"][0]["filter_data"]["a"][0]: must be a string)", + R"(["sources"][0]["registration_config"]["filter_data"]["a"][0]: must be a string)", R"json({"sources": [{ "source_type": "navigation", "source_time": 1643235574,
diff --git a/content/test/data/accessibility/event/anonymous-block-children-changed-expected-auralinux.txt b/content/test/data/accessibility/event/anonymous-block-children-changed-expected-auralinux.txt deleted file mode 100644 index 884fbb5..0000000 --- a/content/test/data/accessibility/event/anonymous-block-children-changed-expected-auralinux.txt +++ /dev/null
@@ -1,17 +0,0 @@ -CHILDREN-CHANGED:ADD index:0 CHILD:(role=ROLE_PARAGRAPH) role=ROLE_SECTION ENABLED,SENSITIVE,SHOWING,VISIBLE -CHILDREN-CHANGED:ADD index:1 CHILD:(role=ROLE_LINK) role=ROLE_SECTION ENABLED,SENSITIVE,SHOWING,VISIBLE -=== Start Continuation === -CHILDREN-CHANGED:ADD index:2 CHILD:(role=ROLE_PARAGRAPH) role=ROLE_SECTION ENABLED,SENSITIVE,SHOWING,VISIBLE -CHILDREN-CHANGED:ADD index:3 CHILD:(role=ROLE_LINK) role=ROLE_SECTION ENABLED,SENSITIVE,SHOWING,VISIBLE -=== Start Continuation === -CHILDREN-CHANGED:REMOVE index:0 CHILD:(role=ROLE_PARAGRAPH) role=ROLE_SECTION ENABLED,SENSITIVE,SHOWING,VISIBLE -CHILDREN-CHANGED:REMOVE index:1 CHILD:(role=ROLE_LINK) role=ROLE_SECTION ENABLED,SENSITIVE,SHOWING,VISIBLE -=== Start Continuation === -CHILDREN-CHANGED:ADD index:2 CHILD:(role=ROLE_PARAGRAPH) role=ROLE_SECTION ENABLED,SENSITIVE,SHOWING,VISIBLE -CHILDREN-CHANGED:ADD index:3 CHILD:(role=ROLE_LINK) role=ROLE_SECTION ENABLED,SENSITIVE,SHOWING,VISIBLE -=== Start Continuation === -CHILDREN-CHANGED:ADD index:4 CHILD:(role=ROLE_PARAGRAPH) role=ROLE_SECTION ENABLED,SENSITIVE,SHOWING,VISIBLE -CHILDREN-CHANGED:ADD index:5 CHILD:(role=ROLE_LINK) role=ROLE_SECTION ENABLED,SENSITIVE,SHOWING,VISIBLE -=== Start Continuation === -CHILDREN-CHANGED:REMOVE index:0 CHILD:(role=ROLE_PARAGRAPH) role=ROLE_SECTION ENABLED,SENSITIVE,SHOWING,VISIBLE -CHILDREN-CHANGED:REMOVE index:1 CHILD:(role=ROLE_LINK) role=ROLE_SECTION ENABLED,SENSITIVE,SHOWING,VISIBLE
diff --git a/content/test/data/accessibility/event/anonymous-block-children-changed.html b/content/test/data/accessibility/event/anonymous-block-children-changed.html deleted file mode 100644 index 5a9e6895..0000000 --- a/content/test/data/accessibility/event/anonymous-block-children-changed.html +++ /dev/null
@@ -1,47 +0,0 @@ -<!-- -@AURALINUX-DENY:STATE-CHANGE:DEFUNCT* ---> -<!DOCTYPE html> -<html> -<body> -<div role="group"> - <div id="container"></div> -</div> -<script> - const container = document.getElementById("container"); - - function addChildren(index) { - const p = document.createElement("p"); - p.id = "p" + index; - p.innerHTML = "paragraph " + index; - container.appendChild(p); - - const a = document.createElement("a"); - a.id = "a" + index; - a.innerHTML = "link " + index; - a.href = "#"; - container.appendChild(a); - } - - function removeChildren(index) { - container.removeChild(document.getElementById("p" + index)); - container.removeChild(document.getElementById("a" + index)); - } - - var go_passes = [ - () => addChildren(1), - () => addChildren(2), - () => removeChildren(1), - () => addChildren(3), - () => addChildren(4), - () => removeChildren(2), - ]; - - var current_pass = 0; - function go() { - go_passes[current_pass++].call(); - return current_pass < go_passes.length; - } -</script> -</body> -</html>
diff --git a/content/test/data/accessibility/html/list-text-addition-expected-blink.txt b/content/test/data/accessibility/html/list-text-addition-expected-blink.txt deleted file mode 100644 index d42d8c88..0000000 --- a/content/test/data/accessibility/html/list-text-addition-expected-blink.txt +++ /dev/null
@@ -1,25 +0,0 @@ -rootWebArea name='done' -++genericContainer ignored -++++genericContainer ignored -++++++staticText name='$' -++++++++inlineTextBox name='$' -++++++list name='inline list' -++++++++staticText name='$' -++++++++++inlineTextBox name='$' -++++++++listItem -++++++++++staticText name='item' -++++++++++++inlineTextBox name='item' -++++++++staticText name='$' -++++++++++inlineTextBox name='$' -++++++staticText name='$' -++++++++inlineTextBox name='$' -++++++list name='block list' -++++++++staticText name='$' -++++++++++inlineTextBox name='$' -++++++++listItem -++++++++++staticText name='item' -++++++++++++inlineTextBox name='item' -++++++++staticText name='$' -++++++++++inlineTextBox name='$' -++++++staticText name='$' -++++++++inlineTextBox name='$'
diff --git a/content/test/data/accessibility/html/list-text-addition.html b/content/test/data/accessibility/html/list-text-addition.html deleted file mode 100644 index 6d324c3..0000000 --- a/content/test/data/accessibility/html/list-text-addition.html +++ /dev/null
@@ -1,32 +0,0 @@ -<!-- -@WAIT-FOR:done ---> -<html> -<head> -<script> -function convertWhitespaceToDollar(node) { - let child = node.firstChild; - while (child) { - if (child.nodeType == Node.ELEMENT_NODE) - convertWhitespaceToDollar(child); - else if (child.nodeType == Node.TEXT_NODE && child.data.indexOf('\n') >= 0) - child.data = '$'; - child = child.nextSibling; - } -} -setTimeout(() => { - convertWhitespaceToDollar(document.body); - document.title = 'done'; -}, 500); -</script> -</head> -<body> -<ul aria-label="inline list"> -<li style="display:inline;">item</li> -</ul> -<ul aria-label="block list" style="list-style-type: none;"> -<li>item</li> -</ul> -</body> -</body> -</html>
diff --git a/content/test/data/accessibility/html/list-text-expected-blink.txt b/content/test/data/accessibility/html/list-text-expected-blink.txt deleted file mode 100644 index d46e926..0000000 --- a/content/test/data/accessibility/html/list-text-expected-blink.txt +++ /dev/null
@@ -1,41 +0,0 @@ -rootWebArea -++genericContainer ignored -++++genericContainer ignored -++++++list -++++++++listItem -++++++++++listMarker name='1. ' -++++++++++++staticText ignored name='1. ' -++++++++++staticText name='tic' -++++++++++++inlineTextBox name='tic' -++++++++staticText name='^' -++++++++++inlineTextBox name='^' -++++++++listItem -++++++++++listMarker name='2. ' -++++++++++++staticText ignored name='2. ' -++++++++++staticText name='tac' -++++++++++++inlineTextBox name='tac' -++++++++listItem -++++++++++listMarker name='3. ' -++++++++++++staticText ignored name='3. ' -++++++++++staticText name='toe' -++++++++++++inlineTextBox name='toe' -++++++++staticText name='|' -++++++++++inlineTextBox name='|' -++++++staticText name='^' -++++++++inlineTextBox name='^' -++++++list -++++++++listItem -++++++++++staticText name='tic' -++++++++++++inlineTextBox name='tic' -++++++++staticText name=' ' -++++++++++inlineTextBox name=' ' -++++++++listItem -++++++++++staticText name='tac' -++++++++++++inlineTextBox name='tac' -++++++++staticText name=' ' -++++++++++inlineTextBox name=' ' -++++++++listItem -++++++++++staticText name='toe' -++++++++++++inlineTextBox name='toe' -++++++staticText name='|' -++++++++inlineTextBox name='|'
diff --git a/content/test/data/accessibility/html/list-text.html b/content/test/data/accessibility/html/list-text.html deleted file mode 100644 index b89da32..0000000 --- a/content/test/data/accessibility/html/list-text.html +++ /dev/null
@@ -1,20 +0,0 @@ -<!DOCTYPE html> -<html> - <style type="text/css"> - .inlineList li { - display: inline; - } - </style> - <body> - <ol> - <li>tic</li> - ^<li>tac</li> - <li>toe</li>| - </ol> - ^<ul class="inlineList"> - <li>tic</li> - <li>tac</li> - <li>toe</li> - </ul>| - </body> -</html>
diff --git a/content/test/data/accessibility/regression/anonymous-block-many-children-changed-expected-blink.txt b/content/test/data/accessibility/regression/anonymous-block-many-children-changed-expected-blink.txt deleted file mode 100644 index 4806d91..0000000 --- a/content/test/data/accessibility/regression/anonymous-block-many-children-changed-expected-blink.txt +++ /dev/null
@@ -1,3 +0,0 @@ -rootWebArea -++genericContainer ignored -++++genericContainer ignored
diff --git a/content/test/data/accessibility/regression/anonymous-block-many-children-changed.html b/content/test/data/accessibility/regression/anonymous-block-many-children-changed.html deleted file mode 100644 index b2fe28a2..0000000 --- a/content/test/data/accessibility/regression/anonymous-block-many-children-changed.html +++ /dev/null
@@ -1,27 +0,0 @@ -<!DOCTYPE html> -<html> -<body class="@NO_CHILDREN_DUMP"> -<div id="outer"> - <div id="inner"></div> -</div> -<script> - // This test verifies we do not time out due to children-changed being - // fired on each anonymous-block child when a single child is added to, - // or removed from, that anonymous block. - var count = 5000; - const inner = document.getElementById("inner"); - for (let i = 0; i < count; ++i) { - const p = document.createElement("p"); - p.id = "p" + i; - p.innerHTML = "paragraph " + i; - inner.appendChild(p); - - const a = document.createElement("a"); - a.id = "a" + i; - a.innerHTML = "link " + i; - a.href = "#"; - inner.appendChild(a); - } -</script> -</body> -</html>
diff --git a/content/test/data/attribution_reporting/databases/version_30.sql b/content/test/data/attribution_reporting/databases/version_30.sql index 23c1806..68a96ec 100644 --- a/content/test/data/attribution_reporting/databases/version_30.sql +++ b/content/test/data/attribution_reporting/databases/version_30.sql
@@ -48,4 +48,6 @@ CREATE INDEX contribution_aggregation_id_idx ON aggregatable_contributions(aggregation_id); +INSERT INTO conversions VALUES (1,2,3,4,5,6,7,8,9); + COMMIT;
diff --git a/content/test/data/attribution_reporting/databases/version_29.sql b/content/test/data/attribution_reporting/databases/version_31.sql similarity index 68% rename from content/test/data/attribution_reporting/databases/version_29.sql rename to content/test/data/attribution_reporting/databases/version_31.sql index c461349..c71d6be 100644 --- a/content/test/data/attribution_reporting/databases/version_29.sql +++ b/content/test/data/attribution_reporting/databases/version_31.sql
@@ -2,7 +2,7 @@ BEGIN TRANSACTION; -CREATE TABLE impressions(impression_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,impression_data INTEGER NOT NULL,impression_origin TEXT NOT NULL,conversion_origin TEXT NOT NULL,reporting_origin TEXT NOT NULL,impression_time INTEGER NOT NULL,expiry_time INTEGER NOT NULL,num_conversions INTEGER NOT NULL,active INTEGER NOT NULL,conversion_destination TEXT NOT NULL,source_type INTEGER NOT NULL,attributed_truthfully INTEGER NOT NULL,priority INTEGER NOT NULL,impression_site TEXT NOT NULL,debug_key INTEGER,aggregatable_budget_consumed INTEGER NOT NULL,aggregatable_sources BLOB NOT NULL,filter_data BLOB NOT NULL); +CREATE TABLE impressions(impression_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,impression_data INTEGER NOT NULL,impression_origin TEXT NOT NULL,conversion_origin TEXT NOT NULL,reporting_origin TEXT NOT NULL,impression_time INTEGER NOT NULL,expiry_time INTEGER NOT NULL,num_conversions INTEGER NOT NULL,event_level_active INTEGER NOT NULL,aggregatable_active INTEGER NOT NULL,conversion_destination TEXT NOT NULL,source_type INTEGER NOT NULL,attributed_truthfully INTEGER NOT NULL,priority INTEGER NOT NULL,impression_site TEXT NOT NULL,debug_key INTEGER,aggregatable_budget_consumed INTEGER NOT NULL,aggregatable_sources BLOB NOT NULL,filter_data BLOB NOT NULL); CREATE TABLE conversions(conversion_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,impression_id INTEGER NOT NULL,conversion_data INTEGER NOT NULL,conversion_time INTEGER NOT NULL,report_time INTEGER NOT NULL,priority INTEGER NOT NULL,failed_send_attempts INTEGER NOT NULL,external_report_id TEXT NOT NULL,debug_key INTEGER); @@ -10,23 +10,23 @@ CREATE TABLE dedup_keys(impression_id INTEGER NOT NULL,dedup_key INTEGER NOT NULL,PRIMARY KEY(impression_id,dedup_key))WITHOUT ROWID; -CREATE TABLE aggregatable_report_metadata(aggregation_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,source_id INTEGER NOT NULL,trigger_time INTEGER NOT NULL,debug_key INTEGER); +CREATE TABLE aggregatable_report_metadata(aggregation_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,source_id INTEGER NOT NULL,trigger_time INTEGER NOT NULL,debug_key INTEGER,external_report_id TEXT NOT NULL,report_time INTEGER NOT NULL,failed_send_attempts INTEGER NOT NULL); -CREATE TABLE aggregatable_contributions(contribution_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,aggregation_id INTEGER NOT NULL,report_time INTEGER NOT NULL,failed_send_attempts INTEGER NOT NULL,key_high_bits INTEGER NOT NULL,key_low_bits INTEGER NOT NULL,value INTEGER NOT NULL,external_report_id TEXT NOT NULL); +CREATE TABLE aggregatable_contributions(contribution_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,aggregation_id INTEGER NOT NULL,key_high_bits INTEGER NOT NULL,key_low_bits INTEGER NOT NULL,value INTEGER NOT NULL); CREATE TABLE meta(key LONGVARCHAR NOT NULL UNIQUE PRIMARY KEY, value LONGVARCHAR); INSERT INTO meta VALUES('mmap_status','-1'); -INSERT INTO meta VALUES('version','29'); -INSERT INTO meta VALUES('last_compatible_version','29'); +INSERT INTO meta VALUES('version','31'); +INSERT INTO meta VALUES('last_compatible_version','31'); -CREATE INDEX conversion_destination_idx ON impressions(active,conversion_destination,reporting_origin); +CREATE INDEX conversion_destination_idx ON impressions(event_level_active,aggregatable_active,conversion_destination,reporting_origin); CREATE INDEX impression_expiry_idx ON impressions(expiry_time); CREATE INDEX impression_origin_idx ON impressions(impression_origin); -CREATE INDEX impression_site_reporting_origin_idx ON impressions(impression_site,reporting_origin)WHERE active=1 AND num_conversions=0; +CREATE INDEX impression_site_reporting_origin_idx ON impressions(impression_site,reporting_origin)WHERE event_level_active=1 AND num_conversions=0 AND aggregatable_active=1 AND aggregatable_budget_consumed=0; CREATE INDEX conversion_report_idx ON conversions(report_time); @@ -44,10 +44,8 @@ CREATE INDEX aggregate_trigger_time_idx ON aggregatable_report_metadata(trigger_time); +CREATE INDEX aggregate_report_time_idx ON aggregatable_report_metadata(report_time); + CREATE INDEX contribution_aggregation_id_idx ON aggregatable_contributions(aggregation_id); -CREATE INDEX contribution_report_time_idx ON aggregatable_contributions(report_time); - -INSERT INTO conversions VALUES (1,2,3,4,5,6,7,8,9); - COMMIT;
diff --git a/content/test/data/gpu/pixel_webgpu_cached_swap_buffer_invalidated.html b/content/test/data/gpu/pixel_webgpu_cached_swap_buffer_invalidated.html index ea8c53ab..a8ac584 100644 --- a/content/test/data/gpu/pixel_webgpu_cached_swap_buffer_invalidated.html +++ b/content/test/data/gpu/pixel_webgpu_cached_swap_buffer_invalidated.html
@@ -45,7 +45,6 @@ device: device, format: 'bgra8unorm', usage: GPUTextureUsage.RENDER_ATTACHMENT, - compositingAlphaMode: 'premultiplied', }); let framesToRender = 30;
diff --git a/content/test/fenced_frame_test_utils.cc b/content/test/fenced_frame_test_utils.cc index 46e3dd7..f2a5633 100644 --- a/content/test/fenced_frame_test_utils.cc +++ b/content/test/fenced_frame_test_utils.cc
@@ -23,30 +23,6 @@ return FrameTreeNode::GloballyFindByID(inner_node_id); } -FencedFrame* GetMatchingFencedFrameInOuterFrameTree(RenderFrameHostImpl* rfh) { - EXPECT_EQ(blink::features::kFencedFramesImplementationTypeParam.Get(), - blink::features::FencedFramesImplementationType::kMPArch); - // `rfh` doesn't always have to be a root frame, since this needs to work - // for arbitrary frames within a fenced frame. - EXPECT_TRUE(rfh->frame_tree_node()->IsInFencedFrameTree()); - - RenderFrameHostImpl* outer_delegate_frame = - rfh->GetMainFrame()->GetParentOrOuterDocument(); - - std::vector<FencedFrame*> fenced_frames = - outer_delegate_frame->GetFencedFrames(); - EXPECT_FALSE(fenced_frames.empty()); - - for (FencedFrame* fenced_frame : fenced_frames) { - if (fenced_frame->GetInnerRoot() == rfh->GetMainFrame()) { - return fenced_frame; - } - } - - NOTREACHED(); - return nullptr; -} - TestFencedFrameURLMappingResultObserver:: TestFencedFrameURLMappingResultObserver() = default; @@ -55,53 +31,13 @@ void TestFencedFrameURLMappingResultObserver::OnFencedFrameURLMappingComplete( absl::optional<GURL> mapped_url, + absl::optional<AdAuctionData> ad_auction_data, absl::optional<FencedFrameURLMapping::PendingAdComponentsMap> pending_ad_components_map) { mapping_complete_observed_ = true; mapped_url_ = std::move(mapped_url); + ad_auction_data_ = ad_auction_data; pending_ad_components_map_ = std::move(pending_ad_components_map); } -FencedFrameNavigationObserver::FencedFrameNavigationObserver( - RenderFrameHostImpl* fenced_frame_rfh) - : frame_tree_node_(fenced_frame_rfh->frame_tree_node()) { - EXPECT_TRUE(frame_tree_node_->IsInFencedFrameTree()); - - if (blink::features::kFencedFramesImplementationTypeParam.Get() == - blink::features::FencedFramesImplementationType::kShadowDOM) { - observer_for_shadow_dom_ = - std::make_unique<TestFrameNavigationObserver>(fenced_frame_rfh); - return; - } - - fenced_frame_for_mparch_ = - GetMatchingFencedFrameInOuterFrameTree(fenced_frame_rfh); -} - -FencedFrameNavigationObserver::~FencedFrameNavigationObserver() = default; - -void FencedFrameNavigationObserver::Wait(net::Error expected_net_error_code) { - if (blink::features::kFencedFramesImplementationTypeParam.Get() == - blink::features::FencedFramesImplementationType::kShadowDOM) { - DCHECK(observer_for_shadow_dom_); - observer_for_shadow_dom_->Wait(); - EXPECT_EQ(observer_for_shadow_dom_->last_net_error_code(), - expected_net_error_code); - return; - } - - DCHECK(fenced_frame_for_mparch_); - - // TODO(crbug.com/1257133): Once this bug is fixed, we can use - // `TestFrameNavigationObserver` to tell us when the navigation has finished, - // which actually exposes net::Error codes encountered during navigation. - // Therefore once that bug is fixed, we can perform finer-grained error - // code comparisons than the crude `RenderFrameHost::IsErrorDocument()` one - // below. - fenced_frame_for_mparch_->WaitForDidStopLoadingForTesting(); - - EXPECT_EQ(frame_tree_node_->current_frame_host()->IsErrorDocument(), - expected_net_error_code != net::OK); -} - } // namespace content
diff --git a/content/test/fenced_frame_test_utils.h b/content/test/fenced_frame_test_utils.h index 7d69bda..d66e1f4 100644 --- a/content/test/fenced_frame_test_utils.h +++ b/content/test/fenced_frame_test_utils.h
@@ -10,10 +10,7 @@ namespace content { -class FencedFrame; -class RenderFrameHostImpl; class FrameTreeNode; -class TestFrameNavigationObserver; // `node` is expected to be the child FrameTreeNode created in response to a // <fencedframe> element being created. This method: @@ -22,11 +19,6 @@ // we're in the MPArch version of fenced frames FrameTreeNode* GetFencedFrameRootNode(FrameTreeNode* node); -// This method takes in a RenderFrameHostImpl that must be inside a fenced frame -// FrameTree, and returns the FencedFrame* object that represents this inner -// FrameTree from the outer FrameTree. -FencedFrame* GetMatchingFencedFrameInOuterFrameTree(RenderFrameHostImpl* rfh); - // Tests can use this class to observe and check the URL mapping result. class TestFencedFrameURLMappingResultObserver : public FencedFrameURLMapping::MappingResultObserver { @@ -36,6 +28,7 @@ void OnFencedFrameURLMappingComplete( absl::optional<GURL> mapped_url, + absl::optional<AdAuctionData> ad_auction_data, absl::optional<FencedFrameURLMapping::PendingAdComponentsMap> pending_ad_components_map) override; @@ -48,36 +41,16 @@ return pending_ad_components_map_; } + const absl::optional<AdAuctionData> ad_auction_data() const { + return ad_auction_data_; + } + private: bool mapping_complete_observed_ = false; absl::optional<GURL> mapped_url_; absl::optional<FencedFrameURLMapping::PendingAdComponentsMap> pending_ad_components_map_; -}; - -class FencedFrameNavigationObserver { - public: - explicit FencedFrameNavigationObserver(RenderFrameHostImpl* fenced_frame_rfh); - - ~FencedFrameNavigationObserver(); - - void Wait(net::Error expected_net_error_code); - - private: - FrameTreeNode* frame_tree_node_ = nullptr; - - // For the ShadowDOM version of fenced frames, we can just use a - // `TestFrameNavigationObserver` as normal directly on the frame that is - // navigating. - std::unique_ptr<TestFrameNavigationObserver> observer_for_shadow_dom_; - - // For the MPArch version of fenced frames, rely on - // FencedFrame::WaitForDidStopLoadingForTesting. `TestFrameNavigationObserver` - // does not fully work inside of a fenced frame FrameTree: `WaitForCommit()` - // works, but `Wait()` always times out because it expects to hear the - // DidFinishedLoad event from the outer WebContents, which is not communicated - // by nested FrameTrees. - FencedFrame* fenced_frame_for_mparch_ = nullptr; + absl::optional<AdAuctionData> ad_auction_data_; }; } // namespace content
diff --git a/content/test/mock_client_hints_controller_delegate.cc b/content/test/mock_client_hints_controller_delegate.cc index 94e097a..29076daa 100644 --- a/content/test/mock_client_hints_controller_delegate.cc +++ b/content/test/mock_client_hints_controller_delegate.cc
@@ -2,14 +2,42 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "content/test/mock_client_hints_controller_delegate.h" +#include "content/public/test/mock_client_hints_controller_delegate.h" #include "content/public/common/origin_util.h" +#include "services/network/public/cpp/is_potentially_trustworthy.h" #include "third_party/blink/public/common/user_agent/user_agent_metadata.h" #include "url/gurl.h" namespace content { +namespace { + +bool PersistClientHintsHelper(const GURL& url, + const blink::EnabledClientHints& client_hints, + ClientHintsContainer* container) { + DCHECK(container); + if (!network::IsUrlPotentiallyTrustworthy(url)) { + return false; + } + const url::Origin origin = url::Origin::Create(url); + (*container)[origin] = client_hints; + return true; +} + +void GetAllowedClientHintsFromSourceHelper( + const url::Origin& origin, + const ClientHintsContainer& container, + blink::EnabledClientHints* client_hints) { + const auto& it = container.find(origin); + DCHECK(client_hints); + if (it != container.end()) { + *client_hints = it->second; + } +} + +} // namespace + MockClientHintsControllerDelegate::MockClientHintsControllerDelegate( const blink::UserAgentMetadata& metadata) : metadata_(metadata) {}
diff --git a/content/test/mock_client_hints_utils.cc b/content/test/mock_client_hints_utils.cc deleted file mode 100644 index ccfc584..0000000 --- a/content/test/mock_client_hints_utils.cc +++ /dev/null
@@ -1,36 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "content/test/mock_client_hints_utils.h" - -#include "services/network/public/cpp/is_potentially_trustworthy.h" - -namespace content { - -bool PersistClientHintsHelper(const GURL& url, - const blink::EnabledClientHints& client_hints, - ClientHintsContainer* container) { - DCHECK(container); - if (!network::IsUrlPotentiallyTrustworthy(url)) { - return false; - } - ClientHintsPersistencyData data; - data.client_hints = client_hints; - const url::Origin origin = url::Origin::Create(url); - (*container)[origin] = data; - return true; -} - -void GetAllowedClientHintsFromSourceHelper( - const url::Origin& origin, - const ClientHintsContainer& container, - blink::EnabledClientHints* client_hints) { - const auto& it = container.find(origin); - DCHECK(client_hints); - if (it != container.end()) { - *client_hints = it->second.client_hints; - } -} - -} // namespace content
diff --git a/content/test/mock_client_hints_utils.h b/content/test/mock_client_hints_utils.h deleted file mode 100644 index b127bf7..0000000 --- a/content/test/mock_client_hints_utils.h +++ /dev/null
@@ -1,35 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CONTENT_TEST_MOCK_CLIENT_HINTS_UTILS_H_ -#define CONTENT_TEST_MOCK_CLIENT_HINTS_UTILS_H_ - -#include <map> - -#include "content/public/common/origin_util.h" -#include "third_party/blink/public/common/client_hints/enabled_client_hints.h" -#include "third_party/blink/public/platform/web_url.h" - -namespace content { - -struct ClientHintsPersistencyData { - blink::EnabledClientHints client_hints; -}; - -using ClientHintsContainer = - std::map<const url::Origin, ClientHintsPersistencyData>; - -bool PersistClientHintsHelper( - const GURL& url, - const blink::EnabledClientHints& enabled_client_hints, - ClientHintsContainer* container); - -void GetAllowedClientHintsFromSourceHelper( - const url::Origin& origin, - const ClientHintsContainer& container, - blink::EnabledClientHints* client_hints); - -} // namespace content - -#endif // CONTENT_TEST_MOCK_CLIENT_HINTS_UTILS_H_
diff --git a/content/test/test_aggregation_service_impl.cc b/content/test/test_aggregation_service_impl.cc index 712e3e9..68d9977 100644 --- a/content/test/test_aggregation_service_impl.cc +++ b/content/test/test_aggregation_service_impl.cc
@@ -41,13 +41,14 @@ } } -AggregationServicePayloadContents::ProcessingType ConvertToProcessingType( - TestAggregationService::ProcessingType processing_type) { - switch (processing_type) { - case TestAggregationService::ProcessingType::kTwoParty: - return AggregationServicePayloadContents::ProcessingType::kTwoParty; - case TestAggregationService::ProcessingType::kSingleServer: - return AggregationServicePayloadContents::ProcessingType::kSingleServer; +AggregationServicePayloadContents::AggregationMode ConvertToAggregationMode( + TestAggregationService::AggregationMode aggregation_mode) { + switch (aggregation_mode) { + case TestAggregationService::AggregationMode::kTeeBased: + return AggregationServicePayloadContents::AggregationMode::kTeeBased; + case TestAggregationService::AggregationMode::kExperimentalPoplar: + return AggregationServicePayloadContents::AggregationMode:: + kExperimentalPoplar; } } @@ -135,7 +136,7 @@ ConvertToOperation(request.operation), {AggregationServicePayloadContents::HistogramContribution{ .bucket = request.bucket, .value = request.value}}, - ConvertToProcessingType(request.processing_type)); + ConvertToAggregationMode(request.aggregation_mode)); AggregatableReportSharedInfo shared_info( /*scheduled_report_time=*/base::Time::Now() + base::Seconds(30),
diff --git a/content/web_test/browser/fake_bluetooth_delegate.cc b/content/web_test/browser/fake_bluetooth_delegate.cc index 147dbe0..87b633d 100644 --- a/content/web_test/browser/fake_bluetooth_delegate.cc +++ b/content/web_test/browser/fake_bluetooth_delegate.cc
@@ -100,6 +100,17 @@ return base::Contains(device_id_to_services_map_, device_id); } +void FakeBluetoothDelegate::RevokeDevicePermissionWebInitiated( + RenderFrameHost* frame, + const WebBluetoothDeviceId& device_id) { + device_id_to_services_map_.erase(device_id); + device_id_to_name_map_.erase(device_id); + device_id_to_manufacturer_code_map_.erase(device_id); + auto& device_address_to_id_map = GetAddressToIdMapForOrigin(frame); + base::EraseIf(device_address_to_id_map, + [device_id](auto& entry) { return entry.second == device_id; }); +} + bool FakeBluetoothDelegate::IsAllowedToAccessService( RenderFrameHost* frame, const WebBluetoothDeviceId& device_id,
diff --git a/content/web_test/browser/fake_bluetooth_delegate.h b/content/web_test/browser/fake_bluetooth_delegate.h index f2aca535..0d9d046 100644 --- a/content/web_test/browser/fake_bluetooth_delegate.h +++ b/content/web_test/browser/fake_bluetooth_delegate.h
@@ -68,6 +68,9 @@ bool HasDevicePermission( RenderFrameHost* frame, const blink::WebBluetoothDeviceId& device_id) override; + void RevokeDevicePermissionWebInitiated( + RenderFrameHost* frame, + const blink::WebBluetoothDeviceId& device_id) override; bool IsAllowedToAccessService(RenderFrameHost* frame, const blink::WebBluetoothDeviceId& device_id, const device::BluetoothUUID& service) override;
diff --git a/content/web_test/browser/web_test_browser_context.cc b/content/web_test/browser/web_test_browser_context.cc index 3f1b166..f2a44cb0 100644 --- a/content/web_test/browser/web_test_browser_context.cc +++ b/content/web_test/browser/web_test_browser_context.cc
@@ -16,9 +16,9 @@ #include "content/public/browser/browser_thread.h" #include "content/public/browser/push_messaging_service.h" #include "content/public/browser/resource_context.h" +#include "content/public/test/mock_client_hints_controller_delegate.h" #include "content/shell/browser/shell_content_browser_client.h" #include "content/test/mock_background_sync_controller.h" -#include "content/test/mock_client_hints_controller_delegate.h" #include "content/test/mock_platform_notification_service.h" #include "content/web_test/browser/web_test_background_fetch_delegate.h" #include "content/web_test/browser/web_test_download_manager_delegate.h"
diff --git a/content/web_test/common/web_test.mojom b/content/web_test/common/web_test.mojom index 6055929..8a7479a 100644 --- a/content/web_test/common/web_test.mojom +++ b/content/web_test/common/web_test.mojom
@@ -134,7 +134,8 @@ // 1) broadcasting change happening in one renderer to all other renderers, or // 2) sending accumulated changes to a single new renderer. ReplicateWebTestRuntimeFlagsChanges( - mojo_base.mojom.DictionaryValue changed_layout_test_runtime_flags); + mojo_base.mojom.DeprecatedDictionaryValue + changed_layout_test_runtime_flags); // Called on the renderer process with the main window's local main frame to // conclude the test. Used to bounce this request from another renderer. @@ -156,7 +157,8 @@ ProcessWorkItem(WorkItem work_item); // Syncs the work queue states to the new renderer. - ReplicateWorkQueueStates(mojo_base.mojom.DictionaryValue work_queue_states); + ReplicateWorkQueueStates( + mojo_base.mojom.DeprecatedDictionaryValue work_queue_states); }; // Web test messages sent from the renderer process to the browser. This @@ -285,7 +287,7 @@ // Notifies the browser that one of renderers has changed web test runtime // flags (i.e. has set dump_as_text). WebTestRuntimeFlagsChanged( - mojo_base.mojom.DictionaryValue changed_web_test_runtime_flags); + mojo_base.mojom.DeprecatedDictionaryValue changed_web_test_runtime_flags); // Registers a new isolated filesystem with the given files, and returns the // new filesystem id. @@ -319,5 +321,5 @@ // Notifies the browser that the work queue states changed. WorkQueueStatesChanged( - mojo_base.mojom.DictionaryValue changed_work_queue_states); + mojo_base.mojom.DeprecatedDictionaryValue changed_work_queue_states); };
diff --git a/device/bluetooth/floss/bluetooth_adapter_floss.cc b/device/bluetooth/floss/bluetooth_adapter_floss.cc index 0fd5489..3efe17b5 100644 --- a/device/bluetooth/floss/bluetooth_adapter_floss.cc +++ b/device/bluetooth/floss/bluetooth_adapter_floss.cc
@@ -35,6 +35,25 @@ std::move(callback)); } +BluetoothDeviceFloss::ConnectErrorCode BtifStatusToConnectErrorCode( + uint32_t status) { + switch (static_cast<FlossAdapterClient::BtifStatus>(status)) { + case FlossAdapterClient::BtifStatus::kFail: + return BluetoothDeviceFloss::ConnectErrorCode::ERROR_FAILED; + case FlossAdapterClient::BtifStatus::kAuthFailure: + return BluetoothDeviceFloss::ConnectErrorCode::ERROR_AUTH_FAILED; + case FlossAdapterClient::BtifStatus::kAuthRejected: + return BluetoothDeviceFloss::ConnectErrorCode::ERROR_AUTH_REJECTED; + case FlossAdapterClient::BtifStatus::kDone: + case FlossAdapterClient::BtifStatus::kBusy: + return BluetoothDeviceFloss::ConnectErrorCode::ERROR_INPROGRESS; + case FlossAdapterClient::BtifStatus::kUnsupported: + return BluetoothDeviceFloss::ConnectErrorCode::ERROR_UNSUPPORTED_DEVICE; + default: + return BluetoothDeviceFloss::ConnectErrorCode::ERROR_UNKNOWN; + } +} + } // namespace // static @@ -544,16 +563,20 @@ return; } - if (status != 0) { - LOG(ERROR) << "Received BondStateChanged with error status = " << status; - return; - } - - BLUETOOTH_LOG(EVENT) << "BondStateChanged " << remote_device.address << " = " - << static_cast<uint32_t>(bond_state); + BLUETOOTH_LOG(EVENT) << "BondStateChanged " << remote_device.address + << " state = " << static_cast<uint32_t>(bond_state) + << " status = " << status; BluetoothDeviceFloss* device = static_cast<BluetoothDeviceFloss*>(devices_[canonical_address].get()); + + if (status != 0) { + LOG(ERROR) << "Received BondStateChanged with error status = " << status; + // TODO(b/192289534): Record status in UMA. + device->TriggerConnectCallback(BtifStatusToConnectErrorCode(status)); + return; + } + device->SetBondState(bond_state); NotifyDeviceChanged(device); NotifyDevicePairedChanged(device, device->IsPaired());
diff --git a/device/bluetooth/floss/bluetooth_device_floss.cc b/device/bluetooth/floss/bluetooth_device_floss.cc index be9c918..cbdd012b 100644 --- a/device/bluetooth/floss/bluetooth_device_floss.cc +++ b/device/bluetooth/floss/bluetooth_device_floss.cc
@@ -20,8 +20,7 @@ namespace { -void OnCreateBond(BluetoothDeviceFloss::ConnectCallback callback, - const absl::optional<bool>& ret, +void OnCreateBond(const absl::optional<bool>& ret, const absl::optional<Error>& error) { if (ret.has_value() && !*ret) { BLUETOOTH_LOG(ERROR) << "CreateBond returned failure"; @@ -31,17 +30,6 @@ BLUETOOTH_LOG(ERROR) << "Failed to create bond: " << error->name << ": " << error->message; } - - // In Floss API, |error| is not the error code of the pairing result, but only - // the error code of the pairing request. - // TODO(b/202874707): Handle the pairing result properly. - // TODO(b/192289534): Record UMA metrics. - auto connect_error = - error ? absl::optional<BluetoothDeviceFloss::ConnectErrorCode>( - BluetoothDeviceFloss::ConnectErrorCode::ERROR_UNKNOWN) - : absl::nullopt; - - std::move(callback).Run(connect_error); } void OnRemoveBond(base::OnceClosure callback, @@ -59,14 +47,6 @@ std::move(callback).Run(); } -void OnConnectAllEnabledProfiles(const absl::optional<Void>& ret, - const absl::optional<Error>& error) { - if (error.has_value()) { - BLUETOOTH_LOG(ERROR) << "Failed to connect all enabled profiles: " - << error->name << ": " << error->message; - } -} - } // namespace using AddressType = device::BluetoothDevice::AddressType; @@ -158,9 +138,9 @@ } bool BluetoothDeviceFloss::IsConnectable() const { - NOTIMPLEMENTED(); - - return false; + // Mark all devices as connectable for now. + // TODO(b/211126690): Implement based on supported profiles. + return true; } bool BluetoothDeviceFloss::IsConnecting() const { @@ -227,13 +207,18 @@ ConnectCallback callback) { BLUETOOTH_LOG(EVENT) << "Connecting to " << address_; + // To simulate BlueZ API behavior, we don't reply the callback as soon as + // Floss CreateBond API returns, but rather we trigger the callback later + // after pairing is done and profiles are connected. + pending_callback_on_connect_profiles_ = std::move(callback); + if (IsPaired() || !pairing_delegate) { // No need to pair, or unable to, skip straight to connection. - // TODO(b/202334519): Support connection flow without pairing. + ConnectAllEnabledProfiles(); } else { pairing_ = std::make_unique<BluetoothPairingFloss>(pairing_delegate); FlossDBusManager::Get()->GetAdapterClient()->CreateBond( - base::BindOnce(&OnCreateBond, std::move(callback)), AsFlossDeviceId(), + base::BindOnce(&OnCreateBond), AsFlossDeviceId(), FlossAdapterClient::BluetoothTransport::kAuto); } } @@ -353,7 +338,9 @@ void BluetoothDeviceFloss::ConnectAllEnabledProfiles() { FlossDBusManager::Get()->GetAdapterClient()->ConnectAllEnabledProfiles( - base::BindOnce(&OnConnectAllEnabledProfiles), AsFlossDeviceId()); + base::BindOnce(&BluetoothDeviceFloss::OnConnectAllEnabledProfiles, + weak_ptr_factory_.GetWeakPtr()), + AsFlossDeviceId()); } void BluetoothDeviceFloss::ResetPairing() { @@ -424,4 +411,26 @@ NOTIMPLEMENTED(); } +void BluetoothDeviceFloss::OnConnectAllEnabledProfiles( + const absl::optional<Void>& ret, + const absl::optional<Error>& error) { + if (error.has_value()) { + BLUETOOTH_LOG(ERROR) << "Failed to connect all enabled profiles: " + << error->name << ": " << error->message; + // TODO(b/202874707): Design a proper new errors for Floss. + if (pending_callback_on_connect_profiles_) + TriggerConnectCallback(BluetoothDevice::ConnectErrorCode::ERROR_UNKNOWN); + } + + TriggerConnectCallback(absl::nullopt); +} + +void BluetoothDeviceFloss::TriggerConnectCallback( + absl::optional<BluetoothDevice::ConnectErrorCode> error_code) { + if (pending_callback_on_connect_profiles_) { + std::move(*pending_callback_on_connect_profiles_).Run(error_code); + pending_callback_on_connect_profiles_ = absl::nullopt; + } +} + } // namespace floss
diff --git a/device/bluetooth/floss/bluetooth_device_floss.h b/device/bluetooth/floss/bluetooth_device_floss.h index 81ceb7e54..5da7992 100644 --- a/device/bluetooth/floss/bluetooth_device_floss.h +++ b/device/bluetooth/floss/bluetooth_device_floss.h
@@ -108,6 +108,9 @@ void SetIsConnected(bool is_connected); void ConnectAllEnabledProfiles(); void ResetPairing(); + // Triggers the pending callback of Connect() method. + void TriggerConnectCallback( + absl::optional<BluetoothDevice::ConnectErrorCode> error_code); BluetoothPairingFloss* pairing() const { return pairing_.get(); } @@ -136,6 +139,12 @@ void OnCancelPairingError(const Error& error); void OnForgetError(ErrorCallback error_callback, const Error& error); + void OnConnectAllEnabledProfiles(const absl::optional<Void>& ret, + const absl::optional<Error>& error); + + absl::optional<ConnectCallback> pending_callback_on_connect_profiles_ = + absl::nullopt; + // Address of this device. Changing this should necessitate creating a new // BluetoothDeviceFloss object. const std::string address_;
diff --git a/device/bluetooth/floss/fake_floss_adapter_client.cc b/device/bluetooth/floss/fake_floss_adapter_client.cc index be8be21..94ea459 100644 --- a/device/bluetooth/floss/fake_floss_adapter_client.cc +++ b/device/bluetooth/floss/fake_floss_adapter_client.cc
@@ -133,7 +133,8 @@ void FakeFlossAdapterClient::ConnectAllEnabledProfiles( ResponseCallback<Void> callback, const FlossDeviceId& device) { - // No-op, there is no need for testing yet. + PostDelayedTask(base::BindOnce(std::move(callback), /*ret=*/absl::nullopt, + /*err=*/absl::nullopt)); } void FakeFlossAdapterClient::PostDelayedTask(base::OnceClosure callback) {
diff --git a/device/bluetooth/floss/floss_adapter_client.h b/device/bluetooth/floss/floss_adapter_client.h index f5877da..20c0ffa 100644 --- a/device/bluetooth/floss/floss_adapter_client.h +++ b/device/bluetooth/floss/floss_adapter_client.h
@@ -51,6 +51,25 @@ kBonded = 2, }; + // Adopted from bt_status_t in system/include/hardware/bluetooth.h + enum class BtifStatus { + kSuccess = 0, + kFail, + kNotReady, + kNomem, + kBusy, + kDone, + kUnsupported, + kParmInvalid, + kUnhandled, + kAuthFailure, + kRmtDevDown, + kAuthRejected, + kJniEnvironmentError, + kJniThreadAttachError, + kWakelockError, + }; + class Observer : public base::CheckedObserver { public: Observer(const Observer&) = delete;
diff --git a/docs/mojo_and_services.md b/docs/mojo_and_services.md index 38a3d37..9ad035d 100644 --- a/docs/mojo_and_services.md +++ b/docs/mojo_and_services.md
@@ -395,7 +395,7 @@ ``` cpp mojo::Remote<math::mojom::MathService> math_service = content::ServiceProcessHost::Launch<math::mojom::MathService>( - content::ServiceProcessHost::LaunchOptions() + content::ServiceProcessHost::Options() .WithDisplayName("Math!") .Pass()); ```
diff --git a/extensions/browser/api/automation_internal/automation_internal_api.cc b/extensions/browser/api/automation_internal/automation_internal_api.cc index f2064ba..b45c2366 100644 --- a/extensions/browser/api/automation_internal/automation_internal_api.cc +++ b/extensions/browser/api/automation_internal/automation_internal_api.cc
@@ -621,6 +621,7 @@ case api::automation::ACTION_TYPE_ANNOTATEPAGEIMAGES: case api::automation::ACTION_TYPE_SIGNALENDOFTEST: case api::automation::ACTION_TYPE_INTERNALINVALIDATETREE: + case api::automation::ACTION_TYPE_RUNSCREENAI: case api::automation::ACTION_TYPE_NONE: break; }
diff --git a/extensions/browser/guest_view/web_view/web_view_apitest.cc b/extensions/browser/guest_view/web_view/web_view_apitest.cc index 26adbb4..4a991a09 100644 --- a/extensions/browser/guest_view/web_view/web_view_apitest.cc +++ b/extensions/browser/guest_view/web_view/web_view_apitest.cc
@@ -14,12 +14,15 @@ #include "base/path_service.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" +#include "base/test/metrics/histogram_tester.h" +#include "base/test/scoped_feature_list.h" #include "base/threading/thread_restrictions.h" #include "build/build_config.h" #include "components/guest_view/browser/guest_view_manager.h" #include "components/guest_view/browser/guest_view_manager_delegate.h" #include "components/guest_view/browser/guest_view_manager_factory.h" #include "components/guest_view/browser/test_guest_view_manager.h" +#include "content/public/browser/browser_context.h" #include "content/public/browser/render_frame_host.h" #include "content/public/browser/render_process_host.h" #include "content/public/browser/render_view_host.h" @@ -27,6 +30,7 @@ #include "content/public/common/content_switches.h" #include "content/public/test/browser_test_utils.h" #include "content/public/test/hit_test_region_observer.h" +#include "content/public/test/mock_client_hints_controller_delegate.h" #include "content/public/test/no_renderer_crashes_assertion.h" #include "content/public/test/test_renderer_host.h" #include "content/public/test/test_utils.h" @@ -39,6 +43,7 @@ #include "extensions/common/extension_paths.h" #include "extensions/common/switches.h" #include "extensions/shell/browser/desktop_controller.h" +#include "extensions/shell/browser/shell_browser_context.h" #include "extensions/shell/browser/shell_content_browser_client.h" #include "extensions/shell/browser/shell_extension_system.h" #include "extensions/shell/test/shell_test.h" @@ -50,7 +55,9 @@ #include "net/test/embedded_test_server/http_request.h" #include "net/test/embedded_test_server/http_response.h" #include "services/network/public/cpp/features.h" +#include "third_party/blink/public/common/features.h" #include "third_party/blink/public/common/switches.h" +#include "third_party/blink/public/common/user_agent/user_agent_metadata.h" #include "ui/display/display_switches.h" #if defined(USE_AURA) @@ -67,13 +74,14 @@ const char kRedirectResponseFullPath[] = "/guest_redirect.html"; const char kUserAgentRedirectResponsePath[] = "/detect-user-agent"; const char kTestServerPort[] = "testServer.port"; +const char kExpectUserAgentPath[] = "/expect-user-agent"; // Handles |request| by serving a redirect response if the |User-Agent| is // foobar. -static std::unique_ptr<net::test_server::HttpResponse> UserAgentResponseHandler( - const std::string& path, - const GURL& redirect_target, - const net::test_server::HttpRequest& request) { +static std::unique_ptr<net::test_server::HttpResponse> +UserAgentRedirectResponseHandler(const std::string& path, + const GURL& redirect_target, + const net::test_server::HttpRequest& request) { if (!base::StartsWith(path, request.relative_url, base::CompareCase::SENSITIVE)) { return nullptr; @@ -91,6 +99,30 @@ return std::move(http_response); } +static std::unique_ptr<net::test_server::HttpResponse> +ExpectUserAgentResponseHandler(const std::string& path, + const net::test_server::HttpRequest& request) { + if (!base::StartsWith(path, request.relative_url, + base::CompareCase::SENSITIVE)) { + return nullptr; + } + + auto it = request.headers.find("User-Agent"); + EXPECT_TRUE(it != request.headers.end()); + EXPECT_TRUE( + base::StartsWith("foobar", it->second, base::CompareCase::SENSITIVE)); + + it = request.headers.find("Sec-CH-UA-Platform"); + EXPECT_TRUE(it != request.headers.end()); + EXPECT_EQ("\"\"", it->second); + + std::unique_ptr<net::test_server::BasicHttpResponse> http_response( + new net::test_server::BasicHttpResponse); + http_response->set_code(net::HTTP_OK); + http_response->set_content_type("html/text"); + return std::move(http_response); +} + class WebContentsHiddenObserver : public content::WebContentsObserver { public: WebContentsHiddenObserver(content::WebContents* web_contents, @@ -238,7 +270,7 @@ base::BindRepeating(&EmptyResponseHandler, kEmptyResponsePath)); embedded_test_server()->RegisterRequestHandler(base::BindRepeating( - &UserAgentResponseHandler, kUserAgentRedirectResponsePath, + &UserAgentRedirectResponseHandler, kUserAgentRedirectResponsePath, embedded_test_server()->GetURL(kRedirectResponseFullPath))); net::test_server::RegisterDefaultHandlers(embedded_test_server()); @@ -867,4 +899,44 @@ RunTest("testClosedShadowRoot", "web_view/apitest"); } +class WebViewAPITestUserAgentOverride + : public WebViewAPITest { + public: + void SetUp() override { + scoped_feature_list_.InitAndEnableFeature( + blink::features::kUserAgentOverrideExperiment); + WebViewAPITest::SetUp(); + } + + private: + base::test::ScopedFeatureList scoped_feature_list_; +}; + +IN_PROC_BROWSER_TEST_F(WebViewAPITestUserAgentOverride, TestSetUserAgentOverride) { + blink::UserAgentMetadata ua_metadata; + ua_metadata.platform = "foobar"; + content::MockClientHintsControllerDelegate client_hints_controller_delegate( + ua_metadata); + + static_cast<ShellBrowserContext*>( + ShellContentBrowserClient::Get()->GetBrowserContext()) + ->set_client_hints_controller_delegate(&client_hints_controller_delegate); + + // The 'Sec-CH-UA' header is only sent over HTTPS + net::test_server::EmbeddedTestServer https_server( + net::test_server::EmbeddedTestServer::TYPE_HTTPS); + https_server.RegisterRequestHandler(base::BindRepeating( + &ExpectUserAgentResponseHandler, kExpectUserAgentPath)); + https_server.SetSSLConfig( + net::test_server::EmbeddedTestServer::CERT_COMMON_NAME_IS_DOMAIN); + ASSERT_TRUE(https_server.Start()); + base::HistogramTester histogram; + test_config_.SetIntPath(kTestServerPort, https_server.port()); + RunTest("testSetUserAgentOverride", "web_view/apitest"); + content::FetchHistogramsFromChildProcesses(); + histogram.ExpectBucketCount( + blink::UserAgentOverride::kUserAgentOverrideHistogram, + blink::UserAgentOverride::UserAgentOverriden, 1); +} + } // namespace extensions
diff --git a/extensions/browser/script_executor.cc b/extensions/browser/script_executor.cc index 672e3a1..c0c456fe 100644 --- a/extensions/browser/script_executor.cc +++ b/extensions/browser/script_executor.cc
@@ -78,6 +78,13 @@ continue; } + if (frame->IsErrorDocument()) { + AddWillNotInjectResult( + frame_id, base::StringPrintf( + "Frame with ID %d is showing error page", frame_id)); + continue; + } + pending_render_frames_.push_back(frame); }
diff --git a/extensions/common/api/automation.idl b/extensions/common/api/automation.idl index 5db6b5a..e030dff2 100644 --- a/extensions/common/api/automation.idl +++ b/extensions/common/api/automation.idl
@@ -400,6 +400,7 @@ loadInlineTextBoxes, replaceSelectedText, resumeMedia, + runScreenAi, scrollBackward, scrollDown, scrollForward,
diff --git a/extensions/common/mojom/event_dispatcher.mojom b/extensions/common/mojom/event_dispatcher.mojom index 825a671..90f9677e 100644 --- a/extensions/common/mojom/event_dispatcher.mojom +++ b/extensions/common/mojom/event_dispatcher.mojom
@@ -15,7 +15,7 @@ interface EventDispatcher { // Sent to the renderer to dispatch an event to a listener. DispatchEvent(DispatchEventParams params, - mojo_base.mojom.ListValue event_args); + mojo_base.mojom.DeprecatedListValue event_args); }; // Typemapped to extensions::EventFilteringInfo.
diff --git a/extensions/common/mojom/event_router.mojom b/extensions/common/mojom/event_router.mojom index ebabaec9..ec66ce1 100644 --- a/extensions/common/mojom/event_router.mojom +++ b/extensions/common/mojom/event_router.mojom
@@ -46,20 +46,22 @@ // has |extension_id| in |param|, the listener is added for the extension. // Otherwise, it has a |listener_url| in |param| and the listener is added // for the URL. - AddFilteredListenerForMainThread(EventListenerParam param, - string event_name, - mojo_base.mojom.DictionaryValue filter, - bool add_lazy_listener); + AddFilteredListenerForMainThread( + EventListenerParam param, + string event_name, + mojo_base.mojom.DeprecatedDictionaryValue filter, + bool add_lazy_listener); // Notifies the browser that the given extension added a listener for a // service worker to instances of the named event that satisfy the filter. - AddFilteredListenerForServiceWorker(string extension_id, - url.mojom.Url worker_scope_url, - string event_name, - int64 service_worker_version_id, - int32 worker_thread_id, - mojo_base.mojom.DictionaryValue filter, - bool add_lazy_listener); + AddFilteredListenerForServiceWorker( + string extension_id, + url.mojom.Url worker_scope_url, + string event_name, + int64 service_worker_version_id, + int32 worker_thread_id, + mojo_base.mojom.DeprecatedDictionaryValue filter, + bool add_lazy_listener); // Notifies the browser that the given |extension_id| or |listener_url| // removed a listener to an event. If it has |extension_id| in |param|, the @@ -92,20 +94,22 @@ // If it has |extension_id| in |param|, the listener is removed for the // extension. Otherwise, it has a |listener_url| in |param| and the listener // is removed for the URL. - RemoveFilteredListenerForMainThread(EventListenerParam param, - string event_name, - mojo_base.mojom.DictionaryValue filter, - bool remove_lazy_listener); + RemoveFilteredListenerForMainThread( + EventListenerParam param, + string event_name, + mojo_base.mojom.DeprecatedDictionaryValue filter, + bool remove_lazy_listener); // Notifies the browser that the given extension is no longer interested in // instances of the named event that satisfy the filter from an extension // service worker. - RemoveFilteredListenerForServiceWorker(string extension_id, - url.mojom.Url worker_scope_url, - string event_name, - int64 service_worker_version_id, - int32 worker_thread_id, - mojo_base.mojom.DictionaryValue filter, - bool remove_lazy_listener); + RemoveFilteredListenerForServiceWorker( + string extension_id, + url.mojom.Url worker_scope_url, + string event_name, + int64 service_worker_version_id, + int32 worker_thread_id, + mojo_base.mojom.DeprecatedDictionaryValue filter, + bool remove_lazy_listener); };
diff --git a/extensions/common/mojom/frame.mojom b/extensions/common/mojom/frame.mojom index 6b76184..8ccd97a 100644 --- a/extensions/common/mojom/frame.mojom +++ b/extensions/common/mojom/frame.mojom
@@ -35,7 +35,7 @@ // Message name. string name; // List of message arguments. - mojo_base.mojom.ListValue arguments; + mojo_base.mojom.DeprecatedListValue arguments; // Extension ID this request was sent from. This can be empty, in the case // where we expose APIs to normal web pages using the extension function // system. @@ -85,7 +85,7 @@ MessageInvoke(string extension_id, string module_name, string function_name, - mojo_base.mojom.ListValue args); + mojo_base.mojom.DeprecatedListValue args); // Notifies the renderer that it should run some JavaScript code. The reply // is sent back to the browser to return the script running result. An empty @@ -127,9 +127,11 @@ // one of the base::Value types, wrapped as the first element in a LIST // typed Value. [UnlimitedSize] - Request(RequestParams params) => (bool success, - mojo_base.mojom.ListValue response_wrapper, - string error); + Request(RequestParams params) + => (bool success, + mojo_base.mojom.DeprecatedListValue response_wrapper, + string error); + // Notifies the browser process that a tab has started or stopped matching // certain conditions. This method is called by response to several events: //
diff --git a/extensions/test/data/web_view/apitest/main.js b/extensions/test/data/web_view/apitest/main.js index 4282ed0..ebb3960f 100644 --- a/extensions/test/data/web_view/apitest/main.js +++ b/extensions/test/data/web_view/apitest/main.js
@@ -22,6 +22,7 @@ embedder.windowOpenGuestURL = embedder.baseGuestURL + '/guest.html'; embedder.sameDocumentNavigationURL = embedder.baseGuestURL + '/guest_same_document_navigation.html'; + embedder.expectUserAgentURL = 'https://localhost:' + config.testServer.port + '/expect-user-agent'; }; window.runTest = function(testName) { @@ -1943,6 +1944,21 @@ document.body.appendChild(webview); } +// Ensure that the 'setUserAgentOverride' function sets the correct User-Agent +// request header and removes the values of User-Agent Client Hint headers +function testSetUserAgentOverride() { + var webview = new WebView(); + webview.setUserAgentOverride('foobar'); + + // Expectations are checked in the server. + webview.addEventListener('loadstop', () => { + embedder.test.succeed(); + }); + + webview.setAttribute("src", embedder.expectUserAgentURL); + document.body.appendChild(webview); +} + // Tests end. embedder.test.testList = { @@ -2021,6 +2037,7 @@ 'testWebRequestAPIGoogleProperty': testWebRequestAPIGoogleProperty, 'testCaptureVisibleRegion': testCaptureVisibleRegion, 'testClosedShadowRoot': testClosedShadowRoot, + 'testSetUserAgentOverride': testSetUserAgentOverride, }; onload = function() {
diff --git a/gpu/command_buffer/service/external_vk_image_dawn_representation.cc b/gpu/command_buffer/service/external_vk_image_dawn_representation.cc index 5f8b5ed..fc63311 100644 --- a/gpu/command_buffer/service/external_vk_image_dawn_representation.cc +++ b/gpu/command_buffer/service/external_vk_image_dawn_representation.cc
@@ -55,12 +55,11 @@ texture_descriptor.mipLevelCount = 1; texture_descriptor.sampleCount = 1; - // We need to have internal usages of CopySrc for copies and - // RenderAttachment for clears. + // We need to have an internal usage of CopySrc in order to use + // CopyTextureToTextureInternal. WGPUDawnTextureInternalUsageDescriptor internalDesc = {}; internalDesc.chain.sType = WGPUSType_DawnTextureInternalUsageDescriptor; - internalDesc.internalUsage = - WGPUTextureUsage_CopySrc | WGPUTextureUsage_RenderAttachment; + internalDesc.internalUsage = WGPUTextureUsage_CopySrc; texture_descriptor.nextInChain = reinterpret_cast<WGPUChainedStruct*>(&internalDesc);
diff --git a/gpu/command_buffer/service/shared_image_backing_d3d.cc b/gpu/command_buffer/service/shared_image_backing_d3d.cc index 2e2c33e..9f51ca99 100644 --- a/gpu/command_buffer/service/shared_image_backing_d3d.cc +++ b/gpu/command_buffer/service/shared_image_backing_d3d.cc
@@ -620,12 +620,11 @@ } #endif - // We need to have internal usages of CopySrc for copies and - // RenderAttachment for clears. + // We need to have an internal usage of CopySrc in order to use + // CopyTextureToTextureInternal. WGPUDawnTextureInternalUsageDescriptor internalDesc = {}; internalDesc.chain.sType = WGPUSType_DawnTextureInternalUsageDescriptor; - internalDesc.internalUsage = - WGPUTextureUsage_CopySrc | WGPUTextureUsage_RenderAttachment; + internalDesc.internalUsage = WGPUTextureUsage_CopySrc; texture_descriptor.nextInChain = reinterpret_cast<WGPUChainedStruct*>(&internalDesc);
diff --git a/gpu/command_buffer/service/shared_image_backing_factory_iosurface.mm b/gpu/command_buffer/service/shared_image_backing_factory_iosurface.mm index 5cfcad9..66598f2 100644 --- a/gpu/command_buffer/service/shared_image_backing_factory_iosurface.mm +++ b/gpu/command_buffer/service/shared_image_backing_factory_iosurface.mm
@@ -120,12 +120,11 @@ texture_descriptor.mipLevelCount = 1; texture_descriptor.sampleCount = 1; - // We need to have internal usages of CopySrc for copies and - // RenderAttachment for clears. + // We need to have an internal usage of CopySrc in order to use + // CopyTextureToTextureInternal. WGPUDawnTextureInternalUsageDescriptor internalDesc = {}; internalDesc.chain.sType = WGPUSType_DawnTextureInternalUsageDescriptor; - internalDesc.internalUsage = - WGPUTextureUsage_CopySrc | WGPUTextureUsage_RenderAttachment; + internalDesc.internalUsage = WGPUTextureUsage_CopySrc; texture_descriptor.nextInChain = reinterpret_cast<WGPUChainedStruct*>(&internalDesc);
diff --git a/gpu/command_buffer/service/shared_image_representation.h b/gpu/command_buffer/service/shared_image_representation.h index 19962b2..e1f2e81 100644 --- a/gpu/command_buffer/service/shared_image_representation.h +++ b/gpu/command_buffer/service/shared_image_representation.h
@@ -247,6 +247,9 @@ GetTexturePassthrough() = 0; gpu::TextureBase* GetTextureBase() override; + + protected: + friend class SharedImageRepresentationDawnEGLImage; }; class GPU_GLES2_EXPORT SharedImageRepresentationSkia
diff --git a/gpu/command_buffer/service/shared_image_representation_dawn_egl_image.cc b/gpu/command_buffer/service/shared_image_representation_dawn_egl_image.cc index b7e23a87..3c9bd0b 100644 --- a/gpu/command_buffer/service/shared_image_representation_dawn_egl_image.cc +++ b/gpu/command_buffer/service/shared_image_representation_dawn_egl_image.cc
@@ -6,12 +6,20 @@ #include "build/build_config.h" #include "gpu/command_buffer/service/texture_manager.h" -#if BUILDFLAG(IS_WIN) -#include "gpu/command_buffer/service/shared_image_backing_d3d.h" -#endif #include <dawn/native/OpenGLBackend.h> +namespace { +GLenum ToSharedImageAccessGLMode(WGPUTextureUsage usage) { + if (usage & (WGPUTextureUsage_CopyDst | WGPUTextureUsage_RenderAttachment | + WGPUTextureUsage_StorageBinding | WGPUTextureUsage_Present)) { + return GL_SHARED_IMAGE_ACCESS_MODE_READWRITE_CHROMIUM; + } else { + return GL_SHARED_IMAGE_ACCESS_MODE_READ_CHROMIUM; + } +} +} // namespace + namespace gpu { SharedImageRepresentationDawnEGLImage::SharedImageRepresentationDawnEGLImage( @@ -42,13 +50,7 @@ WGPUTexture SharedImageRepresentationDawnEGLImage::BeginAccess( WGPUTextureUsage usage) { -#if BUILDFLAG(IS_WIN) - // On D3D11 backings, we must acquire the keyed mutex to do interop. If we - // ever switch to non-D3D backings on Windows, this code will break horribly. - // TODO(senorblanco): This should probably be a virtual on SharedImageBacking - // to avoid this cast. - static_cast<SharedImageBackingD3D*>(backing())->BeginAccessD3D11(); -#endif + gl_representation_->BeginAccess(ToSharedImageAccessGLMode(usage)); dawn::native::opengl::ExternalImageDescriptorEGLImage externalImageDesc; externalImageDesc.cTextureDescriptor = &texture_descriptor_; const auto& texture = gl_representation_->GetTexturePassthrough(); @@ -68,11 +70,7 @@ if (dawn::native::IsTextureSubresourceInitialized(texture_, 0, 1, 0, 1)) { SetCleared(); } -#if BUILDFLAG(IS_WIN) - // TODO(senorblanco): This should probably be a virtual on SharedImageBacking - // to avoid this cast. - static_cast<SharedImageBackingD3D*>(backing())->EndAccessD3D11(); -#endif + gl_representation_->EndAccess(); // All further operations on the textures are errors (they would be racy // with other backings). dawn_procs_.textureDestroy(texture_);
diff --git a/gpu/command_buffer/service/shared_image_representation_dawn_ozone.cc b/gpu/command_buffer/service/shared_image_representation_dawn_ozone.cc index 9d3d98c..6e3ddef 100644 --- a/gpu/command_buffer/service/shared_image_representation_dawn_ozone.cc +++ b/gpu/command_buffer/service/shared_image_representation_dawn_ozone.cc
@@ -70,12 +70,11 @@ texture_descriptor.mipLevelCount = 1; texture_descriptor.sampleCount = 1; - // We need to have internal usages of CopySrc for copies and - // RenderAttachment for clears. + // We need to have an internal usage of CopySrc in order to use + // CopyTextureToTextureInternal. WGPUDawnTextureInternalUsageDescriptor internalDesc = {}; internalDesc.chain.sType = WGPUSType_DawnTextureInternalUsageDescriptor; - internalDesc.internalUsage = - WGPUTextureUsage_CopySrc | WGPUTextureUsage_RenderAttachment; + internalDesc.internalUsage = WGPUTextureUsage_CopySrc; texture_descriptor.nextInChain = reinterpret_cast<WGPUChainedStruct*>(&internalDesc);
diff --git a/gpu/command_buffer/service/webgpu_decoder_impl.cc b/gpu/command_buffer/service/webgpu_decoder_impl.cc index bd85889f..dd1e79f 100644 --- a/gpu/command_buffer/service/webgpu_decoder_impl.cc +++ b/gpu/command_buffer/service/webgpu_decoder_impl.cc
@@ -1812,15 +1812,8 @@ render_pass_descriptor.colorAttachmentCount = 1; render_pass_descriptor.colorAttachments = &color_attachment; - WGPUDawnEncoderInternalUsageDescriptor internal_usage_desc = { - .chain = {.sType = WGPUSType_DawnEncoderInternalUsageDescriptor}, - .useInternalUsages = true, - }; - WGPUCommandEncoderDescriptor command_encoder_desc = { - .nextInChain = &internal_usage_desc.chain, - }; WGPUCommandEncoder encoder = - procs.deviceCreateCommandEncoder(device, &command_encoder_desc); + procs.deviceCreateCommandEncoder(device, nullptr); WGPURenderPassEncoder pass = procs.commandEncoderBeginRenderPass(encoder, &render_pass_descriptor); procs.renderPassEncoderEndPass(pass);
diff --git a/gpu/ipc/host/shader_disk_cache.cc b/gpu/ipc/host/shader_disk_cache.cc index 854013f..8caa5e4 100644 --- a/gpu/ipc/host/shader_disk_cache.cc +++ b/gpu/ipc/host/shader_disk_cache.cc
@@ -562,9 +562,9 @@ int rv = disk_cache::CreateCacheBackend( net::SHADER_CACHE, net::CACHE_BACKEND_DEFAULT, - cache_path_.Append(kGpuCachePath), CacheSizeBytes(), - disk_cache::ResetHandling::kResetOnError, nullptr, &backend_, - base::BindOnce(&ShaderDiskCache::CacheCreatedCallback, this)); + /*file_operations=*/nullptr, cache_path_.Append(kGpuCachePath), + CacheSizeBytes(), disk_cache::ResetHandling::kResetOnError, nullptr, + &backend_, base::BindOnce(&ShaderDiskCache::CacheCreatedCallback, this)); if (rv == net::OK) cache_available_ = true;
diff --git a/infra/config/generated/builders/try/android-11-x86-rel/properties.json b/infra/config/generated/builders/try/android-11-x86-rel/properties.json index 5c03c17..f46f338d 100644 --- a/infra/config/generated/builders/try/android-11-x86-rel/properties.json +++ b/infra/config/generated/builders/try/android-11-x86-rel/properties.json
@@ -1,7 +1,7 @@ { "$build/chromium_orchestrator": { "compilator": "android-11-x86-rel-compilator", - "compilator_watcher_git_revision": "c49f1d02dec735eb0e8f03121d3fab2840c2c954" + "compilator_watcher_git_revision": "7809a690bbd935bcb3b4d922e24cabe168aaabc8" }, "$recipe_engine/resultdb/test_presentation": { "column_keys": [],
diff --git a/infra/config/generated/builders/try/android-12-x64-rel/properties.json b/infra/config/generated/builders/try/android-12-x64-rel/properties.json index 7fef7c8..4205c5c 100644 --- a/infra/config/generated/builders/try/android-12-x64-rel/properties.json +++ b/infra/config/generated/builders/try/android-12-x64-rel/properties.json
@@ -1,7 +1,7 @@ { "$build/chromium_orchestrator": { "compilator": "android-12-x64-rel-compilator", - "compilator_watcher_git_revision": "c49f1d02dec735eb0e8f03121d3fab2840c2c954" + "compilator_watcher_git_revision": "7809a690bbd935bcb3b4d922e24cabe168aaabc8" }, "$recipe_engine/resultdb/test_presentation": { "column_keys": [],
diff --git a/infra/config/generated/builders/try/android-marshmallow-arm64-rel/properties.json b/infra/config/generated/builders/try/android-marshmallow-arm64-rel/properties.json index ce20c57e..1bce44f 100644 --- a/infra/config/generated/builders/try/android-marshmallow-arm64-rel/properties.json +++ b/infra/config/generated/builders/try/android-marshmallow-arm64-rel/properties.json
@@ -1,7 +1,7 @@ { "$build/chromium_orchestrator": { "compilator": "android-marshmallow-arm64-rel-compilator", - "compilator_watcher_git_revision": "c49f1d02dec735eb0e8f03121d3fab2840c2c954" + "compilator_watcher_git_revision": "7809a690bbd935bcb3b4d922e24cabe168aaabc8" }, "$build/code_coverage": { "coverage_test_types": [
diff --git a/infra/config/generated/builders/try/android-marshmallow-x86-rel/properties.json b/infra/config/generated/builders/try/android-marshmallow-x86-rel/properties.json index c1673ce0..42e1ff0e 100644 --- a/infra/config/generated/builders/try/android-marshmallow-x86-rel/properties.json +++ b/infra/config/generated/builders/try/android-marshmallow-x86-rel/properties.json
@@ -1,7 +1,7 @@ { "$build/chromium_orchestrator": { "compilator": "android-marshmallow-x86-rel-compilator", - "compilator_watcher_git_revision": "c49f1d02dec735eb0e8f03121d3fab2840c2c954" + "compilator_watcher_git_revision": "7809a690bbd935bcb3b4d922e24cabe168aaabc8" }, "$build/code_coverage": { "coverage_test_types": [
diff --git a/infra/config/generated/builders/try/android-pie-arm64-rel/properties.json b/infra/config/generated/builders/try/android-pie-arm64-rel/properties.json index 3f7d689..282e7904 100644 --- a/infra/config/generated/builders/try/android-pie-arm64-rel/properties.json +++ b/infra/config/generated/builders/try/android-pie-arm64-rel/properties.json
@@ -1,7 +1,7 @@ { "$build/chromium_orchestrator": { "compilator": "android-pie-arm64-rel-compilator", - "compilator_watcher_git_revision": "c49f1d02dec735eb0e8f03121d3fab2840c2c954" + "compilator_watcher_git_revision": "7809a690bbd935bcb3b4d922e24cabe168aaabc8" }, "$recipe_engine/resultdb/test_presentation": { "column_keys": [],
diff --git a/infra/config/generated/builders/try/chromeos-amd64-generic-rel/properties.json b/infra/config/generated/builders/try/chromeos-amd64-generic-rel/properties.json index 72cb82d7..b998d0a 100644 --- a/infra/config/generated/builders/try/chromeos-amd64-generic-rel/properties.json +++ b/infra/config/generated/builders/try/chromeos-amd64-generic-rel/properties.json
@@ -1,7 +1,7 @@ { "$build/chromium_orchestrator": { "compilator": "chromeos-amd64-generic-rel-compilator", - "compilator_watcher_git_revision": "c49f1d02dec735eb0e8f03121d3fab2840c2c954" + "compilator_watcher_git_revision": "7809a690bbd935bcb3b4d922e24cabe168aaabc8" }, "$build/chromium_tests_builder_config": { "builder_config": {
diff --git a/infra/config/generated/builders/try/linux-chromeos-rel/properties.json b/infra/config/generated/builders/try/linux-chromeos-rel/properties.json index 64e17bbc..5684a091 100644 --- a/infra/config/generated/builders/try/linux-chromeos-rel/properties.json +++ b/infra/config/generated/builders/try/linux-chromeos-rel/properties.json
@@ -1,7 +1,7 @@ { "$build/chromium_orchestrator": { "compilator": "linux-chromeos-rel-compilator", - "compilator_watcher_git_revision": "c49f1d02dec735eb0e8f03121d3fab2840c2c954" + "compilator_watcher_git_revision": "7809a690bbd935bcb3b4d922e24cabe168aaabc8" }, "$build/code_coverage": { "coverage_test_types": [
diff --git a/infra/config/generated/builders/try/linux-rel-warmed/properties.json b/infra/config/generated/builders/try/linux-rel-warmed/properties.json index d007f3c..5ef1476b 100644 --- a/infra/config/generated/builders/try/linux-rel-warmed/properties.json +++ b/infra/config/generated/builders/try/linux-rel-warmed/properties.json
@@ -1,7 +1,7 @@ { "$build/chromium_orchestrator": { "compilator": "linux-rel-warmed-compilator", - "compilator_watcher_git_revision": "c49f1d02dec735eb0e8f03121d3fab2840c2c954" + "compilator_watcher_git_revision": "7809a690bbd935bcb3b4d922e24cabe168aaabc8" }, "$build/code_coverage": { "coverage_test_types": [
diff --git a/infra/config/generated/builders/try/linux-rel/properties.json b/infra/config/generated/builders/try/linux-rel/properties.json index 443592b..76df04ab 100644 --- a/infra/config/generated/builders/try/linux-rel/properties.json +++ b/infra/config/generated/builders/try/linux-rel/properties.json
@@ -1,7 +1,7 @@ { "$build/chromium_orchestrator": { "compilator": "linux-rel-compilator", - "compilator_watcher_git_revision": "c49f1d02dec735eb0e8f03121d3fab2840c2c954" + "compilator_watcher_git_revision": "7809a690bbd935bcb3b4d922e24cabe168aaabc8" }, "$build/code_coverage": { "coverage_test_types": [
diff --git a/infra/config/generated/builders/try/linux_chromium_asan_rel_ng/properties.json b/infra/config/generated/builders/try/linux_chromium_asan_rel_ng/properties.json index 290ce5b9..4c492da9 100644 --- a/infra/config/generated/builders/try/linux_chromium_asan_rel_ng/properties.json +++ b/infra/config/generated/builders/try/linux_chromium_asan_rel_ng/properties.json
@@ -1,7 +1,7 @@ { "$build/chromium_orchestrator": { "compilator": "linux_chromium_asan_rel_ng-compilator", - "compilator_watcher_git_revision": "c49f1d02dec735eb0e8f03121d3fab2840c2c954" + "compilator_watcher_git_revision": "7809a690bbd935bcb3b4d922e24cabe168aaabc8" }, "$recipe_engine/resultdb/test_presentation": { "column_keys": [],
diff --git a/infra/config/generated/builders/try/linux_chromium_tsan_rel_ng/properties.json b/infra/config/generated/builders/try/linux_chromium_tsan_rel_ng/properties.json index b87d522..ba82e73 100644 --- a/infra/config/generated/builders/try/linux_chromium_tsan_rel_ng/properties.json +++ b/infra/config/generated/builders/try/linux_chromium_tsan_rel_ng/properties.json
@@ -1,7 +1,7 @@ { "$build/chromium_orchestrator": { "compilator": "linux_chromium_tsan_rel_ng-compilator", - "compilator_watcher_git_revision": "c49f1d02dec735eb0e8f03121d3fab2840c2c954" + "compilator_watcher_git_revision": "7809a690bbd935bcb3b4d922e24cabe168aaabc8" }, "$recipe_engine/resultdb/test_presentation": { "column_keys": [],
diff --git a/infra/config/generated/builders/try/mac-rel/properties.json b/infra/config/generated/builders/try/mac-rel/properties.json index cd4e2ea5..06e9d4b 100644 --- a/infra/config/generated/builders/try/mac-rel/properties.json +++ b/infra/config/generated/builders/try/mac-rel/properties.json
@@ -1,7 +1,7 @@ { "$build/chromium_orchestrator": { "compilator": "mac-rel-compilator", - "compilator_watcher_git_revision": "c49f1d02dec735eb0e8f03121d3fab2840c2c954" + "compilator_watcher_git_revision": "7809a690bbd935bcb3b4d922e24cabe168aaabc8" }, "$build/code_coverage": { "use_clang_coverage": true
diff --git a/infra/config/generated/builders/try/mac11-arm64-rel/properties.json b/infra/config/generated/builders/try/mac11-arm64-rel/properties.json index 1bef0d6..eb089dc 100644 --- a/infra/config/generated/builders/try/mac11-arm64-rel/properties.json +++ b/infra/config/generated/builders/try/mac11-arm64-rel/properties.json
@@ -1,7 +1,7 @@ { "$build/chromium_orchestrator": { "compilator": "mac11-arm64-rel-compilator", - "compilator_watcher_git_revision": "c49f1d02dec735eb0e8f03121d3fab2840c2c954" + "compilator_watcher_git_revision": "7809a690bbd935bcb3b4d922e24cabe168aaabc8" }, "$recipe_engine/resultdb/test_presentation": { "column_keys": [],
diff --git a/infra/config/generated/builders/try/win10_chromium_x64_rel_ng/properties.json b/infra/config/generated/builders/try/win10_chromium_x64_rel_ng/properties.json index 5996d11..85a6e86 100644 --- a/infra/config/generated/builders/try/win10_chromium_x64_rel_ng/properties.json +++ b/infra/config/generated/builders/try/win10_chromium_x64_rel_ng/properties.json
@@ -1,7 +1,7 @@ { "$build/chromium_orchestrator": { "compilator": "win10_chromium_x64_rel_ng-compilator", - "compilator_watcher_git_revision": "c49f1d02dec735eb0e8f03121d3fab2840c2c954" + "compilator_watcher_git_revision": "7809a690bbd935bcb3b4d922e24cabe168aaabc8" }, "$build/code_coverage": { "coverage_test_types": [
diff --git a/infra/config/lib/orchestrator.star b/infra/config/lib/orchestrator.star index 81b04daf..86de3aa 100644 --- a/infra/config/lib/orchestrator.star +++ b/infra/config/lib/orchestrator.star
@@ -16,7 +16,7 @@ # infra/infra git revision to use for the compilator_watcher luciexe sub_build # Used by chromium orchestrators -_COMPILATOR_WATCHER_GIT_REVISION = "c49f1d02dec735eb0e8f03121d3fab2840c2c954" +_COMPILATOR_WATCHER_GIT_REVISION = "7809a690bbd935bcb3b4d922e24cabe168aaabc8" # Nodes for the definition of an orchestrator builder _ORCHESTRATOR = nodes.create_bucket_scoped_node_type("orchestrator")
diff --git a/ios/chrome/app/resources/BUILD.gn b/ios/chrome/app/resources/BUILD.gn index 4e236c2..f20cd2f 100644 --- a/ios/chrome/app/resources/BUILD.gn +++ b/ios/chrome/app/resources/BUILD.gn
@@ -41,8 +41,8 @@ ios_chrome_repack_locales("repack_locales") { visibility = [ ":packed_resources" ] - input_locales = ios_packed_locales - output_locales = ios_packed_locales_as_mac_outputs + input_locales = platform_pak_locales + output_locales = locales_as_apple_outputs } ios_chrome_repack_scalables("repack_scalable_resources") { @@ -140,7 +140,7 @@ config_file = "chrome_localize_strings_config.plist" datapack_dir = get_label_info("//ios/chrome/app/resources:packed_resources", "target_gen_dir") - packed_locales = ios_packed_locales_as_mac_outputs + packed_locales = locales_as_apple_outputs output_filenames = [ "InfoPlist.strings", "Localizable.strings",
diff --git a/ios/chrome/app/strings/ios_strings.grd b/ios/chrome/app/strings/ios_strings.grd index b189d86..4ffccbc 100644 --- a/ios/chrome/app/strings/ios_strings.grd +++ b/ios/chrome/app/strings/ios_strings.grd
@@ -11,10 +11,8 @@ <output filename="grit/ios_strings.h" type="rc_header"> <emit emit_type="prepend"></emit> </output> - <output filename="ios_strings_am.pak" type="data_package" lang="am" /> <output filename="ios_strings_ar.pak" type="data_package" lang="ar" /> <output filename="ios_strings_bg.pak" type="data_package" lang="bg" /> - <output filename="ios_strings_bn.pak" type="data_package" lang="bn" /> <output filename="ios_strings_ca.pak" type="data_package" lang="ca" /> <output filename="ios_strings_cs.pak" type="data_package" lang="cs" /> <output filename="ios_strings_da.pak" type="data_package" lang="da" /> @@ -24,12 +22,9 @@ <output filename="ios_strings_en-US.pak" type="data_package" lang="en" /> <output filename="ios_strings_es.pak" type="data_package" lang="es" /> <output filename="ios_strings_es-MX.pak" type="data_package" lang="es-419" /> - <output filename="ios_strings_et.pak" type="data_package" lang="et" /> <output filename="ios_strings_fa.pak" type="data_package" lang="fa" /> <output filename="ios_strings_fi.pak" type="data_package" lang="fi" /> - <output filename="ios_strings_fil.pak" type="data_package" lang="fil" /> <output filename="ios_strings_fr.pak" type="data_package" lang="fr" /> - <output filename="ios_strings_gu.pak" type="data_package" lang="gu" /> <output filename="ios_strings_he.pak" type="data_package" lang="he" /> <output filename="ios_strings_hi.pak" type="data_package" lang="hi" /> <output filename="ios_strings_hr.pak" type="data_package" lang="hr" /> @@ -37,12 +32,8 @@ <output filename="ios_strings_id.pak" type="data_package" lang="id" /> <output filename="ios_strings_it.pak" type="data_package" lang="it" /> <output filename="ios_strings_ja.pak" type="data_package" lang="ja" /> - <output filename="ios_strings_kn.pak" type="data_package" lang="kn" /> <output filename="ios_strings_ko.pak" type="data_package" lang="ko" /> <output filename="ios_strings_lt.pak" type="data_package" lang="lt" /> - <output filename="ios_strings_lv.pak" type="data_package" lang="lv" /> - <output filename="ios_strings_ml.pak" type="data_package" lang="ml" /> - <output filename="ios_strings_mr.pak" type="data_package" lang="mr" /> <output filename="ios_strings_ms.pak" type="data_package" lang="ms" /> <output filename="ios_strings_nl.pak" type="data_package" lang="nl" /> <!-- The translation console uses 'no' for Norwegian Bokmål. It should @@ -54,12 +45,8 @@ <output filename="ios_strings_ro.pak" type="data_package" lang="ro" /> <output filename="ios_strings_ru.pak" type="data_package" lang="ru" /> <output filename="ios_strings_sk.pak" type="data_package" lang="sk" /> - <output filename="ios_strings_sl.pak" type="data_package" lang="sl" /> <output filename="ios_strings_sr.pak" type="data_package" lang="sr" /> <output filename="ios_strings_sv.pak" type="data_package" lang="sv" /> - <output filename="ios_strings_sw.pak" type="data_package" lang="sw" /> - <output filename="ios_strings_ta.pak" type="data_package" lang="ta" /> - <output filename="ios_strings_te.pak" type="data_package" lang="te" /> <output filename="ios_strings_th.pak" type="data_package" lang="th" /> <output filename="ios_strings_tr.pak" type="data_package" lang="tr" /> <output filename="ios_strings_uk.pak" type="data_package" lang="uk" />
diff --git a/ios/chrome/browser/browser_state/chrome_browser_state_manager_impl.mm b/ios/chrome/browser/browser_state/chrome_browser_state_manager_impl.mm index 80c3f48..5d23b65c 100644 --- a/ios/chrome/browser/browser_state/chrome_browser_state_manager_impl.mm +++ b/ios/chrome/browser/browser_state/chrome_browser_state_manager_impl.mm
@@ -27,6 +27,8 @@ #include "ios/chrome/browser/browser_state_metrics/browser_state_metrics.h" #include "ios/chrome/browser/chrome_constants.h" #include "ios/chrome/browser/chrome_paths.h" +#include "ios/chrome/browser/optimization_guide/optimization_guide_service.h" +#include "ios/chrome/browser/optimization_guide/optimization_guide_service_factory.h" #include "ios/chrome/browser/pref_names.h" #include "ios/chrome/browser/signin/account_consistency_service_factory.h" #include "ios/chrome/browser/signin/account_reconcilor_factory.h" @@ -212,6 +214,11 @@ // Initialization needs to happen after the browser context is available // because UnifiedConsentService's dependencies needs the URL context getter. UnifiedConsentServiceFactory::GetForBrowserState(browser_state); + // Initialization needs to happen after the browser context is available + // because because IOSChromeMetricsServiceAccessor requires browser_state + // to be registered in the ChromeBrowserStateManager. + OptimizationGuideServiceFactory::GetForBrowserState(browser_state) + ->DoFinalInit(browser_state); } void ChromeBrowserStateManagerImpl::AddBrowserStateToCache(
diff --git a/ios/chrome/browser/infobars/infobar_badge_tab_helper.h b/ios/chrome/browser/infobars/infobar_badge_tab_helper.h index c287ce4e..34492f65 100644 --- a/ios/chrome/browser/infobars/infobar_badge_tab_helper.h +++ b/ios/chrome/browser/infobars/infobar_badge_tab_helper.h
@@ -56,13 +56,15 @@ friend class web::WebStateUserData<InfobarBadgeTabHelper>; explicit InfobarBadgeTabHelper(web::WebState* web_state); - // Notifies the tab helper to reset state for added or removed infobars with - // |infobar_type|. Only called for infobars that support badges. - void ResetStateForAddedInfobar(InfobarType infobar_type); - void ResetStateForRemovedInfobar(InfobarType infobar_type); + // Registers/unregisters the infobar to the tab helper for observation of its + // activities. + void RegisterInfobar(infobars::InfoBar* infobar); + void UnregisterInfobar(infobars::InfoBar* infobar); // Notifies the tab helper that an infobar with |type| was accepted or // reverted. void OnInfobarAcceptanceStateChanged(InfobarType infobar_type, bool accepted); + // Update the badges displayed in the location bar. + void UpdateBadgesShown(); // Helper object that listens for accept and revert events for an InfoBarIOS. class InfobarAcceptanceObserver : public InfoBarIOS::Observer { @@ -126,6 +128,8 @@ web::WebState* web_state_; // Map storing the BadgeState for each InfobarType. std::map<InfobarType, BadgeState> infobar_badge_states_; + // Vector storing infobars that are added when prerendering. + std::vector<infobars::InfoBar*> infobars_added_when_prerendering_; WEB_STATE_USER_DATA_KEY_DECL(); };
diff --git a/ios/chrome/browser/infobars/infobar_badge_tab_helper.mm b/ios/chrome/browser/infobars/infobar_badge_tab_helper.mm index 0eae2b6..9b44d2c0 100644 --- a/ios/chrome/browser/infobars/infobar_badge_tab_helper.mm +++ b/ios/chrome/browser/infobars/infobar_badge_tab_helper.mm
@@ -34,6 +34,13 @@ void InfobarBadgeTabHelper::SetDelegate( id<InfobarBadgeTabHelperDelegate> delegate) { delegate_ = delegate; + // Prerendering complete; register infobars using delegate. + for (size_t index = 0; index < infobars_added_when_prerendering_.size(); + ++index) { + RegisterInfobar(infobars_added_when_prerendering_.at(index)); + } + infobars_added_when_prerendering_.clear(); + UpdateBadgesShown(); } void InfobarBadgeTabHelper::UpdateBadgeForInfobarAccepted( @@ -58,7 +65,7 @@ if (infobar_badge_states_.find(infobar_type) == infobar_badge_states_.end()) return; infobar_badge_states_[infobar_type] |= BadgeStatePresented; - [delegate_ updateBadgesShownForWebState:web_state_]; + UpdateBadgesShown(); } void InfobarBadgeTabHelper::UpdateBadgeForInfobarBannerDismissed( @@ -66,7 +73,7 @@ if (infobar_badge_states_.find(infobar_type) == infobar_badge_states_.end()) return; infobar_badge_states_[infobar_type] &= ~BadgeStatePresented; - [delegate_ updateBadgesShownForWebState:web_state_]; + UpdateBadgesShown(); } std::map<InfobarType, BadgeState> InfobarBadgeTabHelper::GetInfobarBadgeStates() @@ -76,16 +83,37 @@ #pragma mark Private -void InfobarBadgeTabHelper::ResetStateForAddedInfobar( - InfobarType infobar_type) { - infobar_badge_states_[infobar_type] = BadgeStateNone; - [delegate_ updateBadgesShownForWebState:web_state_]; +void InfobarBadgeTabHelper::RegisterInfobar(infobars::InfoBar* infobar) { + // Handling the case where an infobar is added during prerendering. + if (!delegate_) { + infobars_added_when_prerendering_.push_back(infobar); + return; + } + // All other cases. + InfobarType infobar_type = GetInfobarType(infobar); + if ([delegate_ badgeSupportedForInfobarType:infobar_type]) { + infobar_badge_states_[infobar_type] = BadgeStateNone; + infobar_accept_observer_.scoped_observations().AddObservation( + static_cast<InfoBarIOS*>(infobar)); + } } -void InfobarBadgeTabHelper::ResetStateForRemovedInfobar( - InfobarType infobar_type) { - infobar_badge_states_.erase(infobar_type); - [delegate_ updateBadgesShownForWebState:web_state_]; +void InfobarBadgeTabHelper::UnregisterInfobar(infobars::InfoBar* infobar) { + // Handling the case where an infobar is removed during prerendering. + if (!delegate_) { + auto pos = std::find(infobars_added_when_prerendering_.begin(), + infobars_added_when_prerendering_.end(), infobar); + if (pos != infobars_added_when_prerendering_.end()) + infobars_added_when_prerendering_.erase(pos); + return; + } + // All other cases. + InfobarType infobar_type = GetInfobarType(infobar); + if ([delegate_ badgeSupportedForInfobarType:infobar_type]) { + infobar_badge_states_.erase(infobar_type); + infobar_accept_observer_.scoped_observations().RemoveObservation( + static_cast<InfoBarIOS*>(infobar)); + } } void InfobarBadgeTabHelper::OnInfobarAcceptanceStateChanged( @@ -98,6 +126,10 @@ } else { infobar_badge_states_[infobar_type] &= ~BadgeStateAccepted; } + UpdateBadgesShown(); +} + +void InfobarBadgeTabHelper::UpdateBadgesShown() { [delegate_ updateBadgesShownForWebState:web_state_]; } @@ -141,29 +173,21 @@ void InfobarBadgeTabHelper::InfobarManagerObserver::OnInfoBarAdded( infobars::InfoBar* infobar) { - if ([tab_helper_->delegate_ - badgeSupportedForInfobarType:GetInfobarType(infobar)]) { - tab_helper_->ResetStateForAddedInfobar(GetInfobarType(infobar)); - infobar_accept_observer_->scoped_observations().AddObservation( - static_cast<InfoBarIOS*>(infobar)); - } + tab_helper_->RegisterInfobar(infobar); + tab_helper_->UpdateBadgesShown(); } void InfobarBadgeTabHelper::InfobarManagerObserver::OnInfoBarRemoved( infobars::InfoBar* infobar, bool animate) { - if ([tab_helper_->delegate_ - badgeSupportedForInfobarType:GetInfobarType(infobar)]) { - tab_helper_->ResetStateForRemovedInfobar(GetInfobarType(infobar)); - infobar_accept_observer_->scoped_observations().RemoveObservation( - static_cast<InfoBarIOS*>(infobar)); - } + tab_helper_->UnregisterInfobar(infobar); + tab_helper_->UpdateBadgesShown(); } void InfobarBadgeTabHelper::InfobarManagerObserver::OnInfoBarReplaced( infobars::InfoBar* old_infobar, infobars::InfoBar* new_infobar) { - // New permission infobar in the same tab should keep preserve previous + // New permission infobar in the same tab should keep preserving previous // states. if (GetInfobarType(old_infobar) == InfobarType::kInfobarTypePermissions && GetInfobarType(new_infobar) == InfobarType::kInfobarTypePermissions) {
diff --git a/ios/chrome/browser/infobars/infobar_badge_tab_helper_unittest.mm b/ios/chrome/browser/infobars/infobar_badge_tab_helper_unittest.mm index 66239182..a2e26c72 100644 --- a/ios/chrome/browser/infobars/infobar_badge_tab_helper_unittest.mm +++ b/ios/chrome/browser/infobars/infobar_badge_tab_helper_unittest.mm
@@ -37,8 +37,8 @@ // Create the InfobarBadgeTabHelper for web_state_ and set its delegate. InfobarBadgeTabHelper::CreateForWebState(&web_state_); - tab_helper()->SetDelegate(delegate_); delegate_.badgeTabHelper = tab_helper(); + tab_helper()->SetDelegate(delegate_); } // Adds a FakeInfobarIOS with specified badge support to the WebState's
diff --git a/ios/chrome/browser/metrics/ios_chrome_metrics_service_client.mm b/ios/chrome/browser/metrics/ios_chrome_metrics_service_client.mm index 74eade0..48d7471 100644 --- a/ios/chrome/browser/metrics/ios_chrome_metrics_service_client.mm +++ b/ios/chrome/browser/metrics/ios_chrome_metrics_service_client.mm
@@ -454,6 +454,10 @@ ->GetChromeBrowserStateManager() ->GetLoadedBrowserStates(); bool all_profiles_succeeded = true; + + // If this function is called too early (before browser_state is fully + // initialized), the event listener will not be registered correctly. + DCHECK_GT(loaded_browser_states.size(), 0u); for (ChromeBrowserState* browser_state : loaded_browser_states) { if (!RegisterForBrowserStateEvents(browser_state)) { all_profiles_succeeded = false;
diff --git a/ios/chrome/browser/metrics/ios_chrome_metrics_service_client_unittest.mm b/ios/chrome/browser/metrics/ios_chrome_metrics_service_client_unittest.mm index f611699..30649ce1 100644 --- a/ios/chrome/browser/metrics/ios_chrome_metrics_service_client_unittest.mm +++ b/ios/chrome/browser/metrics/ios_chrome_metrics_service_client_unittest.mm
@@ -18,6 +18,7 @@ #include "components/metrics/unsent_log_store.h" #include "components/prefs/testing_pref_service.h" #include "components/ukm/ukm_service.h" +#include "ios/chrome/browser/application_context.h" #include "ios/chrome/browser/browser_state/test_chrome_browser_state.h" #include "ios/chrome/browser/browser_state/test_chrome_browser_state_manager.h" #include "ios/chrome/test/ios_chrome_scoped_testing_chrome_browser_state_manager.h" @@ -36,9 +37,13 @@ public: IOSChromeMetricsServiceClientTest() : scoped_browser_state_manager_( - std::make_unique<TestChromeBrowserStateManager>(base::FilePath())), - browser_state_(TestChromeBrowserState::Builder().Build()), - enabled_state_provider_(/*consent=*/false, /*enabled=*/false) {} + std::make_unique<TestChromeBrowserStateManager>( + TestChromeBrowserState::Builder().Build())), + enabled_state_provider_(/*consent=*/false, /*enabled=*/false) { + browser_state_ = GetApplicationContext() + ->GetChromeBrowserStateManager() + ->GetLastUsedBrowserState(); + } IOSChromeMetricsServiceClientTest(const IOSChromeMetricsServiceClientTest&) = delete; @@ -56,7 +61,7 @@ protected: web::WebTaskEnvironment task_environment_; IOSChromeScopedTestingChromeBrowserStateManager scoped_browser_state_manager_; - std::unique_ptr<ChromeBrowserState> browser_state_; + ChromeBrowserState* browser_state_; metrics::TestEnabledStateProvider enabled_state_provider_; TestingPrefServiceSimple prefs_; std::unique_ptr<metrics::MetricsStateManager> metrics_state_manager_;
diff --git a/ios/chrome/browser/optimization_guide/optimization_guide_service.h b/ios/chrome/browser/optimization_guide/optimization_guide_service.h index ba8f5f3..42346e2a 100644 --- a/ios/chrome/browser/optimization_guide/optimization_guide_service.h +++ b/ios/chrome/browser/optimization_guide/optimization_guide_service.h
@@ -45,6 +45,10 @@ OptimizationGuideService(const OptimizationGuideService&) = delete; OptimizationGuideService& operator=(const OptimizationGuideService&) = delete; + // Some initialization parts must be done once |browser_state| is fully + // initialized. + void DoFinalInit(web::BrowserState* browser_state); + // Registers the optimization types that intend to be queried during the // session. It is expected for this to be called right after the browser has // been initialized.
diff --git a/ios/chrome/browser/optimization_guide/optimization_guide_service.mm b/ios/chrome/browser/optimization_guide/optimization_guide_service.mm index 1299a24..11cba6b7 100644 --- a/ios/chrome/browser/optimization_guide/optimization_guide_service.mm +++ b/ios/chrome/browser/optimization_guide/optimization_guide_service.mm
@@ -62,14 +62,6 @@ optimization_guide::CommandLineTopHostProvider::CreateIfEnabled(); tab_url_provider_ = std::make_unique<TabUrlProviderImpl>( chrome_browser_state, base::DefaultClock::GetInstance()); - bool optimization_guide_fetching_enabled = - optimization_guide::IsUserPermittedToFetchFromRemoteOptimizationGuide( - browser_state->IsOffTheRecord(), chrome_browser_state->GetPrefs()); - base::UmaHistogramBoolean("OptimizationGuide.RemoteFetchingEnabled", - optimization_guide_fetching_enabled); - IOSChromeMetricsServiceAccessor::RegisterSyntheticFieldTrial( - "SyntheticOptimizationGuideRemoteFetching", - optimization_guide_fetching_enabled ? "Enabled" : "Disabled"); hint_store_ = optimization_guide::features::ShouldPersistHintsToDisk() ? std::make_unique<optimization_guide::OptimizationGuideStore>( @@ -93,6 +85,22 @@ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); } +void OptimizationGuideService::DoFinalInit(web::BrowserState* browser_state) { + ChromeBrowserState* chrome_browser_state = + ChromeBrowserState::FromBrowserState(browser_state); + DCHECK(chrome_browser_state); + if (!chrome_browser_state->IsOffTheRecord()) { + bool optimization_guide_fetching_enabled = + optimization_guide::IsUserPermittedToFetchFromRemoteOptimizationGuide( + browser_state->IsOffTheRecord(), chrome_browser_state->GetPrefs()); + base::UmaHistogramBoolean("OptimizationGuide.RemoteFetchingEnabled", + optimization_guide_fetching_enabled); + IOSChromeMetricsServiceAccessor::RegisterSyntheticFieldTrial( + "SyntheticOptimizationGuideRemoteFetching", + optimization_guide_fetching_enabled ? "Enabled" : "Disabled"); + } +} + optimization_guide::HintsManager* OptimizationGuideService::GetHintsManager() { return hints_manager_.get(); }
diff --git a/ios/chrome/browser/optimization_guide/optimization_guide_service_unittest.mm b/ios/chrome/browser/optimization_guide/optimization_guide_service_unittest.mm index 9eceef4..8ff7161 100644 --- a/ios/chrome/browser/optimization_guide/optimization_guide_service_unittest.mm +++ b/ios/chrome/browser/optimization_guide/optimization_guide_service_unittest.mm
@@ -107,6 +107,7 @@ optimization_guide_service_ = OptimizationGuideServiceFactory::GetForBrowserState( browser_state_.get()); + optimization_guide_service_->DoFinalInit(browser_state_.get()); } void PushHintsComponentAndWaitForCompletion() {
diff --git a/ios/chrome/browser/tabs/tab_helper_util.mm b/ios/chrome/browser/tabs/tab_helper_util.mm index 761b528..83ab66a5 100644 --- a/ios/chrome/browser/tabs/tab_helper_util.mm +++ b/ios/chrome/browser/tabs/tab_helper_util.mm
@@ -207,9 +207,10 @@ web_state->GetStableIdentifier()); PagePlaceholderTabHelper::CreateForWebState(web_state); PrintTabHelper::CreateForWebState(web_state); - InfobarBadgeTabHelper::CreateForWebState(web_state); } + InfobarBadgeTabHelper::CreateForWebState(web_state); + if (base::FeatureList::IsEnabled(kSharedHighlightingIOS)) { LinkToTextTabHelper::CreateForWebState(web_state); }
diff --git a/ios/chrome/browser/ui/follow/OWNERS b/ios/chrome/browser/ui/follow/OWNERS new file mode 100644 index 0000000..a7ef34b --- /dev/null +++ b/ios/chrome/browser/ui/follow/OWNERS
@@ -0,0 +1,2 @@ +edchin@google.com +tinazwang@google.com \ No newline at end of file
diff --git a/ios/chrome/content_widget_extension/BUILD.gn b/ios/chrome/content_widget_extension/BUILD.gn index 77079554..db35a3ef 100644 --- a/ios/chrome/content_widget_extension/BUILD.gn +++ b/ios/chrome/content_widget_extension/BUILD.gn
@@ -80,8 +80,8 @@ } repack_locales("packed_resources") { - input_locales = ios_packed_locales - output_locales = ios_packed_locales_as_mac_outputs + input_locales = platform_pak_locales + output_locales = locales_as_apple_outputs source_patterns = [ "$root_gen_dir/ios/content_widget_extension/ios_content_widget_extension_${branding_path_component}_strings_" ] @@ -93,7 +93,7 @@ _packed_resources_target = ":packed_resources" config_file = "content_widget_extension_localize_strings_config.plist" datapack_dir = get_label_info(_packed_resources_target, "target_gen_dir") - packed_locales = ios_packed_locales_as_mac_outputs + packed_locales = locales_as_apple_outputs output_filenames = [ "InfoPlist.strings" ] deps = [ "//ios/chrome/content_widget_extension/strings:ios_content_widget_extension_chromium_strings",
diff --git a/ios/chrome/credential_provider_extension/BUILD.gn b/ios/chrome/credential_provider_extension/BUILD.gn index 9f84d88d..29eec46d 100644 --- a/ios/chrome/credential_provider_extension/BUILD.gn +++ b/ios/chrome/credential_provider_extension/BUILD.gn
@@ -23,8 +23,8 @@ extension_repack_all_locales("packed_resources") { extension = "credential_provider_extension" - input_locales = ios_packed_locales - output_locales = ios_packed_locales_as_mac_outputs + input_locales = platform_pak_locales + output_locales = locales_as_apple_outputs } tweak_info_plist("tweak_info_plist") { @@ -102,7 +102,7 @@ _packed_resources_target = ":packed_resources" config_file = "credential_provider_extension_localize_strings_config.plist" datapack_dir = get_label_info(_packed_resources_target, "target_gen_dir") - packed_locales = ios_packed_locales_as_mac_outputs + packed_locales = locales_as_apple_outputs output_filenames = [ "Localizable.strings" ] deps = [ _packed_resources_target ] }
diff --git a/ios/chrome/search_widget_extension/BUILD.gn b/ios/chrome/search_widget_extension/BUILD.gn index db5938d..21d5d31 100644 --- a/ios/chrome/search_widget_extension/BUILD.gn +++ b/ios/chrome/search_widget_extension/BUILD.gn
@@ -88,8 +88,8 @@ } repack_locales("packed_resources") { - input_locales = ios_packed_locales - output_locales = ios_packed_locales_as_mac_outputs + input_locales = platform_pak_locales + output_locales = locales_as_apple_outputs source_patterns = [ "$root_gen_dir/ios/search_widget_extension/ios_search_widget_extension_strings_", @@ -107,7 +107,7 @@ _packed_resources_target = ":packed_resources" config_file = "search_widget_extension_localize_strings_config.plist" datapack_dir = get_label_info(_packed_resources_target, "target_gen_dir") - packed_locales = ios_packed_locales_as_mac_outputs + packed_locales = locales_as_apple_outputs output_filenames = [ "InfoPlist.strings", "Localizable.strings",
diff --git a/ios/chrome/share_extension/BUILD.gn b/ios/chrome/share_extension/BUILD.gn index 22e327a5..d0467f4 100644 --- a/ios/chrome/share_extension/BUILD.gn +++ b/ios/chrome/share_extension/BUILD.gn
@@ -22,8 +22,8 @@ extension_repack_all_locales("packed_resources") { extension = "share_extension" - input_locales = ios_packed_locales - output_locales = ios_packed_locales_as_mac_outputs + input_locales = platform_pak_locales + output_locales = locales_as_apple_outputs } tweak_info_plist("tweak_info_plist") { @@ -85,7 +85,7 @@ _packed_resources_target = ":packed_resources" config_file = "share_extension_localize_strings_config.plist" datapack_dir = get_label_info(_packed_resources_target, "target_gen_dir") - packed_locales = ios_packed_locales_as_mac_outputs + packed_locales = locales_as_apple_outputs output_filenames = [ "Localizable.strings" ] deps = [ _packed_resources_target ] }
diff --git a/ios/chrome/widget_kit_extension/BUILD.gn b/ios/chrome/widget_kit_extension/BUILD.gn index 01e6d323..3e3ccc7 100644 --- a/ios/chrome/widget_kit_extension/BUILD.gn +++ b/ios/chrome/widget_kit_extension/BUILD.gn
@@ -64,8 +64,8 @@ extension_repack_all_locales("packed_resources") { extension = "widget_kit_extension" - input_locales = ios_packed_locales - output_locales = ios_packed_locales_as_mac_outputs + input_locales = platform_pak_locales + output_locales = locales_as_apple_outputs } generate_localizable_strings("system_strings") { @@ -73,7 +73,7 @@ _packed_resources_target = ":packed_resources" config_file = "widget_kit_extension_localize_strings_config.plist" datapack_dir = get_label_info(_packed_resources_target, "target_gen_dir") - packed_locales = ios_packed_locales_as_mac_outputs + packed_locales = locales_as_apple_outputs output_filenames = [ "Localizable.strings" ] deps = [ _packed_resources_target ] }
diff --git a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios.zip.sha1 index cf721e95..96fdd44 100644 --- a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -712244873065fe4ee5c9893d8bd469425e4f8a4b \ No newline at end of file +f9c226738ee6a62f0614d26e8f298546de1b9137 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator.zip.sha1 index a4b3c68..ba6de02 100644 --- a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -53609dc312da9de37a634ea27ff4d28d97186a71 \ No newline at end of file +9236074b50ae6f5e3809bf74b33a0bea63f001c8 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios.zip.sha1 index cc34174..cf7d8e0 100644 --- a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -014e1d867bcb84609a254aa6b1576579a8f647df \ No newline at end of file +9b616600441c1270ab4e09254ef4422613d3795a \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator.zip.sha1 index a213e5b..9991468 100644 --- a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -ebb7ba9fc136087057c70ddfddc623370a0b2efe \ No newline at end of file +ce75e9f6eb1c009af2c2519de865d48e4a7eb941 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.ios.zip.sha1 index bf0f4be3..c1687c1 100644 --- a/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -0f657d7e14a6009702a43c7876e2fc21b8a7f571 \ No newline at end of file +e013960bfda6f34a1e5a89fdc7d14bfdc45afd8c \ No newline at end of file
diff --git a/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.iossimulator.zip.sha1 index 81cf3d98..57c1306 100644 --- a/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -75676869017cf9b23e5a790efe1c0b728dda1ae9 \ No newline at end of file +e31b14e414ecf413273af78669d1827d26a65234 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios.zip.sha1 index 9503b87e..b980e52 100644 --- a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -8ecbae7dd9cb2be7ae028e9df5c63d77ae429bb3 \ No newline at end of file +ada7d68fa33d7fd8f553f85c8da4ab21de59322a \ No newline at end of file
diff --git a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator.zip.sha1 index 3c7d6a1..6af7665 100644 --- a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -85ee980214f7bea84c07ab904fa2938b7bb2655a \ No newline at end of file +251cf511b4e2e4c8b0fcae51fbd006622dcd39fa \ No newline at end of file
diff --git a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios.zip.sha1 index 8d4e3836..87568e8 100644 --- a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -03cea78452ffad7200998a2c76dfdb1f4dcdd81d \ No newline at end of file +548be7948e8ca7f7f3876ee23ddc32d4cdb8c8b3 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator.zip.sha1 index 4dece53..d213a68 100644 --- a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -12b2a81e9d48bc8b3011a01d7a81631283bd4618 \ No newline at end of file +93d17b3e5ce03d06c9ff0edea0458175c42d8d66 \ No newline at end of file
diff --git a/ios/third_party/material_components_ios/BUILD.gn b/ios/third_party/material_components_ios/BUILD.gn index 80ee319..e218418 100644 --- a/ios/third_party/material_components_ios/BUILD.gn +++ b/ios/third_party/material_components_ios/BUILD.gn
@@ -1698,7 +1698,7 @@ # Only MaterialTabs.bundle contains translation. if (component_name == "MaterialTabs") { - component_locales = ios_packed_locales_as_mac_outputs + component_locales = locales_as_apple_outputs } } }
diff --git a/ios/web/public/thread/web_task_traits.h b/ios/web/public/thread/web_task_traits.h index aa66b01..375cf01 100644 --- a/ios/web/public/thread/web_task_traits.h +++ b/ios/web/public/thread/web_task_traits.h
@@ -56,7 +56,9 @@ class CheckArgumentsAreValid = std::enable_if_t< base::trait_helpers::AreValidTraits<ValidTrait, ArgTypes...>::value>> constexpr WebTaskTraitsExtension(ArgTypes... args) - : web_thread_(base::trait_helpers::GetEnum<WebThread::ID>(args...)), + : web_thread_( + base::trait_helpers::GetEnum<WebThread::ID, WebThread::ID_COUNT>( + args...)), nestable_(!base::trait_helpers::HasTrait<NonNestable, ArgTypes...>()) {} constexpr base::TaskTraitsExtensionStorage Serialize() const { @@ -74,7 +76,13 @@ static_cast<bool>(extension.data[1])); } - constexpr WebThread::ID web_thread() const { return web_thread_; } + constexpr WebThread::ID web_thread() const { + // TODO(crbug.com/1026641): Migrate to WebTaskTraits under which WebThread + // is not a trait. Until then, only code that knows traits have explicitly + // set the WebThread trait should check this field. + DCHECK_NE(web_thread_, WebThread::ID_COUNT); + return web_thread_; + } // Returns true if tasks with these traits may run in a nested RunLoop. constexpr bool nestable() const { return nestable_; } @@ -96,6 +104,41 @@ return WebTaskTraitsExtension(std::forward<ArgTypes>(args)...).Serialize(); } +class WebTaskTraits : public base::TaskTraits { + public: + struct ValidTrait : public base::TaskTraits::ValidTrait { + ValidTrait(NonNestable); + + // TODO(crbug.com/1304248): iOS never supported TaskPriority, but some + // callers are providing it... Add support? + ValidTrait(base::TaskPriority); + + // TODO(crbug.com/1026641): These traits are meaningless on WebThreads but + // some callers of post_task.h had been using them in conjunction with + // WebThread::ID traits. Remove such usage post-migration. + ValidTrait(base::MayBlock); + ValidTrait(base::TaskShutdownBehavior); + }; + + // TODO(crbug.com/1026641): Get rid of WebTaskTraitsExtension and store its + // members (|nestable_|) directly in WebTaskTraits. + template < + class... ArgTypes, + class CheckArgumentsAreValid = std::enable_if_t< + base::trait_helpers::AreValidTraits<ValidTrait, ArgTypes...>::value>> + constexpr WebTaskTraits(ArgTypes... args) : base::TaskTraits(args...) {} + + // Returns true if tasks with these traits may run in a nested RunLoop. + bool nestable() const { + return GetExtension<WebTaskTraitsExtension>().nestable(); + } +}; + +static_assert(sizeof(WebTaskTraits) == sizeof(base::TaskTraits), + "During the migration away from WebTasktraitsExtension, " + "WebTaskTraits must only use base::TaskTraits for storage " + "to prevent slicing."); + } // namespace web #endif // IOS_WEB_PUBLIC_THREAD_WEB_TASK_TRAITS_H_
diff --git a/ios/web/public/thread/web_thread.h b/ios/web/public/thread/web_thread.h index f8999fb4..8240a55 100644 --- a/ios/web/public/thread/web_thread.h +++ b/ios/web/public/thread/web_thread.h
@@ -22,6 +22,11 @@ namespace web { +// TODO(crbug.com/1026641): Include web_task_traits.h directly when the +// migration to Get(UI|IO)ThreadTaskrunner() is complete and the cyclic +// dependency of web_task_traits.h on WebThread::ID is broken. +class WebTaskTraits; + class WebThreadDelegate; // Use DCHECK_CURRENTLY_ON(WebThread::ID) to assert that a function can only be @@ -30,33 +35,45 @@ (DCHECK(::web::WebThread::CurrentlyOn(thread_identifier)) \ << ::web::WebThread::GetDCheckCurrentlyOnErrorMessage(thread_identifier)) +// The main entry point to post tasks to the UI thread. Tasks posted with the +// same |traits| will run in posting order (i.e. according to the +// SequencedTaskRunner contract). Tasks posted with different |traits| can be +// re-ordered. You may keep a reference to this task runner, it's always +// thread-safe to post to it though it may start returning false at some point +// during shutdown when it definitely is no longer accepting tasks. +// +// In unit tests, there must be a WebTaskEnvironment in scope for this API to be +// available. +// +// TODO(crbug.com/1026641): Make default traits |{}| the default param when it's +// possible to include web_task_traits.h in this file (see note above on the +// WebTaskTraits fwd-decl). +scoped_refptr<base::SingleThreadTaskRunner> GetUIThreadTaskRunner( + const WebTaskTraits& traits); + +// The WebThread::IO counterpart to GetUIThreadTaskRunner(). +scoped_refptr<base::SingleThreadTaskRunner> GetIOThreadTaskRunner( + const WebTaskTraits& traits); + /////////////////////////////////////////////////////////////////////////////// // WebThread // -// Utility functions for threads that are known by name. For example, there is -// one IO thread for the entire process, and various pieces of code find it -// useful to retrieve a pointer to the IO thread's message loop. -// -// See web_task_traits.h for posting Tasks to a WebThread. -// -// This class automatically handles the lifetime of different threads. You -// should never need to cache pointers to MessageLoops, since they're not thread -// safe. +// Utility functions for threads that are known by name. class WebThread { public: // An enumeration of the well-known threads. - // NOTE: threads must be listed in the order of their life-time, with each - // thread outliving every other thread below it. enum ID { - // The main thread in the browser. + // The main thread in the browser. It stops running tasks during shutdown + // and is never joined. UI, - // This is the thread that processes non-blocking IO, i.e. IPC and network. - // Blocking IO should happen in ThreadPool. + // This is the thread that processes non-blocking I/O, i.e. IPC and network. + // Blocking I/O should happen in base::ThreadPool. It is joined on shutdown + // (and thus any task posted to it may block shutdown). IO, // NOTE: do not add new threads here. Instead you should just use - // base::Create*TaskRunner to run tasks on the ThreadPool. + // base::ThreadPool::Create*TaskRunner to run tasks on the base::ThreadPool. // This identifier does not represent a thread. Instead it counts the // number of well-known threads. Insert new well-known threads before this @@ -67,14 +84,12 @@ WebThread(const WebThread&) = delete; WebThread& operator=(const WebThread&) = delete; - // NOTE: Task posting APIs have moved to post_task.h. See web_task_traits.h. - // Delete/ReleaseSoon() helpers allow future deletion of an owned object on // its associated thread. If you already have a task runner bound to a // WebThread you should use its SequencedTaskRunner::DeleteSoon() member - // method. If you don't, the helpers below avoid having to do - // base::CreateSingleThreadTaskRunner({WebThread::ID})->DeleteSoon(...) which - // is equivalent. + // method. + // TODO(crbug.com/1026641): Get rid of the last few callers to these in favor + // of an explicit call to web::GetUIThreadTaskRunner({})->DeleteSoon(...). template <class T> static bool DeleteSoon(ID identifier, @@ -162,7 +177,7 @@ static scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunnerForThread( ID identifier); - WebThread() {} + WebThread() = default; }; } // namespace web
diff --git a/ios/web/web_state/ui/crw_web_controller.mm b/ios/web/web_state/ui/crw_web_controller.mm index a61b39e..2e04aeb 100644 --- a/ios/web/web_state/ui/crw_web_controller.mm +++ b/ios/web/web_state/ui/crw_web_controller.mm
@@ -1645,7 +1645,7 @@ return; #if defined(__IPHONE_15_4) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_15_4 - if (@available(iOS 15, *)) { + if (@available(iOS 15.4, *)) { CRWWebViewContentView* webViewContentView = [[CRWWebViewContentView alloc] initWithWebView:self.webView scrollView:self.webScrollView @@ -1653,12 +1653,11 @@ [_containerView displayWebViewContentView:webViewContentView]; return; } -#else +#endif // defined(__IPHONE_15_4) CRWWebViewContentView* webViewContentView = [[CRWWebViewContentView alloc] initWithWebView:self.webView scrollView:self.webScrollView]; [_containerView displayWebViewContentView:webViewContentView]; -#endif // defined(__IPHONE_15_4) } - (void)removeWebView {
diff --git a/ios/web/web_thread_impl.cc b/ios/web/web_thread_impl.cc index 67e5fdc..e4d60cf 100644 --- a/ios/web/web_thread_impl.cc +++ b/ios/web/web_thread_impl.cc
@@ -24,55 +24,6 @@ namespace { -// An implementation of SingleThreadTaskRunner to be used in conjunction -// with WebThread. -class WebThreadTaskRunner : public base::SingleThreadTaskRunner { - public: - explicit WebThreadTaskRunner(WebThread::ID identifier) : id_(identifier) {} - - WebThreadTaskRunner(const WebThreadTaskRunner&) = delete; - WebThreadTaskRunner& operator=(const WebThreadTaskRunner&) = delete; - - // SingleThreadTaskRunner implementation. - bool PostDelayedTask(const base::Location& from_here, - base::OnceClosure task, - base::TimeDelta delay) override { - return base::PostDelayedTask(from_here, {id_}, std::move(task), delay); - } - - bool PostNonNestableDelayedTask(const base::Location& from_here, - base::OnceClosure task, - base::TimeDelta delay) override { - return base::PostDelayedTask(from_here, {id_, NonNestable()}, - std::move(task), delay); - } - - bool RunsTasksInCurrentSequence() const override { - return WebThread::CurrentlyOn(id_); - } - - protected: - ~WebThreadTaskRunner() override {} - - private: - WebThread::ID id_; -}; - -// A separate helper is used just for the task runners, in order to avoid -// needing to initialize the globals to create a task runner. -struct WebThreadTaskRunners { - WebThreadTaskRunners() { - for (int i = 0; i < WebThread::ID_COUNT; ++i) { - task_runners[i] = new WebThreadTaskRunner(static_cast<WebThread::ID>(i)); - } - } - - scoped_refptr<base::SingleThreadTaskRunner> task_runners[WebThread::ID_COUNT]; -}; - -base::LazyInstance<WebThreadTaskRunners>::Leaky g_task_runners = - LAZY_INSTANCE_INITIALIZER; - // State of a given WebThread::ID. enum WebThreadState { // WebThread::ID does not exist. @@ -145,6 +96,41 @@ return accepting_tasks; } +// An implementation of SingleThreadTaskRunner to be used in conjunction +// with WebThread. +class WebThreadTaskRunner : public base::SingleThreadTaskRunner { + public: + explicit WebThreadTaskRunner(WebThread::ID identifier) : id_(identifier) {} + + WebThreadTaskRunner(const WebThreadTaskRunner&) = delete; + WebThreadTaskRunner& operator=(const WebThreadTaskRunner&) = delete; + + // SingleThreadTaskRunner implementation. + bool PostDelayedTask(const base::Location& from_here, + base::OnceClosure task, + base::TimeDelta delay) override { + return PostTaskHelper(id_, from_here, std::move(task), delay, + true /* nestable */); + } + + bool PostNonNestableDelayedTask(const base::Location& from_here, + base::OnceClosure task, + base::TimeDelta delay) override { + return PostTaskHelper(id_, from_here, std::move(task), delay, + false /* nestable */); + } + + bool RunsTasksInCurrentSequence() const override { + return WebThread::CurrentlyOn(id_); + } + + protected: + ~WebThreadTaskRunner() override {} + + private: + WebThread::ID id_; +}; + class WebThreadTaskExecutor : public base::TaskExecutor { public: WebThreadTaskExecutor() {} @@ -159,29 +145,71 @@ GetWebThreadIdentifier(traits), from_here, std::move(task), delay, traits.GetExtension<WebTaskTraitsExtension>().nestable()); } - scoped_refptr<base::TaskRunner> CreateTaskRunner( const base::TaskTraits& traits) override { - return GetTaskRunnerForThread(GetWebThreadIdentifier(traits)); + return GetTaskRunner(GetWebThreadIdentifier(traits), traits); } - scoped_refptr<base::SequencedTaskRunner> CreateSequencedTaskRunner( const base::TaskTraits& traits) override { - return GetTaskRunnerForThread(GetWebThreadIdentifier(traits)); + return GetTaskRunner(GetWebThreadIdentifier(traits), traits); } - scoped_refptr<base::SingleThreadTaskRunner> CreateSingleThreadTaskRunner( const base::TaskTraits& traits, base::SingleThreadTaskRunnerThreadMode thread_mode) override { // It's not possible to request DEDICATED access to a WebThread. DCHECK_EQ(thread_mode, base::SingleThreadTaskRunnerThreadMode::SHARED); - return GetTaskRunnerForThread(GetWebThreadIdentifier(traits)); + return GetTaskRunner(GetWebThreadIdentifier(traits), traits); + } + + scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner( + WebThread::ID identifier, + const base::TaskTraits& traits) const { + // //TODO(crbug.com/1304248): Unlike content, iOS never honored + // |traits.priority()|... but this is where it could. + // Ref. content::BaseBrowserTaskExecutor::GetTaskRunner() + switch (identifier) { + case WebThread::UI: + return ui_thread_task_runner_; + case WebThread::IO: + return io_thread_task_runner_; + case WebThread::ID_COUNT: + NOTREACHED(); + return nullptr; + } + } + + // A static getter that also verifies the instance was set and warns of steps + // to take if not. + static const WebThreadTaskExecutor* GetInstance() { + DCHECK(g_instance) + << "No web task executor created.\nHint: if this is in a unit test, " + "you're likely missing a WebTaskEnvironment member in your " + "fixture."; + return g_instance; + } + + // Creates the WebThreadTaskExecutor instance. It is intentionally leaked on + // shutdown, except in unit tests which can reset it via + // ResetInstanceForTesting(). + static void CreateInstance() { + DCHECK(!g_instance); + g_instance = new WebThreadTaskExecutor(); + base::RegisterTaskExecutor(WebTaskTraitsExtension::kExtensionId, + g_instance); + } + + static void ResetInstanceForTesting() { + DCHECK(g_instance); + base::UnregisterTaskExecutorForTesting( + WebTaskTraitsExtension::kExtensionId); + delete g_instance; + g_instance = nullptr; } private: WebThread::ID GetWebThreadIdentifier(const base::TaskTraits& traits) { DCHECK_EQ(traits.extension_id(), WebTaskTraitsExtension::kExtensionId); - WebThread::ID id = + const WebThread::ID id = traits.GetExtension<WebTaskTraitsExtension>().web_thread(); DCHECK_LT(id, WebThread::ID_COUNT); @@ -201,17 +229,31 @@ return id; } - scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunnerForThread( - WebThread::ID identifier) { - return g_task_runners.Get().task_runners[identifier]; - } + static WebThreadTaskExecutor* g_instance; + + scoped_refptr<WebThreadTaskRunner> ui_thread_task_runner_ = + base::MakeRefCounted<WebThreadTaskRunner>(WebThread::UI); + scoped_refptr<WebThreadTaskRunner> io_thread_task_runner_ = + base::MakeRefCounted<WebThreadTaskRunner>(WebThread::IO); }; -// |g_web_thread_task_executor| is intentionally leaked on shutdown. -WebThreadTaskExecutor* g_web_thread_task_executor = nullptr; +// static +WebThreadTaskExecutor* WebThreadTaskExecutor::g_instance = nullptr; } // namespace +scoped_refptr<base::SingleThreadTaskRunner> GetUIThreadTaskRunner( + const WebTaskTraits& traits) { + return WebThreadTaskExecutor::GetInstance()->GetTaskRunner(WebThread::UI, + traits); +} + +scoped_refptr<base::SingleThreadTaskRunner> GetIOThreadTaskRunner( + const WebTaskTraits& traits) { + return WebThreadTaskExecutor::GetInstance()->GetTaskRunner(WebThread::IO, + traits); +} + WebThreadImpl::WebThreadImpl( ID identifier, scoped_refptr<base::SingleThreadTaskRunner> task_runner) @@ -320,23 +362,27 @@ // static scoped_refptr<base::SingleThreadTaskRunner> WebThread::GetTaskRunnerForThread( ID identifier) { - return g_task_runners.Get().task_runners[identifier]; + DCHECK_GE(identifier, 0); + DCHECK_LT(identifier, ID_COUNT); + switch (identifier) { + case UI: + return GetUIThreadTaskRunner({}); + case IO: + return GetIOThreadTaskRunner({}); + case ID_COUNT: + NOTREACHED(); + return nullptr; + } } // static void WebThreadImpl::CreateTaskExecutor() { - DCHECK(!g_web_thread_task_executor); - g_web_thread_task_executor = new WebThreadTaskExecutor(); - base::RegisterTaskExecutor(WebTaskTraitsExtension::kExtensionId, - g_web_thread_task_executor); + WebThreadTaskExecutor::CreateInstance(); } // static void WebThreadImpl::ResetTaskExecutorForTesting() { - DCHECK(g_web_thread_task_executor); - base::UnregisterTaskExecutorForTesting(WebTaskTraitsExtension::kExtensionId); - delete g_web_thread_task_executor; - g_web_thread_task_executor = nullptr; + WebThreadTaskExecutor::ResetInstanceForTesting(); } } // namespace web
diff --git a/ios/web/web_thread_unittest.cc b/ios/web/web_thread_unittest.cc index 13011d811..642b6ba 100644 --- a/ios/web/web_thread_unittest.cc +++ b/ios/web/web_thread_unittest.cc
@@ -8,6 +8,7 @@ #include "base/task/post_task.h" #include "ios/web/public/test/web_task_environment.h" #include "ios/web/public/thread/web_task_traits.h" +#include "ios/web/public/thread/web_thread.h" #include "ios/web/web_thread_impl.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/platform_test.h" @@ -18,14 +19,17 @@ protected: static void BasicFunction(base::OnceClosure continuation, WebThread::ID target) { + auto other_thread = target == WebThread::UI ? WebThread::IO : WebThread::UI; + EXPECT_TRUE(WebThread::CurrentlyOn(target)); + EXPECT_FALSE(WebThread::CurrentlyOn(other_thread)); std::move(continuation).Run(); } - web::WebTaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_{WebTaskEnvironment::REAL_IO_THREAD}; }; -TEST_F(WebThreadTest, PostTask) { +TEST_F(WebThreadTest, BasePostTask) { base::RunLoop run_loop; EXPECT_TRUE(base::PostTask( FROM_HERE, {WebThread::IO}, @@ -34,6 +38,22 @@ run_loop.Run(); } +TEST_F(WebThreadTest, GetUITaskRunnerPostTask) { + base::RunLoop run_loop; + EXPECT_TRUE(GetUIThreadTaskRunner({})->PostTask( + FROM_HERE, base::BindOnce(&BasicFunction, run_loop.QuitWhenIdleClosure(), + WebThread::UI))); + run_loop.Run(); +} + +TEST_F(WebThreadTest, GetIOTaskRunnerPostTask) { + base::RunLoop run_loop; + EXPECT_TRUE(GetIOThreadTaskRunner({})->PostTask( + FROM_HERE, base::BindOnce(&BasicFunction, run_loop.QuitWhenIdleClosure(), + WebThread::IO))); + run_loop.Run(); +} + TEST_F(WebThreadTest, PostTaskViaTaskRunner) { scoped_refptr<base::TaskRunner> task_runner = base::CreateTaskRunner({WebThread::IO});
diff --git a/ios/web_view/BUILD.gn b/ios/web_view/BUILD.gn index cc64386fd..a675da0 100644 --- a/ios/web_view/BUILD.gn +++ b/ios/web_view/BUILD.gn
@@ -541,8 +541,8 @@ "//ui/strings:ax_strings", "//ui/strings:ui_strings", ] - input_locales = ios_packed_locales - output_locales = ios_packed_locales_as_mac_outputs + input_locales = platform_pak_locales + output_locales = locales_as_apple_outputs copy_data_to_bundle = true }
diff --git a/media/capabilities/bucket_utility.cc b/media/capabilities/bucket_utility.cc index 9c0bf43..facefca 100644 --- a/media/capabilities/bucket_utility.cc +++ b/media/capabilities/bucket_utility.cc
@@ -6,6 +6,9 @@ #include <algorithm> #include <cmath> +#include <iterator> + +#include "base/check_op.h" namespace { @@ -25,6 +28,23 @@ 854, 960, 1080, 1280, 1440, 1920, 2160, 2560, 2880, 3160, 3840, 4128, 4320, 5120, 6144, 7360, 7680, 8000, 9000, 10000, 11000, 11520}; +// Pixel buckets that are used to quantize the resolution to limit the amount of +// information that is stored and exposed through the API. The pixel size +// indices are used for logging, the pixel size buckets can therefore not be +// changed unless the corresponding logging code is updated. +constexpr int kWebrtcPixelsBuckets[] = {1280 * 720, 1920 * 1080, 2560 * 1440, + 3840 * 2160}; +// The boundaries between buckets are calculated as the point between the two +// buckets. +constexpr int kWebrtcPixelsBoundaries[] = { + (kWebrtcPixelsBuckets[0] + kWebrtcPixelsBuckets[1]) / 2, + (kWebrtcPixelsBuckets[1] + kWebrtcPixelsBuckets[2]) / 2, + (kWebrtcPixelsBuckets[2] + kWebrtcPixelsBuckets[3]) / 2}; +// Static assert to make sure that `kWebrtcPixelsBoundaries[]` is updated if new +// pixel sizes are added to kWebrtcPixelsBuckets[]`. +static_assert(std::size(kWebrtcPixelsBoundaries) + 1 == + std::size(kWebrtcPixelsBuckets)); + } // namespace namespace media { @@ -81,4 +101,22 @@ return higher_bucket; } +int GetWebrtcPixelsBucket(int pixels) { + return kWebrtcPixelsBuckets[GetWebrtcPixelsBucketIndex(pixels)]; +} + +int GetWebrtcPixelsBucketIndex(int pixels) { + const int* pixels_bucket_it = + std::lower_bound(std::begin(kWebrtcPixelsBoundaries), + std::end(kWebrtcPixelsBoundaries), pixels); + // The output from std::lower_bound is in the range [begin, end], hence the + // subtraction below is well defined. + int pixels_bucket_index = + std::distance(std::begin(kWebrtcPixelsBoundaries), pixels_bucket_it); + DCHECK_GE(pixels_bucket_index, 0); + DCHECK_LT(pixels_bucket_index, + static_cast<int>(std::size(kWebrtcPixelsBuckets))); + return pixels_bucket_index; +} + } // namespace media \ No newline at end of file
diff --git a/media/capabilities/bucket_utility.h b/media/capabilities/bucket_utility.h index 9d89b3d9..8bcdbe2 100644 --- a/media/capabilities/bucket_utility.h +++ b/media/capabilities/bucket_utility.h
@@ -23,6 +23,16 @@ // characteristics. Bucketing helps avoid fragmentation of recorded stats. MEDIA_EXPORT int GetFpsBucket(double raw_fps); +// Find the nearest WebRTC pixels bucket. Pixel buckets are used to quantize the +// resolution to limit the amount of information that is stored and exposed +// through the API. +MEDIA_EXPORT int GetWebrtcPixelsBucket(int pixels); + +// Find the nearest WebRTC pixels bucket index. The index is used when logging +// the performance of the API, if the index is changed the corresponding logging +// code must also be changed. +MEDIA_EXPORT int GetWebrtcPixelsBucketIndex(int pixels); + } // namespace media #endif // MEDIA_CAPABILITIES_BUCKET_UTILITY_H_
diff --git a/media/capabilities/webrtc_video_stats_db.cc b/media/capabilities/webrtc_video_stats_db.cc index 7e117784..8455ffc 100644 --- a/media/capabilities/webrtc_video_stats_db.cc +++ b/media/capabilities/webrtc_video_stats_db.cc
@@ -9,6 +9,7 @@ #include "base/metrics/field_trial_params.h" #include "base/strings/stringprintf.h" #include "media/base/media_switches.h" +#include "media/capabilities/bucket_utility.h" namespace media { @@ -32,33 +33,6 @@ return VIDEO_CODEC_PROFILE_UNKNOWN; } -template <typename T, size_t N> -constexpr size_t array_size(T (&)[N]) { - return N; -} - -int GetPixelsBucket(int pixels) { - constexpr int kPixelsBuckets[] = {1280 * 720, 1920 * 1080, 3840 * 2160}; - // The boundaries between buckets are calculated as the point between the two - // buckets. - constexpr int kPixelsBoundaries[] = { - (kPixelsBuckets[0] + kPixelsBuckets[1]) / 2, - (kPixelsBuckets[1] + kPixelsBuckets[2]) / 2}; - // Static assert to make sure that `kPixelBoundaries[]` is updated if new - // pixel sizes are added to kPixelsBuckets[]`. - static_assert(array_size(kPixelsBoundaries) + 1 == - array_size(kPixelsBuckets)); - - const int* pixels_bucket_it = std::lower_bound( - std::begin(kPixelsBoundaries), std::end(kPixelsBoundaries), pixels); - // The output from std::lower_bound is in the range [begin, end], hence the - // subtraction below is well defined. - int pixels_bucket_index = (pixels_bucket_it - std::begin(kPixelsBoundaries)); - DCHECK_GE(pixels_bucket_index, 0); - DCHECK_LT(pixels_bucket_index, static_cast<int>(array_size(kPixelsBuckets))); - return kPixelsBuckets[pixels_bucket_index]; -} - } // namespace // static @@ -71,7 +45,7 @@ // Bucket pixel size to prevent an explosion of one-off values in the // database and add basic guards against fingerprinting. return VideoDescKey(is_decode_stats, ValidateVideoCodecProfile(codec_profile), - hardware_accelerated, GetPixelsBucket(pixels)); + hardware_accelerated, GetWebrtcPixelsBucket(pixels)); } WebrtcVideoStatsDB::VideoDescKey::VideoDescKey(bool is_decode_stats,
diff --git a/media/capture/video/chromeos/camera_device_delegate.cc b/media/capture/video/chromeos/camera_device_delegate.cc index 40cbda3..52d1ed93 100644 --- a/media/capture/video/chromeos/camera_device_delegate.cc +++ b/media/capture/video/chromeos/camera_device_delegate.cc
@@ -893,18 +893,33 @@ cros::mojom::Camera3StreamConfigurationPtr stream_config = cros::mojom::Camera3StreamConfiguration::New(); + auto camera_app_device = + CameraAppDeviceBridgeImpl::GetInstance()->GetWeakCameraAppDevice( + device_descriptor_.device_id); for (const auto& param : chrome_capture_params_) { // Set up context for preview stream and record stream. cros::mojom::Camera3StreamPtr stream = cros::mojom::Camera3Stream::New(); StreamType stream_type = (param.first == ClientType::kPreviewClient) ? StreamType::kPreviewOutput : StreamType::kRecordingOutput; - // TODO(henryhsu): PreviewClient should remove HW_VIDEO_ENCODER usage when - // multiple streams enabled. - auto usage = (param.first == ClientType::kPreviewClient) - ? (cros::mojom::GRALLOC_USAGE_HW_COMPOSER | - cros::mojom::GRALLOC_USAGE_HW_VIDEO_ENCODER) - : cros::mojom::GRALLOC_USAGE_HW_VIDEO_ENCODER; + uint32_t usage; + switch (param.first) { + case ClientType::kPreviewClient: + usage = cros::mojom::GRALLOC_USAGE_HW_COMPOSER; + // TODO(henryhsu): PreviewClient should remove HW_VIDEO_ENCODER usage + // when multiple streams enabled. + if (camera_app_device && camera_app_device->GetCaptureIntent() == + cros::mojom::CaptureIntent::VIDEO_RECORD) { + usage |= cros::mojom::GRALLOC_USAGE_HW_VIDEO_ENCODER; + } + break; + case ClientType::kVideoClient: + usage = cros::mojom::GRALLOC_USAGE_HW_VIDEO_ENCODER; + break; + default: + NOTREACHED() << "Unrecognized client type: " + << static_cast<int>(param.first); + } stream->id = static_cast<uint64_t>(stream_type); stream->stream_type = cros::mojom::Camera3StreamType::CAMERA3_STREAM_OUTPUT; stream->width = param.second.requested_format.frame_size.width();
diff --git a/media/mojo/mojom/stable/stable_video_decoder_types.mojom b/media/mojo/mojom/stable/stable_video_decoder_types.mojom index a829257..c259a9b 100644 --- a/media/mojo/mojom/stable/stable_video_decoder_types.mojom +++ b/media/mojo/mojom/stable/stable_video_decoder_types.mojom
@@ -501,6 +501,6 @@ int32 id@0; Type type@1; - mojo_base.mojom.DictionaryValue params@2; + mojo_base.mojom.DeprecatedDictionaryValue params@2; mojo_base.mojom.TimeTicks time@3; };
diff --git a/mojo/core/entrypoints.cc b/mojo/core/entrypoints.cc index ba5781e..ab4b516 100644 --- a/mojo/core/entrypoints.cc +++ b/mojo/core/entrypoints.cc
@@ -359,52 +359,52 @@ } // extern "C" -MojoSystemThunks g_thunks = {sizeof(MojoSystemThunks), - MojoInitializeImpl, - MojoGetTimeTicksNowImpl, - MojoCloseImpl, - MojoQueryHandleSignalsStateImpl, - MojoCreateMessagePipeImpl, - MojoWriteMessageImpl, - MojoReadMessageImpl, - MojoFuseMessagePipesImpl, - MojoCreateMessageImpl, - MojoDestroyMessageImpl, - MojoSerializeMessageImpl, - MojoAppendMessageDataImpl, - MojoGetMessageDataImpl, - MojoSetMessageContextImpl, - MojoGetMessageContextImpl, - MojoNotifyBadMessageImpl, - MojoCreateDataPipeImpl, - MojoWriteDataImpl, - MojoBeginWriteDataImpl, - MojoEndWriteDataImpl, - MojoReadDataImpl, - MojoBeginReadDataImpl, - MojoEndReadDataImpl, - MojoCreateSharedBufferImpl, - MojoDuplicateBufferHandleImpl, - MojoMapBufferImpl, - MojoUnmapBufferImpl, - MojoGetBufferInfoImpl, - MojoCreateTrapImpl, - MojoAddTriggerImpl, - MojoRemoveTriggerImpl, - MojoArmTrapImpl, - MojoWrapPlatformHandleImpl, - MojoUnwrapPlatformHandleImpl, - MojoWrapPlatformSharedMemoryRegionImpl, - MojoUnwrapPlatformSharedMemoryRegionImpl, - MojoCreateInvitationImpl, - MojoAttachMessagePipeToInvitationImpl, - MojoExtractMessagePipeFromInvitationImpl, - MojoSendInvitationImpl, - MojoAcceptInvitationImpl, - MojoSetQuotaImpl, - MojoQueryQuotaImpl, - MojoShutdownImpl, - MojoSetDefaultProcessErrorHandlerImpl}; +MojoSystemThunks64 g_thunks = {sizeof(g_thunks), + MojoInitializeImpl, + MojoGetTimeTicksNowImpl, + MojoCloseImpl, + MojoQueryHandleSignalsStateImpl, + MojoCreateMessagePipeImpl, + MojoWriteMessageImpl, + MojoReadMessageImpl, + MojoFuseMessagePipesImpl, + MojoCreateMessageImpl, + MojoDestroyMessageImpl, + MojoSerializeMessageImpl, + MojoAppendMessageDataImpl, + MojoGetMessageDataImpl, + MojoSetMessageContextImpl, + MojoGetMessageContextImpl, + MojoNotifyBadMessageImpl, + MojoCreateDataPipeImpl, + MojoWriteDataImpl, + MojoBeginWriteDataImpl, + MojoEndWriteDataImpl, + MojoReadDataImpl, + MojoBeginReadDataImpl, + MojoEndReadDataImpl, + MojoCreateSharedBufferImpl, + MojoDuplicateBufferHandleImpl, + MojoMapBufferImpl, + MojoUnmapBufferImpl, + MojoGetBufferInfoImpl, + MojoCreateTrapImpl, + MojoAddTriggerImpl, + MojoRemoveTriggerImpl, + MojoArmTrapImpl, + MojoWrapPlatformHandleImpl, + MojoUnwrapPlatformHandleImpl, + MojoWrapPlatformSharedMemoryRegionImpl, + MojoUnwrapPlatformSharedMemoryRegionImpl, + MojoCreateInvitationImpl, + MojoAttachMessagePipeToInvitationImpl, + MojoExtractMessagePipeFromInvitationImpl, + MojoSendInvitationImpl, + MojoAcceptInvitationImpl, + MojoSetQuotaImpl, + MojoQueryQuotaImpl, + MojoShutdownImpl, + MojoSetDefaultProcessErrorHandlerImpl}; } // namespace @@ -421,7 +421,7 @@ g_core = core_instance.get(); } -const MojoSystemThunks& GetSystemThunks() { +const MojoSystemThunks64& GetSystemThunks() { return g_thunks; }
diff --git a/mojo/core/entrypoints.h b/mojo/core/entrypoints.h index e18366b7..6ac59d08 100644 --- a/mojo/core/entrypoints.h +++ b/mojo/core/entrypoints.h
@@ -14,10 +14,10 @@ // Initializes the global Core object. MOJO_SYSTEM_IMPL_EXPORT void InitializeCore(); -// Returns a MojoSystemThunks struct populated with the EDK's implementation of -// each function. This may be used by embedders to populate thunks for +// Returns a MojoSystemThunks64 struct populated with the EDK's implementation +// of each function. This may be used by embedders to populate thunks for // application loading. -MOJO_SYSTEM_IMPL_EXPORT const MojoSystemThunks& GetSystemThunks(); +MOJO_SYSTEM_IMPL_EXPORT const MojoSystemThunks64& GetSystemThunks(); } // namespace core } // namespace mojo
diff --git a/mojo/core/mojo_core.cc b/mojo/core/mojo_core.cc index 8a33ded..f7866ff 100644 --- a/mojo/core/mojo_core.cc +++ b/mojo/core/mojo_core.cc
@@ -183,7 +183,7 @@ return MOJO_RESULT_OK; } -MojoSystemThunks g_thunks = {0}; +MojoSystemThunks64 g_thunks = {0}; } // namespace @@ -193,7 +193,7 @@ #define EXPORT_FROM_MOJO_CORE __attribute__((visibility("default"))) #endif -EXPORT_FROM_MOJO_CORE void MojoGetSystemThunks(MojoSystemThunks* thunks) { +EXPORT_FROM_MOJO_CORE void MojoGetSystemThunks(MojoSystemThunks64* thunks) { if (!g_thunks.size) { g_thunks = mojo::core::GetSystemThunks(); g_thunks.Initialize = InitializeImpl; @@ -202,7 +202,7 @@ // Caller must provide a thunk structure at least large enough to hold Core // ABI version 0. SetQuota is the first function introduced in ABI version 1. - CHECK_GE(thunks->size, offsetof(MojoSystemThunks, SetQuota)); + CHECK_GE(thunks->size, offsetof(MojoSystemThunks64, SetQuota)); // NOTE: This also overrites |thunks->size| with the actual size of our own // thunks if smaller than the caller's. This informs the caller that we
diff --git a/mojo/public/c/system/thunks.cc b/mojo/public/c/system/thunks.cc index cb29af7..8cec68d 100644 --- a/mojo/public/c/system/thunks.cc +++ b/mojo/public/c/system/thunks.cc
@@ -34,9 +34,9 @@ namespace { -typedef void (*MojoGetSystemThunksFunction)(MojoSystemThunks* thunks); +typedef void (*MojoGetSystemThunksFunction)(MojoSystemThunks64* thunks); -MojoSystemThunks g_thunks; +MojoSystemThunks64 g_thunks; MojoResult NotImplemented(const char* name) { if (g_thunks.size > 0) { @@ -54,9 +54,9 @@ } // namespace -#define INVOKE_THUNK(name, ...) \ - offsetof(MojoSystemThunks, name) < g_thunks.size \ - ? g_thunks.name(__VA_ARGS__) \ +#define INVOKE_THUNK(name, ...) \ + offsetof(MojoSystemThunks64, name) < g_thunks.size \ + ? g_thunks.name(__VA_ARGS__) \ : NotImplemented(#name) namespace mojo { @@ -863,7 +863,7 @@ } // extern "C" -const MojoSystemThunks* MojoEmbedderGetSystemThunks() { +const MojoSystemThunks64* MojoEmbedderGetSystemThunks64() { return &g_thunks; } @@ -871,7 +871,7 @@ return &g_thunks_32; } -void MojoEmbedderSetSystemThunks(const MojoSystemThunks* thunks) { +void MojoEmbedderSetSystemThunks(const MojoSystemThunks64* thunks) { // Assume embedders will always use matching versions of the Mojo Core and // public APIs. DCHECK_EQ(thunks->size, sizeof(g_thunks));
diff --git a/mojo/public/c/system/thunks.h b/mojo/public/c/system/thunks.h index e45d231..c7e3b14 100644 --- a/mojo/public/c/system/thunks.h +++ b/mojo/public/c/system/thunks.h
@@ -29,7 +29,7 @@ // (e.g. an optional "Options" structure as many functions here have). // #pragma pack(push, 8) -struct MojoSystemThunks { +struct MojoSystemThunks64 { uint32_t size; // Should be set to sizeof(MojoSystemThunks). MojoResult (*Initialize)(const struct MojoInitializeOptions* options); @@ -240,7 +240,7 @@ // longer consuming it. typedef uint32_t MojoHandle32; -struct MojoSystemThunks32 { +struct MojoSystemThunks { uint32_t size; // Should be set to sizeof(MojoSystemThunks32). MojoResult (*Initialize)(const struct MojoInitializeOptions* options); @@ -439,14 +439,14 @@ }; #pragma pack(pop) -MOJO_SYSTEM_EXPORT const struct MojoSystemThunks* MojoEmbedderGetSystemThunks(); +typedef struct MojoSystemThunks MojoSystemThunks32; -MOJO_SYSTEM_EXPORT const struct MojoSystemThunks32* -MojoEmbedderGetSystemThunks32(); +MOJO_SYSTEM_EXPORT const struct MojoSystemThunks64* +MojoEmbedderGetSystemThunks64(); -// A function for setting up the embedder's own system thunks. This should only -// be called by Mojo embedder code. +MOJO_SYSTEM_EXPORT const MojoSystemThunks32* MojoEmbedderGetSystemThunks32(); + MOJO_SYSTEM_EXPORT void MojoEmbedderSetSystemThunks( - const struct MojoSystemThunks* system_thunks); + const struct MojoSystemThunks64* system_thunks); #endif // MOJO_PUBLIC_C_SYSTEM_THUNKS_H_
diff --git a/net/disk_cache/backend_unittest.cc b/net/disk_cache/backend_unittest.cc index e20a2529..7d076c0 100644 --- a/net/disk_cache/backend_unittest.cc +++ b/net/disk_cache/backend_unittest.cc
@@ -581,14 +581,16 @@ // Now test the public API. int rv = disk_cache::CreateCacheBackend( - net::DISK_CACHE, net::CACHE_BACKEND_DEFAULT, cache_path_, 0, + net::DISK_CACHE, net::CACHE_BACKEND_DEFAULT, + /*file_operations=*/nullptr, cache_path_, 0, disk_cache::ResetHandling::kNeverReset, nullptr, &cache, cb.callback()); ASSERT_THAT(cb.GetResult(rv), IsOk()); ASSERT_TRUE(cache.get()); cache.reset(); rv = disk_cache::CreateCacheBackend( - net::MEMORY_CACHE, net::CACHE_BACKEND_DEFAULT, base::FilePath(), 0, + net::MEMORY_CACHE, net::CACHE_BACKEND_DEFAULT, + /*file_operations=*/nullptr, base::FilePath(), 0, disk_cache::ResetHandling::kNeverReset, nullptr, &cache, cb.callback()); ASSERT_THAT(cb.GetResult(rv), IsOk()); ASSERT_TRUE(cache.get()); @@ -605,7 +607,8 @@ std::unique_ptr<disk_cache::Backend> cache; int rv = disk_cache::CreateCacheBackend( - net::MEMORY_CACHE, net::CACHE_BACKEND_DEFAULT, base::FilePath(), 0, + net::MEMORY_CACHE, net::CACHE_BACKEND_DEFAULT, + /*file_operations=*/nullptr, base::FilePath(), 0, disk_cache::ResetHandling::kNeverReset, nullptr, &cache, on_cleanup.closure(), cb.callback()); ASSERT_THAT(cb.GetResult(rv), IsOk()); @@ -629,12 +632,14 @@ std::unique_ptr<disk_cache::Backend> cache, cache2; int rv = disk_cache::CreateCacheBackend( - net::APP_CACHE, net::CACHE_BACKEND_DEFAULT, cache_path_, 0, - disk_cache::ResetHandling::kNeverReset, nullptr, &cache, cb.callback()); + net::APP_CACHE, net::CACHE_BACKEND_DEFAULT, /*file_operations=*/nullptr, + cache_path_, 0, disk_cache::ResetHandling::kNeverReset, nullptr, &cache, + cb.callback()); int rv2 = disk_cache::CreateCacheBackend( - net::APP_CACHE, net::CACHE_BACKEND_DEFAULT, cache_path_, 0, - disk_cache::ResetHandling::kNeverReset, nullptr, &cache2, cb2.callback()); + net::APP_CACHE, net::CACHE_BACKEND_DEFAULT, /*file_operations=*/nullptr, + cache_path_, 0, disk_cache::ResetHandling::kNeverReset, nullptr, &cache2, + cb2.callback()); EXPECT_THAT(cb.GetResult(rv), IsOk()); EXPECT_TRUE(cache.get()); @@ -666,12 +671,14 @@ std::unique_ptr<disk_cache::Backend> cache, cache2; int rv = disk_cache::CreateCacheBackend( - net::APP_CACHE, net::CACHE_BACKEND_SIMPLE, cache_path_, 0, - disk_cache::ResetHandling::kNeverReset, nullptr, &cache, cb.callback()); + net::APP_CACHE, net::CACHE_BACKEND_SIMPLE, /*file_operations=*/nullptr, + cache_path_, 0, disk_cache::ResetHandling::kNeverReset, nullptr, &cache, + cb.callback()); int rv2 = disk_cache::CreateCacheBackend( - net::APP_CACHE, net::CACHE_BACKEND_SIMPLE, cache_path_, 0, - disk_cache::ResetHandling::kNeverReset, nullptr, &cache2, cb2.callback()); + net::APP_CACHE, net::CACHE_BACKEND_SIMPLE, /*file_operations=*/nullptr, + cache_path_, 0, disk_cache::ResetHandling::kNeverReset, nullptr, &cache2, + cb2.callback()); EXPECT_THAT(cb.GetResult(rv), IsOk()); ASSERT_TRUE(cache.get()); @@ -716,8 +723,8 @@ std::unique_ptr<disk_cache::Backend> cache; int rv = disk_cache::CreateCacheBackend( - net::APP_CACHE, net::CACHE_BACKEND_SIMPLE, cache_path_, 0, - disk_cache::ResetHandling::kNeverReset, nullptr, &cache, + net::APP_CACHE, net::CACHE_BACKEND_SIMPLE, /*file_operations=*/nullptr, + cache_path_, 0, disk_cache::ResetHandling::kNeverReset, nullptr, &cache, run_loop.QuitClosure(), cb.callback()); EXPECT_THAT(cb.GetResult(rv), IsOk()); ASSERT_TRUE(cache.get()); @@ -764,8 +771,8 @@ // Create a backend with post-cleanup callback specified, in order to know // when the index has been written back (so it can be deleted race-free). int rv = disk_cache::CreateCacheBackend( - net::APP_CACHE, net::CACHE_BACKEND_SIMPLE, cache_path_, 0, - disk_cache::ResetHandling::kNeverReset, nullptr, &cache, + net::APP_CACHE, net::CACHE_BACKEND_SIMPLE, /*file_operations=*/nullptr, + cache_path_, 0, disk_cache::ResetHandling::kNeverReset, nullptr, &cache, run_loop.QuitClosure(), cb.callback()); EXPECT_THAT(cb.GetResult(rv), IsOk()); ASSERT_TRUE(cache.get()); @@ -939,8 +946,8 @@ net::TestCompletionCallback cb; std::unique_ptr<disk_cache::Backend> extra_cache; int rv = disk_cache::CreateCacheBackend( - net::DISK_CACHE, net::CACHE_BACKEND_DEFAULT, store.GetPath(), 0, - disk_cache::ResetHandling::kNeverReset, + net::DISK_CACHE, net::CACHE_BACKEND_DEFAULT, /*file_operations=*/nullptr, + store.GetPath(), 0, disk_cache::ResetHandling::kNeverReset, /* net_log = */ nullptr, &extra_cache, cb.callback()); ASSERT_THAT(cb.GetResult(rv), IsOk()); ASSERT_TRUE(extra_cache.get() != nullptr); @@ -1088,7 +1095,8 @@ std::unique_ptr<disk_cache::Backend> backend; int rv = disk_cache::CreateCacheBackend( - net::DISK_CACHE, net::CACHE_BACKEND_BLOCKFILE, cache_path_, 0, + net::DISK_CACHE, net::CACHE_BACKEND_BLOCKFILE, + /*file_operations=*/nullptr, cache_path_, 0, disk_cache::ResetHandling::kNeverReset, nullptr, &backend, cb.callback()); ASSERT_NE(net::OK, cb.GetResult(rv)); @@ -2517,7 +2525,8 @@ net::TestCompletionCallback cb; std::unique_ptr<disk_cache::Backend> base_cache; int rv = disk_cache::CreateCacheBackend( - net::DISK_CACHE, net::CACHE_BACKEND_BLOCKFILE, cache_path_, 0, + net::DISK_CACHE, net::CACHE_BACKEND_BLOCKFILE, + /*file_operations=*/nullptr, cache_path_, 0, disk_cache::ResetHandling::kResetOnError, nullptr, &base_cache, cb.callback()); ASSERT_THAT(cb.GetResult(rv), IsOk()); @@ -2605,7 +2614,8 @@ base::ScopedDisallowBlocking disallow_blocking; base::FilePath path(cache_path_); int rv = disk_cache::CreateCacheBackend( - net::DISK_CACHE, net::CACHE_BACKEND_BLOCKFILE, path, 0, + net::DISK_CACHE, net::CACHE_BACKEND_BLOCKFILE, + /*file_operations=*/nullptr, path, 0, disk_cache::ResetHandling::kResetOnError, nullptr, &cache_, cb.callback()); path.clear(); // Make sure path was captured by the previous call. @@ -3707,14 +3717,15 @@ std::unique_ptr<disk_cache::Backend> cache[kNumberOfCaches]; int rv = disk_cache::CreateCacheBackend( - net::DISK_CACHE, net::CACHE_BACKEND_DEFAULT, store1.GetPath(), 0, - disk_cache::ResetHandling::kNeverReset, nullptr, &cache[0], - cb.callback()); + net::DISK_CACHE, net::CACHE_BACKEND_DEFAULT, /*file_operations=*/nullptr, + store1.GetPath(), 0, disk_cache::ResetHandling::kNeverReset, nullptr, + &cache[0], cb.callback()); ASSERT_THAT(cb.GetResult(rv), IsOk()); rv = disk_cache::CreateCacheBackend( net::GENERATED_BYTE_CODE_CACHE, net::CACHE_BACKEND_DEFAULT, - store2.GetPath(), 0, disk_cache::ResetHandling::kNeverReset, nullptr, - &cache[1], cb.callback()); + /*file_operations=*/nullptr, store2.GetPath(), 0, + disk_cache::ResetHandling::kNeverReset, nullptr, &cache[1], + cb.callback()); ASSERT_THAT(cb.GetResult(rv), IsOk()); ASSERT_TRUE(cache[0].get() != nullptr && cache[1].get() != nullptr); @@ -4100,13 +4111,13 @@ cache_.reset(); // Check that the |SimpleBackendImpl| does not favor this structure. - disk_cache::SimpleBackendImpl* simple_cache = - new disk_cache::SimpleBackendImpl(cache_path_, nullptr, nullptr, 0, - net::DISK_CACHE, nullptr); + auto simple_cache = std::make_unique<disk_cache::SimpleBackendImpl>( + /*file_operations_factory=*/nullptr, cache_path_, nullptr, nullptr, 0, + net::DISK_CACHE, nullptr); net::TestCompletionCallback cb; int rv = simple_cache->Init(cb.callback()); EXPECT_NE(net::OK, cb.GetResult(rv)); - delete simple_cache; + simple_cache.reset(); DisableIntegrityCheck(); } @@ -4889,8 +4900,9 @@ // Simple cache should be able to recover. int rv = disk_cache::CreateCacheBackend( - net::APP_CACHE, net::CACHE_BACKEND_SIMPLE, cache_path_, 0, - disk_cache::ResetHandling::kNeverReset, nullptr, &cache, cb.callback()); + net::APP_CACHE, net::CACHE_BACKEND_SIMPLE, /*file_operations=*/nullptr, + cache_path_, 0, disk_cache::ResetHandling::kNeverReset, nullptr, &cache, + cb.callback()); EXPECT_THAT(cb.GetResult(rv), IsOk()); } @@ -4912,8 +4924,9 @@ // Simple cache should not be able to recover when there are entry files. int rv = disk_cache::CreateCacheBackend( - net::APP_CACHE, net::CACHE_BACKEND_SIMPLE, cache_path_, 0, - disk_cache::ResetHandling::kNeverReset, nullptr, &cache, cb.callback()); + net::APP_CACHE, net::CACHE_BACKEND_SIMPLE, /*file_operations=*/nullptr, + cache_path_, 0, disk_cache::ResetHandling::kNeverReset, nullptr, &cache, + cb.callback()); EXPECT_THAT(cb.GetResult(rv), IsError(net::ERR_FAILED)); } @@ -4986,8 +4999,9 @@ // Create an initial back-end and wait for indexing int rv = disk_cache::CreateCacheBackend( - net::APP_CACHE, net::CACHE_BACKEND_SIMPLE, cache_path_, 0, - disk_cache::ResetHandling::kNeverReset, nullptr, &cache, cb.callback()); + net::APP_CACHE, net::CACHE_BACKEND_SIMPLE, /*file_operations=*/nullptr, + cache_path_, 0, disk_cache::ResetHandling::kNeverReset, nullptr, &cache, + cb.callback()); EXPECT_THAT(cb.GetResult(rv), IsOk()); ASSERT_TRUE(cache.get()); WaitForSimpleCacheIndexAndCheck(cache.get()); @@ -5003,8 +5017,9 @@ net::TestCompletionCallback cb; int rv = disk_cache::CreateCacheBackend( - net::APP_CACHE, net::CACHE_BACKEND_SIMPLE, cache_path_, 0, - disk_cache::ResetHandling::kNeverReset, nullptr, &cache, cb.callback()); + net::APP_CACHE, net::CACHE_BACKEND_SIMPLE, /*file_operations=*/nullptr, + cache_path_, 0, disk_cache::ResetHandling::kNeverReset, nullptr, &cache, + cb.callback()); EXPECT_THAT(cb.GetResult(rv), IsOk()); ASSERT_TRUE(cache.get()); WaitForSimpleCacheIndexAndCheck(cache.get()); @@ -5028,8 +5043,9 @@ std::unique_ptr<disk_cache::Backend> cache; int rv = disk_cache::CreateCacheBackend( - net::APP_CACHE, net::CACHE_BACKEND_SIMPLE, cache_path_, 0, - disk_cache::ResetHandling::kNeverReset, nullptr, &cache, cb.callback()); + net::APP_CACHE, net::CACHE_BACKEND_SIMPLE, /*file_operations=*/nullptr, + cache_path_, 0, disk_cache::ResetHandling::kNeverReset, nullptr, &cache, + cb.callback()); EXPECT_THAT(cb.GetResult(rv), IsOk()); ASSERT_TRUE(cache.get()); WaitForSimpleCacheIndexAndCheck(cache.get()); @@ -5045,8 +5061,9 @@ std::unique_ptr<disk_cache::Backend> cache; int rv = disk_cache::CreateCacheBackend( - net::APP_CACHE, net::CACHE_BACKEND_SIMPLE, cache_path_, 0, - disk_cache::ResetHandling::kReset, nullptr, &cache, cb.callback()); + net::APP_CACHE, net::CACHE_BACKEND_SIMPLE, /*file_operations=*/nullptr, + cache_path_, 0, disk_cache::ResetHandling::kReset, nullptr, &cache, + cb.callback()); EXPECT_THAT(cb.GetResult(rv), IsOk()); ASSERT_TRUE(cache.get()); WaitForSimpleCacheIndexAndCheck(cache.get());
diff --git a/net/disk_cache/disk_cache.cc b/net/disk_cache/disk_cache.cc index 5966fc6d..4fab854 100644 --- a/net/disk_cache/disk_cache.cc +++ b/net/disk_cache/disk_cache.cc
@@ -6,6 +6,7 @@ #include "base/bind.h" #include "base/files/file_path.h" +#include "base/files/file_util.h" #include "base/memory/raw_ptr.h" #include "base/metrics/field_trial.h" #include "base/task/single_thread_task_runner.h" @@ -28,18 +29,20 @@ // finished. class CacheCreator { public: - CacheCreator(const base::FilePath& path, - disk_cache::ResetHandling reset_handling, - int64_t max_bytes, - net::CacheType type, - net::BackendType backend_type, + CacheCreator( + const base::FilePath& path, + disk_cache::ResetHandling reset_handling, + int64_t max_bytes, + net::CacheType type, + net::BackendType backend_type, + scoped_refptr<disk_cache::BackendFileOperationsFactory> file_operations, #if BUILDFLAG(IS_ANDROID) - base::android::ApplicationStatusListener* app_status_listener, + base::android::ApplicationStatusListener* app_status_listener, #endif - net::NetLog* net_log, - std::unique_ptr<disk_cache::Backend>* backend, - base::OnceClosure post_cleanup_callback, - net::CompletionOnceCallback callback); + net::NetLog* net_log, + std::unique_ptr<disk_cache::Backend>* backend, + base::OnceClosure post_cleanup_callback, + net::CompletionOnceCallback callback); CacheCreator(const CacheCreator&) = delete; CacheCreator& operator=(const CacheCreator&) = delete; @@ -63,6 +66,7 @@ int64_t max_bytes_; net::CacheType type_; net::BackendType backend_type_; + scoped_refptr<disk_cache::BackendFileOperationsFactory> file_operations_; #if BUILDFLAG(IS_ANDROID) raw_ptr<base::android::ApplicationStatusListener> app_status_listener_; #endif @@ -80,6 +84,7 @@ int64_t max_bytes, net::CacheType type, net::BackendType backend_type, + scoped_refptr<disk_cache::BackendFileOperationsFactory> file_operations, #if BUILDFLAG(IS_ANDROID) base::android::ApplicationStatusListener* app_status_listener, #endif @@ -93,6 +98,7 @@ max_bytes_(max_bytes), type_(type), backend_type_(backend_type), + file_operations_(std::move(file_operations)), #if BUILDFLAG(IS_ANDROID) app_status_listener_(app_status_listener), #endif @@ -120,9 +126,9 @@ (backend_type_ == net::CACHE_BACKEND_DEFAULT && kSimpleBackendIsDefault)) { disk_cache::SimpleBackendImpl* simple_cache = - new disk_cache::SimpleBackendImpl(path_, cleanup_tracker_.get(), - /* file_tracker = */ nullptr, - max_bytes_, type_, net_log_); + new disk_cache::SimpleBackendImpl( + file_operations_, path_, cleanup_tracker_.get(), + /* file_tracker = */ nullptr, max_bytes_, type_, net_log_); created_cache_.reset(simple_cache); #if BUILDFLAG(IS_ANDROID) if (app_status_listener_) @@ -217,6 +223,7 @@ net::Error CreateCacheBackendImpl( net::CacheType type, net::BackendType backend_type, + scoped_refptr<BackendFileOperationsFactory> file_operations, const base::FilePath& path, int64_t max_bytes, ResetHandling reset_handling, @@ -248,6 +255,7 @@ bool had_post_cleanup_callback = !post_cleanup_callback.is_null(); CacheCreator* creator = new CacheCreator( path, reset_handling, max_bytes, type, backend_type, + std::move(file_operations), #if BUILDFLAG(IS_ANDROID) std::move(app_status_listener), #endif @@ -260,26 +268,30 @@ return creator->TryCreateCleanupTrackerAndRun(); } -net::Error CreateCacheBackend(net::CacheType type, - net::BackendType backend_type, - const base::FilePath& path, - int64_t max_bytes, - ResetHandling reset_handling, - net::NetLog* net_log, - std::unique_ptr<Backend>* backend, - net::CompletionOnceCallback callback) { - return CreateCacheBackendImpl( - type, backend_type, path, max_bytes, reset_handling, +net::Error CreateCacheBackend( + net::CacheType type, + net::BackendType backend_type, + scoped_refptr<BackendFileOperationsFactory> file_operations, + const base::FilePath& path, + int64_t max_bytes, + ResetHandling reset_handling, + net::NetLog* net_log, + std::unique_ptr<Backend>* backend, + net::CompletionOnceCallback callback) { + return CreateCacheBackendImpl(type, backend_type, std::move(file_operations), + path, max_bytes, reset_handling, #if BUILDFLAG(IS_ANDROID) - nullptr, + nullptr, #endif - net_log, backend, base::OnceClosure(), std::move(callback)); + net_log, backend, base::OnceClosure(), + std::move(callback)); } #if BUILDFLAG(IS_ANDROID) NET_EXPORT net::Error CreateCacheBackend( net::CacheType type, net::BackendType backend_type, + scoped_refptr<BackendFileOperationsFactory> file_operations, const base::FilePath& path, int64_t max_bytes, ResetHandling reset_handling, @@ -287,24 +299,27 @@ std::unique_ptr<Backend>* backend, net::CompletionOnceCallback callback, base::android::ApplicationStatusListener* app_status_listener) { - return CreateCacheBackendImpl(type, backend_type, path, max_bytes, - reset_handling, std::move(app_status_listener), - net_log, backend, base::OnceClosure(), - std::move(callback)); + return CreateCacheBackendImpl( + type, backend_type, std::move(file_operations), path, max_bytes, + reset_handling, std::move(app_status_listener), net_log, backend, + base::OnceClosure(), std::move(callback)); } #endif -net::Error CreateCacheBackend(net::CacheType type, - net::BackendType backend_type, - const base::FilePath& path, - int64_t max_bytes, - ResetHandling reset_handling, - net::NetLog* net_log, - std::unique_ptr<Backend>* backend, - base::OnceClosure post_cleanup_callback, - net::CompletionOnceCallback callback) { +net::Error CreateCacheBackend( + net::CacheType type, + net::BackendType backend_type, + scoped_refptr<BackendFileOperationsFactory> file_operations, + const base::FilePath& path, + int64_t max_bytes, + ResetHandling reset_handling, + net::NetLog* net_log, + std::unique_ptr<Backend>* backend, + base::OnceClosure post_cleanup_callback, + net::CompletionOnceCallback callback) { return CreateCacheBackendImpl( - type, backend_type, path, max_bytes, reset_handling, + type, backend_type, std::move(file_operations), path, max_bytes, + reset_handling, #if BUILDFLAG(IS_ANDROID) nullptr, #endif @@ -393,4 +408,78 @@ return ret; } +TrivialFileOperations::TrivialFileOperations() { + DETACH_FROM_SEQUENCE(sequence_checker_); +} + +TrivialFileOperations::~TrivialFileOperations() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); +} + +bool TrivialFileOperations::CreateDirectory(const base::FilePath& path) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + + // This is needed for some unittests. + if (path.empty()) { + return false; + } + + DCHECK(path.IsAbsolute()); + + bool result = base::CreateDirectory(path); + return result; +} + +bool TrivialFileOperations::PathExists(const base::FilePath& path) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + + // This is needed for some unittests. + if (path.empty()) { + return false; + } + + DCHECK(path.IsAbsolute()); + + bool result = base::PathExists(path); + return result; +} + +base::File TrivialFileOperations::OpenFile(const base::FilePath& path, + uint32_t flags) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + DCHECK(path.IsAbsolute()); + + base::File file(path, flags); + return file; +} + +bool TrivialFileOperations::DeleteFile(const base::FilePath& path) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + DCHECK(path.IsAbsolute()); + + return base::DeleteFile(path); +} + +bool TrivialFileOperations::ReplaceFile(const base::FilePath& from_path, + const base::FilePath& to_path, + base::File::Error* error) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + DCHECK(from_path.IsAbsolute()); + DCHECK(to_path.IsAbsolute()); + + return base::ReplaceFile(from_path, to_path, error); +} + +absl::optional<base::File::Info> TrivialFileOperations::GetFileInfo( + const base::FilePath& path) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + DCHECK(path.IsAbsolute()); + + base::File::Info file_info; + if (!base::GetFileInfo(path, &file_info)) { + return absl::nullopt; + } + return file_info; +} + } // namespace disk_cache
diff --git a/net/disk_cache/disk_cache.h b/net/disk_cache/disk_cache.h index aca39cf..e8e0d92 100644 --- a/net/disk_cache/disk_cache.h +++ b/net/disk_cache/disk_cache.h
@@ -14,6 +14,7 @@ #include <string> #include <vector> +#include "base/files/file.h" #include "base/memory/ref_counted.h" #include "base/strings/string_split.h" #include "base/time/time.h" @@ -23,6 +24,7 @@ #include "net/base/net_errors.h" #include "net/base/net_export.h" #include "net/base/request_priority.h" +#include "third_party/abseil-cpp/absl/types/optional.h" namespace base { class FilePath; @@ -43,6 +45,7 @@ class Entry; class Backend; class EntryResult; +class BackendFileOperationsFactory; struct RangeResult; using EntryResultCallback = base::OnceCallback<void(EntryResult)>; using RangeResultCallback = base::OnceCallback<void(const RangeResult&)>; @@ -51,35 +54,39 @@ // See CreateCacheBackend() for its usage. enum class ResetHandling { kReset, kResetOnError, kNeverReset }; -// Returns an instance of a Backend of the given |type|. |path| points to a -// folder where the cached data will be stored (if appropriate). This cache -// instance must be the only object that will be reading or writing files to -// that folder (if another one exists, and |type| is not net::DISK_CACHE this -// operation will not complete until the previous duplicate gets destroyed and -// finishes all I/O). The returned object should be deleted when not needed -// anymore. +// Returns an instance of a Backend of the given `type`. `file_operations` +// (nullable) is used to broker file operations in sandboxed environments. +// Currently `file_operations` is only used for the simple backend. +// `path` points to a folder where the cached data will be stored (if +// appropriate). This cache instance must be the only object that will be +// reading or writing files to that folder (if another one exists, and `type` is +// not net::DISK_CACHE this operation will not complete until the previous +// duplicate gets destroyed and finishes all I/O). The returned object should be +// deleted when not needed anymore. // -// If |reset_handling| is set to kResetOnError and there is a problem with the +// If `reset_handling` is set to kResetOnError and there is a problem with the // cache initialization, the files will be deleted and a new set will be // created. If it's set to kReset, this will happen even if there isn't a // problem with cache initialization. Finally, if it's set to kNeverReset, the // cache creation will fail if there is a problem with cache initialization. // -// |max_bytes| is the maximum size the cache can grow to. If zero is passed in -// as |max_bytes|, the cache will determine the value to use. The returned +// `max_bytes` is the maximum size the cache can grow to. If zero is passed in +// as `max_bytes`, the cache will determine the value to use. The returned // pointer can be nullptr if a fatal error is found. The actual return value of // the function is a net error code. If this function returns ERR_IO_PENDING, -// the |callback| will be invoked when a backend is available or a fatal error -// condition is reached. The pointer to receive the |backend| must remain valid +// the `callback` will be invoked when a backend is available or a fatal error +// condition is reached. The pointer to receive the `backend` must remain valid // until the operation completes (the callback is notified). -NET_EXPORT net::Error CreateCacheBackend(net::CacheType type, - net::BackendType backend_type, - const base::FilePath& path, - int64_t max_bytes, - ResetHandling reset_handling, - net::NetLog* net_log, - std::unique_ptr<Backend>* backend, - net::CompletionOnceCallback callback); +NET_EXPORT net::Error CreateCacheBackend( + net::CacheType type, + net::BackendType backend_type, + scoped_refptr<BackendFileOperationsFactory> file_operations, + const base::FilePath& path, + int64_t max_bytes, + ResetHandling reset_handling, + net::NetLog* net_log, + std::unique_ptr<Backend>* backend, + net::CompletionOnceCallback callback); #if BUILDFLAG(IS_ANDROID) // Similar to the function above, but takes an |app_status_listener| which is @@ -88,6 +95,7 @@ NET_EXPORT net::Error CreateCacheBackend( net::CacheType type, net::BackendType backend_type, + scoped_refptr<BackendFileOperationsFactory> file_operations, const base::FilePath& path, int64_t max_bytes, ResetHandling reset_handling, @@ -109,6 +117,7 @@ NET_EXPORT net::Error CreateCacheBackend( net::CacheType type, net::BackendType backend_type, + scoped_refptr<BackendFileOperationsFactory> file_operations, const base::FilePath& path, int64_t max_bytes, ResetHandling reset_handling, @@ -549,6 +558,70 @@ // available. constexpr int kMaxWebUICodeCacheSize = 5 * 1024 * 1024; +// An interface to provide file operations so that the HTTP cache works on +// a sandboxed process. +// All the paths must be absolute paths. +class BackendFileOperations { + public: + virtual ~BackendFileOperations() = default; + + // Creates a directory with the given path and returns whether that succeeded. + virtual bool CreateDirectory(const base::FilePath& path) = 0; + + // Returns true if the given path exists on the local filesystem. + virtual bool PathExists(const base::FilePath& path) = 0; + + // Opens a file with the given path and flags. Returns the opened file. + virtual base::File OpenFile(const base::FilePath& path, uint32_t flags) = 0; + + // Deletes a file with the given path and returns whether that succeeded. + virtual bool DeleteFile(const base::FilePath& path) = 0; + + // Renames a file `from_path` to `to_path`. Returns the error information. + virtual bool ReplaceFile(const base::FilePath& from_path, + const base::FilePath& to_path, + base::File::Error* error) = 0; + + // Returns information about the given path. + virtual absl::optional<base::File::Info> GetFileInfo( + const base::FilePath& path) = 0; +}; + +// A factory interface that creates BackendFileOperations. +class BackendFileOperationsFactory + : public base::RefCounted<BackendFileOperationsFactory> { + public: + // Creates a BackendFileOperations which is bound to `task_runner`. + virtual std::unique_ptr<BackendFileOperations> Create( + scoped_refptr<base::SequencedTaskRunner> task_runner) = 0; + + protected: + friend class base::RefCounted<BackendFileOperationsFactory>; + virtual ~BackendFileOperationsFactory() = default; +}; + +// A trivial BackendFileOperations implementation which uses corresponding +// base functions. +class NET_EXPORT TrivialFileOperations final : public BackendFileOperations { + public: + TrivialFileOperations(); + ~TrivialFileOperations() override; + + // BackendFileOperations implementation: + bool CreateDirectory(const base::FilePath& path) override; + bool PathExists(const base::FilePath& path) override; + base::File OpenFile(const base::FilePath& path, uint32_t flags) override; + bool DeleteFile(const base::FilePath& path) override; + bool ReplaceFile(const base::FilePath& from_path, + const base::FilePath& to_path, + base::File::Error* error) override; + absl::optional<base::File::Info> GetFileInfo( + const base::FilePath& path) override; + + private: + SEQUENCE_CHECKER(sequence_checker_); +}; + } // namespace disk_cache #endif // NET_DISK_CACHE_DISK_CACHE_H_
diff --git a/net/disk_cache/disk_cache_fuzzer.cc b/net/disk_cache/disk_cache_fuzzer.cc index 9c44950..2e0bd143 100644 --- a/net/disk_cache/disk_cache_fuzzer.cc +++ b/net/disk_cache/disk_cache_fuzzer.cc
@@ -1164,9 +1164,9 @@ std::make_unique<disk_cache::SimpleFileTracker>(kMaxFdsSimpleCache); std::unique_ptr<disk_cache::SimpleBackendImpl> simple_backend = std::make_unique<disk_cache::SimpleBackendImpl>( - cache_path_, /* cleanup_tracker = */ nullptr, - simple_file_tracker_.get(), max_size_, type, - /*net_log = */ nullptr); + /*file_operations=*/nullptr, cache_path_, + /*cleanup_tracker=*/nullptr, simple_file_tracker_.get(), max_size_, + type, /*net_log=*/nullptr); int rv = simple_backend->Init(cb.callback()); CHECK_EQ(cb.GetResult(rv), net::OK); simple_cache_impl_ = simple_backend.get();
diff --git a/net/disk_cache/disk_cache_test_base.cc b/net/disk_cache/disk_cache_test_base.cc index 90e7a8b..8eda21f 100644 --- a/net/disk_cache/disk_cache_test_base.cc +++ b/net/disk_cache/disk_cache_test_base.cc
@@ -401,8 +401,9 @@ std::make_unique<disk_cache::SimpleFileTracker>(64); std::unique_ptr<disk_cache::SimpleBackendImpl> simple_backend = std::make_unique<disk_cache::SimpleBackendImpl>( - cache_path_, /* cleanup_tracker = */ nullptr, - simple_file_tracker_.get(), size_, type_, /*net_log = */ nullptr); + /*file_operations=*/nullptr, cache_path_, + /* cleanup_tracker = */ nullptr, simple_file_tracker_.get(), size_, + type_, /*net_log = */ nullptr); int rv = simple_backend->Init(cb.callback()); ASSERT_THAT(cb.GetResult(rv), IsOk()); simple_cache_impl_ = simple_backend.get();
diff --git a/net/disk_cache/simple/simple_backend_impl.cc b/net/disk_cache/simple/simple_backend_impl.cc index 441ad7cd..4b9d888 100644 --- a/net/disk_cache/simple/simple_backend_impl.cc +++ b/net/disk_cache/simple/simple_backend_impl.cc
@@ -49,8 +49,6 @@ using base::FilePath; using base::Time; -using base::DirectoryExists; -using base::CreateDirectory; namespace disk_cache { @@ -75,12 +73,14 @@ // backend type and version. If the directory contains no cache, occupies it // with the fresh structure. SimpleCacheConsistencyResult FileStructureConsistent( + BackendFileOperations* file_operations, const base::FilePath& path) { - if (!base::PathExists(path) && !base::CreateDirectory(path)) { + if (!file_operations->PathExists(path) && + !file_operations->CreateDirectory(path)) { LOG(ERROR) << "Failed to create directory: " << path.LossyDisplayName(); return SimpleCacheConsistencyResult::kCreateDirectoryFailed; } - return disk_cache::UpgradeSimpleCacheOnDisk(path); + return disk_cache::UpgradeSimpleCacheOnDisk(file_operations, path); } // A context used by a BarrierCompletionCallback to track state. @@ -181,6 +181,17 @@ : SimpleEntryImpl::NON_OPTIMISTIC_OPERATIONS; } +class TrivialFileOperationsFactory : public BackendFileOperationsFactory { + public: + std::unique_ptr<BackendFileOperations> Create( + scoped_refptr<base::SequencedTaskRunner> task_runner) override { + return std::make_unique<TrivialFileOperations>(); + } + + private: + ~TrivialFileOperationsFactory() override = default; +}; + } // namespace class SimpleBackendImpl::ActiveEntryProxy @@ -210,6 +221,7 @@ }; SimpleBackendImpl::SimpleBackendImpl( + scoped_refptr<BackendFileOperationsFactory> file_operations_factory, const FilePath& path, scoped_refptr<BackendCleanupTracker> cleanup_tracker, SimpleFileTracker* file_tracker, @@ -217,6 +229,10 @@ net::CacheType cache_type, net::NetLog* net_log) : Backend(cache_type), + file_operations_factory_( + file_operations_factory + ? std::move(file_operations_factory) + : base::MakeRefCounted<TrivialFileOperationsFactory>()), cleanup_tracker_(std::move(cleanup_tracker)), file_tracker_(file_tracker ? file_tracker : g_simple_file_tracker.Pointer()), @@ -249,7 +265,8 @@ net::Error SimpleBackendImpl::Init(CompletionOnceCallback completion_callback) { auto index_task_runner = base::ThreadPool::CreateSequencedTaskRunner( - {base::MayBlock(), base::TaskPriority::USER_BLOCKING, + {base::MayBlock(), base::WithBaseSyncPrimitives(), + base::TaskPriority::USER_BLOCKING, base::TaskShutdownBehavior::BLOCK_SHUTDOWN}); prioritized_task_runner_ = @@ -263,10 +280,12 @@ index_->ExecuteWhenReady( base::BindOnce(&RecordIndexLoad, GetCacheType(), base::TimeTicks::Now())); + auto file_operations = file_operations_factory_->Create(index_task_runner); index_task_runner->PostTaskAndReplyWithResult( FROM_HERE, - base::BindOnce(&SimpleBackendImpl::InitCacheStructureOnDisk, path_, - orig_max_size_, GetCacheType()), + base::BindOnce(&SimpleBackendImpl::InitCacheStructureOnDisk, + std::move(file_operations), path_, orig_max_size_, + GetCacheType()), base::BindOnce(&SimpleBackendImpl::InitializeIndex, AsWeakPtr(), std::move(completion_callback))); return net::ERR_IO_PENDING; @@ -695,13 +714,15 @@ // static SimpleBackendImpl::DiskStatResult SimpleBackendImpl::InitCacheStructureOnDisk( + std::unique_ptr<BackendFileOperations> file_operations, const base::FilePath& path, uint64_t suggested_max_size, net::CacheType cache_type) { DiskStatResult result; result.max_size = suggested_max_size; result.net_error = net::OK; - SimpleCacheConsistencyResult consistency = FileStructureConsistent(path); + SimpleCacheConsistencyResult consistency = + FileStructureConsistent(file_operations.get(), path); SIMPLE_CACHE_UMA(ENUMERATION, "ConsistencyResult", cache_type, consistency); // If the cache structure is inconsistent make a single attempt at @@ -716,7 +737,7 @@ cache_type, deleted_files); if (base::IsDirectoryEmpty(path)) { SimpleCacheConsistencyResult orig_consistency = consistency; - consistency = FileStructureConsistent(path); + consistency = FileStructureConsistent(file_operations.get(), path); SIMPLE_CACHE_UMA(ENUMERATION, "RetryConsistencyResult", cache_type, consistency); if (consistency == SimpleCacheConsistencyResult::kOK) { @@ -737,9 +758,9 @@ << " path: " << path.LossyDisplayName(); result.net_error = net::ERR_FAILED; } else { - bool mtime_result = - disk_cache::simple_util::GetMTime(path, &result.cache_dir_mtime); - if (!mtime_result) { + absl::optional<base::File::Info> file_info = + file_operations->GetFileInfo(path); + if (!file_info.has_value()) { // Something deleted the directory between when we set it up and the // mstat; this is not uncommon on some test fixtures which erase their // tempdir while some worker threads may still be running. @@ -747,10 +768,13 @@ "after creation; path: " << path.LossyDisplayName(); result.net_error = net::ERR_FAILED; - } else if (!result.max_size) { - int64_t available = base::SysInfo::AmountOfFreeDiskSpace(path); - result.max_size = disk_cache::PreferredCacheSize(available, cache_type); - DCHECK(result.max_size); + } else { + result.cache_dir_mtime = file_info->last_modified; + if (!result.max_size) { + int64_t available = base::SysInfo::AmountOfFreeDiskSpace(path); + result.max_size = disk_cache::PreferredCacheSize(available, cache_type); + DCHECK(result.max_size); + } } } return result;
diff --git a/net/disk_cache/simple/simple_backend_impl.h b/net/disk_cache/simple/simple_backend_impl.h index a7d9986..72a3aa5 100644 --- a/net/disk_cache/simple/simple_backend_impl.h +++ b/net/disk_cache/simple/simple_backend_impl.h
@@ -51,6 +51,7 @@ // SimpleBackendImpl instance is created. class BackendCleanupTracker; +class BackendFileOperationsFactory; class SimpleEntryImpl; class SimpleFileTracker; class SimpleIndex; @@ -62,12 +63,14 @@ // Note: only pass non-nullptr for |file_tracker| if you don't want the global // one (which things other than tests would want). |file_tracker| must outlive // the backend and all the entries, including their asynchronous close. - SimpleBackendImpl(const base::FilePath& path, - scoped_refptr<BackendCleanupTracker> cleanup_tracker, - SimpleFileTracker* file_tracker, - int64_t max_bytes, - net::CacheType cache_type, - net::NetLog* net_log); + SimpleBackendImpl( + scoped_refptr<BackendFileOperationsFactory> file_operations_factory, + const base::FilePath& path, + scoped_refptr<BackendCleanupTracker> cleanup_tracker, + SimpleFileTracker* file_tracker, + int64_t max_bytes, + net::CacheType cache_type, + net::NetLog* net_log); ~SimpleBackendImpl() override; @@ -185,9 +188,11 @@ // Try to create the directory if it doesn't exist. This must run on the // sequence on which SimpleIndexFile is running disk I/O. - static DiskStatResult InitCacheStructureOnDisk(const base::FilePath& path, - uint64_t suggested_max_size, - net::CacheType cache_type); + static DiskStatResult InitCacheStructureOnDisk( + std::unique_ptr<BackendFileOperations> file_operations, + const base::FilePath& path, + uint64_t suggested_max_size, + net::CacheType cache_type); // Looks at current state of |entries_pending_doom_| and |active_entries_| // relevant to |entry_hash|, and, as appropriate, either returns a valid entry @@ -252,6 +257,8 @@ // Calculates and returns a new entry's worker pool priority. uint32_t GetNewEntryPriority(net::RequestPriority request_priority); + scoped_refptr<BackendFileOperationsFactory> file_operations_factory_; + // We want this destroyed after every other field. scoped_refptr<BackendCleanupTracker> cleanup_tracker_;
diff --git a/net/disk_cache/simple/simple_index_file_unittest.cc b/net/disk_cache/simple/simple_index_file_unittest.cc index b2130d69..bc237f42 100644 --- a/net/disk_cache/simple/simple_index_file_unittest.cc +++ b/net/disk_cache/simple/simple_index_file_unittest.cc
@@ -568,8 +568,9 @@ base::WriteFile(old_index_file, index_file_contents.data(), index_file_contents.size())); + TrivialFileOperations file_operations; // Upgrade the cache. - ASSERT_EQ(disk_cache::UpgradeSimpleCacheOnDisk(cache_path), + ASSERT_EQ(disk_cache::UpgradeSimpleCacheOnDisk(&file_operations, cache_path), SimpleCacheConsistencyResult::kOK); // Create the backend and initiate index flush by destroying the backend. @@ -581,17 +582,17 @@ net::TestClosure post_cleanup; cleanup_tracker->AddPostCleanupCallback(post_cleanup.closure()); - disk_cache::SimpleBackendImpl* simple_cache = - new disk_cache::SimpleBackendImpl( - cache_path, cleanup_tracker, /* file_tracker = */ nullptr, 0, - net::DISK_CACHE, /* net_log = */ nullptr); + auto simple_cache = std::make_unique<disk_cache::SimpleBackendImpl>( + /*file_operations_factory=*/nullptr, cache_path, cleanup_tracker, + /*file_tracker=*/nullptr, 0, net::DISK_CACHE, + /*net_log=*/nullptr); net::TestCompletionCallback cb; int rv = simple_cache->Init(cb.callback()); EXPECT_THAT(cb.GetResult(rv), IsOk()); simple_cache->index()->ExecuteWhenReady(cb.callback()); rv = cb.WaitForResult(); EXPECT_THAT(rv, IsOk()); - delete simple_cache; + simple_cache.reset(); cleanup_tracker = nullptr; // The backend flushes the index on destruction; it will run the post-cleanup
diff --git a/net/disk_cache/simple/simple_version_upgrade.cc b/net/disk_cache/simple/simple_version_upgrade.cc index 72f3370..fb78d1f 100644 --- a/net/disk_cache/simple/simple_version_upgrade.cc +++ b/net/disk_cache/simple/simple_version_upgrade.cc
@@ -13,6 +13,7 @@ #include "base/files/memory_mapped_file.h" #include "base/logging.h" #include "base/pickle.h" +#include "net/disk_cache/disk_cache.h" #include "net/disk_cache/simple/simple_backend_version.h" #include "net/disk_cache/simple/simple_entry_format_history.h" #include "third_party/zlib/zlib.h" @@ -31,8 +32,10 @@ LOG(ERROR) << "Failed to upgrade Simple Cache from version: " << version; } -bool WriteFakeIndexFile(const base::FilePath& file_name) { - base::File file(file_name, base::File::FLAG_CREATE | base::File::FLAG_WRITE); +bool WriteFakeIndexFile(disk_cache::BackendFileOperations* file_operations, + const base::FilePath& file_name) { + base::File file = file_operations->OpenFile( + file_name, base::File::FLAG_CREATE | base::File::FLAG_WRITE); if (!file.IsValid()) return false; @@ -104,10 +107,11 @@ // <cache-dir-mtime> is the last modification time with nanosecond precision // of the directory, where all files for entries are stored. // <hash-of-the-key> represent the first 64 bits of a SHA-1 of the key. -bool UpgradeIndexV5V6(const base::FilePath& cache_directory) { +bool UpgradeIndexV5V6(BackendFileOperations* file_operations, + const base::FilePath& cache_directory) { const base::FilePath old_index_file = cache_directory.AppendASCII(kIndexFileName); - return base::DeleteFile(old_index_file); + return file_operations->DeleteFile(old_index_file); } // Some points about the Upgrade process are still not clear: @@ -126,6 +130,7 @@ // intermediate fake index flushing must be added as soon as we add more // upgrade steps. SimpleCacheConsistencyResult UpgradeSimpleCacheOnDisk( + BackendFileOperations* file_operations, const base::FilePath& path) { // There is a convention among disk cache backends: looking at the magic in // the file "index" it should be sufficient to determine if the cache belongs @@ -137,13 +142,13 @@ // 2. The Simple Backend has pickled file format for the index making it hacky // to have the magic in the right place. const base::FilePath fake_index = path.AppendASCII(kFakeIndexFileName); - base::File fake_index_file(fake_index, - base::File::FLAG_OPEN | base::File::FLAG_READ); + base::File fake_index_file = file_operations->OpenFile( + fake_index, base::File::FLAG_OPEN | base::File::FLAG_READ); if (!fake_index_file.IsValid()) { if (fake_index_file.error_details() == base::File::FILE_ERROR_NOT_FOUND) { - if (!WriteFakeIndexFile(fake_index)) { - base::DeleteFile(fake_index); + if (!WriteFakeIndexFile(file_operations, fake_index)) { + file_operations->DeleteFile(fake_index); LOG(ERROR) << "Failed to write a new fake index."; return SimpleCacheConsistencyResult::kWriteFakeIndexFileFailed; } @@ -191,7 +196,7 @@ DCHECK_LE(5U, version_from); if (version_from == 5) { // Upgrade only the index for V5 -> V6 move. - if (!UpgradeIndexV5V6(path)) { + if (!UpgradeIndexV5V6(file_operations, path)) { LogMessageFailedUpgradeFromVersion(file_header.version); return SimpleCacheConsistencyResult::kUpgradeIndexV5V6Failed; } @@ -220,13 +225,13 @@ return SimpleCacheConsistencyResult::kOK; const base::FilePath temp_fake_index = path.AppendASCII("upgrade-index"); - if (!WriteFakeIndexFile(temp_fake_index)) { - base::DeleteFile(temp_fake_index); + if (!WriteFakeIndexFile(file_operations, temp_fake_index)) { + file_operations->DeleteFile(temp_fake_index); LOG(ERROR) << "Failed to write a new fake index."; LogMessageFailedUpgradeFromVersion(file_header.version); return SimpleCacheConsistencyResult::kWriteFakeIndexFileFailed; } - if (!base::ReplaceFile(temp_fake_index, fake_index, nullptr)) { + if (!file_operations->ReplaceFile(temp_fake_index, fake_index, nullptr)) { LOG(ERROR) << "Failed to replace the fake index."; LogMessageFailedUpgradeFromVersion(file_header.version); return SimpleCacheConsistencyResult::kReplaceFileFailed;
diff --git a/net/disk_cache/simple/simple_version_upgrade.h b/net/disk_cache/simple/simple_version_upgrade.h index b9c34eb..55e764e 100644 --- a/net/disk_cache/simple/simple_version_upgrade.h +++ b/net/disk_cache/simple/simple_version_upgrade.h
@@ -20,6 +20,8 @@ namespace disk_cache { +class BackendFileOperations; + // These values are persisted to logs. Entries should not be renumbered and // numeric values should never be reused. enum class SimpleCacheConsistencyResult { @@ -44,7 +46,8 @@ // necessary transitions succeeded. If this function fails, there is nothing // left to do other than dropping the whole cache directory. NET_EXPORT_PRIVATE SimpleCacheConsistencyResult -UpgradeSimpleCacheOnDisk(const base::FilePath& path); +UpgradeSimpleCacheOnDisk(BackendFileOperations* file_operations, + const base::FilePath& path); // Check if the cache structure at the given path is empty except for index // files. If so, then delete the index files. Returns true if any files @@ -68,7 +71,8 @@ }; // Exposed for testing. -NET_EXPORT_PRIVATE bool UpgradeIndexV5V6(const base::FilePath& cache_directory); +NET_EXPORT_PRIVATE bool UpgradeIndexV5V6(BackendFileOperations* file_operations, + const base::FilePath& cache_directory); } // namespace disk_cache
diff --git a/net/disk_cache/simple/simple_version_upgrade_unittest.cc b/net/disk_cache/simple/simple_version_upgrade_unittest.cc index e382b0e..6a10cf8 100644 --- a/net/disk_cache/simple/simple_version_upgrade_unittest.cc +++ b/net/disk_cache/simple/simple_version_upgrade_unittest.cc
@@ -13,6 +13,7 @@ #include "base/format_macros.h" #include "base/strings/stringprintf.h" #include "net/base/net_errors.h" +#include "net/disk_cache/disk_cache.h" #include "net/disk_cache/simple/simple_backend_version.h" #include "net/disk_cache/simple/simple_entry_format_history.h" #include "testing/gtest/include/gtest/gtest.h" @@ -58,8 +59,10 @@ ASSERT_EQ(static_cast<int>(sizeof(data)), base::WriteFile(file_name, reinterpret_cast<const char*>(&data), sizeof(data))); + disk_cache::TrivialFileOperations file_operations; EXPECT_EQ(disk_cache::SimpleCacheConsistencyResult::kVersionFromTheFuture, - disk_cache::UpgradeSimpleCacheOnDisk(cache_dir.GetPath())); + disk_cache::UpgradeSimpleCacheOnDisk(&file_operations, + cache_dir.GetPath())); } TEST(SimpleVersionUpgradeTest, ExperimentBacktoDefault) { @@ -77,10 +80,12 @@ base::WriteFile(file_name, reinterpret_cast<const char*>(&data), sizeof(data))); + disk_cache::TrivialFileOperations file_operations; // The cache needs to transition from a deprecated experiment back to not // having one. EXPECT_EQ(disk_cache::SimpleCacheConsistencyResult::kBadZeroCheck, - disk_cache::UpgradeSimpleCacheOnDisk(cache_dir.GetPath())); + disk_cache::UpgradeSimpleCacheOnDisk(&file_operations, + cache_dir.GetPath())); } TEST(SimpleVersionUpgradeTest, FakeIndexVersionGetsUpdated) { @@ -95,9 +100,10 @@ static_cast<int>(file_contents.size()), base::WriteFile(index_file, file_contents.data(), file_contents.size())); + disk_cache::TrivialFileOperations file_operations; // Upgrade. ASSERT_EQ(disk_cache::SimpleCacheConsistencyResult::kOK, - disk_cache::UpgradeSimpleCacheOnDisk(cache_path)); + disk_cache::UpgradeSimpleCacheOnDisk(&file_operations, cache_path)); // Check that the version in the fake index file is updated. std::string new_fake_index_contents; @@ -138,8 +144,9 @@ } } + disk_cache::TrivialFileOperations file_operations; // Upgrade. - ASSERT_TRUE(disk_cache::UpgradeIndexV5V6(cache_path)); + ASSERT_TRUE(disk_cache::UpgradeIndexV5V6(&file_operations, cache_path)); // Check that the old index disappeared but the files remain unchanged. EXPECT_FALSE(base::PathExists(index_file));
diff --git a/net/dns/BUILD.gn b/net/dns/BUILD.gn index a69d9a51..6bc60f6 100644 --- a/net/dns/BUILD.gn +++ b/net/dns/BUILD.gn
@@ -452,13 +452,11 @@ visibility = [ "//net:test_support" ] testonly = true sources = [ - "address_info_test_util.cc", "dns_test_util.cc", "host_resolver_results_test_util.cc", "mock_host_resolver.cc", ] public = [ - "address_info_test_util.h", "dns_test_util.h", "host_resolver_results_test_util.h", "mock_host_resolver.h",
diff --git a/net/dns/address_info.cc b/net/dns/address_info.cc index ef407c6..5c888a4 100644 --- a/net/dns/address_info.cc +++ b/net/dns/address_info.cc
@@ -4,6 +4,8 @@ #include "net/dns/address_info.h" +#include <memory> + #include "base/logging.h" #include "base/notreached.h" #include "base/sys_byteorder.h" @@ -59,7 +61,8 @@ getter = std::make_unique<AddrInfoGetter>(); int err = OK; int os_error = 0; - addrinfo* ai = getter->getaddrinfo(host, &hints, &os_error, network); + std::unique_ptr<addrinfo, FreeAddrInfoFunc> ai = + getter->getaddrinfo(host, &hints, &os_error, network); if (!ai) { err = ERR_NAME_NOT_RESOLVED; @@ -82,31 +85,21 @@ return AddressInfoAndResult(absl::optional<AddressInfo>(), err, os_error); } - return AddressInfoAndResult( - absl::optional<AddressInfo>(AddressInfo(ai, std::move(getter))), OK, 0); + return AddressInfoAndResult(absl::optional<AddressInfo>(AddressInfo( + std::move(ai), std::move(getter))), + OK, 0); } -AddressInfo::AddressInfo(AddressInfo&& other) - : ai_(other.ai_), getter_(std::move(other.getter_)) { - other.ai_ = nullptr; -} +AddressInfo::AddressInfo(AddressInfo&& other) = default; -AddressInfo& AddressInfo::operator=(AddressInfo&& other) { - ai_ = other.ai_; - other.ai_ = nullptr; - getter_ = std::move(other.getter_); - return *this; -} +AddressInfo& AddressInfo::operator=(AddressInfo&& other) = default; -AddressInfo::~AddressInfo() { - if (ai_) - getter_->freeaddrinfo(ai_); -} +AddressInfo::~AddressInfo() = default; //// public methods AddressInfo::const_iterator AddressInfo::begin() const { - return const_iterator(ai_); + return const_iterator(ai_.get()); } AddressInfo::const_iterator AddressInfo::end() const { @@ -122,7 +115,7 @@ bool AddressInfo::IsAllLocalhostOfOneFamily() const { bool saw_v4_localhost = false; bool saw_v6_localhost = false; - const auto* ai = ai_; + const auto* ai = ai_.get(); for (; ai != nullptr; ai = Next(ai)) { switch (ai->ai_family) { case AF_INET: { @@ -173,20 +166,27 @@ //// private methods -AddressInfo::AddressInfo(addrinfo* ai, std::unique_ptr<AddrInfoGetter> getter) - : ai_(ai), getter_(std::move(getter)) {} +AddressInfo::AddressInfo(std::unique_ptr<addrinfo, FreeAddrInfoFunc> ai, + std::unique_ptr<AddrInfoGetter> getter) + : ai_(std::move(ai)), getter_(std::move(getter)) {} //// AddrInfoGetter AddrInfoGetter::AddrInfoGetter() = default; AddrInfoGetter::~AddrInfoGetter() = default; -addrinfo* AddrInfoGetter::getaddrinfo( +std::unique_ptr<addrinfo, FreeAddrInfoFunc> AddrInfoGetter::getaddrinfo( const std::string& host, const addrinfo* hints, int* out_os_error, NetworkChangeNotifier::NetworkHandle network) { addrinfo* ai; + // We wrap freeaddrinfo() in a lambda just in case some operating systems use + // a different signature for it. + FreeAddrInfoFunc deleter = [](addrinfo* ai) { ::freeaddrinfo(ai); }; + + std::unique_ptr<addrinfo, FreeAddrInfoFunc> rv = {nullptr, deleter}; + if (network != NetworkChangeNotifier::kInvalidNetworkHandle) { // Currently, only Android supports lookups for a specific network. #if BUILDFLAG(IS_ANDROID) @@ -194,11 +194,11 @@ nullptr, hints, &ai); #elif BUILDFLAG(IS_WIN) *out_os_error = WSAEOPNOTSUPP; - return nullptr; + return rv; #else errno = ENOSYS; *out_os_error = EAI_SYSTEM; - return nullptr; + return rv; #endif // BUILDFLAG(IS_ANDROID) } else { *out_os_error = ::getaddrinfo(host.c_str(), nullptr, hints, &ai); @@ -208,14 +208,11 @@ #if BUILDFLAG(IS_WIN) *out_os_error = WSAGetLastError(); #endif - return nullptr; + return rv; } - return ai; -} - -void AddrInfoGetter::freeaddrinfo(addrinfo* ai) { - ::freeaddrinfo(ai); + rv.reset(ai); + return rv; } } // namespace net
diff --git a/net/dns/address_info.h b/net/dns/address_info.h index 5fa5730..23d68f5 100644 --- a/net/dns/address_info.h +++ b/net/dns/address_info.h
@@ -21,6 +21,8 @@ class AddressList; class AddrInfoGetter; +using FreeAddrInfoFunc = void (*)(addrinfo*); + // AddressInfo -- this encapsulates the system call to getaddrinfo and the // data structure that it populates and returns. class NET_EXPORT_PRIVATE AddressInfo { @@ -42,6 +44,7 @@ const addrinfo& operator*() const; private: + // Owned by AddressInfo. const addrinfo* ai_; }; @@ -80,10 +83,12 @@ private: // Constructors - AddressInfo(addrinfo* ai, std::unique_ptr<AddrInfoGetter> getter); + AddressInfo(std::unique_ptr<addrinfo, FreeAddrInfoFunc> ai, + std::unique_ptr<AddrInfoGetter> getter); // Data. - addrinfo* ai_; // Never null (except after move) + std::unique_ptr<addrinfo, FreeAddrInfoFunc> + ai_; // Never null (except after move) std::unique_ptr<AddrInfoGetter> getter_; }; @@ -97,11 +102,11 @@ // Virtual for tests. virtual ~AddrInfoGetter(); - virtual addrinfo* getaddrinfo(const std::string& host, - const addrinfo* hints, - int* out_os_error, - NetworkChangeNotifier::NetworkHandle network); - virtual void freeaddrinfo(addrinfo* ai); + virtual std::unique_ptr<addrinfo, FreeAddrInfoFunc> getaddrinfo( + const std::string& host, + const addrinfo* hints, + int* out_os_error, + NetworkChangeNotifier::NetworkHandle network); }; } // namespace net
diff --git a/net/dns/address_info_test_util.cc b/net/dns/address_info_test_util.cc deleted file mode 100644 index 708dd8e..0000000 --- a/net/dns/address_info_test_util.cc +++ /dev/null
@@ -1,69 +0,0 @@ -// Copyright (c) 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "net/dns/address_info_test_util.h" - -#include <cstring> - -#include "base/check.h" -#include "base/sys_byteorder.h" -#include "net/base/sys_addrinfo.h" - -namespace net { -namespace test { - -template <unsigned int N> -std::unique_ptr<char[]> make_addrinfo_list(std::vector<IpAndPort> ipp, - const std::string& canonical_name) { - struct Buffer { - addrinfo ai[N]; - sockaddr_in addr[N]; - char canonical_name[256]; - }; - - CHECK(ipp.size() == N); - CHECK(canonical_name.length() <= 255); - - std::unique_ptr<char[]> data(new char[sizeof(Buffer)]); - memset(data.get(), 0x0, sizeof(Buffer)); - Buffer* buffer = reinterpret_cast<Buffer*>(data.get()); - - memcpy(&buffer->canonical_name[0], canonical_name.data(), - canonical_name.length() + 1); - - for (unsigned int i = 0; i < N; ++i) { - std::uint8_t ip[4] = {ipp[i].ip.a, ipp[i].ip.b, ipp[i].ip.c, ipp[i].ip.d}; - sockaddr_in* addr = &buffer->addr[i]; - memcpy(&addr->sin_addr, ip, 4); - addr->sin_family = AF_INET; - addr->sin_port = base::HostToNet16(static_cast<std::uint16_t>(ipp[i].port)); - - addrinfo* ai = &buffer->ai[i]; - ai->ai_family = AF_INET; - ai->ai_socktype = SOCK_STREAM; - ai->ai_addrlen = sizeof(sockaddr_in); - ai->ai_addr = reinterpret_cast<sockaddr*>(addr); - ai->ai_canonname = reinterpret_cast<decltype(buffer->ai[0].ai_canonname)>( - buffer->canonical_name); - if (i < (N - 1)) - ai->ai_next = &buffer->ai[i + 1]; - } - - return data; -} - -template std::unique_ptr<char[]> make_addrinfo_list<1>( - std::vector<IpAndPort> ipp, - const std::string& canonical_name); -template std::unique_ptr<char[]> make_addrinfo_list<3>( - std::vector<IpAndPort> ipp, - const std::string& canonical_name); - -std::unique_ptr<char[]> make_addrinfo(IpAndPort ipp, - const std::string& canonical_name) { - return make_addrinfo_list<1>({ipp}, canonical_name); -} - -} // namespace test -} // namespace net
diff --git a/net/dns/address_info_test_util.h b/net/dns/address_info_test_util.h deleted file mode 100644 index 72e36ee..0000000 --- a/net/dns/address_info_test_util.h +++ /dev/null
@@ -1,38 +0,0 @@ -// Copyright (c) 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef NET_DNS_ADDRESS_INFO_TEST_UTIL_H_ -#define NET_DNS_ADDRESS_INFO_TEST_UTIL_H_ - -#include <memory> -#include <string> -#include <vector> - -namespace net { -namespace test { - -struct IpAndPort { - struct Ip { - uint8_t a; - uint8_t b; - uint8_t c; - uint8_t d; - }; - Ip ip; - int port; -}; - -// |N| is the length of the IpAndPort vector. -// (The templating greatly simplifies the internals of this function). -template <unsigned int N> -std::unique_ptr<char[]> make_addrinfo_list(std::vector<IpAndPort> ipp, - const std::string& canonical_name); - -std::unique_ptr<char[]> make_addrinfo(IpAndPort ipp, - const std::string& canonical_name); - -} // namespace test -} // namespace net - -#endif // NET_DNS_ADDRESS_INFO_TEST_UTIL_H_
diff --git a/net/dns/address_info_unittest.cc b/net/dns/address_info_unittest.cc index fe355f5..1763956a 100644 --- a/net/dns/address_info_unittest.cc +++ b/net/dns/address_info_unittest.cc
@@ -4,14 +4,21 @@ #include "net/dns/address_info.h" +#include <stdint.h> +#include <stdlib.h> +#include <string.h> + +#include <array> #include <memory> +#include "base/check_op.h" +#include "base/numerics/safe_conversions.h" +#include "base/strings/string_piece.h" #include "base/sys_byteorder.h" #include "build/build_config.h" #include "net/base/address_list.h" #include "net/base/net_errors.h" #include "net/base/sys_addrinfo.h" -#include "net/dns/address_info_test_util.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -21,14 +28,107 @@ class MockAddrInfoGetter : public AddrInfoGetter { public: - addrinfo* getaddrinfo(const std::string& host, - const addrinfo* hints, - int* out_os_error, - NetworkChangeNotifier::NetworkHandle network) override; - void freeaddrinfo(addrinfo* ai) override; + std::unique_ptr<addrinfo, FreeAddrInfoFunc> getaddrinfo( + const std::string& host, + const addrinfo* hints, + int* out_os_error, + NetworkChangeNotifier::NetworkHandle network) override; + + private: + struct IpAndPort { + struct Ip { + uint8_t a; + uint8_t b; + uint8_t c; + uint8_t d; + }; + Ip ip; + int port; + }; + + // Initialises `addr` and `ai` from `ip_and_port`, `canonical_name` and + // `ai_next`. + static void InitializeAddrinfo(const IpAndPort& ip_and_port, + char* canonical_name, + addrinfo* ai_next, + sockaddr_in* addr, + addrinfo* ai); + + // Allocates and initialises an addrinfo structure containing the ip addresses + // and ports from `ipp` and the name `canonical_name`. This function is + // designed to be used within getaddrinfo(), which returns a raw pointer even + // though it transfers ownership. So this function does the same. Since + // addrinfo is a C-style variable-sized structure it cannot be allocated with + // new. It is allocated with malloc() instead, so it must be freed with + // free(). + template <size_t N> + static std::unique_ptr<addrinfo, FreeAddrInfoFunc> MakeAddrInfoList( + const IpAndPort (&ipp)[N], + base::StringPiece canonical_name); + + static std::unique_ptr<addrinfo, FreeAddrInfoFunc> MakeAddrInfo( + IpAndPort ipp, + base::StringPiece canonical_name); }; -addrinfo* MockAddrInfoGetter::getaddrinfo( +template <size_t N> +std::unique_ptr<addrinfo, FreeAddrInfoFunc> +MockAddrInfoGetter::MakeAddrInfoList(const IpAndPort (&ipp)[N], + base::StringPiece canonical_name) { + struct Buffer { + addrinfo ai[N]; + sockaddr_in addr[N]; + char canonical_name[256]; + }; + + CHECK_LE(canonical_name.size(), 255u); + + Buffer* const buffer = new Buffer(); + memset(buffer, 0x0, sizeof(Buffer)); + + // At least one trailing nul byte on buffer->canonical_name was added by + // memset() above. + memcpy(buffer->canonical_name, canonical_name.data(), canonical_name.size()); + + for (size_t i = 0; i < N; ++i) { + InitializeAddrinfo(ipp[i], buffer->canonical_name, + i + 1 < N ? buffer->ai + i + 1 : nullptr, + buffer->addr + i, buffer->ai + i); + } + + return {reinterpret_cast<addrinfo*>(buffer), + [](addrinfo* ai) { delete reinterpret_cast<Buffer*>(ai); }}; +} + +std::unique_ptr<addrinfo, FreeAddrInfoFunc> MockAddrInfoGetter::MakeAddrInfo( + IpAndPort ipp, + base::StringPiece canonical_name) { + return MakeAddrInfoList({ipp}, canonical_name); +} + +void MockAddrInfoGetter::InitializeAddrinfo(const IpAndPort& ip_and_port, + char* canonical_name, + addrinfo* ai_next, + sockaddr_in* addr, + addrinfo* ai) { + const uint8_t ip[4] = {ip_and_port.ip.a, ip_and_port.ip.b, ip_and_port.ip.c, + ip_and_port.ip.d}; + memcpy(&addr->sin_addr, ip, 4); + addr->sin_family = AF_INET; + addr->sin_port = + base::HostToNet16(base::checked_cast<uint16_t>(ip_and_port.port)); + + ai->ai_family = AF_INET; + ai->ai_socktype = SOCK_STREAM; + ai->ai_addrlen = sizeof(sockaddr_in); + ai->ai_addr = reinterpret_cast<sockaddr*>(addr); + ai->ai_canonname = + reinterpret_cast<decltype(ai->ai_canonname)>(canonical_name); + if (ai_next) + ai->ai_next = ai_next; +} + +std::unique_ptr<addrinfo, FreeAddrInfoFunc> MockAddrInfoGetter::getaddrinfo( const std::string& host, const addrinfo* /* hints */, int* out_os_error, @@ -37,39 +137,27 @@ *out_os_error = 0; if (host == std::string("canonical.bar.com")) - return reinterpret_cast<addrinfo*>( - test::make_addrinfo({{1, 2, 3, 4}, 80}, "canonical.bar.com").release()); + return MakeAddrInfo({{1, 2, 3, 4}, 80}, "canonical.bar.com"); else if (host == "iteration.test") - return reinterpret_cast<addrinfo*>( - test::make_addrinfo_list<3>({{{10, 20, 30, 40}, 80}, - {{11, 21, 31, 41}, 81}, - {{12, 22, 32, 42}, 82}}, - "iteration.test") - .release()); + return MakeAddrInfoList({{{10, 20, 30, 40}, 80}, + {{11, 21, 31, 41}, 81}, + {{12, 22, 32, 42}, 82}}, + "iteration.test"); else if (host == "alllocalhost.com") - return reinterpret_cast<addrinfo*>( - test::make_addrinfo_list<3>( - {{{127, 0, 0, 1}, 80}, {{127, 0, 0, 2}, 80}, {{127, 0, 0, 3}, 80}}, - "alllocalhost.com") - .release()); + return MakeAddrInfoList( + {{{127, 0, 0, 1}, 80}, {{127, 0, 0, 2}, 80}, {{127, 0, 0, 3}, 80}}, + "alllocalhost.com"); else if (host == "not.alllocalhost.com") - return reinterpret_cast<addrinfo*>( - test::make_addrinfo_list<3>( - {{{128, 0, 0, 1}, 80}, {{127, 0, 0, 2}, 80}, {{127, 0, 0, 3}, 80}}, - "not.alllocalhost.com") - .release()); + return MakeAddrInfoList( + {{{128, 0, 0, 1}, 80}, {{127, 0, 0, 2}, 80}, {{127, 0, 0, 3}, 80}}, + "not.alllocalhost.com"); else if (host == "www.example.com") - return reinterpret_cast<addrinfo*>( - test::make_addrinfo({{8, 8, 8, 8}, 80}, "www.example.com").release()); + return MakeAddrInfo({{8, 8, 8, 8}, 80}, "www.example.com"); // Failure *out_os_error = 1; - return nullptr; -} - -void MockAddrInfoGetter::freeaddrinfo(addrinfo* ai) { - std::unique_ptr<char[]> mock_addrinfo(reinterpret_cast<char*>(ai)); + return {nullptr, [](addrinfo*) {}}; } std::unique_ptr<addrinfo> MakeHints(AddressFamily address_family,
diff --git a/net/dns/context_host_resolver.cc b/net/dns/context_host_resolver.cc index 5fc8257..c29c19e 100644 --- a/net/dns/context_host_resolver.cc +++ b/net/dns/context_host_resolver.cc
@@ -130,6 +130,7 @@ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); resolve_context_->set_url_request_context(request_context); + manager_->RemoveResolveContextRegistrationIfNeeded(resolve_context_.get()); } HostResolverManager* ContextHostResolver::GetManagerForTesting() {
diff --git a/net/dns/host_resolver_manager.cc b/net/dns/host_resolver_manager.cc index f92d579..f1c0b64 100644 --- a/net/dns/host_resolver_manager.cc +++ b/net/dns/host_resolver_manager.cc
@@ -3189,6 +3189,20 @@ RemoveAllJobs(context); } +void HostResolverManager::RemoveResolveContextRegistrationIfNeeded( + const ResolveContext* context) { + // Whether ResolveContext should register for notifications or not depends on + // ResolveContext::MustRegisterForNotifications. Ideally that would be an + // invariant for the entire lifetime of `context`, unfortunately it is not + // due to the current ResolveContexts creation procedure (their + // URLRequestContext is initially set to nullptr and only later it is + // updated). + if (!context->MustRegisterForInvalidations() && + registered_contexts_.HasObserver(context)) { + registered_contexts_.RemoveObserver(context); + } +} + void HostResolverManager::SetTickClockForTesting( const base::TickClock* tick_clock) { tick_clock_ = tick_clock;
diff --git a/net/dns/host_resolver_manager.h b/net/dns/host_resolver_manager.h index 8a200c11..801ed3e8 100644 --- a/net/dns/host_resolver_manager.h +++ b/net/dns/host_resolver_manager.h
@@ -179,6 +179,12 @@ void RegisterResolveContext(ResolveContext* context); void DeregisterResolveContext(const ResolveContext* context); + // ContextHostResolvers should call this after associating a ResolveContext + // with a URLRequestContext. + // TODO(stefanoduo): Remove once MustRegisterForInvalidations becomes an + // invariant. + void RemoveResolveContextRegistrationIfNeeded(const ResolveContext* context); + void set_proc_params_for_test(const ProcTaskParams& proc_params) { proc_params_ = proc_params; }
diff --git a/net/http/http_cache.cc b/net/http/http_cache.cc index 6918f29..f977658 100644 --- a/net/http/http_cache.cc +++ b/net/http/http_cache.cc
@@ -101,13 +101,14 @@ #if BUILDFLAG(IS_ANDROID) if (app_status_listener_) { return disk_cache::CreateCacheBackend( - type_, backend_type_, path_, max_bytes_, reset_handling, net_log, - backend, std::move(callback), app_status_listener_); + type_, backend_type_, /*file_operations=*/nullptr, path_, max_bytes_, + reset_handling, net_log, backend, std::move(callback), + app_status_listener_); } #endif - return disk_cache::CreateCacheBackend(type_, backend_type_, path_, max_bytes_, - reset_handling, net_log, backend, - std::move(callback)); + return disk_cache::CreateCacheBackend( + type_, backend_type_, /*file_operations=*/nullptr, path_, max_bytes_, + reset_handling, net_log, backend, std::move(callback)); } #if BUILDFLAG(IS_ANDROID)
diff --git a/net/tools/cachetool/cachetool.cc b/net/tools/cachetool/cachetool.cc index a237981..d6f0f455 100644 --- a/net/tools/cachetool/cachetool.cc +++ b/net/tools/cachetool/cachetool.cc
@@ -753,8 +753,8 @@ std::unique_ptr<Backend> cache_backend; net::TestCompletionCallback cb; int rv = disk_cache::CreateCacheBackend( - net::DISK_CACHE, backend_type, cache_path, INT_MAX, - disk_cache::ResetHandling::kNeverReset, nullptr, &cache_backend, + net::DISK_CACHE, backend_type, /*file_operations=*/nullptr, cache_path, + INT_MAX, disk_cache::ResetHandling::kNeverReset, nullptr, &cache_backend, cb.callback()); if (cb.GetResult(rv) != net::OK) { std::cerr << "Invalid cache." << std::endl;
diff --git a/net/tools/disk_cache_memory_test/disk_cache_memory_test.cc b/net/tools/disk_cache_memory_test/disk_cache_memory_test.cc index 94787e21..b3470332 100644 --- a/net/tools/disk_cache_memory_test/disk_cache_memory_test.cc +++ b/net/tools/disk_cache_memory_test/disk_cache_memory_test.cc
@@ -95,10 +95,10 @@ base::RunLoop run_loop; net::CompletionOnceCallback callback = base::BindOnce(&SetSuccessCodeOnCompletion, &run_loop, &succeeded); - const int net_error = - CreateCacheBackend(spec.cache_type, spec.backend_type, spec.path, 0, - disk_cache::ResetHandling::kNeverReset, nullptr, - &backend, std::move(callback)); + const int net_error = CreateCacheBackend( + spec.cache_type, spec.backend_type, /*file_operations=*/nullptr, + spec.path, 0, disk_cache::ResetHandling::kNeverReset, nullptr, &backend, + std::move(callback)); if (net_error == net::OK) SetSuccessCodeOnCompletion(&run_loop, &succeeded, net::OK); else
diff --git a/pdf/BUILD.gn b/pdf/BUILD.gn index 4d0d5535..b41c60fb 100644 --- a/pdf/BUILD.gn +++ b/pdf/BUILD.gn
@@ -262,7 +262,6 @@ static_library("pdf_view_web_plugin") { visibility = [ ":*", - "//chrome/renderer", "//components/pdf/renderer", ] @@ -455,6 +454,4 @@ } group("pdf") { } - group("pdf_view_web_plugin") { - } }
diff --git a/remoting/host/mojom/remoting_host.mojom b/remoting/host/mojom/remoting_host.mojom index 452379b6..30d130d0 100644 --- a/remoting/host/mojom/remoting_host.mojom +++ b/remoting/host/mojom/remoting_host.mojom
@@ -24,7 +24,7 @@ // This method may be called multiple times as changes are detected in the // host configuration file. [EnableIf=is_win] - ApplyHostConfig(mojo_base.mojom.DictionaryValue config); + ApplyHostConfig(mojo_base.mojom.DeprecatedDictionaryValue config); // Provides the network process with a set of platform handles which are used // for pairing functionality. The network process does not have access to the
diff --git a/remoting/protocol/ice_transport_channel.cc b/remoting/protocol/ice_transport_channel.cc index 1159b24..48e34f3 100644 --- a/remoting/protocol/ice_transport_channel.cc +++ b/remoting/protocol/ice_transport_channel.cc
@@ -21,7 +21,6 @@ #include "third_party/webrtc/p2p/base/p2p_transport_channel.h" #include "third_party/webrtc/p2p/base/packet_transport_internal.h" #include "third_party/webrtc/p2p/base/port.h" -#include "third_party/webrtc/rtc_base/network.h" namespace remoting { namespace protocol {
diff --git a/remoting/protocol/transport_context.h b/remoting/protocol/transport_context.h index e1597be..cf31af8d 100644 --- a/remoting/protocol/transport_context.h +++ b/remoting/protocol/transport_context.h
@@ -20,10 +20,6 @@ class SharedURLLoaderFactory; } // namespace network -namespace rtc { -class NetworkManager; -} // namespace rtc - namespace remoting { class OAuthTokenGetter; @@ -64,15 +60,6 @@ ice_config_ = ice_config; } - // Sets a reference to the NetworkManager that holds the list of - // network interfaces. If the NetworkManager is deleted while this - // TransportContext is live, the caller should set this to nullptr. - // TODO(crbug.com/848045): This should be a singleton - either a global - // instance, or one that is owned by this TransportContext. - void set_network_manager(rtc::NetworkManager* network_manager) { - network_manager_ = network_manager; - } - // Prepares fresh ICE configs. It may be called while connection is being // negotiated to minimize the chance that the following GetIceConfig() will // be blocking. @@ -86,7 +73,6 @@ } const NetworkSettings& network_settings() const { return network_settings_; } TransportRole role() const { return role_; } - rtc::NetworkManager* network_manager() const { return network_manager_; } // Returns the suggested bandwidth cap for TURN relay connections, or 0 if // no rate-limit is set in the IceConfig. @@ -106,8 +92,6 @@ NetworkSettings network_settings_; TransportRole role_; - raw_ptr<rtc::NetworkManager> network_manager_ = nullptr; - IceConfig ice_config_; base::Time last_request_completion_time_;
diff --git a/services/network/BUILD.gn b/services/network/BUILD.gn index ab096d2a..a929bbd 100644 --- a/services/network/BUILD.gn +++ b/services/network/BUILD.gn
@@ -36,6 +36,10 @@ "crl_set_distributor.h", "data_pipe_element_reader.cc", "data_pipe_element_reader.h", + "disk_cache/mojo_backend_file_operations.cc", + "disk_cache/mojo_backend_file_operations.h", + "disk_cache/mojo_backend_file_operations_factory.cc", + "disk_cache/mojo_backend_file_operations_factory.h", "dns_config_change_manager.cc", "dns_config_change_manager.h", "host_resolver.cc",
diff --git a/services/network/disk_cache/mojo_backend_file_operations.cc b/services/network/disk_cache/mojo_backend_file_operations.cc new file mode 100644 index 0000000..50469f0 --- /dev/null +++ b/services/network/disk_cache/mojo_backend_file_operations.cc
@@ -0,0 +1,64 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "services/network/disk_cache/mojo_backend_file_operations.h" + +#include "base/task/sequenced_task_runner.h" + +namespace network { + +MojoBackendFileOperations::MojoBackendFileOperations( + mojo::PendingRemote<mojom::HttpCacheBackendFileOperations> pending_remote, + scoped_refptr<base::SequencedTaskRunner> task_runner) + : remote_(std::move(pending_remote), std::move(task_runner)) {} +MojoBackendFileOperations::~MojoBackendFileOperations() = default; + +bool MojoBackendFileOperations::CreateDirectory(const base::FilePath& path) { + bool result = false; + remote_->CreateDirectory(path, &result); + return result; +} + +bool MojoBackendFileOperations::PathExists(const base::FilePath& path) { + bool result = false; + remote_->PathExists(path, &result); + return result; +} + +base::File MojoBackendFileOperations::OpenFile(const base::FilePath& path, + uint32_t flags) { + base::File file; + base::File::Error error; + remote_->OpenFile(path, flags, &file, &error); + if (error != base::File::FILE_OK) { + return base::File(error); + } + return file; +} + +bool MojoBackendFileOperations::DeleteFile(const base::FilePath& path) { + bool result = false; + remote_->DeleteFile(path, &result); + return result; +} + +bool MojoBackendFileOperations::ReplaceFile(const base::FilePath& from_path, + const base::FilePath& to_path, + base::File::Error* error_out) { + base::File::Error error; + remote_->RenameFile(from_path, to_path, &error); + if (error_out) { + *error_out = error; + } + return error == base::File::FILE_OK; +} + +absl::optional<base::File::Info> MojoBackendFileOperations::GetFileInfo( + const base::FilePath& path) { + absl::optional<base::File::Info> info; + remote_->GetFileInfo(path, &info); + return info; +} + +} // namespace network
diff --git a/services/network/disk_cache/mojo_backend_file_operations.h b/services/network/disk_cache/mojo_backend_file_operations.h new file mode 100644 index 0000000..66ed9ee --- /dev/null +++ b/services/network/disk_cache/mojo_backend_file_operations.h
@@ -0,0 +1,44 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef SERVICES_NETWORK_DISK_CACHE_MOJO_BACKEND_FILE_OPERATIONS_H_ +#define SERVICES_NETWORK_DISK_CACHE_MOJO_BACKEND_FILE_OPERATIONS_H_ + +#include "base/component_export.h" +#include "base/memory/ref_counted.h" +#include "base/task/sequenced_task_runner.h" +#include "mojo/public/cpp/bindings/pending_remote.h" +#include "mojo/public/cpp/bindings/remote.h" +#include "net/disk_cache/disk_cache.h" +#include "services/network/public/mojom/http_cache_backend_file_operations.mojom.h" + +namespace network { + +// A BackendFileOperations that provides file operations with brokering them +// via mojo. +class MojoBackendFileOperations final + : public disk_cache::BackendFileOperations { + public: + MojoBackendFileOperations( + mojo::PendingRemote<mojom::HttpCacheBackendFileOperations> pending_remote, + scoped_refptr<base::SequencedTaskRunner> task_runner); + ~MojoBackendFileOperations() override; + + // disk_cache::BackendFileOperations implementation: + bool CreateDirectory(const base::FilePath& path) override; + bool PathExists(const base::FilePath& path) override; + base::File OpenFile(const base::FilePath& path, uint32_t flags) override; + bool DeleteFile(const base::FilePath& path) override; + bool ReplaceFile(const base::FilePath& from_path, + const base::FilePath& to_path, + base::File::Error* error) override; + absl::optional<base::File::Info> GetFileInfo( + const base::FilePath& path) override; + + private: + mojo::Remote<mojom::HttpCacheBackendFileOperations> remote_; +}; + +} // namespace network +#endif // SERVICES_NETWORK_DISK_CACHE_MOJO_BACKEND_FILE_OPERATIONS_H_
diff --git a/services/network/disk_cache/mojo_backend_file_operations_factory.cc b/services/network/disk_cache/mojo_backend_file_operations_factory.cc new file mode 100644 index 0000000..a8afd691 --- /dev/null +++ b/services/network/disk_cache/mojo_backend_file_operations_factory.cc
@@ -0,0 +1,27 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "services/network/disk_cache/mojo_backend_file_operations_factory.h" + +#include "services/network/disk_cache/mojo_backend_file_operations.h" + +namespace network { + +MojoBackendFileOperationsFactory::MojoBackendFileOperationsFactory( + mojo::PendingRemote<mojom::HttpCacheBackendFileOperationsFactory> + pending_remote) + : remote_(std::move(pending_remote)) {} +MojoBackendFileOperationsFactory::~MojoBackendFileOperationsFactory() = default; + +std::unique_ptr<disk_cache::BackendFileOperations> +MojoBackendFileOperationsFactory::Create( + scoped_refptr<base::SequencedTaskRunner> task_runner) { + mojo::PendingRemote<mojom::HttpCacheBackendFileOperations> pending_remote; + remote_->Create(pending_remote.InitWithNewPipeAndPassReceiver()); + + return std::make_unique<MojoBackendFileOperations>(std::move(pending_remote), + std::move(task_runner)); +} + +} // namespace network
diff --git a/services/network/disk_cache/mojo_backend_file_operations_factory.h b/services/network/disk_cache/mojo_backend_file_operations_factory.h new file mode 100644 index 0000000..e6a1d5a --- /dev/null +++ b/services/network/disk_cache/mojo_backend_file_operations_factory.h
@@ -0,0 +1,44 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef SERVICES_NETWORK_DISK_CACHE_MOJO_BACKEND_FILE_OPERATIONS_FACTORY_H_ +#define SERVICES_NETWORK_DISK_CACHE_MOJO_BACKEND_FILE_OPERATIONS_FACTORY_H_ + +#include <memory> + +#include "base/component_export.h" +#include "base/memory/ref_counted.h" +#include "mojo/public/cpp/bindings/pending_remote.h" +#include "mojo/public/cpp/bindings/remote.h" +#include "net/disk_cache/disk_cache.h" +#include "services/network/public/mojom/http_cache_backend_file_operations.mojom.h" + +namespace base { +class SequencedTaskRunner; +} // namespace base + +namespace network { + +// A BackendFileOperationsFactory implementation that creates +// MojoBackendFileOperations on Create. +class COMPONENT_EXPORT(NETWORK_SERVICE) MojoBackendFileOperationsFactory final + : public disk_cache::BackendFileOperationsFactory { + public: + explicit MojoBackendFileOperationsFactory( + mojo::PendingRemote<mojom::HttpCacheBackendFileOperationsFactory> + pending_remote); + + // BackendFileOperationsFactory implementation: + std::unique_ptr<disk_cache::BackendFileOperations> Create( + scoped_refptr<base::SequencedTaskRunner> task_runner) override; + + private: + ~MojoBackendFileOperationsFactory() override; + + mojo::Remote<mojom::HttpCacheBackendFileOperationsFactory> remote_; +}; + +} // namespace network + +#endif // SERVICES_NETWORK_DISK_CACHE_MOJO_BACKEND_FILE_OPERATIONS_FACTORY_H_
diff --git a/services/network/network_context.cc b/services/network/network_context.cc index d02d253..b892006 100644 --- a/services/network/network_context.cc +++ b/services/network/network_context.cc
@@ -83,6 +83,7 @@ #include "net/url_request/url_request_context_builder.h" #include "services/network/cookie_manager.h" #include "services/network/cors/cors_url_loader_factory.h" +#include "services/network/disk_cache/mojo_backend_file_operations_factory.h" #include "services/network/host_resolver.h" #include "services/network/http_auth_cache_copier.h" #include "services/network/http_server_properties_pref_delegate.h" @@ -537,6 +538,12 @@ std::move(url_loader_factory_for_cert_net_fetcher_receiver)); SetBlockTrustTokens(params_->block_trust_tokens); + + if (params_ && params_->http_cache_file_operations_factory) { + http_cache_file_operations_factory_ = + base::MakeRefCounted<MojoBackendFileOperationsFactory>( + std::move(params_->http_cache_file_operations_factory)); + } } NetworkContext::NetworkContext(
diff --git a/services/network/network_context.h b/services/network/network_context.h index 01befea8..3fd4c43 100644 --- a/services/network/network_context.h +++ b/services/network/network_context.h
@@ -109,6 +109,7 @@ class ExpectCTReporter; class HostResolver; class MdnsResponderManager; +class MojoBackendFileOperationsFactory; class NetworkService; class NetworkServiceNetworkDelegate; class NetworkServiceProxyDelegate; @@ -887,6 +888,9 @@ std::unique_ptr<url_matcher::URLMatcher> url_matcher_; + scoped_refptr<MojoBackendFileOperationsFactory> + http_cache_file_operations_factory_; + base::WeakPtrFactory<NetworkContext> weak_factory_{this}; };
diff --git a/services/network/public/mojom/BUILD.gn b/services/network/public/mojom/BUILD.gn index 4085455..57d420a 100644 --- a/services/network/public/mojom/BUILD.gn +++ b/services/network/public/mojom/BUILD.gn
@@ -267,6 +267,7 @@ "devtools_observer.mojom", "early_hints.mojom", "fetch_api.mojom", + "http_cache_backend_file_operations.mojom", "http_raw_headers.mojom", "http_request_headers.mojom", "ip_address_space.mojom",
diff --git a/services/network/public/mojom/http_cache_backend_file_operations.mojom b/services/network/public/mojom/http_cache_backend_file_operations.mojom new file mode 100644 index 0000000..b09ff10 --- /dev/null +++ b/services/network/public/mojom/http_cache_backend_file_operations.mojom
@@ -0,0 +1,43 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module network.mojom; + +import "mojo/public/mojom/base/file.mojom"; +import "mojo/public/mojom/base/file_error.mojom"; +import "mojo/public/mojom/base/file_info.mojom"; +import "mojo/public/mojom/base/file_path.mojom"; + +// An interface to provide file operations so that the HTTP cache works in +// a sandboxed network service. +// All the paths must be absolute paths. +interface HttpCacheBackendFileOperations { + // Creates a directory with the given path and returns whether that succeeded. + [Sync] CreateDirectory(mojo_base.mojom.FilePath path) => (bool result); + + // Returns true if the given path exists on the local filesystem. + [Sync] PathExists(mojo_base.mojom.FilePath path) => (bool result); + + // Opens a file with the given path and flags. Returns the opened file and + // the error information. + [Sync] OpenFile(mojo_base.mojom.FilePath path, uint32 flags) => + (mojo_base.mojom.File? file, mojo_base.mojom.FileError error); + + // Deletes a file with the given path and returns whether that succeeded. + [Sync] DeleteFile(mojo_base.mojom.FilePath path) => (bool result); + + // Renames a file `from_path` to `to_path`. Returns the error information. + [Sync] RenameFile(mojo_base.mojom.FilePath from_path, + mojo_base.mojom.FilePath to_path) => (mojo_base.mojom.FileError error); + + // Returns information about the given path. + [Sync] GetFileInfo( + mojo_base.mojom.FilePath path) => (mojo_base.mojom.FileInfo? info); +}; + +// A factory interface for HttpcacheBackendFileOperations. +interface HttpCacheBackendFileOperationsFactory { + // Creates a HttpCacheBackendFileOperations. + Create(pending_receiver<HttpCacheBackendFileOperations> receiver); +}; \ No newline at end of file
diff --git a/services/network/public/mojom/net_log.mojom b/services/network/public/mojom/net_log.mojom index b4b08d9..aa668db 100644 --- a/services/network/public/mojom/net_log.mojom +++ b/services/network/public/mojom/net_log.mojom
@@ -40,7 +40,7 @@ // Returns network error code. Start( mojo_base.mojom.File destination, - mojo_base.mojom.DictionaryValue extra_constants, + mojo_base.mojom.DeprecatedDictionaryValue extra_constants, NetLogCaptureMode capture_mode, uint64 max_file_size) => (int32 net_error); @@ -50,7 +50,8 @@ // // Returns network error code; if successful this will occur only after // the file has been fully written. - Stop(mojo_base.mojom.DictionaryValue polled_values) => (int32 net_error); + Stop(mojo_base.mojom.DeprecatedDictionaryValue polled_values) + => (int32 net_error); }; // Equivalent to NetLogEventPhase in net/log/net_log_event_type.h.
diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom index 0b1afd4..560fb1a 100644 --- a/services/network/public/mojom/network_context.mojom +++ b/services/network/public/mojom/network_context.mojom
@@ -21,6 +21,7 @@ import "services/network/public/mojom/default_credentials.mojom"; import "services/network/public/mojom/devtools_observer.mojom"; import "services/network/public/mojom/host_resolver.mojom"; +import "services/network/public/mojom/http_cache_backend_file_operations.mojom"; import "services/network/public/mojom/http_request_headers.mojom"; import "services/network/public/mojom/ip_address.mojom"; import "services/network/public/mojom/ip_endpoint.mojom"; @@ -339,6 +340,11 @@ // If null and the cache is enabled, an in-memory database is used. mojo_base.mojom.FilePath? http_cache_path; + // A factory to broker file operations needed for the HTTP cache on some + // platforms (depending on the sandboxing mechanism the platform provides). + pending_remote<HttpCacheBackendFileOperationsFactory>? + http_cache_file_operations_factory; + // Enabled protocols. Note that these apply to all fetches, including those // used to fetch PAC scripts. Note that currently data URLs are always enabled // and file URLs are always disabled. @@ -1043,7 +1049,7 @@ mojo_base.mojom.UnguessableToken? reporting_source, NetworkIsolationKey network_isolation_key, string? user_agent, - mojo_base.mojom.DictionaryValue body); + mojo_base.mojom.DeprecatedDictionaryValue body); // Queues a signed exchange report. // @@ -1100,7 +1106,7 @@ [EnableIf=is_ct_supported] GetExpectCTState(string domain, NetworkIsolationKey network_isolation_key) - => (mojo_base.mojom.DictionaryValue state); + => (mojo_base.mojom.DeprecatedDictionaryValue state); // Creates a UDP socket. Caller can supply a |listener| interface pointer // to listen for incoming datagrams. A null |listener| is acceptable if caller @@ -1346,7 +1352,8 @@ // Retrieve values from the HSTS state from the associated contexts // transport security state. - GetHSTSState(string domain) => (mojo_base.mojom.DictionaryValue state); + GetHSTSState(string domain) + => (mojo_base.mojom.DeprecatedDictionaryValue state); // Sets allowed and blocked origins respectively for the URLLoaderFactory // consumers to access beyond the same-origin policy. The list is managed per
diff --git a/services/network/public/mojom/network_service.mojom b/services/network/public/mojom/network_service.mojom index 6bd184e..f4eca48 100644 --- a/services/network/public/mojom/network_service.mojom +++ b/services/network/public/mojom/network_service.mojom
@@ -188,7 +188,7 @@ // the key "clientInfo". StartNetLog(mojo_base.mojom.File file, NetLogCaptureMode capture_mode, - mojo_base.mojom.DictionaryValue constants); + mojo_base.mojom.DeprecatedDictionaryValue constants); // Attaches an external source of NetLog events. Control events will be sent // to the |proxy_source| pipe indicating when netlogging is active, the
diff --git a/services/network/public/mojom/network_service_test.mojom b/services/network/public/mojom/network_service_test.mojom index fdc78d1c..78348c5 100644 --- a/services/network/public/mojom/network_service_test.mojom +++ b/services/network/public/mojom/network_service_test.mojom
@@ -4,6 +4,7 @@ module network.mojom; +import "mojo/public/mojom/base/file.mojom"; import "mojo/public/mojom/base/file_path.mojom"; import "mojo/public/mojom/base/memory_pressure_level.mojom"; import "mojo/public/mojom/base/time.mojom"; @@ -11,6 +12,7 @@ import "services/network/public/mojom/network_change_manager.mojom"; import "services/network/public/mojom/network_param.mojom"; import "services/network/public/mojom/network_types.mojom"; +import "services/network/public/mojom/http_cache_backend_file_operations.mojom"; // Maps to net::RuleBasedHostResolverProc::Rule::ResolverType. // @@ -34,6 +36,9 @@ array<string> dns_aliases; }; +// The "simple" backend of an HTTP cache. +interface SimpleCache {}; + // Testing interface to the network service. // Methods are sometimes synchronous to avoid race conditions since this test // interface is on a different pipe than interfaces which are impacted. @@ -139,4 +144,11 @@ // Opens a file with the given `path`, and returns whether it is valid. OpenFile(mojo_base.mojom.FilePath path) => (bool result); + + // Creates a "simple" backend for an HTTP cache. + // Returns the created cache if succeeded, and null otherwise. + CreateSimpleCache( + pending_remote<HttpCacheBackendFileOperationsFactory> factory, + mojo_base.mojom.FilePath path) + => (pending_remote<SimpleCache>? backend); };
diff --git a/services/network/public/mojom/reporting_service.mojom b/services/network/public/mojom/reporting_service.mojom index 06d1239..291fb9ba 100644 --- a/services/network/public/mojom/reporting_service.mojom +++ b/services/network/public/mojom/reporting_service.mojom
@@ -37,7 +37,7 @@ // attempt. int32 attempts; // The body of the report. - mojo_base.mojom.DictionaryValue body; + mojo_base.mojom.DeprecatedDictionaryValue body; // The status of the report. ReportingApiReportStatus status; };
diff --git a/storage/browser/database/database_tracker.h b/storage/browser/database/database_tracker.h index 63d2c3a..95a867e 100644 --- a/storage/browser/database/database_tracker.h +++ b/storage/browser/database/database_tracker.h
@@ -148,8 +148,8 @@ virtual bool GetAllOriginsInfo(std::vector<OriginInfo>* origins_info); // Thread-safe getter. - QuotaManagerProxy* quota_manager_proxy() const { - return quota_manager_proxy_.get(); + const scoped_refptr<QuotaManagerProxy>& quota_manager_proxy() const { + return quota_manager_proxy_; } bool IsDatabaseScheduledForDeletion(const std::string& origin_identifier,
diff --git a/storage/browser/file_system/obfuscated_file_util_unittest.cc b/storage/browser/file_system/obfuscated_file_util_unittest.cc index 408808c..bf18d902 100644 --- a/storage/browser/file_system/obfuscated_file_util_unittest.cc +++ b/storage/browser/file_system/obfuscated_file_util_unittest.cc
@@ -2040,13 +2040,7 @@ EXPECT_EQ(2, count); } -// crbug.com/176470 -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_ANDROID) -#define MAYBE_TestQuotaOnCopyFile DISABLED_TestQuotaOnCopyFile -#else -#define MAYBE_TestQuotaOnCopyFile TestQuotaOnCopyFile -#endif -TEST_P(ObfuscatedFileUtilTest, MAYBE_TestQuotaOnCopyFile) { +TEST_P(ObfuscatedFileUtilTest, TestQuotaOnCopyFile) { FileSystemURL from_file(CreateURLFromUTF8("fromfile")); FileSystemURL obstacle_file(CreateURLFromUTF8("obstaclefile")); FileSystemURL to_file1(CreateURLFromUTF8("tofile1"));
diff --git a/testing/buildbot/chromium.android.fyi.json b/testing/buildbot/chromium.android.fyi.json index b82e75e..75505ae8 100644 --- a/testing/buildbot/chromium.android.fyi.json +++ b/testing/buildbot/chromium.android.fyi.json
@@ -1833,7 +1833,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M100", - "revision": "version:100.0.4896.28" + "revision": "version:100.0.4896.39" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -2253,7 +2253,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M99", - "revision": "version:99.0.4844.65" + "revision": "version:99.0.4844.66" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -2337,7 +2337,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M100", - "revision": "version:100.0.4896.28" + "revision": "version:100.0.4896.39" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -2757,7 +2757,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M99", - "revision": "version:99.0.4844.65" + "revision": "version:99.0.4844.66" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}",
diff --git a/testing/buildbot/chromium.android.json b/testing/buildbot/chromium.android.json index 7e264541..b143849 100644 --- a/testing/buildbot/chromium.android.json +++ b/testing/buildbot/chromium.android.json
@@ -44879,7 +44879,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M100", - "revision": "version:100.0.4896.28" + "revision": "version:100.0.4896.39" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -45299,7 +45299,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M99", - "revision": "version:99.0.4844.65" + "revision": "version:99.0.4844.66" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -45383,7 +45383,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M100", - "revision": "version:100.0.4896.28" + "revision": "version:100.0.4896.39" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -45803,7 +45803,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M99", - "revision": "version:99.0.4844.65" + "revision": "version:99.0.4844.66" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -45891,7 +45891,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M100", - "revision": "version:100.0.4896.28" + "revision": "version:100.0.4896.39" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -46311,7 +46311,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M99", - "revision": "version:99.0.4844.65" + "revision": "version:99.0.4844.66" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -46395,7 +46395,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M100", - "revision": "version:100.0.4896.28" + "revision": "version:100.0.4896.39" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -46815,7 +46815,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M99", - "revision": "version:99.0.4844.65" + "revision": "version:99.0.4844.66" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -46970,7 +46970,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M100", - "revision": "version:100.0.4896.28" + "revision": "version:100.0.4896.39" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -47390,7 +47390,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M99", - "revision": "version:99.0.4844.65" + "revision": "version:99.0.4844.66" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -47474,7 +47474,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M100", - "revision": "version:100.0.4896.28" + "revision": "version:100.0.4896.39" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -47894,7 +47894,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M99", - "revision": "version:99.0.4844.65" + "revision": "version:99.0.4844.66" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -48049,7 +48049,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M100", - "revision": "version:100.0.4896.28" + "revision": "version:100.0.4896.39" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -48469,7 +48469,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M99", - "revision": "version:99.0.4844.65" + "revision": "version:99.0.4844.66" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -48553,7 +48553,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M100", - "revision": "version:100.0.4896.28" + "revision": "version:100.0.4896.39" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -48973,7 +48973,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M99", - "revision": "version:99.0.4844.65" + "revision": "version:99.0.4844.66" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}",
diff --git a/testing/buildbot/chromium.fyi.json b/testing/buildbot/chromium.fyi.json index f2a77f2..4600401 100644 --- a/testing/buildbot/chromium.fyi.json +++ b/testing/buildbot/chromium.fyi.json
@@ -76094,10 +76094,7 @@ }, "lacros-amd64-generic-rel-skylab-fyi": { "additional_compile_targets": [ - "chrome", - "linux_symbols", - "symupload", - "strip_chrome_binary" + "chrome" ], "skylab_tests": [ {
diff --git a/testing/buildbot/chromium.mac.json b/testing/buildbot/chromium.mac.json index 7e508f1..02e37e8b 100644 --- a/testing/buildbot/chromium.mac.json +++ b/testing/buildbot/chromium.mac.json
@@ -10873,7 +10873,7 @@ } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 12 + "shards": 18 }, "test": "content_browsertests", "test_id_prefix": "ninja://content/test:content_browsertests/"
diff --git a/testing/buildbot/test_suite_exceptions.pyl b/testing/buildbot/test_suite_exceptions.pyl index c1f4ee4..8c5f98a 100644 --- a/testing/buildbot/test_suite_exceptions.pyl +++ b/testing/buildbot/test_suite_exceptions.pyl
@@ -1248,7 +1248,7 @@ }, 'Mac11 Tests (dbg)': { # https://crbug.com/1279504 'swarming': { - 'shards': 12, + 'shards': 18, }, },
diff --git a/testing/buildbot/variants.pyl b/testing/buildbot/variants.pyl index ed03c79..eb7ba60 100644 --- a/testing/buildbot/variants.pyl +++ b/testing/buildbot/variants.pyl
@@ -387,7 +387,7 @@ { 'cipd_package': 'chromium/testing/weblayer-x86', 'location': 'weblayer_instrumentation_test_M100', - 'revision': 'version:100.0.4896.28', + 'revision': 'version:100.0.4896.39', } ], }, @@ -411,7 +411,7 @@ { 'cipd_package': 'chromium/testing/weblayer-x86', 'location': 'weblayer_instrumentation_test_M99', - 'revision': 'version:99.0.4844.65', + 'revision': 'version:99.0.4844.66', } ], }, @@ -531,7 +531,7 @@ { 'cipd_package': 'chromium/testing/weblayer-x86', 'location': 'weblayer_instrumentation_test_M100', - 'revision': 'version:100.0.4896.28', + 'revision': 'version:100.0.4896.39', } ], }, @@ -555,7 +555,7 @@ { 'cipd_package': 'chromium/testing/weblayer-x86', 'location': 'weblayer_instrumentation_test_M99', - 'revision': 'version:99.0.4844.65', + 'revision': 'version:99.0.4844.66', } ], }, @@ -675,7 +675,7 @@ { 'cipd_package': 'chromium/testing/weblayer-x86', 'location': 'weblayer_instrumentation_test_M100', - 'revision': 'version:100.0.4896.28', + 'revision': 'version:100.0.4896.39', } ], }, @@ -699,7 +699,7 @@ { 'cipd_package': 'chromium/testing/weblayer-x86', 'location': 'weblayer_instrumentation_test_M99', - 'revision': 'version:99.0.4844.65', + 'revision': 'version:99.0.4844.66', } ], },
diff --git a/testing/buildbot/waterfalls.pyl b/testing/buildbot/waterfalls.pyl index 9b80f7a..c51608cd 100644 --- a/testing/buildbot/waterfalls.pyl +++ b/testing/buildbot/waterfalls.pyl
@@ -3214,9 +3214,6 @@ 'lacros-amd64-generic-rel-skylab-fyi': { 'additional_compile_targets': [ 'chrome', - 'linux_symbols', - 'symupload', - 'strip_chrome_binary', ], 'test_suites': { 'skylab_tests': 'lacros_amd64_generic_rel_skylab_fyi',
diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json index 89f731e..d852f6b3 100644 --- a/testing/variations/fieldtrial_testing_config.json +++ b/testing/variations/fieldtrial_testing_config.json
@@ -1774,7 +1774,32 @@ ], "experiments": [ { - "name": "ReadLater__SemiIntegrated", + "name": "ReadLater_US__SemiIntegrated_M99_v1", + "params": { + "allow_bookmark_type_swapping": "true", + "autodismiss_enabled": "true", + "bookmark_in_app_menu": "false", + "bookmark_visuals_enabled": "true", + "enable_persisted_tab_data_maintenance": "true", + "enable_price_notification": "false", + "enable_price_tracking": "true", + "price_tracking_with_optimization_guide": "true", + "reading_list_in_app_menu": "false", + "use_root_bookmark_as_default": "true" + }, + "enable_features": [ + "BookmarksImprovedSaveFlow", + "BookmarksRefresh", + "CommercePriceTracking", + "ReadLater" + ], + "disable_features": [ + "OptimizationGuidePushNotifications", + "ShoppingList" + ] + }, + { + "name": "ReadLater_non_US__SemiIntegrated_M99_v1", "params": { "allow_bookmark_type_swapping": "true", "autodismiss_enabled": "true", @@ -1789,18 +1814,29 @@ "ReadLater" ], "disable_features": [ + "CommercePriceTracking", + "OptimizationGuidePushNotifications", "ShoppingList" ] - } - ] - }, - { - "platforms": [ - "android" - ], - "experiments": [ + }, { - "name": "ReadLater__DedicatedSaveFlow", + "name": "ReadLater_non_US__NoCustomTab_M99_v1", + "params": { + "reading_list_in_app_menu": "false", + "use_cct": "false", + "use_root_bookmark_as_default": "true" + }, + "enable_features": [ + "ReadLater" + ], + "disable_features": [ + "CommercePriceTracking", + "OptimizationGuidePushNotifications", + "ShoppingList" + ] + }, + { + "name": "ReadLater_non_US__DedicatedSaveFlow_M99_v1", "params": { "allow_bookmark_type_swapping": "false", "autodismiss_enabled": "true", @@ -1815,63 +1851,13 @@ "ReadLater" ], "disable_features": [ + "CommercePriceTracking", + "OptimizationGuidePushNotifications", "ShoppingList" ] - } - ] - }, - { - "platforms": [ - "android" - ], - "experiments": [ + }, { - "name": "ReadLater__NoCustomTab", - "params": { - "reading_list_in_app_menu": "false", - "use_cct": "false", - "use_root_bookmark_as_default": "true" - }, - "enable_features": [ - "ReadLater" - ], - "disable_features": [ - "ShoppingList" - ] - } - ] - }, - { - "platforms": [ - "android" - ], - "experiments": [ - { - "name": "WallE__BookmarkMenuItem", - "params": { - "bookmark_in_app_menu": "true", - "bookmark_visuals_enabled": "true", - "reading_list_in_app_menu": "false", - "use_root_bookmark_as_default": "true" - }, - "enable_features": [ - "BookmarksRefresh", - "ReadLater" - ], - "disable_features": [ - "BookmarksImprovedSaveFlow", - "ShoppingList" - ] - } - ] - }, - { - "platforms": [ - "android" - ], - "experiments": [ - { - "name": "WallE__BookmarksRefresh", + "name": "BookmarksRefresh_non_US__BookmarksRefresh_M99_v1", "params": { "bookmark_in_app_menu": "false", "bookmark_visuals_enabled": "true", @@ -1884,6 +1870,140 @@ ], "disable_features": [ "BookmarksImprovedSaveFlow", + "CommercePriceTracking", + "OptimizationGuidePushNotifications", + "ShoppingList" + ] + }, + { + "name": "BookmarksRefresh_non_US__BookmarksRefreshWithMenuItem_M99_v1", + "params": { + "bookmark_in_app_menu": "true", + "bookmark_visuals_enabled": "true", + "reading_list_in_app_menu": "false", + "use_root_bookmark_as_default": "true" + }, + "enable_features": [ + "BookmarksRefresh", + "ReadLater" + ], + "disable_features": [ + "BookmarksImprovedSaveFlow", + "CommercePriceTracking", + "OptimizationGuidePushNotifications", + "ShoppingList" + ] + }, + { + "name": "WallE_US__PriceWithNotifications_M99_v1", + "params": { + "autodismiss_enabled": "true", + "bookmark_in_app_menu": "true", + "bookmark_visuals_enabled": "true", + "enable_persisted_tab_data_maintenance": "true", + "enable_price_notification": "true", + "enable_price_tracking": "true", + "price_tracking_with_optimization_guide": "true", + "reading_list_in_app_menu": "false", + "use_root_bookmark_as_default": "true" + }, + "enable_features": [ + "BookmarksImprovedSaveFlow", + "BookmarksRefresh", + "CommercePriceTracking", + "OptimizationGuidePushNotifications", + "ReadLater", + "ShoppingList" + ] + }, + { + "name": "WallE_US__BookmarksRefresh_M99_v1", + "params": { + "bookmark_in_app_menu": "false", + "bookmark_visuals_enabled": "true", + "enable_persisted_tab_data_maintenance": "true", + "enable_price_notification": "false", + "enable_price_tracking": "true", + "price_tracking_with_optimization_guide": "true", + "reading_list_in_app_menu": "false", + "use_root_bookmark_as_default": "true" + }, + "enable_features": [ + "BookmarksRefresh", + "CommercePriceTracking", + "ReadLater" + ], + "disable_features": [ + "BookmarksImprovedSaveFlow", + "OptimizationGuidePushNotifications", + "ShoppingList" + ] + }, + { + "name": "WallE_US__BookmarkMenuItem_M99_v1", + "params": { + "bookmark_in_app_menu": "true", + "bookmark_visuals_enabled": "true", + "enable_persisted_tab_data_maintenance": "true", + "enable_price_notification": "false", + "enable_price_tracking": "true", + "price_tracking_with_optimization_guide": "true", + "reading_list_in_app_menu": "false", + "use_root_bookmark_as_default": "true" + }, + "enable_features": [ + "BookmarksRefresh", + "CommercePriceTracking", + "ReadLater" + ], + "disable_features": [ + "BookmarksImprovedSaveFlow", + "OptimizationGuidePushNotifications", + "ShoppingList" + ] + }, + { + "name": "ReadLater_US__NoCustomTab_M99_v1", + "params": { + "enable_persisted_tab_data_maintenance": "true", + "enable_price_notification": "false", + "enable_price_tracking": "true", + "price_tracking_with_optimization_guide": "true", + "reading_list_in_app_menu": "false", + "use_cct": "false", + "use_root_bookmark_as_default": "true" + }, + "enable_features": [ + "CommercePriceTracking", + "ReadLater" + ], + "disable_features": [ + "OptimizationGuidePushNotifications", + "ShoppingList" + ] + }, + { + "name": "ReadLater_US__DedicatedSaveFlow_M99_v1", + "params": { + "allow_bookmark_type_swapping": "false", + "autodismiss_enabled": "true", + "bookmark_in_app_menu": "true", + "bookmark_visuals_enabled": "true", + "enable_persisted_tab_data_maintenance": "true", + "enable_price_notification": "false", + "enable_price_tracking": "true", + "price_tracking_with_optimization_guide": "true", + "reading_list_in_app_menu": "true", + "use_root_bookmark_as_default": "true" + }, + "enable_features": [ + "BookmarksImprovedSaveFlow", + "BookmarksRefresh", + "CommercePriceTracking", + "ReadLater" + ], + "disable_features": [ + "OptimizationGuidePushNotifications", "ShoppingList" ] } @@ -5442,10 +5562,10 @@ ], "experiments": [ { - "name": "Prefetch_2_With_Decoys_20211129", + "name": "Prefetch_2_20220214", "params": { "dns_canary_url": "http://dns-tunnel-check.googlezip.net/connect", - "do_no_state_prefetch": "true", + "do_no_state_prefetch": "false", "ineligible_decoy_request_probability": "1", "lite_mode_only": "false", "max_srp_prefetches": "5",
diff --git a/third_party/blink/public/mojom/bluetooth/web_bluetooth.mojom b/third_party/blink/public/mojom/bluetooth/web_bluetooth.mojom index c357bb4..a9a1d36 100644 --- a/third_party/blink/public/mojom/bluetooth/web_bluetooth.mojom +++ b/third_party/blink/public/mojom/bluetooth/web_bluetooth.mojom
@@ -218,9 +218,13 @@ // Returns a list of permitted Bluetooth devices that the current origin can // access services on. These devices are granted access via RequestDevice(), // but the permission can be revoked at any time by the user through the - // browser's UI. + // browser's UI or by the website through ForgetDevice(). GetDevices() => (array<WebBluetoothDevice> devices); + // Attempts to revoke the permission to the Device identified by |device_id|. + // It will fail silently if the permission cannot be revoked. + ForgetDevice(WebBluetoothDeviceId device_id) => (); + // Creates a GATT Connection to a Bluetooth Device identified by |device_id| // if a connection to the device didn't exist already. If a GATT connection // existed already then this function increases the ref count to keep that
diff --git a/third_party/blink/public/mojom/chromeos/system_extensions/window_management/cros_window_management.mojom b/third_party/blink/public/mojom/chromeos/system_extensions/window_management/cros_window_management.mojom index 206a7ec4..d88de818 100644 --- a/third_party/blink/public/mojom/chromeos/system_extensions/window_management/cros_window_management.mojom +++ b/third_party/blink/public/mojom/chromeos/system_extensions/window_management/cros_window_management.mojom
@@ -42,4 +42,7 @@ // Minimizes the window identified by id if one exists, else do nothing. Minimize(mojo_base.mojom.UnguessableToken id); + + // Allocates focus to the CrosWindow identified by id and brings to front. + Focus(mojo_base.mojom.UnguessableToken id); };
diff --git a/third_party/blink/public/mojom/devtools/devtools_frontend.mojom b/third_party/blink/public/mojom/devtools/devtools_frontend.mojom index 192c71c..606a88e 100644 --- a/third_party/blink/public/mojom/devtools/devtools_frontend.mojom +++ b/third_party/blink/public/mojom/devtools/devtools_frontend.mojom
@@ -32,5 +32,5 @@ // Provides embedder functionality to a frame serving as DevTools frontend. interface DevToolsFrontendHost { // Sends a message to DevTools frontend embedder. - DispatchEmbedderMessage(mojo_base.mojom.DictionaryValue message); + DispatchEmbedderMessage(mojo_base.mojom.DeprecatedDictionaryValue message); };
diff --git a/third_party/blink/public/mojom/frame/frame.mojom b/third_party/blink/public/mojom/frame/frame.mojom index e25bc16..dbc607e 100644 --- a/third_party/blink/public/mojom/frame/frame.mojom +++ b/third_party/blink/public/mojom/frame/frame.mojom
@@ -742,7 +742,7 @@ JavaScriptMethodExecuteRequest( mojo_base.mojom.String16 object_name, mojo_base.mojom.String16 method_name, - mojo_base.mojom.ListValue arguments, + mojo_base.mojom.DeprecatedListValue arguments, bool wants_result) => (mojo_base.mojom.Value result); // Request for the renderer to execute JavaScript in the frame's context.
diff --git a/third_party/blink/public/mojom/navigation/navigation_params.mojom b/third_party/blink/public/mojom/navigation/navigation_params.mojom index 82f4d60..3e47498 100644 --- a/third_party/blink/public/mojom/navigation/navigation_params.mojom +++ b/third_party/blink/public/mojom/navigation/navigation_params.mojom
@@ -113,7 +113,7 @@ // initiator information in DevTools protocol format. See // https://chromedevtools.github.io/devtools-protocol/tot/Network#type-Initiator // for details. - mojo_base.mojom.DictionaryValue? devtools_initiator; + mojo_base.mojom.DeprecatedDictionaryValue? devtools_initiator; // Specifies whether, and how, the navigation should execute a Trust Tokens // operation (https://github.com/wicg/trust-token-api) and attach headers
diff --git a/third_party/blink/public/mojom/peerconnection/peer_connection_tracker.mojom b/third_party/blink/public/mojom/peerconnection/peer_connection_tracker.mojom index ed0bf4f..09d8333 100644 --- a/third_party/blink/public/mojom/peerconnection/peer_connection_tracker.mojom +++ b/third_party/blink/public/mojom/peerconnection/peer_connection_tracker.mojom
@@ -126,10 +126,10 @@ // Adds standard PeerConnection stats for webrtc-internals. // |lid| is the renderer local id, // |value| is the list of stats reports. - AddStandardStats(int32 lid, mojo_base.mojom.ListValue value); + AddStandardStats(int32 lid, mojo_base.mojom.DeprecatedListValue value); // Adds legacy PeerConnection stats for webrtc-internals. // |lid| is the renderer local id, // |value| is the list of stats reports. - AddLegacyStats(int32 lid, mojo_base.mojom.ListValue value); + AddLegacyStats(int32 lid, mojo_base.mojom.DeprecatedListValue value); };
diff --git a/third_party/blink/public/mojom/web_feature/web_feature.mojom b/third_party/blink/public/mojom/web_feature/web_feature.mojom index aa2b06da..fab6a70 100644 --- a/third_party/blink/public/mojom/web_feature/web_feature.mojom +++ b/third_party/blink/public/mojom/web_feature/web_feature.mojom
@@ -3499,6 +3499,7 @@ kSecureContextIncorrectForSharedWorker = 4178, kV8FunctionPrototypeArguments = 4179, kV8FunctionPrototypeCaller = 4180, + kBluetoothDeviceForget = 4181, // Add new features immediately above this line. Don't change assigned // numbers of any item, and don't reuse removed slots.
diff --git a/third_party/blink/renderer/bindings/core/v8/serialization/serialization_tag.h b/third_party/blink/renderer/bindings/core/v8/serialization/serialization_tag.h index d9a7195..46602e80 100644 --- a/third_party/blink/renderer/bindings/core/v8/serialization/serialization_tag.h +++ b/third_party/blink/renderer/bindings/core/v8/serialization/serialization_tag.h
@@ -75,9 +75,8 @@ kReadableStreamTransferTag = 'r', // index:uint32_t kTransformStreamTransferTag = 'm', // index:uint32_t kWritableStreamTransferTag = 'w', // index:uint32_t - // TODO(crbug.com/1288839): document format as soon as it is determined. - kMediaStreamTrack = 's', - kDOMPointTag = 'Q', // x:Double, y:Double, z:Double, w:Double + kMediaStreamTrack = 's', // session_id.high:uint64_t, session_id.low:uint64_t + kDOMPointTag = 'Q', // x:Double, y:Double, z:Double, w:Double kDOMPointReadOnlyTag = 'W', // x:Double, y:Double, z:Double, w:Double kDOMRectTag = 'E', // x:Double, y:Double, width:Double, height:Double kDOMRectReadOnlyTag = 'R', // x:Double, y:Double, width:Double, height:Double
diff --git a/third_party/blink/renderer/bindings/core/v8/serialization/v8_script_value_deserializer.cc b/third_party/blink/renderer/bindings/core/v8/serialization/v8_script_value_deserializer.cc index d50ecd9..fb633a3f 100644 --- a/third_party/blink/renderer/bindings/core/v8/serialization/v8_script_value_deserializer.cc +++ b/third_party/blink/renderer/bindings/core/v8/serialization/v8_script_value_deserializer.cc
@@ -225,6 +225,16 @@ } } +bool V8ScriptValueDeserializer::ReadUnguessableToken( + base::UnguessableToken* token_out) { + uint64_t high; + uint64_t low; + if (!ReadUint64(&high) || !ReadUint64(&low)) + return false; + *token_out = base::UnguessableToken::Deserialize(high, low); + return true; +} + bool V8ScriptValueDeserializer::ReadUTF8String(String* string) { uint32_t utf8_length = 0; const void* utf8_data = nullptr;
diff --git a/third_party/blink/renderer/bindings/core/v8/serialization/v8_script_value_deserializer.h b/third_party/blink/renderer/bindings/core/v8/serialization/v8_script_value_deserializer.h index 34f1322..286b37fc 100644 --- a/third_party/blink/renderer/bindings/core/v8/serialization/v8_script_value_deserializer.h +++ b/third_party/blink/renderer/bindings/core/v8/serialization/v8_script_value_deserializer.h
@@ -69,6 +69,7 @@ bool ReadRawBytes(size_t size, const void** data) { return deserializer_.ReadRawBytes(size, data); } + bool ReadUnguessableToken(base::UnguessableToken* token_out); bool ReadUTF8String(String* string_out); DOMRectReadOnly* ReadDOMRectReadOnly();
diff --git a/third_party/blink/renderer/bindings/core/v8/serialization/v8_script_value_serializer.cc b/third_party/blink/renderer/bindings/core/v8/serialization/v8_script_value_serializer.cc index b010f601..767fb3d 100644 --- a/third_party/blink/renderer/bindings/core/v8/serialization/v8_script_value_serializer.cc +++ b/third_party/blink/renderer/bindings/core/v8/serialization/v8_script_value_serializer.cc
@@ -369,6 +369,12 @@ } } +void V8ScriptValueSerializer::WriteUnguessableToken( + const base::UnguessableToken& token) { + WriteUint64(token.GetHighForSerialization()); + WriteUint64(token.GetLowForSerialization()); +} + void V8ScriptValueSerializer::WriteUTF8String(const String& string) { // TODO(jbroman): Ideally this method would take a WTF::StringView, but the // StringUTF8Adaptor trick doesn't yet work with StringView.
diff --git a/third_party/blink/renderer/bindings/core/v8/serialization/v8_script_value_serializer.h b/third_party/blink/renderer/bindings/core/v8/serialization/v8_script_value_serializer.h index 2a82f9b..a65a200 100644 --- a/third_party/blink/renderer/bindings/core/v8/serialization/v8_script_value_serializer.h +++ b/third_party/blink/renderer/bindings/core/v8/serialization/v8_script_value_serializer.h
@@ -70,6 +70,7 @@ void WriteRawBytes(const void* data, size_t size) { serializer_.WriteRawBytes(data, size); } + void WriteUnguessableToken(const base::UnguessableToken& token); void WriteUTF8String(const String&); template <typename E>
diff --git a/third_party/blink/renderer/bindings/core/v8/v8_metrics.cc b/third_party/blink/renderer/bindings/core/v8/v8_metrics.cc index ab8d7ca..d4ca396c 100644 --- a/third_party/blink/renderer/bindings/core/v8/v8_metrics.cc +++ b/third_party/blink/renderer/bindings/core/v8/v8_metrics.cc
@@ -148,119 +148,169 @@ return true; } +void CheckUnifiedEvents(const v8::metrics::GarbageCollectionFullCycle& event) { + // Check that all used values have been initialized. + DCHECK_LE(0, event.total.total_wall_clock_duration_in_us); + DCHECK_LE(0, event.total.mark_wall_clock_duration_in_us); + DCHECK_LE(0, event.total.weak_wall_clock_duration_in_us); + DCHECK_LE(0, event.total.compact_wall_clock_duration_in_us); + DCHECK_LE(0, event.total.sweep_wall_clock_duration_in_us); + DCHECK_LE(0, event.main_thread.total_wall_clock_duration_in_us); + DCHECK_LE(0, event.main_thread.mark_wall_clock_duration_in_us); + DCHECK_LE(0, event.main_thread.weak_wall_clock_duration_in_us); + DCHECK_LE(0, event.main_thread.compact_wall_clock_duration_in_us); + DCHECK_LE(0, event.main_thread.sweep_wall_clock_duration_in_us); + DCHECK_LE(0, event.main_thread_atomic.total_wall_clock_duration_in_us); + DCHECK_LE(0, event.main_thread_atomic.mark_wall_clock_duration_in_us); + DCHECK_LE(0, event.main_thread_atomic.weak_wall_clock_duration_in_us); + DCHECK_LE(0, event.main_thread_atomic.compact_wall_clock_duration_in_us); + DCHECK_LE(0, event.main_thread_atomic.sweep_wall_clock_duration_in_us); + // TODO(chromium:1154636): Also check for the following when they are + // populated: +#if 0 + DCHECK_LE(0, event.main_thread_incremental.total_wall_clock_duration_in_us); + DCHECK_LE(0, event.main_thread_incremental.mark_wall_clock_duration_in_us); + DCHECK_LE(0, event.main_thread_incremental.weak_wall_clock_duration_in_us); + DCHECK_LE(0, event.main_thread_incremental.compact_wall_clock_duration_in_us); + DCHECK_LE(0, event.main_thread_incremental.sweep_wall_clock_duration_in_us); + DCHECK_LE(0, event.objects.bytes_before); + DCHECK_LE(0, event.objects.bytes_after); + DCHECK_LE(0, event.objects.bytes_freed); + DCHECK_LE(0, event.memory.bytes_freed); + DCHECK_LE(0, event.efficiency_in_bytes_per_us); + DCHECK_LE(0, event.main_thread_efficiency_in_bytes_per_us); + DCHECK_LE(0, event.collection_rate_in_percent); +#endif +} + } // namespace void V8MetricsRecorder::AddMainThreadEvent( const v8::metrics::GarbageCollectionFullCycle& event, ContextId context_id) { - if (!CheckCppEvents(event)) - return; - // Report throughput metrics: - UMA_HISTOGRAM_TIMES( - "V8.GC.Cycle.Full.Cpp", - base::Microseconds(event.total_cpp.total_wall_clock_duration_in_us)); - UMA_HISTOGRAM_TIMES( - "V8.GC.Cycle.Full.Mark.Cpp", - base::Microseconds(event.total_cpp.mark_wall_clock_duration_in_us)); - UMA_HISTOGRAM_TIMES( - "V8.GC.Cycle.Full.Weak.Cpp", - base::Microseconds(event.total_cpp.weak_wall_clock_duration_in_us)); - UMA_HISTOGRAM_TIMES( - "V8.GC.Cycle.Full.Compact.Cpp", - base::Microseconds(event.total_cpp.compact_wall_clock_duration_in_us)); - UMA_HISTOGRAM_TIMES( - "V8.GC.Cycle.Full.Sweep.Cpp", - base::Microseconds(event.total_cpp.sweep_wall_clock_duration_in_us)); +#define UMA_HISTOGRAM_TIMES_ALL_GC_PHASES(prefix, suffix, statistics) \ + UMA_HISTOGRAM_TIMES( \ + prefix suffix, \ + base::Microseconds(statistics.total_wall_clock_duration_in_us)); \ + UMA_HISTOGRAM_TIMES( \ + prefix ".Mark" suffix, \ + base::Microseconds(statistics.mark_wall_clock_duration_in_us)); \ + UMA_HISTOGRAM_TIMES( \ + prefix ".Compact" suffix, \ + base::Microseconds(statistics.compact_wall_clock_duration_in_us)); \ + UMA_HISTOGRAM_TIMES( \ + prefix ".Sweep" suffix, \ + base::Microseconds(statistics.sweep_wall_clock_duration_in_us)); \ + UMA_HISTOGRAM_TIMES( \ + prefix ".Weak" suffix, \ + base::Microseconds(statistics.weak_wall_clock_duration_in_us)); - UMA_HISTOGRAM_TIMES( - "V8.GC.Cycle.MainThread.Full.Cpp", - base::Microseconds( - event.main_thread_cpp.total_wall_clock_duration_in_us)); - UMA_HISTOGRAM_TIMES( - "V8.GC.Cycle.MainThread.Full.Mark.Cpp", - base::Microseconds(event.main_thread_cpp.mark_wall_clock_duration_in_us)); - UMA_HISTOGRAM_TIMES( - "V8.GC.Cycle.MainThread.Full.Weak.Cpp", - base::Microseconds(event.main_thread_cpp.weak_wall_clock_duration_in_us)); - UMA_HISTOGRAM_TIMES( - "V8.GC.Cycle.MainThread.Full.Compact.Cpp", - base::Microseconds( - event.main_thread_cpp.compact_wall_clock_duration_in_us)); - UMA_HISTOGRAM_TIMES( - "V8.GC.Cycle.MainThread.Full.Sweep.Cpp", - base::Microseconds( - event.main_thread_cpp.sweep_wall_clock_duration_in_us)); + DCHECK_LE(0, event.reason); + UMA_HISTOGRAM_ENUMERATION("V8.GC.Cycle.Reason.Full", event.reason, + v8::internal::kGarbageCollectionReasonMaxValue); - // Report atomic pause metrics: - UMA_HISTOGRAM_TIMES( - "V8.GC.Cycle.MainThread.Full.Atomic.Cpp", - base::Microseconds( - event.main_thread_atomic_cpp.total_wall_clock_duration_in_us)); - UMA_HISTOGRAM_TIMES( - "V8.GC.Cycle.MainThread.Full.Atomic.Mark.Cpp", - base::Microseconds( - event.main_thread_atomic_cpp.mark_wall_clock_duration_in_us)); - UMA_HISTOGRAM_TIMES( - "V8.GC.Cycle.MainThread.Full.Atomic.Weak.Cpp", - base::Microseconds( - event.main_thread_atomic_cpp.weak_wall_clock_duration_in_us)); - UMA_HISTOGRAM_TIMES( - "V8.GC.Cycle.MainThread.Full.Atomic.Compact.Cpp", - base::Microseconds( - event.main_thread_atomic_cpp.compact_wall_clock_duration_in_us)); - UMA_HISTOGRAM_TIMES( - "V8.GC.Cycle.MainThread.Full.Atomic.Sweep.Cpp", - base::Microseconds( - event.main_thread_atomic_cpp.sweep_wall_clock_duration_in_us)); - - // Report size metrics: static constexpr size_t kMinSize = 1; static constexpr size_t kMaxSize = 4 * 1024 * 1024; static constexpr size_t kNumBuckets = 50; - DEFINE_THREAD_SAFE_STATIC_LOCAL( - CustomCountHistogram, object_size_before_histogram, - ("V8.GC.Cycle.Objects.Before.Full.Cpp", kMinSize, kMaxSize, kNumBuckets)); - object_size_before_histogram.Count( - CappedSizeInKB(event.objects_cpp.bytes_before)); + CheckUnifiedEvents(event); - DEFINE_THREAD_SAFE_STATIC_LOCAL( - CustomCountHistogram, object_size_after_histogram, - ("V8.GC.Cycle.Objects.After.Full.Cpp", kMinSize, kMaxSize, kNumBuckets)); - object_size_after_histogram.Count( - CappedSizeInKB(event.objects_cpp.bytes_after)); + // Report throughput metrics: + UMA_HISTOGRAM_TIMES_ALL_GC_PHASES("V8.GC.Cycle.Full", "", event.total); + UMA_HISTOGRAM_TIMES_ALL_GC_PHASES("V8.GC.Cycle.MainThread.Full", "", + event.main_thread); - DEFINE_THREAD_SAFE_STATIC_LOCAL( - CustomCountHistogram, object_size_freed_histogram, - ("V8.GC.Cycle.Objects.Freed.Full.Cpp", kMinSize, kMaxSize, kNumBuckets)); - object_size_freed_histogram.Count( - CappedSizeInKB(event.objects_cpp.bytes_freed)); + // Report atomic pause metrics: + UMA_HISTOGRAM_TIMES_ALL_GC_PHASES("V8.GC.Cycle.MainThread.Full.Atomic", "", + event.main_thread_atomic); - DEFINE_THREAD_SAFE_STATIC_LOCAL( - CustomCountHistogram, memory_size_freed_histogram, - ("V8.GC.Cycle.Memory.Freed.Full.Cpp", kMinSize, kMaxSize, kNumBuckets)); - memory_size_freed_histogram.Count( - CappedSizeInKB(event.memory_cpp.bytes_freed)); + // TODO(chromium:1154636): emit the following when they are populated: + // - event.main_thread_incremental + // - event.objects + // - event.memory // Report efficacy metrics: DEFINE_THREAD_SAFE_STATIC_LOCAL( CustomCountHistogram, efficacy_histogram, - ("V8.GC.Cycle.Efficiency.Full.Cpp", kMinSize, kMaxSize, kNumBuckets)); + ("V8.GC.Cycle.Efficiency.Full", kMinSize, kMaxSize, kNumBuckets)); efficacy_histogram.Count( - CappedEfficacyInKBPerMs(event.efficiency_cpp_in_bytes_per_us)); + CappedEfficacyInKBPerMs(event.efficiency_in_bytes_per_us)); DEFINE_THREAD_SAFE_STATIC_LOCAL(CustomCountHistogram, - efficacy_main_thread_cpp_histogram, - ("V8.GC.Cycle.Efficiency.MainThread.Full.Cpp", + efficacy_main_thread_histogram, + ("V8.GC.Cycle.Efficiency.MainThread.Full", kMinSize, kMaxSize, kNumBuckets)); - efficacy_main_thread_cpp_histogram.Count(CappedEfficacyInKBPerMs( - event.main_thread_efficiency_cpp_in_bytes_per_us)); + efficacy_main_thread_histogram.Count( + CappedEfficacyInKBPerMs(event.main_thread_efficiency_in_bytes_per_us)); DEFINE_THREAD_SAFE_STATIC_LOCAL( CustomCountHistogram, collection_rate_histogram, - ("V8.GC.Cycle.CollectionRate.Full.Cpp", 1, 100, 20)); + ("V8.GC.Cycle.CollectionRate.Full", 1, 100, 20)); collection_rate_histogram.Count(base::saturated_cast<base::Histogram::Sample>( - 100 * event.collection_rate_cpp_in_percent)); + 100 * event.collection_rate_in_percent)); + + if (CheckCppEvents(event)) { + // Report throughput metrics: + UMA_HISTOGRAM_TIMES_ALL_GC_PHASES("V8.GC.Cycle.Full", ".Cpp", + event.total_cpp); + UMA_HISTOGRAM_TIMES_ALL_GC_PHASES("V8.GC.Cycle.MainThread.Full", ".Cpp", + event.main_thread_cpp); + + // Report atomic pause metrics: + UMA_HISTOGRAM_TIMES_ALL_GC_PHASES("V8.GC.Cycle.MainThread.Full.Atomic", + ".Cpp", event.main_thread_atomic_cpp); + + // Report size metrics: + DEFINE_THREAD_SAFE_STATIC_LOCAL(CustomCountHistogram, + object_size_before_histogram, + ("V8.GC.Cycle.Objects.Before.Full.Cpp", + kMinSize, kMaxSize, kNumBuckets)); + object_size_before_histogram.Count( + CappedSizeInKB(event.objects_cpp.bytes_before)); + + DEFINE_THREAD_SAFE_STATIC_LOCAL(CustomCountHistogram, + object_size_after_histogram, + ("V8.GC.Cycle.Objects.After.Full.Cpp", + kMinSize, kMaxSize, kNumBuckets)); + object_size_after_histogram.Count( + CappedSizeInKB(event.objects_cpp.bytes_after)); + + DEFINE_THREAD_SAFE_STATIC_LOCAL(CustomCountHistogram, + object_size_freed_histogram, + ("V8.GC.Cycle.Objects.Freed.Full.Cpp", + kMinSize, kMaxSize, kNumBuckets)); + object_size_freed_histogram.Count( + CappedSizeInKB(event.objects_cpp.bytes_freed)); + + DEFINE_THREAD_SAFE_STATIC_LOCAL( + CustomCountHistogram, memory_size_freed_histogram, + ("V8.GC.Cycle.Memory.Freed.Full.Cpp", kMinSize, kMaxSize, kNumBuckets)); + memory_size_freed_histogram.Count( + CappedSizeInKB(event.memory_cpp.bytes_freed)); + + // Report efficacy metrics: + DEFINE_THREAD_SAFE_STATIC_LOCAL( + CustomCountHistogram, efficacy_histogram, + ("V8.GC.Cycle.Efficiency.Full.Cpp", kMinSize, kMaxSize, kNumBuckets)); + efficacy_histogram.Count( + CappedEfficacyInKBPerMs(event.efficiency_cpp_in_bytes_per_us)); + + DEFINE_THREAD_SAFE_STATIC_LOCAL( + CustomCountHistogram, efficacy_main_thread_cpp_histogram, + ("V8.GC.Cycle.Efficiency.MainThread.Full.Cpp", kMinSize, kMaxSize, + kNumBuckets)); + efficacy_main_thread_cpp_histogram.Count(CappedEfficacyInKBPerMs( + event.main_thread_efficiency_cpp_in_bytes_per_us)); + + DEFINE_THREAD_SAFE_STATIC_LOCAL( + CustomCountHistogram, collection_rate_histogram, + ("V8.GC.Cycle.CollectionRate.Full.Cpp", 1, 100, 20)); + collection_rate_histogram.Count( + base::saturated_cast<base::Histogram::Sample>( + 100 * event.collection_rate_cpp_in_percent)); + } + +#undef UMA_HISTOGRAM_TIMES_ALL_GC_PHASES } namespace {
diff --git a/third_party/blink/renderer/bindings/generated_in_modules.gni b/third_party/blink/renderer/bindings/generated_in_modules.gni index 4f57aa5f..e21670a 100644 --- a/third_party/blink/renderer/bindings/generated_in_modules.gni +++ b/third_party/blink/renderer/bindings/generated_in_modules.gni
@@ -391,8 +391,6 @@ "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_gpu_buffer_binding_layout.h", "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_gpu_buffer_descriptor.cc", "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_gpu_buffer_descriptor.h", - "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_gpu_canvas_compositing_alpha_mode.cc", - "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_gpu_canvas_compositing_alpha_mode.h", "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_gpu_canvas_configuration.cc", "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_gpu_canvas_configuration.h", "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_gpu_color_dict.cc",
diff --git a/third_party/blink/renderer/bindings/modules/v8/serialization/v8_script_value_deserializer_for_modules.cc b/third_party/blink/renderer/bindings/modules/v8/serialization/v8_script_value_deserializer_for_modules.cc index cf11e8d..111d5d6da 100644 --- a/third_party/blink/renderer/bindings/modules/v8/serialization/v8_script_value_deserializer_for_modules.cc +++ b/third_party/blink/renderer/bindings/modules/v8/serialization/v8_script_value_deserializer_for_modules.cc
@@ -531,7 +531,12 @@ return nullptr; } - return MediaStreamTrack::Create(ExecutionContext::From(GetScriptState())); + base::UnguessableToken session_id; + if (!ReadUnguessableToken(&session_id)) + return nullptr; + + return MediaStreamTrack::Create(ExecutionContext::From(GetScriptState()), + session_id); } } // namespace blink
diff --git a/third_party/blink/renderer/bindings/modules/v8/serialization/v8_script_value_serializer_for_modules.cc b/third_party/blink/renderer/bindings/modules/v8/serialization/v8_script_value_serializer_for_modules.cc index 8a0527a..cad79a2 100644 --- a/third_party/blink/renderer/bindings/modules/v8/serialization/v8_script_value_serializer_for_modules.cc +++ b/third_party/blink/renderer/bindings/modules/v8/serialization/v8_script_value_serializer_for_modules.cc
@@ -234,7 +234,8 @@ return false; } - return WriteMediaStreamTrack(); + return WriteMediaStreamTrack(wrappable->ToImpl<MediaStreamTrack>(), + exception_state); } return false; } @@ -505,9 +506,18 @@ return true; } -bool V8ScriptValueSerializerForModules::WriteMediaStreamTrack() { - WriteTag(kMediaStreamTrack); +bool V8ScriptValueSerializerForModules::WriteMediaStreamTrack( + MediaStreamTrack* track, + ExceptionState& exception_state) { + if (!track->serializable_session_id()) { + exception_state.ThrowDOMException( + DOMExceptionCode::kDataCloneError, + "MediaStreamTrack could not be serialized."); + return false; + } + WriteTag(kMediaStreamTrack); + WriteUnguessableToken(*track->serializable_session_id()); return true; }
diff --git a/third_party/blink/renderer/bindings/modules/v8/serialization/v8_script_value_serializer_for_modules.h b/third_party/blink/renderer/bindings/modules/v8/serialization/v8_script_value_serializer_for_modules.h index 63a59b8b..612a642 100644 --- a/third_party/blink/renderer/bindings/modules/v8/serialization/v8_script_value_serializer_for_modules.h +++ b/third_party/blink/renderer/bindings/modules/v8/serialization/v8_script_value_serializer_for_modules.h
@@ -53,7 +53,8 @@ bool WriteMediaAudioBuffer(scoped_refptr<media::AudioBuffer>); bool WriteDecoderBuffer(scoped_refptr<media::DecoderBuffer> data, bool for_audio); - bool WriteMediaStreamTrack(); + bool WriteMediaStreamTrack(MediaStreamTrack* track, + ExceptionState& exception_state); }; } // namespace blink
diff --git a/third_party/blink/renderer/bindings/modules/v8/serialization/v8_script_value_serializer_for_modules_test.cc b/third_party/blink/renderer/bindings/modules/v8/serialization/v8_script_value_serializer_for_modules_test.cc index d81accc..7ddb99b 100644 --- a/third_party/blink/renderer/bindings/modules/v8/serialization/v8_script_value_serializer_for_modules_test.cc +++ b/third_party/blink/renderer/bindings/modules/v8/serialization/v8_script_value_serializer_for_modules_test.cc
@@ -34,6 +34,7 @@ #include "third_party/blink/renderer/modules/crypto/crypto_result_impl.h" #include "third_party/blink/renderer/modules/filesystem/dom_file_system.h" #include "third_party/blink/renderer/modules/mediastream/media_stream_track.h" +#include "third_party/blink/renderer/modules/mediastream/mock_media_stream_video_source.h" #include "third_party/blink/renderer/modules/peerconnection/rtc_certificate.h" #include "third_party/blink/renderer/modules/peerconnection/rtc_certificate_generator.h" #include "third_party/blink/renderer/modules/webcodecs/allow_shared_buffer_source_util.h" @@ -1185,6 +1186,13 @@ MediaStreamSource* source = MakeGarbageCollected<MediaStreamSource>( "test_id", MediaStreamSource::StreamType::kTypeVideo, "test_name", false /* remote */); + std::unique_ptr<MockMediaStreamVideoSource> mock_source( + base::WrapUnique(new MockMediaStreamVideoSource())); + MediaStreamDevice device; + base::UnguessableToken token = base::UnguessableToken::Create(); + device.set_session_id(token); + mock_source->SetDevice(device); + source->SetPlatformSource(std::move(mock_source)); MediaStreamComponent* component = MakeGarbageCollected<MediaStreamComponent>(source); MediaStreamTrack* blink_track = MakeGarbageCollected<MediaStreamTrack>( @@ -1203,5 +1211,31 @@ V8MediaStreamTrack::ToImpl(result.As<v8::Object>()); EXPECT_EQ(new_track->label(), "dummy"); } + +TEST(V8ScriptValueSerializerForModulesTest, + TransferMediaStreamTrackNoSessionIdThrows) { + V8TestingScope scope; + ExceptionState exception_state(scope.GetIsolate(), + ExceptionState::kExecutionContext, "Window", + "postMessage"); + + MediaStreamSource* source = MakeGarbageCollected<MediaStreamSource>( + "test_id", MediaStreamSource::StreamType::kTypeVideo, "test_name", + false /* remote */); + MediaStreamComponent* component = + MakeGarbageCollected<MediaStreamComponent>(source); + MediaStreamTrack* blink_track = MakeGarbageCollected<MediaStreamTrack>( + scope.GetExecutionContext(), component); + + // Transfer a MediaStreamTrack with no session id should throw an error. + Transferables transferables; + transferables.media_stream_tracks.push_back(blink_track); + v8::Local<v8::Value> wrapper = ToV8(blink_track, scope.GetScriptState()); + EXPECT_FALSE(V8ScriptValueSerializer(scope.GetScriptState()) + .Serialize(wrapper, exception_state)); + EXPECT_TRUE(HadDOMExceptionInModulesTest( + "DataCloneError", scope.GetScriptState(), exception_state)); +} + } // namespace } // namespace blink
diff --git a/third_party/blink/renderer/controller/BUILD.gn b/third_party/blink/renderer/controller/BUILD.gn index a789586..8fd0fb4 100644 --- a/third_party/blink/renderer/controller/BUILD.gn +++ b/third_party/blink/renderer/controller/BUILD.gn
@@ -197,6 +197,7 @@ "//third_party/blink/renderer/core:testing", "//third_party/blink/renderer/core:unit_test_support", "//third_party/blink/renderer/modules:modules", + "//third_party/blink/renderer/modules/mediastream:test_support", "//third_party/blink/renderer/platform:platform", "//third_party/blink/renderer/platform:test_support", ]
diff --git a/third_party/blink/renderer/controller/crash_memory_metrics_reporter_impl.cc b/third_party/blink/renderer/controller/crash_memory_metrics_reporter_impl.cc index 7720c75..c0259841 100644 --- a/third_party/blink/renderer/controller/crash_memory_metrics_reporter_impl.cc +++ b/third_party/blink/renderer/controller/crash_memory_metrics_reporter_impl.cc
@@ -31,7 +31,7 @@ } CrashMemoryMetricsReporterImpl::CrashMemoryMetricsReporterImpl() { - base::SetPartitionAllocOomCallback( + ::partition_alloc::SetPartitionAllocOomCallback( CrashMemoryMetricsReporterImpl::OnOOMCallback); }
diff --git a/third_party/blink/renderer/core/css/build.gni b/third_party/blink/renderer/core/css/build.gni index 8b22dfd0..aef0b83 100644 --- a/third_party/blink/renderer/core/css/build.gni +++ b/third_party/blink/renderer/core/css/build.gni
@@ -607,8 +607,6 @@ "style_element.h", "style_engine.cc", "style_engine.h", - "style_engine_context.cc", - "style_engine_context.h", "style_environment_variables.cc", "style_environment_variables.h", "style_invalidation_root.cc",
diff --git a/third_party/blink/renderer/core/css/css_style_sheet.cc b/third_party/blink/renderer/core/css/css_style_sheet.cc index ae6c0c7..5b87a0d 100644 --- a/third_party/blink/renderer/core/css/css_style_sheet.cc +++ b/third_party/blink/renderer/core/css/css_style_sheet.cc
@@ -555,9 +555,9 @@ return load_completed_; } -void CSSStyleSheet::StartLoadingDynamicSheet() { +void CSSStyleSheet::SetToPendingState() { SetLoadCompleted(false); - owner_node_->StartLoadingDynamicSheet(); + owner_node_->SetToPendingState(); } void CSSStyleSheet::SetLoadCompleted(bool completed) {
diff --git a/third_party/blink/renderer/core/css/css_style_sheet.h b/third_party/blink/renderer/core/css/css_style_sheet.h index 1f3b145..103fa3a 100644 --- a/third_party/blink/renderer/core/css/css_style_sheet.h +++ b/third_party/blink/renderer/core/css/css_style_sheet.h
@@ -212,7 +212,7 @@ bool SheetLoaded(); bool LoadCompleted() const { return load_completed_; } - void StartLoadingDynamicSheet(); + void SetToPendingState(); void SetText(const String&, CSSImportRules); void SetMedia(MediaList*); void SetAlternateFromConstructor(bool);
diff --git a/third_party/blink/renderer/core/css/style_element.cc b/third_party/blink/renderer/core/css/style_element.cc index c255d8e..200140f 100644 --- a/third_party/blink/renderer/core/css/style_element.cc +++ b/third_party/blink/renderer/core/css/style_element.cc
@@ -114,8 +114,9 @@ DCHECK(sheet_); if (sheet_->IsLoading()) { + DCHECK(IsSameObject(owner_element)); owner_element.GetDocument().GetStyleEngine().RemovePendingSheet( - owner_element, style_engine_context_); + owner_element); } sheet_.Release()->ClearOwnerNode(); @@ -129,6 +130,7 @@ StyleElement::ProcessingResult StyleElement::CreateSheet(Element& element, const String& text) { DCHECK(element.isConnected()); + DCHECK(IsSameObject(element)); Document& document = element.GetDocument(); ContentSecurityPolicy* csp = @@ -162,8 +164,8 @@ start_position_ == TextPosition::BelowRangePosition() ? TextPosition::MinimumPosition() : start_position_; - new_sheet = document.GetStyleEngine().CreateSheet( - element, text, start_position, style_engine_context_); + new_sheet = + document.GetStyleEngine().CreateSheet(element, text, start_position); new_sheet->SetMediaQueries(media_queries); loading_ = false; } @@ -189,13 +191,14 @@ if (IsLoading()) return false; - document.GetStyleEngine().RemovePendingSheet(*sheet_->ownerNode(), - style_engine_context_); + DCHECK(IsSameObject(*sheet_->ownerNode())); + document.GetStyleEngine().RemovePendingSheet(*sheet_->ownerNode()); return true; } -void StyleElement::StartLoadingDynamicSheet(Document& document) { - document.GetStyleEngine().AddPendingSheet(style_engine_context_); +void StyleElement::SetToPendingState(Document& document, Element& element) { + DCHECK(IsSameObject(element)); + document.GetStyleEngine().AddPendingSheet(element); } void StyleElement::Trace(Visitor* visitor) const {
diff --git a/third_party/blink/renderer/core/css/style_element.h b/third_party/blink/renderer/core/css/style_element.h index 4020bea9..11f910a 100644 --- a/third_party/blink/renderer/core/css/style_element.h +++ b/third_party/blink/renderer/core/css/style_element.h
@@ -22,7 +22,6 @@ #define THIRD_PARTY_BLINK_RENDERER_CORE_CSS_STYLE_ELEMENT_H_ #include "third_party/blink/renderer/core/css/css_style_sheet.h" -#include "third_party/blink/renderer/core/css/style_engine_context.h" #include "third_party/blink/renderer/platform/wtf/text/text_position.h" namespace blink { @@ -30,6 +29,7 @@ class ContainerNode; class Document; class Element; +class Node; class CORE_EXPORT StyleElement : public GarbageCollectedMixin { public: @@ -43,11 +43,16 @@ virtual const AtomicString& type() const = 0; virtual const AtomicString& media() const = 0; + // Returns whether |this| and |node| are the same object. Helps us verify + // parameter validity in certain member functions with an Element parameter + // which should only be called by a subclass with |this|. + virtual bool IsSameObject(const Node& node) const = 0; + CSSStyleSheet* sheet() const { return sheet_.Get(); } bool IsLoading() const; bool SheetLoaded(Document&); - void StartLoadingDynamicSheet(Document&); + void SetToPendingState(Document&, Element& element); void RemovedFrom(Element&, ContainerNode& insertion_point); ProcessingResult ProcessStyleSheet(Document&, Element&); @@ -65,7 +70,6 @@ bool loading_ : 1; bool registered_as_candidate_ : 1; TextPosition start_position_; - StyleEngineContext style_engine_context_; }; } // namespace blink
diff --git a/third_party/blink/renderer/core/css/style_engine.cc b/third_party/blink/renderer/core/css/style_engine.cc index 41e945c..21da7da0 100644 --- a/third_party/blink/renderer/core/css/style_engine.cc +++ b/third_party/blink/renderer/core/css/style_engine.cc
@@ -240,29 +240,31 @@ return *inspector_style_sheet_; } -void StyleEngine::AddPendingSheet(StyleEngineContext& context) { +void StyleEngine::AddPendingSheet(Node& style_sheet_candidate_node) { pending_script_blocking_stylesheets_++; - context.AddingPendingSheet(GetDocument()); - - if (context.AddedPendingSheetBeforeBody()) { - pending_render_blocking_stylesheets_++; - } else { + auto* manager = GetDocument().GetRenderBlockingResourceManager(); + bool is_render_blocking = + manager && manager->AddPendingStylesheet(style_sheet_candidate_node); + if (!is_render_blocking) { pending_parser_blocking_stylesheets_++; + if (GetDocument().body()) { + GetDocument().CountUse( + WebFeature::kPendingStylesheetAddedAfterBodyStarted); + } GetDocument().DidAddPendingParserBlockingStylesheet(); } } // This method is called whenever a top-level stylesheet has finished loading. -void StyleEngine::RemovePendingSheet(Node& style_sheet_candidate_node, - const StyleEngineContext& context) { +void StyleEngine::RemovePendingSheet(Node& style_sheet_candidate_node) { if (style_sheet_candidate_node.isConnected()) SetNeedsActiveStyleUpdate(style_sheet_candidate_node.GetTreeScope()); - if (context.AddedPendingSheetBeforeBody()) { - DCHECK_GT(pending_render_blocking_stylesheets_, 0); - pending_render_blocking_stylesheets_--; - } else { + auto* manager = GetDocument().GetRenderBlockingResourceManager(); + bool is_render_blocking = + manager && manager->RemovePendingStylesheet(style_sheet_candidate_node); + if (!is_render_blocking) { DCHECK_GT(pending_parser_blocking_stylesheets_, 0); pending_parser_blocking_stylesheets_--; if (!pending_parser_blocking_stylesheets_) @@ -737,12 +739,11 @@ CSSStyleSheet* StyleEngine::CreateSheet(Element& element, const String& text, - TextPosition start_position, - StyleEngineContext& context) { + TextPosition start_position) { DCHECK(element.GetDocument() == GetDocument()); CSSStyleSheet* style_sheet = nullptr; - AddPendingSheet(context); + AddPendingSheet(element); AtomicString text_content(text);
diff --git a/third_party/blink/renderer/core/css/style_engine.h b/third_party/blink/renderer/core/css/style_engine.h index 052b56e5..4b4f2d6b 100644 --- a/third_party/blink/renderer/core/css/style_engine.h +++ b/third_party/blink/renderer/core/css/style_engine.h
@@ -88,7 +88,6 @@ class DocumentStyleEnvironmentVariables; class CascadeLayerMap; class SpaceSplitString; -class StyleEngineContext; class StyleResolver; class StyleResolverStats; class StyleRuleFontFace; @@ -243,22 +242,15 @@ void SetPreferredStylesheetSetNameIfNotSet(const String&); void SetHttpDefaultStyle(const String&); - void AddPendingSheet(StyleEngineContext&); - void RemovePendingSheet(Node& style_sheet_candidate_node, - const StyleEngineContext&); + void AddPendingSheet(Node& style_sheet_candidate_node); + void RemovePendingSheet(Node& style_sheet_candidate_node); bool HasPendingScriptBlockingSheets() const { return pending_script_blocking_stylesheets_ > 0; } - bool HasPendingRenderBlockingSheets() const { - return pending_render_blocking_stylesheets_ > 0; - } bool HaveScriptBlockingStylesheetsLoaded() const { return !HasPendingScriptBlockingSheets(); } - bool HaveRenderBlockingStylesheetsLoaded() const { - return !HasPendingRenderBlockingSheets(); - } unsigned MaxDirectAdjacentSelectors() const { return GetRuleFeatureSet().MaxDirectAdjacentSelectors(); @@ -353,8 +345,7 @@ CSSStyleSheet* CreateSheet(Element&, const String& text, - WTF::TextPosition start_position, - StyleEngineContext&); + WTF::TextPosition start_position); void CollectFeaturesTo(RuleFeatureSet& features); @@ -737,14 +728,6 @@ int pending_script_blocking_stylesheets_{0}; // Tracks the number of currently loading top-level stylesheets which block - // rendering (the "Update the rendering" step of the event loop processing - // model) from starting. Sheets loaded using the @import directive are not - // included in this count. See: - // https://html.spec.whatwg.org/multipage/webappapis.html#event-loop-processing-model - // Once all of these sheets have loaded, rendering begins. - int pending_render_blocking_stylesheets_{0}; - - // Tracks the number of currently loading top-level stylesheets which block // the HTML parser. Sheets loaded using the @import directive are not included // in this count. Once all of these sheets have loaded, the parser may // continue.
diff --git a/third_party/blink/renderer/core/css/style_engine_context.cc b/third_party/blink/renderer/core/css/style_engine_context.cc deleted file mode 100644 index 6e79519b7..0000000 --- a/third_party/blink/renderer/core/css/style_engine_context.cc +++ /dev/null
@@ -1,47 +0,0 @@ -/* - * Copyright (C) 2016 Google, Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY GOOGLE INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "third_party/blink/renderer/core/css/style_engine_context.h" - -#include "third_party/blink/renderer/core/frame/web_feature.h" -#include "third_party/blink/renderer/platform/instrumentation/use_counter.h" - -namespace blink { - -StyleEngineContext::StyleEngineContext() - : added_pending_sheet_before_body_(false) {} - -void StyleEngineContext::AddingPendingSheet(const Document& document) { - // If the sheet was ever added before the body then all references to it are - // treated as before-body. - if (!added_pending_sheet_before_body_) { - added_pending_sheet_before_body_ = !document.body(); - if (!added_pending_sheet_before_body_) { - document.CountUse(WebFeature::kPendingStylesheetAddedAfterBodyStarted); - } - } -} - -} // namespace blink
diff --git a/third_party/blink/renderer/core/css/style_engine_context.h b/third_party/blink/renderer/core/css/style_engine_context.h deleted file mode 100644 index 2d6e6fc..0000000 --- a/third_party/blink/renderer/core/css/style_engine_context.h +++ /dev/null
@@ -1,27 +0,0 @@ -// Copyright (c) 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_CSS_STYLE_ENGINE_CONTEXT_H_ -#define THIRD_PARTY_BLINK_RENDERER_CORE_CSS_STYLE_ENGINE_CONTEXT_H_ - -#include "third_party/blink/renderer/core/dom/document.h" - -namespace blink { - -class CORE_EXPORT StyleEngineContext { - public: - StyleEngineContext(); - ~StyleEngineContext() = default; - bool AddedPendingSheetBeforeBody() const { - return added_pending_sheet_before_body_; - } - void AddingPendingSheet(const Document&); - - private: - bool added_pending_sheet_before_body_ : 1; -}; - -} // namespace blink - -#endif // THIRD_PARTY_BLINK_RENDERER_CORE_CSS_STYLE_ENGINE_CONTEXT_H_
diff --git a/third_party/blink/renderer/core/css/style_engine_test.cc b/third_party/blink/renderer/core/css/style_engine_test.cc index be39973..e7f8dac 100644 --- a/third_party/blink/renderer/core/css/style_engine_test.cc +++ b/third_party/blink/renderer/core/css/style_engine_test.cc
@@ -776,16 +776,15 @@ String sheet_text("div {}"); TextPosition min_pos = TextPosition::MinimumPosition(); - StyleEngineContext context; CSSStyleSheet* sheet1 = - GetStyleEngine().CreateSheet(*element, sheet_text, min_pos, context); + GetStyleEngine().CreateSheet(*element, sheet_text, min_pos); // Check that the first sheet is not using a cached StyleSheetContents. EXPECT_FALSE(sheet1->Contents()->IsUsedFromTextCache()); CSSStyleSheet* sheet2 = - GetStyleEngine().CreateSheet(*element, sheet_text, min_pos, context); + GetStyleEngine().CreateSheet(*element, sheet_text, min_pos); // Check that the second sheet uses the cached StyleSheetContents for the // first. @@ -802,7 +801,7 @@ element = MakeGarbageCollected<HTMLStyleElement>(GetDocument(), CreateElementFlags()); - sheet1 = GetStyleEngine().CreateSheet(*element, sheet_text, min_pos, context); + sheet1 = GetStyleEngine().CreateSheet(*element, sheet_text, min_pos); // Check that we did not use a cached StyleSheetContents after the garbage // collection.
diff --git a/third_party/blink/renderer/core/css/style_rule_import.cc b/third_party/blink/renderer/core/css/style_rule_import.cc index 7d867ea3..77e13af 100644 --- a/third_party/blink/renderer/core/css/style_rule_import.cc +++ b/third_party/blink/renderer/core/css/style_rule_import.cc
@@ -164,7 +164,7 @@ // the sheet being imported is pending. if (parent_style_sheet_ && parent_style_sheet_->LoadCompleted() && root_sheet == parent_style_sheet_) { - parent_style_sheet_->StartLoadingDynamicSheet(); + parent_style_sheet_->SetToPendingState(); } } }
diff --git a/third_party/blink/renderer/core/css/style_sheet_contents.cc b/third_party/blink/renderer/core/css/style_sheet_contents.cc index bae30e10..ce6a525 100644 --- a/third_party/blink/renderer/core/css/style_sheet_contents.cc +++ b/third_party/blink/renderer/core/css/style_sheet_contents.cc
@@ -481,19 +481,19 @@ ClearRuleSet(); } -void StyleSheetContents::StartLoadingDynamicSheet() { +void StyleSheetContents::SetToPendingState() { StyleSheetContents* root = RootStyleSheet(); for (const auto& client : root->loading_clients_) - client->StartLoadingDynamicSheet(); + client->SetToPendingState(); // Copy the completed clients to a vector for iteration. - // startLoadingDynamicSheet will move the style sheet from the completed state + // SetToPendingState() will move the style sheet from the completed state // to the loading state which modifies the set of completed clients. We // therefore need the copy in order to not modify the set of completed clients // while iterating it. HeapVector<Member<CSSStyleSheet>> completed_clients; CopyToVector(root->completed_clients_, completed_clients); for (unsigned i = 0; i < completed_clients.size(); ++i) - completed_clients[i]->StartLoadingDynamicSheet(); + completed_clients[i]->SetToPendingState(); } StyleSheetContents* StyleSheetContents::RootStyleSheet() const {
diff --git a/third_party/blink/renderer/core/css/style_sheet_contents.h b/third_party/blink/renderer/core/css/style_sheet_contents.h index 09e2db4..d65304a 100644 --- a/third_party/blink/renderer/core/css/style_sheet_contents.h +++ b/third_party/blink/renderer/core/css/style_sheet_contents.h
@@ -77,7 +77,10 @@ bool IsLoading() const; void CheckLoaded(); - void StartLoadingDynamicSheet(); + + // Called if this sheet has finished loading and then a dynamically added + // @import rule starts loading a child stylesheet. + void SetToPendingState(); StyleSheetContents* RootStyleSheet() const; bool HasSingleOwnerNode() const;
diff --git a/third_party/blink/renderer/core/dom/document.cc b/third_party/blink/renderer/core/dom/document.cc index 2be480e..efaa237 100644 --- a/third_party/blink/renderer/core/dom/document.cc +++ b/third_party/blink/renderer/core/dom/document.cc
@@ -3319,8 +3319,6 @@ void Document::WillInsertBody() { if (Loader()) fetcher_->LoosenLoadThrottlingPolicy(); - if (render_blocking_resource_manager_) - render_blocking_resource_manager_->WillInsertBody(); // If we get to the <body> try to resume commits since we should have content // to paint now. @@ -3487,7 +3485,7 @@ return; } - if (GetStyleEngine().HaveRenderBlockingStylesheetsLoaded()) + if (HaveRenderBlockingStylesheetsLoaded()) UpdateStyleAndLayout(DocumentUpdateReason::kUnknown); load_event_progress_ = kLoadEventCompleted; @@ -6590,8 +6588,7 @@ // the window load event too early. To avoid this we force the styles to be // up to date before calling FrameLoader::finishedParsing(). See // https://bugs.webkit.org/show_bug.cgi?id=36864 starting around comment 35. - if (!is_initial_empty_document_ && - GetStyleEngine().HaveRenderBlockingStylesheetsLoaded()) { + if (!is_initial_empty_document_ && HaveRenderBlockingStylesheetsLoaded()) { UpdateStyleAndLayoutTree(); } @@ -7406,12 +7403,14 @@ return style_engine_->HaveScriptBlockingStylesheetsLoaded(); } +bool Document::HaveRenderBlockingStylesheetsLoaded() const { + return !render_blocking_resource_manager_ || + !render_blocking_resource_manager_->HasPendingStylesheets(); +} + bool Document::HaveRenderBlockingResourcesLoaded() const { - // TODO(crbug.com/1271296): Unify the management of render-blocking - // stylesheets and other render-blocking resources. - return style_engine_->HaveRenderBlockingStylesheetsLoaded() && - (!render_blocking_resource_manager_ || - !render_blocking_resource_manager_->IsRenderBlocked()); + return !render_blocking_resource_manager_ || + !render_blocking_resource_manager_->HasRenderBlockingResources(); } Locale& Document::GetCachedLocale(const AtomicString& locale) { @@ -7597,9 +7596,8 @@ // TODO(tkent): Is this necessary? WPT spin-by-blocking-style-sheet.html // doesn't hit this condition, and FlushAutofocusCandidates() is not called // until the stylesheet is loaded. - StyleEngine& engine = GetStyleEngine(); - if (engine.HasPendingScriptBlockingSheets() || - engine.HasPendingRenderBlockingSheets()) { + if (GetStyleEngine().HasPendingScriptBlockingSheets() || + !HaveRenderBlockingStylesheetsLoaded()) { return; } @@ -8149,7 +8147,11 @@ } void Document::RenderBlockingResourceUnblocked() { - BeginLifecycleUpdatesIfRenderingReady(); + // Only HTML documents can ever be render-blocked by external resources. + // https://html.spec.whatwg.org/#allows-adding-render-blocking-elements + DCHECK(IsA<HTMLDocument>(this)); + if (body()) + BeginLifecycleUpdatesIfRenderingReady(); } void Document::SetFindInPageActiveMatchNode(Node* node) {
diff --git a/third_party/blink/renderer/core/dom/document.h b/third_party/blink/renderer/core/dom/document.h index d89207c3..121c98393 100644 --- a/third_party/blink/renderer/core/dom/document.h +++ b/third_party/blink/renderer/core/dom/document.h
@@ -1665,6 +1665,7 @@ // Return true if any accessibility contexts have been enabled. bool IsAccessibilityEnabled() const { return !ax_contexts_.IsEmpty(); } + bool HaveRenderBlockingStylesheetsLoaded() const; bool HaveRenderBlockingResourcesLoaded() const; // Sets a beforeunload handler for documents which are embedding plugins. This
diff --git a/third_party/blink/renderer/core/dom/node.h b/third_party/blink/renderer/core/dom/node.h index 0e84f29..c42579f 100644 --- a/third_party/blink/renderer/core/dom/node.h +++ b/third_party/blink/renderer/core/dom/node.h
@@ -420,7 +420,7 @@ }; virtual void NotifyLoadedSheetAndAllCriticalSubresources( LoadedSheetErrorStatus) {} - virtual void StartLoadingDynamicSheet() { NOTREACHED(); } + virtual void SetToPendingState() { NOTREACHED(); } bool HasName() const { DCHECK(!IsTextNode());
diff --git a/third_party/blink/renderer/core/dom/processing_instruction.cc b/third_party/blink/renderer/core/dom/processing_instruction.cc index ca905e7..a8361f2 100644 --- a/third_party/blink/renderer/core/dom/processing_instruction.cc +++ b/third_party/blink/renderer/core/dom/processing_instruction.cc
@@ -169,7 +169,7 @@ } else { params.SetCharset(charset.IsEmpty() ? GetDocument().Encoding() : WTF::TextEncoding(charset)); - GetDocument().GetStyleEngine().AddPendingSheet(style_engine_context_); + GetDocument().GetStyleEngine().AddPendingSheet(*this); CSSStyleSheetResource::Fetch(params, GetDocument().Fetcher(), this); } } @@ -295,8 +295,7 @@ void ProcessingInstruction::RemovePendingSheet() { if (is_xsl_) return; - GetDocument().GetStyleEngine().RemovePendingSheet(*this, - style_engine_context_); + GetDocument().GetStyleEngine().RemovePendingSheet(*this); } void ProcessingInstruction::Trace(Visitor* visitor) const {
diff --git a/third_party/blink/renderer/core/dom/processing_instruction.h b/third_party/blink/renderer/core/dom/processing_instruction.h index 79a9ef9d..dbb8922 100644 --- a/third_party/blink/renderer/core/dom/processing_instruction.h +++ b/third_party/blink/renderer/core/dom/processing_instruction.h
@@ -22,7 +22,6 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_DOM_PROCESSING_INSTRUCTION_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_DOM_PROCESSING_INSTRUCTION_H_ -#include "third_party/blink/renderer/core/css/style_engine_context.h" #include "third_party/blink/renderer/core/dom/character_data.h" #include "third_party/blink/renderer/platform/loader/fetch/resource_client.h" #include "third_party/blink/renderer/platform/wtf/casting.h" @@ -95,7 +94,6 @@ String title_; String media_; Member<StyleSheet> sheet_; - StyleEngineContext style_engine_context_; bool loading_; bool alternate_; bool is_css_;
diff --git a/third_party/blink/renderer/core/exported/web_node_test.cc b/third_party/blink/renderer/core/exported/web_node_test.cc index 55ccc546..bd3db4dc 100644 --- a/third_party/blink/renderer/core/exported/web_node_test.cc +++ b/third_party/blink/renderer/core/exported/web_node_test.cc
@@ -79,7 +79,7 @@ WebNode input_node(GetDocument().getElementById("focusable")); EXPECT_FALSE(input_node.IsFocusable()); - EXPECT_TRUE(GetDocument().GetStyleEngine().HasPendingRenderBlockingSheets()); + EXPECT_FALSE(GetDocument().HaveRenderBlockingStylesheetsLoaded()); main_resource.Finish(); css_resource.Complete("dummy {}");
diff --git a/third_party/blink/renderer/core/exported/web_view_impl.cc b/third_party/blink/renderer/core/exported/web_view_impl.cc index 9e7af740..980651077 100644 --- a/third_party/blink/renderer/core/exported/web_view_impl.cc +++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
@@ -1406,8 +1406,8 @@ DocumentLifecycle::kPaintClean); auto* builder = MakeGarbageCollected<PaintRecordBuilder>(); - main_view.PaintOutsideOfLifecycle(builder->Context(), PaintFlag::kNoFlag, - CullRect(rect)); + main_view.PaintOutsideOfLifecycleWithThrottlingAllowed( + builder->Context(), PaintFlag::kNoFlag, CullRect(rect)); // Don't bother to save/restore here as the caller is expecting the canvas // to be modified and take care of it. canvas->clipRect(gfx::RectToSkRect(rect));
diff --git a/third_party/blink/renderer/core/frame/attribution_src_loader.cc b/third_party/blink/renderer/core/frame/attribution_src_loader.cc index af64b0d6..f07727d2 100644 --- a/third_party/blink/renderer/core/frame/attribution_src_loader.cc +++ b/third_party/blink/renderer/core/frame/attribution_src_loader.cc
@@ -21,6 +21,7 @@ #include "third_party/blink/renderer/core/frame/local_frame.h" #include "third_party/blink/renderer/core/frame/local_frame_client.h" #include "third_party/blink/renderer/core/html/html_image_element.h" +#include "third_party/blink/renderer/platform/heap/persistent.h" #include "third_party/blink/renderer/platform/loader/cors/cors.h" #include "third_party/blink/renderer/platform/loader/fetch/fetch_context.h" #include "third_party/blink/renderer/platform/loader/fetch/fetch_initiator_type_names.h" @@ -133,14 +134,13 @@ if (!src_url.ProtocolIsInHTTPFamily()) return RegisterResult::kInvalidProtocol; - ExecutionContext* execution_context = - local_frame_->GetDocument()->GetExecutionContext(); - if (!RuntimeEnabledFeatures::ConversionMeasurementEnabled( - execution_context)) { - return RegisterResult::kNotAllowed; - } + LocalDOMWindow* window = local_frame_->DomWindow(); + Document* document = window->document(); - const bool feature_policy_enabled = execution_context->IsFeatureEnabled( + if (!RuntimeEnabledFeatures::ConversionMeasurementEnabled(window)) + return RegisterResult::kNotAllowed; + + const bool feature_policy_enabled = window->IsFeatureEnabled( mojom::blink::PermissionsPolicyFeature::kAttributionReporting); if (!feature_policy_enabled) { @@ -150,7 +150,7 @@ } // The API is only allowed in secure contexts. - if (!execution_context->IsSecureContext()) { + if (!window->IsSecureContext()) { LogAuditIssue( AttributionReportingIssueType::kAttributionSourceUntrustworthyOrigin, local_frame_->GetSecurityContext()->GetSecurityOrigin()->ToString(), @@ -167,7 +167,20 @@ return RegisterResult::kUntrustworthyOrigin; } - // TODO(crbug.com/1302680): Defer handling if the document is prerendering. + if (document->IsPrerendering()) { + document->AddPostPrerenderingActivationStep( + WTF::Bind(&AttributionSrcLoader::DoRegistration, + WrapPersistentIfNeeded(this), src_url)); + } else { + DoRegistration(src_url); + } + + return RegisterResult::kSuccess; +} + +void AttributionSrcLoader::DoRegistration(const KURL& src_url) { + if (!local_frame_->IsAttached()) + return; ResourceRequest request(src_url); request.SetHttpMethod(http_names::kGET); @@ -184,7 +197,6 @@ auto* client = MakeGarbageCollected<ResourceClient>(this); resource_clients_.insert(client); RawResource::Fetch(params, local_frame_->DomWindow()->Fetcher(), client); - return RegisterResult::kSuccess; } String AttributionSrcLoader::ResourceClient::DebugName() const {
diff --git a/third_party/blink/renderer/core/frame/attribution_src_loader.h b/third_party/blink/renderer/core/frame/attribution_src_loader.h index e2620cc..6354157 100644 --- a/third_party/blink/renderer/core/frame/attribution_src_loader.h +++ b/third_party/blink/renderer/core/frame/attribution_src_loader.h
@@ -49,6 +49,8 @@ private: class ResourceClient; + void DoRegistration(const KURL& src_url); + void LogAuditIssue(AttributionReportingIssueType issue_type, const String& string, HTMLElement* element = nullptr);
diff --git a/third_party/blink/renderer/core/frame/local_frame_view.cc b/third_party/blink/renderer/core/frame/local_frame_view.cc index 3eae9f4..ea712c4c 100644 --- a/third_party/blink/renderer/core/frame/local_frame_view.cc +++ b/third_party/blink/renderer/core/frame/local_frame_view.cc
@@ -4057,7 +4057,6 @@ SCOPED_UMA_AND_UKM_TIMER(EnsureUkmAggregator(), LocalFrameUkmAggregator::kPaint); - AllowThrottlingScope allow_throttling(*this); ForAllNonThrottledLocalFrameViews([](LocalFrameView& frame_view) { frame_view.Lifecycle().AdvanceTo(DocumentLifecycle::kInPaint); }); @@ -4073,6 +4072,14 @@ }); } +void LocalFrameView::PaintOutsideOfLifecycleWithThrottlingAllowed( + GraphicsContext& context, + const PaintFlags paint_flags, + const CullRect& cull_rect) { + AllowThrottlingScope allow_throttling(*this); + PaintOutsideOfLifecycle(context, paint_flags, cull_rect); +} + void LocalFrameView::PaintForTest(const CullRect& cull_rect) { AllowThrottlingScope allow_throttling(*this); Lifecycle().AdvanceTo(DocumentLifecycle::kInPaint);
diff --git a/third_party/blink/renderer/core/frame/local_frame_view.h b/third_party/blink/renderer/core/frame/local_frame_view.h index bd3feafb..1805b4a 100644 --- a/third_party/blink/renderer/core/frame/local_frame_view.h +++ b/third_party/blink/renderer/core/frame/local_frame_view.h
@@ -346,11 +346,11 @@ bool IsUpdatingLifecycle() const; - // Run all needed lifecycle stages. After calling this method, all frames will - // be in the lifecycle state PaintClean. If lifecycle throttling is allowed - // (see AllowThrottlingScope), some frames may skip the lifecycle update - // (e.g., based on visibility) and will not end up being PaintClean. Set - // |reason| to indicate the reason for this update, for metrics purposes. + // Run all needed lifecycle stages. After calling this method, all + // non-throttled frames will be in the lifecycle state PaintClean. + // AllowThrottlingScope is used to allow frame throttling. Throttled frames + // will skip the lifecycle update and will not end up being PaintClean. + // Set |reason| to indicate the reason for this update, for metrics purposes. // Returns whether the lifecycle was successfully updated to PaintClean. bool UpdateAllLifecyclePhases(DocumentUpdateReason reason); @@ -359,9 +359,11 @@ bool UpdateAllLifecyclePhasesForTest(); // Computes the style, layout, compositing and pre-paint lifecycle stages - // if needed. + // if needed. Frame throttling is not enabled by default. // After calling this method, all frames will be in a lifecycle - // state >= PrePaintClean, unless the frame was throttled or inactive. + // state >= PrePaintClean, unless the frame was throttled (if frame + // throttling, which is not allowed by default, is allowed by the caller) or + // inactive. // Returns whether the lifecycle was successfully updated to the // desired state. bool UpdateAllLifecyclePhasesExceptPaint(DocumentUpdateReason reason); @@ -369,6 +371,8 @@ // Printing needs everything up-to-date except paint (which will be done // specially). We may also print a detached frame or a descendant of a // detached frame and need special handling of the frame. + // Frame throttling is not allowed by default. Normally we don't want to + // throttle frames for printing. void UpdateLifecyclePhasesForPrinting(); // TODO(pdr): Remove this in favor of |UpdateAllLifecyclePhasesExceptPaint|. @@ -376,14 +380,17 @@ // Computes the style, layout, and compositing inputs lifecycle stages if // needed. After calling this method, all frames will be in a lifecycle state - // >= CompositingInputsClean, unless the frame was throttled or inactive. + // >= CompositingInputsClean, unless the frame was throttled (if frame + // throttling, which is not allowed by default, is allowed by the caller) or + // inactive. // Returns whether the lifecycle was successfully updated to the // desired state. bool UpdateLifecycleToCompositingInputsClean(DocumentUpdateReason reason); // Computes only the style and layout lifecycle stages. // After calling this method, all frames will be in a lifecycle - // state >= LayoutClean, unless the frame was throttled or inactive. + // state >= LayoutClean, unless the frame was throttled (if frame throttling, + // which is not allowed by default, is allowed by the caller) or inactive. // Returns whether the lifecycle was successfully updated to the // desired state. bool UpdateLifecycleToLayoutClean(DocumentUpdateReason reason); @@ -570,6 +577,16 @@ // PaintController other than the default one(s). The following functions are // provided for these cases. This frame view must be in PrePaintClean or // PaintClean state when these functions are called. + // AllowThrottlingScope is used to allow frame throttling. + void PaintOutsideOfLifecycleWithThrottlingAllowed( + GraphicsContext&, + PaintFlags, + const CullRect& cull_rect = CullRect::Infinite()); + + // Same as the above, but frame throttling is not allowed by default. If this + // function is called without frame throttling allowed, the caller must have + // just updated the document lifecycle to PrePaintClean or PaintClean without + // frame throttling allowed. void PaintOutsideOfLifecycle( GraphicsContext&, PaintFlags,
diff --git a/third_party/blink/renderer/core/html/fenced_frame/html_fenced_frame_element.cc b/third_party/blink/renderer/core/html/fenced_frame/html_fenced_frame_element.cc index d840aea2..d7e8e33b 100644 --- a/third_party/blink/renderer/core/html/fenced_frame/html_fenced_frame_element.cc +++ b/third_party/blink/renderer/core/html/fenced_frame/html_fenced_frame_element.cc
@@ -8,6 +8,7 @@ #include "third_party/blink/public/common/frame/fenced_frame_sandbox_flags.h" #include "third_party/blink/public/mojom/devtools/console_message.mojom-blink.h" #include "third_party/blink/public/mojom/web_feature/web_feature.mojom-blink.h" +#include "third_party/blink/renderer/core/css/style_change_reason.h" #include "third_party/blink/renderer/core/dom/document.h" #include "third_party/blink/renderer/core/dom/shadow_root.h" #include "third_party/blink/renderer/core/execution_context/execution_context.h" @@ -62,6 +63,21 @@ DocumentFencedFrames::From(GetDocument()).DeregisterFencedFrame(this); } +void HTMLFencedFrameElement::SetCollapsed(bool collapse) { + if (collapsed_by_client_ == collapse) + return; + + collapsed_by_client_ = collapse; + + // This is always called in response to an IPC, so should not happen in the + // middle of a style recalc. + DCHECK(!GetDocument().InStyleRecalc()); + + // Trigger style recalc to trigger layout tree re-attachment. + SetNeedsStyleRecalc(kLocalStyleChange, StyleChangeReasonForTracing::Create( + style_change_reason::kFrame)); +} + // START HTMLFencedFrameElement::FencedFrameDelegate. HTMLFencedFrameElement::FencedFrameDelegate* @@ -211,6 +227,12 @@ } } +bool HTMLFencedFrameElement::LayoutObjectIsNeeded( + const ComputedStyle& style) const { + return !collapsed_by_client_ && + HTMLFrameOwnerElement::LayoutObjectIsNeeded(style); +} + LayoutObject* HTMLFencedFrameElement::CreateLayoutObject( const ComputedStyle& style, LegacyLayout legacy_layout) {
diff --git a/third_party/blink/renderer/core/html/fenced_frame/html_fenced_frame_element.h b/third_party/blink/renderer/core/html/fenced_frame/html_fenced_frame_element.h index 1d3a653..83cc3808 100644 --- a/third_party/blink/renderer/core/html/fenced_frame/html_fenced_frame_element.h +++ b/third_party/blink/renderer/core/html/fenced_frame/html_fenced_frame_element.h
@@ -69,6 +69,7 @@ NOTREACHED(); return ParsedPermissionsPolicy(); } + void SetCollapsed(bool) override; // HTMLElement overrides. bool IsHTMLFencedFrameElement() const final { return true; } @@ -114,6 +115,7 @@ const QualifiedName&, const AtomicString&, MutableCSSPropertyValueSet*) override; + bool LayoutObjectIsNeeded(const ComputedStyle&) const override; LayoutObject* CreateLayoutObject(const ComputedStyle&, LegacyLayout) override; void AttachLayoutTree(AttachContext& context) override; bool SupportsFocus() const override; @@ -139,6 +141,7 @@ absl::optional<PhysicalSize> frozen_frame_size_; absl::optional<PhysicalRect> content_rect_; bool should_freeze_frame_size_on_next_layout_ = false; + bool collapsed_by_client_ = false; friend class ResizeObserverDelegate; };
diff --git a/third_party/blink/renderer/core/html/forms/resources/picker_common.js b/third_party/blink/renderer/core/html/forms/resources/picker_common.js index 62dfb5c..9779f175 100644 --- a/third_party/blink/renderer/core/html/forms/resources/picker_common.js +++ b/third_party/blink/renderer/core/html/forms/resources/picker_common.js
@@ -250,40 +250,39 @@ return null; } -/** - * @constructor - */ -function EventEmitter() { -} +// ---------------------------------------------------------------- -{ +class EventEmitter { + constructor() { + } + /** * @param {!string} type * @param {!function({...*})} callback */ - EventEmitter.prototype.on = function(type, callback) { + on(type, callback) { console.assert(callback instanceof Function); if (!this._callbacks) this._callbacks = {}; if (!this._callbacks[type]) this._callbacks[type] = []; this._callbacks[type].push(callback); - }; + } - EventEmitter.prototype.hasListener = function(type) { + hasListener(type) { if (!this._callbacks) return false; var callbacksForType = this._callbacks[type]; if (!callbacksForType) return false; return callbacksForType.length > 0; - }; + } /** * @param {!string} type * @param {!function(Object)} callback */ - EventEmitter.prototype.removeListener = function(type, callback) { + removeListener(type, callback) { if (!this._callbacks) return; var callbacksForType = this._callbacks[type]; @@ -292,13 +291,13 @@ callbacksForType.splice(callbacksForType.indexOf(callback), 1); if (callbacksForType.length === 0) delete this._callbacks[type]; - }; + } /** * @param {!string} type * @param {...*} var_args */ - EventEmitter.prototype.dispatchEvent = function(type) { + dispatchEvent(type) { if (!this._callbacks) return; var callbacksForType = this._callbacks[type]; @@ -308,7 +307,7 @@ for (var i = 0; i < callbacksForType.length; ++i) { callbacksForType[i].apply(this, Array.prototype.slice.call(arguments, 1)); } - }; + } } // ----------------------------------------------------------------
diff --git a/third_party/blink/renderer/core/html/html_link_element.cc b/third_party/blink/renderer/core/html/html_link_element.cc index a738425e9..35cd4d6 100644 --- a/third_party/blink/renderer/core/html/html_link_element.cc +++ b/third_party/blink/renderer/core/html/html_link_element.cc
@@ -374,9 +374,9 @@ std::make_unique<IncrementLoadEventDelayCount>(GetDocument()))); } -void HTMLLinkElement::StartLoadingDynamicSheet() { +void HTMLLinkElement::SetToPendingState() { DCHECK(GetLinkStyle()); - GetLinkStyle()->StartLoadingDynamicSheet(); + GetLinkStyle()->SetToPendingState(); } bool HTMLLinkElement::IsURLAttribute(const Attribute& attribute) const {
diff --git a/third_party/blink/renderer/core/html/html_link_element.h b/third_party/blink/renderer/core/html/html_link_element.h index 30cc03b..905e62f 100644 --- a/third_party/blink/renderer/core/html/html_link_element.h +++ b/third_party/blink/renderer/core/html/html_link_element.h
@@ -150,7 +150,7 @@ bool SheetLoaded() override; void NotifyLoadedSheetAndAllCriticalSubresources( LoadedSheetErrorStatus) override; - void StartLoadingDynamicSheet() override; + void SetToPendingState() override; void FinishParsingChildren() override; bool HasActivationBehavior() const override;
diff --git a/third_party/blink/renderer/core/html/html_style_element.h b/third_party/blink/renderer/core/html/html_style_element.h index f0642d5..f2e6e84 100644 --- a/third_party/blink/renderer/core/html/html_style_element.h +++ b/third_party/blink/renderer/core/html/html_style_element.h
@@ -67,13 +67,15 @@ } void NotifyLoadedSheetAndAllCriticalSubresources( LoadedSheetErrorStatus) override; - void StartLoadingDynamicSheet() override { - StyleElement::StartLoadingDynamicSheet(GetDocument()); + void SetToPendingState() override { + StyleElement::SetToPendingState(GetDocument(), *this); } const AtomicString& media() const override; const AtomicString& type() const override; + bool IsSameObject(const Node& node) const override { return this == &node; } + Member<BlockingAttribute> blocking_attribute_; };
diff --git a/third_party/blink/renderer/core/html/link_resource.h b/third_party/blink/renderer/core/html/link_resource.h index bbad4499..62b10ffd 100644 --- a/third_party/blink/renderer/core/html/link_resource.h +++ b/third_party/blink/renderer/core/html/link_resource.h
@@ -71,7 +71,7 @@ WTF::TextEncoding GetCharset() const; ExecutionContext* GetExecutionContext(); - Member<HTMLLinkElement> owner_; + const Member<HTMLLinkElement> owner_; }; } // namespace blink
diff --git a/third_party/blink/renderer/core/html/link_style.cc b/third_party/blink/renderer/core/html/link_style.cc index 8086abb9..bd1db252 100644 --- a/third_party/blink/renderer/core/html/link_style.cc +++ b/third_party/blink/renderer/core/html/link_style.cc
@@ -150,7 +150,7 @@ fired_load_ = true; } -void LinkStyle::StartLoadingDynamicSheet() { +void LinkStyle::SetToPendingState() { DCHECK_LT(pending_sheet_type_, kBlocking); AddPendingSheet(kBlocking); } @@ -176,7 +176,7 @@ if (pending_sheet_type_ == kNonBlocking) return; - GetDocument().GetStyleEngine().AddPendingSheet(style_engine_context_); + GetDocument().GetStyleEngine().AddPendingSheet(*owner_); } void LinkStyle::RemovePendingSheet() { @@ -192,8 +192,7 @@ return; } - GetDocument().GetStyleEngine().RemovePendingSheet(*owner_, - style_engine_context_); + GetDocument().GetStyleEngine().RemovePendingSheet(*owner_); } void LinkStyle::SetDisabledState(bool disabled) { @@ -281,7 +280,10 @@ // Don't hold up layout tree construction and script execution on // stylesheets that are not needed for the layout at the moment. bool critical_style = media_query_matches && !owner_->IsAlternate(); - bool render_blocking = critical_style && owner_->IsCreatedByParser(); + bool render_blocking = + critical_style && (owner_->IsCreatedByParser() || + (RuntimeEnabledFeatures::BlockingAttributeEnabled() && + owner_->blocking().IsRenderBlocking())); AddPendingSheet(render_blocking ? kBlocking : kNonBlocking);
diff --git a/third_party/blink/renderer/core/html/link_style.h b/third_party/blink/renderer/core/html/link_style.h index 6e461f0..65d52b0 100644 --- a/third_party/blink/renderer/core/html/link_style.h +++ b/third_party/blink/renderer/core/html/link_style.h
@@ -6,7 +6,6 @@ #define THIRD_PARTY_BLINK_RENDERER_CORE_HTML_LINK_STYLE_H_ #include "third_party/blink/renderer/core/css/style_engine.h" -#include "third_party/blink/renderer/core/css/style_engine_context.h" #include "third_party/blink/renderer/core/dom/node.h" #include "third_party/blink/renderer/core/html/link_resource.h" #include "third_party/blink/renderer/core/loader/resource/css_style_sheet_resource.h" @@ -36,7 +35,7 @@ bool HasLoaded() const override { return loaded_sheet_; } void Trace(Visitor*) const override; - void StartLoadingDynamicSheet(); + void SetToPendingState(); void NotifyLoadedSheetAndAllCriticalSubresources( Node::LoadedSheetErrorStatus); bool SheetLoaded(); @@ -76,7 +75,6 @@ DisabledState disabled_state_; PendingSheetType pending_sheet_type_; RenderBlockingBehavior render_blocking_behavior_; - StyleEngineContext style_engine_context_; bool explicitly_enabled_; bool loading_; bool fired_load_;
diff --git a/third_party/blink/renderer/core/layout/layout_theme.cc b/third_party/blink/renderer/core/layout/layout_theme.cc index 09a6625..a8bc656 100644 --- a/third_party/blink/renderer/core/layout/layout_theme.cc +++ b/third_party/blink/renderer/core/layout/layout_theme.cc
@@ -279,8 +279,6 @@ case kSliderThumbHorizontalPart: case kSliderThumbVerticalPart: return AdjustSliderThumbStyle(style); - case kSearchFieldPart: - return AdjustSearchFieldStyle(style); case kSearchFieldCancelButtonPart: return AdjustSearchFieldCancelButtonStyle(style); default: @@ -508,8 +506,6 @@ void LayoutTheme::AdjustSliderThumbSize(ComputedStyle&) const {} -void LayoutTheme::AdjustSearchFieldStyle(ComputedStyle&) const {} - void LayoutTheme::AdjustSearchFieldCancelButtonStyle(ComputedStyle&) const {} void LayoutTheme::PlatformColorsDidChange() {
diff --git a/third_party/blink/renderer/core/layout/layout_theme.h b/third_party/blink/renderer/core/layout/layout_theme.h index b9d8ee7..0eb07c8e 100644 --- a/third_party/blink/renderer/core/layout/layout_theme.h +++ b/third_party/blink/renderer/core/layout/layout_theme.h
@@ -228,7 +228,6 @@ virtual void AdjustMenuListButtonStyle(ComputedStyle&) const; virtual void AdjustSliderContainerStyle(const Element&, ComputedStyle&) const; virtual void AdjustSliderThumbStyle(ComputedStyle&) const; - virtual void AdjustSearchFieldStyle(ComputedStyle&) const; virtual void AdjustSearchFieldCancelButtonStyle(ComputedStyle&) const; bool HasCustomFocusRingColor() const;
diff --git a/third_party/blink/renderer/core/layout/layout_theme_default.cc b/third_party/blink/renderer/core/layout/layout_theme_default.cc index ade9d0b8..3c25d2f 100644 --- a/third_party/blink/renderer/core/layout/layout_theme_default.cc +++ b/third_party/blink/renderer/core/layout/layout_theme_default.cc
@@ -205,11 +205,6 @@ } } -void LayoutThemeDefault::AdjustSearchFieldStyle(ComputedStyle& style) const { - // Ignore line-height. - style.SetLineHeight(ComputedStyleInitialValues::InitialLineHeight()); -} - void LayoutThemeDefault::AdjustSearchFieldCancelButtonStyle( ComputedStyle& style) const { // Scale the button size based on the font size
diff --git a/third_party/blink/renderer/core/layout/layout_theme_default.h b/third_party/blink/renderer/core/layout/layout_theme_default.h index 0b89614..5730745 100644 --- a/third_party/blink/renderer/core/layout/layout_theme_default.h +++ b/third_party/blink/renderer/core/layout/layout_theme_default.h
@@ -67,7 +67,6 @@ Color inactive_foreground_color) override; Color PlatformFocusRingColor() const override; - void AdjustSearchFieldStyle(ComputedStyle&) const override; void AdjustSearchFieldCancelButtonStyle(ComputedStyle&) const override; // MenuList refers to an unstyled menulist (meaning a menulist without
diff --git a/third_party/blink/renderer/core/layout/ng/ng_block_node.cc b/third_party/blink/renderer/core/layout/ng/ng_block_node.cc index 83e824ce..b1b892c 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_block_node.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_block_node.cc
@@ -2004,6 +2004,13 @@ box_->SetMargin(physical_margins); } +void NGBlockNode::StoreColumnInlineSize(LayoutUnit inline_size) { + LayoutMultiColumnFlowThread* flow_thread = + To<LayoutBlockFlow>(box_.Get())->MultiColumnFlowThread(); + flow_thread->SetLogicalWidth(inline_size); + flow_thread->ClearNeedsLayout(); +} + static bool g_devtools_layout = false; bool DevtoolsReadonlyLayoutScope::InDevtoolsLayout() { return g_devtools_layout;
diff --git a/third_party/blink/renderer/core/layout/ng/ng_block_node.h b/third_party/blink/renderer/core/layout/ng/ng_block_node.h index b177d58..87d097b 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_block_node.h +++ b/third_party/blink/renderer/core/layout/ng/ng_block_node.h
@@ -185,6 +185,9 @@ void StoreMargins(const NGConstraintSpace&, const NGBoxStrut& margins); void StoreMargins(const NGPhysicalBoxStrut& margins); + // Write the inline-size of columns in a multicol container to legacy. + void StoreColumnInlineSize(LayoutUnit); + static bool CanUseNewLayout(const LayoutBox&); bool CanUseNewLayout() const;
diff --git a/third_party/blink/renderer/core/layout/ng/ng_column_layout_algorithm.cc b/third_party/blink/renderer/core/layout/ng/ng_column_layout_algorithm.cc index d797c897..092c5c6 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_column_layout_algorithm.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_column_layout_algorithm.cc
@@ -234,6 +234,11 @@ column_inline_size_ = ResolveUsedColumnInlineSize(ChildAvailableSize().inline_size, Style()); + // Write the column inline-size back to the legacy flow thread if we're at the + // first fragment. TextAutosizer needs this. + if (!IsResumingLayout(BreakToken())) + node_.StoreColumnInlineSize(column_inline_size_); + column_inline_progression_ = column_inline_size_ + ResolveUsedColumnGap(ChildAvailableSize().inline_size, Style());
diff --git a/third_party/blink/renderer/core/layout/ng/ng_out_of_flow_layout_part.cc b/third_party/blink/renderer/core/layout/ng/ng_out_of_flow_layout_part.cc index 00d7e9c..8f868c15 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_out_of_flow_layout_part.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_out_of_flow_layout_part.cc
@@ -253,7 +253,18 @@ return false; TrackedLayoutBoxLinkedHashSet* legacy_objects = container_block->PositionedObjects(); - if (!legacy_objects || legacy_objects->size() == placed_objects->size()) { + + bool are_legacy_objects_already_placed = true; + if (legacy_objects) { + for (LayoutObject* legacy_object : *legacy_objects) { + if (!placed_objects->Contains(legacy_object)) { + are_legacy_objects_already_placed = false; + break; + } + } + } + + if (!legacy_objects || are_legacy_objects_already_placed) { if (!has_legacy_flex_box_ || performing_extra_legacy_check_) return false; // If there is an OOF legacy flex container, and PositionedObjects() are out
diff --git a/third_party/blink/renderer/core/layout/ng/ng_out_of_flow_layout_part_test.cc b/third_party/blink/renderer/core/layout/ng/ng_out_of_flow_layout_part_test.cc index 1665519..554db2d 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_out_of_flow_layout_part_test.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_out_of_flow_layout_part_test.cc
@@ -1937,5 +1937,30 @@ // It should still have two children: the relpos and the OOF. EXPECT_EQ(fragmentainer->Children().size(), 2u); } + +// https://crbug.com/1304371 +TEST_F(NGOutOfFlowLayoutPartTest, PositionedElementMulticolLegacyNGTree) { + ScopedLayoutNGBlockFragmentationForTest block_frag(false); + ScopedLayoutNGFlexFragmentationForTest flex_frag(false); + ScopedLayoutNGGridFragmentationForTest grid_frag(false); + ScopedLayoutNGPrintingForTest printing_frag(false); + ScopedLayoutNGTableFragmentationForTest table_frag(false); + ASSERT_FALSE(RuntimeEnabledFeatures::LayoutNGBlockFragmentationEnabled()); + + SetBodyInnerHTML( + R"HTML( + <div id="container" style="position: relative;"> + <div style="position: absolute;"> + </div> + <div style="column-count: 2;"> + <div id="target" style="position: absolute;">PASS</div> + </div> + </div> + )HTML"); + UpdateAllLifecyclePhasesForTest(); + + ASSERT_FALSE(GetElementById("target")->GetLayoutObject()->NeedsLayout()); +} + } // namespace } // namespace blink
diff --git a/third_party/blink/renderer/core/layout/ng/table/ng_table_section_layout_algorithm.cc b/third_party/blink/renderer/core/layout/ng/table/ng_table_section_layout_algorithm.cc index e4c19624..f33e06b 100644 --- a/third_party/blink/renderer/core/layout/ng/table/ng_table_section_layout_algorithm.cc +++ b/third_party/blink/renderer/core/layout/ng/table/ng_table_section_layout_algorithm.cc
@@ -6,6 +6,7 @@ #include "third_party/blink/renderer/core/layout/ng/ng_block_break_token.h" #include "third_party/blink/renderer/core/layout/ng/ng_block_child_iterator.h" +#include "third_party/blink/renderer/core/layout/ng/ng_box_fragment.h" #include "third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/ng/ng_fragmentation_utils.h" #include "third_party/blink/renderer/core/layout/ng/ng_out_of_flow_layout_part.h" @@ -73,12 +74,7 @@ NGConstraintSpace row_space = row_space_builder.ToConstraintSpace(); const NGLayoutResult* row_result = row.Layout(row_space, row_break_token); - LayoutUnit previously_consumed_row_block_size; if (ConstraintSpace().HasBlockFragmentation()) { - if (row_break_token) { - previously_consumed_row_block_size = - row_break_token->ConsumedBlockSize(); - } LayoutUnit fragmentainer_block_offset = ConstraintSpace().FragmentainerOffsetAtBfc() + offset.block_offset; NGBreakStatus break_status = BreakBeforeChildIfNeeded( @@ -88,15 +84,16 @@ break; } + const NGBoxFragment fragment( + table_data.table_writing_direction, + To<NGPhysicalBoxFragment>(row_result->PhysicalFragment())); + if (is_first_row) { - const NGPhysicalBoxFragment& physical_fragment = - To<NGPhysicalBoxFragment>(row_result->PhysicalFragment()); - DCHECK(physical_fragment.Baseline()); - section_baseline = physical_fragment.Baseline(); + DCHECK(fragment.Baseline()); + section_baseline = fragment.Baseline(); } container_builder_.AddResult(*row_result, offset); - offset.block_offset += table_data.rows[row_index].block_size - - previously_consumed_row_block_size; + offset.block_offset += fragment.BlockSize(); is_first_row = false; if (container_builder_.HasInflowChildBreakInside())
diff --git a/third_party/blink/renderer/core/layout/text_autosizer_test.cc b/third_party/blink/renderer/core/layout/text_autosizer_test.cc index fa858b2..4b63874 100644 --- a/third_party/blink/renderer/core/layout/text_autosizer_test.cc +++ b/third_party/blink/renderer/core/layout/text_autosizer_test.cc
@@ -950,6 +950,52 @@ target->GetLayoutObject()->StyleRef().ComputedFontSize()); } +TEST_F(TextAutosizerTest, MultiColumns2) { + Element* html = GetDocument().body()->parentElement(); + html->setInnerHTML( + "<head>" + " <meta name='viewport' content='width=800'>" + " <style>" + " html { font-size:16px;}" + " #mc {columns: 3; column-gap: 0;}" + " </style>" + "</head>" + "<body>" + " <div id='mc'>" + " <div id='target1'>" + " Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed " + " do eiusmod tempor incididunt ut labore et dolore magna aliqua." + " Ut enim ad minim veniam, quis nostrud exercitation ullamco " + " laboris nisi ut aliquip ex ea commodo consequat. Duis aute " + " irure dolor in reprehenderit in voluptate velit esse cillum " + " dolore eu fugiat nulla pariatur. Excepteur sint occaecat " + " cupidatat non proident, sunt in culpa qui officia deserunt " + " </div>" + " <div id='target2'>" + " Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed " + " do eiusmod tempor incididunt ut labore et dolore magna aliqua." + " Ut enim ad minim veniam, quis nostrud exercitation ullamco " + " laboris nisi ut aliquip ex ea commodo consequat. Duis aute " + " irure dolor in reprehenderit in voluptate velit esse cillum " + " dolore eu fugiat nulla pariatur. Excepteur sint occaecat " + " cupidatat non proident, sunt in culpa qui officia deserunt " + " </div>" + " </div>" + " <div> hello </div>" + "</body>", + ASSERT_NO_EXCEPTION); + UpdateAllLifecyclePhasesForTest(); + + Element* target1 = GetDocument().getElementById("target1"); + Element* target2 = GetDocument().getElementById("target2"); + // (specified font-size = 16px) * ( column width = 800px / 3) / + // (window width = 320px) < 16px. + EXPECT_FLOAT_EQ(16.f, + target1->GetLayoutObject()->StyleRef().ComputedFontSize()); + EXPECT_FLOAT_EQ(16.f, + target2->GetLayoutObject()->StyleRef().ComputedFontSize()); +} + TEST_F(TextAutosizerTest, ScaledbyDSF) { const float device_scale = 3; set_device_scale_factor(device_scale);
diff --git a/third_party/blink/renderer/core/loader/render_blocking_resource_manager.cc b/third_party/blink/renderer/core/loader/render_blocking_resource_manager.cc index 5d932155..de7098f4 100644 --- a/third_party/blink/renderer/core/loader/render_blocking_resource_manager.cc +++ b/third_party/blink/renderer/core/loader/render_blocking_resource_manager.cc
@@ -92,7 +92,7 @@ if (font_resource->IsLoaded()) return; - if (font_preload_timer_has_fired_ || !awaiting_parser_inserted_body_) + if (font_preload_timer_has_fired_ || document_->body()) return; FontPreloadFinishObserver* observer = @@ -111,7 +111,7 @@ if (font_face->LoadStatus() != FontFace::kLoading) return; - if (font_preload_timer_has_fired_ || !awaiting_parser_inserted_body_) + if (font_preload_timer_has_fired_ || document_->body()) return; ImperativeFontLoadFinishedCallback* callback = @@ -162,8 +162,28 @@ font_preload_timer_.Stop(); } +bool RenderBlockingResourceManager::AddPendingStylesheet( + const Node& owner_node) { + if (document_->body()) + return false; + DCHECK(!pending_stylesheet_owner_nodes_.Contains(&owner_node)); + pending_stylesheet_owner_nodes_.insert(&owner_node); + return true; +} + +bool RenderBlockingResourceManager::RemovePendingStylesheet( + const Node& owner_node) { + auto iter = pending_stylesheet_owner_nodes_.find(&owner_node); + if (iter == pending_stylesheet_owner_nodes_.end()) + return false; + pending_stylesheet_owner_nodes_.erase(iter); + document_->RenderBlockingResourceUnblocked(); + return true; +} + void RenderBlockingResourceManager::Trace(Visitor* visitor) const { visitor->Trace(document_); + visitor->Trace(pending_stylesheet_owner_nodes_); visitor->Trace(font_preload_finish_observers_); visitor->Trace(font_preload_timer_); }
diff --git a/third_party/blink/renderer/core/loader/render_blocking_resource_manager.h b/third_party/blink/renderer/core/loader/render_blocking_resource_manager.h index 0f8d4d3..d6b3b78b 100644 --- a/third_party/blink/renderer/core/loader/render_blocking_resource_manager.h +++ b/third_party/blink/renderer/core/loader/render_blocking_resource_manager.h
@@ -15,6 +15,7 @@ class Document; class FontResource; class FontFace; +class Node; class ResourceFinishObserver; // https://html.spec.whatwg.org/#render-blocking-mechanism with some extensions. @@ -28,15 +29,24 @@ RenderBlockingResourceManager& operator=( const RenderBlockingResourceManager&) = delete; - void WillInsertBody() { awaiting_parser_inserted_body_ = false; } - - // https://html.spec.whatwg.org/#render-blocked - bool IsRenderBlocked() const { - return awaiting_parser_inserted_body_ || HasRenderBlockingResources(); + bool HasRenderBlockingResources() const { + return pending_stylesheet_owner_nodes_.size() || + font_preload_finish_observers_.size() || + imperative_font_loading_count_; } - // TODO(crbug.com/1271296): Use this class to handle render-blocking scripts, - // stylesheets and preloads. + // TODO(crbug.com/1271296): Use this class to handle render-blocking scripts + // and preloads. + + bool HasPendingStylesheets() const { + return pending_stylesheet_owner_nodes_.size(); + } + // Returns true if the sheet is successfully added as a render-blocking + // resource. + bool AddPendingStylesheet(const Node& owner_node); + // If the sheet is a render-blocking resource, removes it and returns true; + // otherwise, returns false with no operation. + bool RemovePendingStylesheet(const Node& owner_node); // We additionally allow font preloading (via <link rel="preload"> or Font // Loading API) to block rendering for a short period, so that preloaded fonts @@ -53,17 +63,19 @@ private: friend class RenderBlockingResourceManagerTest; - bool HasRenderBlockingResources() const { - return font_preload_finish_observers_.size() || - imperative_font_loading_count_; - } - // Exposed to unit tests only. void SetFontPreloadTimeoutForTest(base::TimeDelta timeout); void DisableFontPreloadTimeoutForTest(); Member<Document> document_; + // Tracks the currently loading top-level stylesheets which block + // rendering from starting. Sheets loaded using the @import directive are not + // directly included in this set. See: + // https://html.spec.whatwg.org/multipage/links.html#link-type-stylesheet + // https://html.spec.whatwg.org/multipage/semantics.html#update-a-style-block + HeapHashSet<Member<const Node>> pending_stylesheet_owner_nodes_; + // Need to hold strong references here, otherwise they'll be GC-ed immediately // as Resource only holds weak references. HeapHashSet<Member<ResourceFinishObserver>> font_preload_finish_observers_; @@ -73,11 +85,6 @@ HeapTaskRunnerTimer<RenderBlockingResourceManager> font_preload_timer_; base::TimeDelta font_preload_timeout_; bool font_preload_timer_has_fired_ = false; - - // https://html.spec.whatwg.org/#awaiting-parser-inserted-body-flag - // Initialized to true as RenderBlockingResourceManager is created only on - // HTML documents - bool awaiting_parser_inserted_body_ = true; }; } // namespace blink
diff --git a/third_party/blink/renderer/core/loader/render_blocking_resource_manager_test.cc b/third_party/blink/renderer/core/loader/render_blocking_resource_manager_test.cc index 479e2ab..75e1c724 100644 --- a/third_party/blink/renderer/core/loader/render_blocking_resource_manager_test.cc +++ b/third_party/blink/renderer/core/loader/render_blocking_resource_manager_test.cc
@@ -66,7 +66,6 @@ // Rendering is blocked due to ongoing font preloading. EXPECT_TRUE(Compositor().DeferMainFrameUpdate()); EXPECT_TRUE(HasRenderBlockingResources()); - EXPECT_TRUE(GetRenderBlockingResourceManager().IsRenderBlocked()); font_resource.Complete(); test::RunPendingTasks(); @@ -75,14 +74,12 @@ // blocked, as we don't have BODY yet. EXPECT_TRUE(Compositor().DeferMainFrameUpdate()); EXPECT_FALSE(HasRenderBlockingResources()); - EXPECT_TRUE(GetRenderBlockingResourceManager().IsRenderBlocked()); main_resource.Complete("</head><body>some text</body>"); // Rendering starts after BODY has arrived, as the font was loaded earlier. EXPECT_FALSE(Compositor().DeferMainFrameUpdate()); EXPECT_FALSE(HasRenderBlockingResources()); - EXPECT_FALSE(GetRenderBlockingResourceManager().IsRenderBlocked()); } TEST_F(RenderBlockingResourceManagerTest, FastFontFinishAfterBody) { @@ -101,7 +98,6 @@ // Rendering is blocked due to ongoing font preloading. EXPECT_TRUE(Compositor().DeferMainFrameUpdate()); EXPECT_TRUE(HasRenderBlockingResources()); - EXPECT_TRUE(GetRenderBlockingResourceManager().IsRenderBlocked()); main_resource.Complete("</head><body>some text</body>"); @@ -109,7 +105,6 @@ // the font was *not* loaded earlier. EXPECT_TRUE(Compositor().DeferMainFrameUpdate()); EXPECT_TRUE(HasRenderBlockingResources()); - EXPECT_TRUE(GetRenderBlockingResourceManager().IsRenderBlocked()); font_resource.Complete(); test::RunPendingTasks(); @@ -117,7 +112,6 @@ // Rendering starts after font preloading has finished. EXPECT_FALSE(Compositor().DeferMainFrameUpdate()); EXPECT_FALSE(HasRenderBlockingResources()); - EXPECT_FALSE(GetRenderBlockingResourceManager().IsRenderBlocked()); } TEST_F(RenderBlockingResourceManagerTest, SlowFontTimeoutBeforeBody) { @@ -136,7 +130,6 @@ // Rendering is blocked due to ongoing font preloading. EXPECT_TRUE(Compositor().DeferMainFrameUpdate()); EXPECT_TRUE(HasRenderBlockingResources()); - EXPECT_TRUE(GetRenderBlockingResourceManager().IsRenderBlocked()); GetRenderBlockingResourceManager().FontPreloadingTimerFired(nullptr); @@ -144,14 +137,12 @@ // However, rendering is still blocked, as we don't have BODY yet. EXPECT_TRUE(Compositor().DeferMainFrameUpdate()); EXPECT_FALSE(HasRenderBlockingResources()); - EXPECT_TRUE(GetRenderBlockingResourceManager().IsRenderBlocked()); main_resource.Complete("</head><body>some text</body>"); // Rendering starts after BODY has arrived. EXPECT_FALSE(Compositor().DeferMainFrameUpdate()); EXPECT_FALSE(HasRenderBlockingResources()); - EXPECT_FALSE(GetRenderBlockingResourceManager().IsRenderBlocked()); font_resource.Complete(); } @@ -172,21 +163,18 @@ // Rendering is blocked due to ongoing font preloading. EXPECT_TRUE(Compositor().DeferMainFrameUpdate()); EXPECT_TRUE(HasRenderBlockingResources()); - EXPECT_TRUE(GetRenderBlockingResourceManager().IsRenderBlocked()); main_resource.Complete("</head><body>some text</body>"); // Rendering is still blocked by font, even if we already have BODY. EXPECT_TRUE(Compositor().DeferMainFrameUpdate()); EXPECT_TRUE(HasRenderBlockingResources()); - EXPECT_TRUE(GetRenderBlockingResourceManager().IsRenderBlocked()); GetRenderBlockingResourceManager().FontPreloadingTimerFired(nullptr); // Rendering starts after we've waited for the font preloading long enough. EXPECT_FALSE(Compositor().DeferMainFrameUpdate()); EXPECT_FALSE(HasRenderBlockingResources()); - EXPECT_FALSE(GetRenderBlockingResourceManager().IsRenderBlocked()); font_resource.Complete(); } @@ -214,7 +202,6 @@ // Now rendering has started, as there's no blocking resources. EXPECT_FALSE(Compositor().DeferMainFrameUpdate()); - EXPECT_FALSE(GetRenderBlockingResourceManager().IsRenderBlocked()); font_resource.Complete(ReadAhemWoff2()); @@ -248,7 +235,6 @@ // Now rendering has started, as there's no blocking resources. EXPECT_FALSE(Compositor().DeferMainFrameUpdate()); - EXPECT_FALSE(GetRenderBlockingResourceManager().IsRenderBlocked()); font_resource.Complete(ReadAhemWoff2()); @@ -284,7 +270,6 @@ // Now rendering has started, as there's no blocking resources. EXPECT_FALSE(Compositor().DeferMainFrameUpdate()); - EXPECT_FALSE(GetRenderBlockingResourceManager().IsRenderBlocked()); // We render visible fallback as the 'optional' web font hasn't loaded. Compositor().BeginFrame(); @@ -327,7 +312,6 @@ // Now rendering has started, as there's no blocking resources. EXPECT_FALSE(Compositor().DeferMainFrameUpdate()); - EXPECT_FALSE(GetRenderBlockingResourceManager().IsRenderBlocked()); // Force layout update, which lays out target but doesn't paint anything. GetDocument().UpdateStyleAndLayout(DocumentUpdateReason::kTest); @@ -372,7 +356,6 @@ // Now rendering has started, as there's no blocking resources. EXPECT_FALSE(Compositor().DeferMainFrameUpdate()); - EXPECT_FALSE(GetRenderBlockingResourceManager().IsRenderBlocked()); // The 'optional' web font isn't used, as it didn't finish loading before // rendering started. Text is rendered in visible fallback. @@ -419,14 +402,12 @@ // Rendering is blocked due to font being preloaded. EXPECT_TRUE(Compositor().DeferMainFrameUpdate()); EXPECT_TRUE(HasRenderBlockingResources()); - EXPECT_TRUE(GetRenderBlockingResourceManager().IsRenderBlocked()); GetRenderBlockingResourceManager().FontPreloadingTimerFired(nullptr); // Rendering is unblocked after the font preloading has timed out. EXPECT_FALSE(Compositor().DeferMainFrameUpdate()); EXPECT_FALSE(HasRenderBlockingResources()); - EXPECT_FALSE(GetRenderBlockingResourceManager().IsRenderBlocked()); // First frame renders text with visible fallback, as the 'optional' web font // isn't loaded yet, and should be treated as in the failure period. @@ -469,7 +450,6 @@ // Rendering is blocked due to font being preloaded. EXPECT_TRUE(Compositor().DeferMainFrameUpdate()); EXPECT_TRUE(HasRenderBlockingResources()); - EXPECT_TRUE(GetRenderBlockingResourceManager().IsRenderBlocked()); // There are test flakes due to RenderBlockingResourceManager timeout firing // before the ResourceFinishObserver gets notified. So we disable the timeout. @@ -481,7 +461,6 @@ // Rendering is unblocked after the font is preloaded. EXPECT_FALSE(Compositor().DeferMainFrameUpdate()); EXPECT_FALSE(HasRenderBlockingResources()); - EXPECT_FALSE(GetRenderBlockingResourceManager().IsRenderBlocked()); // The 'optional' web font should be used in the first paint. Compositor().BeginFrame(); @@ -516,14 +495,12 @@ // Rendering is blocked due to font being loaded via JavaScript API. EXPECT_TRUE(Compositor().DeferMainFrameUpdate()); EXPECT_TRUE(HasRenderBlockingResources()); - EXPECT_TRUE(GetRenderBlockingResourceManager().IsRenderBlocked()); GetRenderBlockingResourceManager().FontPreloadingTimerFired(nullptr); // Rendering is unblocked after the font preloading has timed out. EXPECT_FALSE(Compositor().DeferMainFrameUpdate()); EXPECT_FALSE(HasRenderBlockingResources()); - EXPECT_FALSE(GetRenderBlockingResourceManager().IsRenderBlocked()); // First frame renders text with visible fallback, as the 'optional' web font // isn't loaded yet, and should be treated as in the failure period. @@ -570,7 +547,6 @@ // Rendering is blocked due to font being preloaded. EXPECT_TRUE(Compositor().DeferMainFrameUpdate()); EXPECT_TRUE(HasRenderBlockingResources()); - EXPECT_TRUE(GetRenderBlockingResourceManager().IsRenderBlocked()); font_resource.Complete(ReadAhemWoff2()); test::RunPendingTasks(); @@ -578,7 +554,6 @@ // Rendering is unblocked after the font is preloaded. EXPECT_FALSE(Compositor().DeferMainFrameUpdate()); EXPECT_FALSE(HasRenderBlockingResources()); - EXPECT_FALSE(GetRenderBlockingResourceManager().IsRenderBlocked()); // The 'optional' web font should be used in the first paint. Compositor().BeginFrame(); @@ -586,4 +561,33 @@ EXPECT_FALSE(GetTargetFont().ShouldSkipDrawing()); } +TEST_F(RenderBlockingResourceManagerTest, ScriptInsertedBodyUnblocksRendering) { + SimRequest main_resource("https://example.com", "text/html"); + SimSubresourceRequest style_resource("https://example.com/sheet.css", + "text/css"); + + LoadURL("https://example.com"); + main_resource.Write(R"HTML( + <!doctype html> + <link rel="stylesheet" href="sheet.css"> + )HTML"); + + Element* body = GetDocument().CreateElementForBinding("body"); + GetDocument().setBody(To<HTMLElement>(body), ASSERT_NO_EXCEPTION); + + // Rendering should be blocked by the pending stylesheet. + EXPECT_TRUE(GetDocument().body()); + EXPECT_TRUE(Compositor().DeferMainFrameUpdate()); + + style_resource.Complete("body { width: 100px; }"); + + // Rendering should be unblocked as all render-blocking resources are loaded + // and there is a body, even though it's not inserted by parser. + EXPECT_FALSE(Compositor().DeferMainFrameUpdate()); + Compositor().BeginFrame(); + EXPECT_EQ(100, GetDocument().body()->OffsetWidth()); + + main_resource.Finish(); +} + } // namespace blink
diff --git a/third_party/blink/renderer/core/page/print_context_test.cc b/third_party/blink/renderer/core/page/print_context_test.cc index 1a81a54f..9cdada67 100644 --- a/third_party/blink/renderer/core/page/print_context_test.cc +++ b/third_party/blink/renderer/core/page/print_context_test.cc
@@ -170,7 +170,8 @@ Event* event = MakeGarbageCollected<BeforePrintEvent>(); GetPrintContext().GetFrame()->DomWindow()->DispatchEvent(*event); GetPrintContext().BeginPrintMode(page_rect.width(), page_rect.height()); - UpdateAllLifecyclePhasesForTest(); + GetDocument().View()->UpdateAllLifecyclePhasesExceptPaint( + DocumentUpdateReason::kTest); auto* builder = MakeGarbageCollected<PaintRecordBuilder>(); GraphicsContext& context = builder->Context(); context.SetPrinting(true);
diff --git a/third_party/blink/renderer/core/scheduler_integration_tests/frame_throttling_test.cc b/third_party/blink/renderer/core/scheduler_integration_tests/frame_throttling_test.cc index d01d1442..7370e7b 100644 --- a/third_party/blink/renderer/core/scheduler_integration_tests/frame_throttling_test.cc +++ b/third_party/blink/renderer/core/scheduler_integration_tests/frame_throttling_test.cc
@@ -7,10 +7,13 @@ #include "base/test/scoped_feature_list.h" #include "cc/base/features.h" #include "cc/layers/picture_layer.h" +#include "cc/paint/paint_record.h" +#include "cc/paint/paint_recorder.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/blink/public/common/features.h" #include "third_party/blink/public/test/test_web_frame_content_dumper.h" #include "third_party/blink/public/web/web_hit_test_result.h" +#include "third_party/blink/public/web/web_print_params.h" #include "third_party/blink/public/web/web_settings.h" #include "third_party/blink/renderer/bindings/core/v8/v8_intersection_observer_init.h" #include "third_party/blink/renderer/core/dom/document.h" @@ -43,6 +46,8 @@ #include "third_party/blink/renderer/platform/testing/unit_test_helpers.h" #include "third_party/blink/renderer/platform/testing/url_test_helpers.h" +#include "third_party/blink/renderer/platform/graphics/logging_canvas.h" + using testing::_; namespace blink { @@ -1937,4 +1942,32 @@ view->GetPaintControllerForTesting().GetPaintArtifact().IsEmpty()); } +TEST_P(FrameThrottlingTest, PrintThrottledFrame) { + SimRequest main_resource("https://example.com/", "text/html"); + SimRequest frame_resource("https://example.com/iframe.html", "text/html"); + + LoadURL("https://example.com/"); + // The frame is initially throttled. + main_resource.Complete(R"HTML( + <div style="height: 2000px"></div> + <iframe id="frame" sandbox src="iframe.html"></iframe> + )HTML"); + frame_resource.Complete("ABC"); + CompositeFrame(); + + auto* frame_element = + To<HTMLIFrameElement>(GetDocument().getElementById("frame")); + auto* sub_frame = To<LocalFrame>(frame_element->ContentFrame()); + EXPECT_TRUE(sub_frame->View()->ShouldThrottleRenderingForTest()); + auto* web_frame = WebLocalFrameImpl::FromFrame(sub_frame); + WebPrintParams print_params(gfx::Size(500, 500)); + web_frame->PrintBegin(print_params, blink::WebNode()); + cc::PaintRecorder recorder; + web_frame->PrintPage(0, recorder.beginRecording(500, 500)); + auto record = recorder.finishRecordingAsPicture(); + String record_string = RecordAsDebugString(*record); + EXPECT_TRUE(record_string.Contains("drawTextBlob")) << record_string.Utf8(); + web_frame->PrintEnd(); +} + } // namespace blink
diff --git a/third_party/blink/renderer/core/svg/svg_style_element.cc b/third_party/blink/renderer/core/svg/svg_style_element.cc index 836c8913..722fb0384 100644 --- a/third_party/blink/renderer/core/svg/svg_style_element.cc +++ b/third_party/blink/renderer/core/svg/svg_style_element.cc
@@ -24,6 +24,7 @@ #include "third_party/blink/public/platform/task_type.h" #include "third_party/blink/renderer/core/css/css_style_sheet.h" +#include "third_party/blink/renderer/core/dom/document.h" #include "third_party/blink/renderer/core/dom/events/event.h" #include "third_party/blink/renderer/core/media_type_names.h" #include "third_party/blink/renderer/platform/wtf/functional.h"
diff --git a/third_party/blink/renderer/core/svg/svg_style_element.h b/third_party/blink/renderer/core/svg/svg_style_element.h index 68bfc05..f6d7401 100644 --- a/third_party/blink/renderer/core/svg/svg_style_element.h +++ b/third_party/blink/renderer/core/svg/svg_style_element.h
@@ -68,9 +68,11 @@ } void NotifyLoadedSheetAndAllCriticalSubresources( LoadedSheetErrorStatus) override; - void StartLoadingDynamicSheet() override { - StyleElement::StartLoadingDynamicSheet(GetDocument()); + void SetToPendingState() override { + StyleElement::SetToPendingState(GetDocument(), *this); } + + bool IsSameObject(const Node& node) const override { return this == &node; } }; } // namespace blink
diff --git a/third_party/blink/renderer/core/testing/sim/sim_compositor.cc b/third_party/blink/renderer/core/testing/sim/sim_compositor.cc index 18b2833..bbc96040 100644 --- a/third_party/blink/renderer/core/testing/sim/sim_compositor.cc +++ b/third_party/blink/renderer/core/testing/sim/sim_compositor.cc
@@ -60,8 +60,8 @@ auto* frame = web_view_->MainFrameImpl()->GetFrame(); auto* builder = MakeGarbageCollected<PaintRecordBuilder>(); - frame->View()->PaintOutsideOfLifecycle(builder->Context(), - PaintFlag::kOmitCompositingInfo); + frame->View()->PaintOutsideOfLifecycleWithThrottlingAllowed( + builder->Context(), PaintFlag::kOmitCompositingInfo); auto infinite_rect = LayoutRect::InfiniteIntRect(); SimCanvas canvas(infinite_rect.width(), infinite_rect.height());
diff --git a/third_party/blink/renderer/core/xml/xsl_style_sheet.h b/third_party/blink/renderer/core/xml/xsl_style_sheet.h index 865803b..c88c400 100644 --- a/third_party/blink/renderer/core/xml/xsl_style_sheet.h +++ b/third_party/blink/renderer/core/xml/xsl_style_sheet.h
@@ -28,6 +28,7 @@ #include "base/memory/scoped_refptr.h" #include "third_party/blink/renderer/core/css/style_sheet.h" #include "third_party/blink/renderer/core/dom/processing_instruction.h" +#include "third_party/blink/renderer/platform/weborigin/kurl.h" #include "third_party/blink/renderer/platform/wtf/casting.h" namespace blink {
diff --git a/third_party/blink/renderer/extensions/chromeos/system_extensions/window_management/cros_window.cc b/third_party/blink/renderer/extensions/chromeos/system_extensions/window_management/cros_window.cc index 15a06fed3..01600d9 100644 --- a/third_party/blink/renderer/extensions/chromeos/system_extensions/window_management/cros_window.cc +++ b/third_party/blink/renderer/extensions/chromeos/system_extensions/window_management/cros_window.cc
@@ -108,8 +108,13 @@ return false; } -bool CrosWindow::focus() { - return false; +void CrosWindow::focus() { + auto* cros_window_management = + window_management_->GetCrosWindowManagementOrNull(); + if (!cros_window_management) { + return; + } + cros_window_management->Focus(window_->id); } bool CrosWindow::close() {
diff --git a/third_party/blink/renderer/extensions/chromeos/system_extensions/window_management/cros_window.h b/third_party/blink/renderer/extensions/chromeos/system_extensions/window_management/cros_window.h index c4a19b5..c4892623 100644 --- a/third_party/blink/renderer/extensions/chromeos/system_extensions/window_management/cros_window.h +++ b/third_party/blink/renderer/extensions/chromeos/system_extensions/window_management/cros_window.h
@@ -38,7 +38,7 @@ void maximize(); void minimize(); bool raise(); - bool focus(); + void focus(); bool close(); private:
diff --git a/third_party/blink/renderer/extensions/chromeos/system_extensions/window_management/cros_window.idl b/third_party/blink/renderer/extensions/chromeos/system_extensions/window_management/cros_window.idl index cd9482d1..80c07ee8 100644 --- a/third_party/blink/renderer/extensions/chromeos/system_extensions/window_management/cros_window.idl +++ b/third_party/blink/renderer/extensions/chromeos/system_extensions/window_management/cros_window.idl
@@ -22,6 +22,7 @@ // Sets window state to minimized. void minimize(); boolean raise(); - boolean focus(); + // Allocates focus to the CrosWindow identified by id and brings to front. + void focus(); boolean close(); };
diff --git a/third_party/blink/renderer/modules/accessibility/ax_object.cc b/third_party/blink/renderer/modules/accessibility/ax_object.cc index 42ba5c32..186a0cce 100644 --- a/third_party/blink/renderer/modules/accessibility/ax_object.cc +++ b/third_party/blink/renderer/modules/accessibility/ax_object.cc
@@ -5512,6 +5512,7 @@ case ax::mojom::blink::Action::kLoadInlineTextBoxes: case ax::mojom::blink::Action::kNone: case ax::mojom::blink::Action::kReplaceSelectedText: + case ax::mojom::blink::Action::kRunScreenAi: case ax::mojom::blink::Action::kScrollBackward: case ax::mojom::blink::Action::kScrollDown: case ax::mojom::blink::Action::kScrollForward:
diff --git a/third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.cc b/third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.cc index c0b7bf1a..0a44c5b 100644 --- a/third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.cc +++ b/third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.cc
@@ -306,39 +306,10 @@ return false; } - // If the prev/next node is also a text node and the adjacent character is - // not whitespace, CanIgnoreSpaceNextTo will return false. In some cases that - // is what we want; in other cases it is not. Examples: - // - // 1a: <p><span>Hello</span><span>[whitespace]</span><span>World</span></p> - // 1b: <p><span>Hello</span>[whitespace]<span>World</span></p> - // 2: <div><ul><li style="display:inline;">x</li>[whitespace]</ul>y</div> - // - // In the first case, we want to preserve the whitespace (crbug.com/435765). - // In the second case, the whitespace in the markup is not relevant because - // the "x" is separated from the "y" by virtue of being inside a different - // block. In order to distinguish these two scenarios, we can use the - // LayoutBox associated with each node. For the first scenario, each node's - // LayoutBox is the LayoutBlockFlow associated with the <p>. For the second - // scenario, the LayoutBox of "x" and the whitespace is the LayoutBlockFlow - // associated with the <ul>; the LayoutBox of "y" is the one associated with - // the <div>. - LayoutBox* box = layout_text.EnclosingBox(); - if (!box) - return false; - - if (prev_node->GetLayoutObject() && prev_node->GetLayoutObject()->IsText()) { - LayoutBox* prev_box = prev_node->GetLayoutObject()->EnclosingBox(); - if (prev_box != box) - return false; - } - - if (next_node->GetLayoutObject() && next_node->GetLayoutObject()->IsText()) { - LayoutBox* next_box = next_node->GetLayoutObject()->EnclosingBox(); - if (next_box != box) - return false; - } - + // Text elements with empty whitespace are returned, because of cases + // such as <span>Hello</span><span> </span><span>World</span>. Keeping + // the whitespace-only node means we now correctly expose "Hello World". + // See crbug.com/435765. return true; } @@ -482,8 +453,8 @@ if (!node || !node->isConnected()) return false; - if (node->IsDocumentNode()) - return true; + if (const Document* document = DynamicTo<Document>(node)) + return document->GetFrame(); // Only relevant if the document has a frame. if (node->ContainingShadowRoot() && !IsShadowContentRelevantForAccessibility(node)) { @@ -2207,7 +2178,44 @@ if (!node) return; - ChildrenChanged(node); + ChildrenChanged(Get(node)); + + if (!layout_object->IsAnonymous()) + return; + + DCHECK_NE(node->GetLayoutObject(), layout_object); + + // The passed-in layout object was anonymous, e.g. anonymous block flow + // inserted by blink as an inline's parent when it had a block sibling. + // If children change on an anonymous layout object, this can + // mean that child AXObjects actually had their children change. + // Therefore, invalidate any of those children as well, using the nearest + // parent that participates in the tree. + // In this example, if ChildrenChanged() is called on the anonymous block, + // then we also process ChildrenChanged() on the <div> and <a>: + // <div> + // | \ + // <p> Anonymous block (Note: Anonymous blocks do not get AXObjects) + // \ + // <a> + // \ + // text + + // The child traversal requires a flat tree traversal, so if it's forbidden, + // don't do it. Additionally, when visiting a slot, we may call AssignNodes, + // so also don't do this if slot (re-)assignment is forbidden. + // TODO(aleventhal) Why is this needed for shadow-slot-assignment.js test? + if (GetDocument().IsFlatTreeTraversalForbidden() || + node->GetDocument() + .GetSlotAssignmentEngine() + .HasPendingSlotAssignmentRecalc()) { + return; + } + + for (Node* child = LayoutTreeBuilderTraversal::FirstChild(*node); child; + child = LayoutTreeBuilderTraversal::NextSibling(*child)) { + ChildrenChanged(Get(child)); + } } void AXObjectCacheImpl::ChildrenChanged(AccessibleNode* accessible_node) {
diff --git a/third_party/blink/renderer/modules/bluetooth/bluetooth_device.cc b/third_party/blink/renderer/modules/bluetooth/bluetooth_device.cc index de06c805..582ae200 100644 --- a/third_party/blink/renderer/modules/bluetooth/bluetooth_device.cc +++ b/third_party/blink/renderer/modules/bluetooth/bluetooth_device.cc
@@ -192,6 +192,22 @@ } } +ScriptPromise BluetoothDevice::forget(ScriptState* script_state, + ExceptionState& exception_state) { + if (!GetExecutionContext()) { + exception_state.ThrowTypeError(kInactiveDocumentError); + return ScriptPromise(); + } + + auto* resolver = MakeGarbageCollected<ScriptPromiseResolver>(script_state); + ScriptPromise promise = resolver->Promise(); + bluetooth_->Service()->ForgetDevice( + device_->id, WTF::Bind(&BluetoothDevice::ForgetCallback, + WrapPersistent(this), WrapPersistent(resolver))); + + return promise; +} + void BluetoothDevice::AdvertisingEvent( mojom::blink::WebBluetoothAdvertisingEventPtr advertising_event) { auto* event = MakeGarbageCollected<BluetoothAdvertisingEvent>( @@ -242,4 +258,8 @@ watch_advertisements_resolver_.Clear(); } +void BluetoothDevice::ForgetCallback(ScriptPromiseResolver* resolver) { + resolver->Resolve(); +} + } // namespace blink
diff --git a/third_party/blink/renderer/modules/bluetooth/bluetooth_device.h b/third_party/blink/renderer/modules/bluetooth/bluetooth_device.h index 75ca2d1..1a95590 100644 --- a/third_party/blink/renderer/modules/bluetooth/bluetooth_device.h +++ b/third_party/blink/renderer/modules/bluetooth/bluetooth_device.h
@@ -92,6 +92,7 @@ ScriptPromise watchAdvertisements(ScriptState*, const WatchAdvertisementsOptions*, ExceptionState&); + ScriptPromise forget(ScriptState*, ExceptionState&); String id() { return device_->id.DeviceIdInBase64().c_str(); } String name() { return device_->name; } BluetoothRemoteGATTServer* gatt() { return gatt_; } @@ -116,6 +117,7 @@ private: void WatchAdvertisementsCallback(mojom::blink::WebBluetoothResult); + void ForgetCallback(ScriptPromiseResolver*); // Holds all GATT Attributes associated with this BluetoothDevice. Member<BluetoothAttributeInstanceMap> attribute_instance_map_;
diff --git a/third_party/blink/renderer/modules/bluetooth/bluetooth_device.idl b/third_party/blink/renderer/modules/bluetooth/bluetooth_device.idl index c24a3e692..d21fa9e 100644 --- a/third_party/blink/renderer/modules/bluetooth/bluetooth_device.idl +++ b/third_party/blink/renderer/modules/bluetooth/bluetooth_device.idl
@@ -17,6 +17,12 @@ MeasureAs=WebBluetoothWatchAdvertisements ] Promise<void> watchAdvertisements( optional WatchAdvertisementsOptions options = {}); + [ + RuntimeEnabled=WebBluetoothGetDevices, + CallWith=ScriptState, + RaisesException, + MeasureAs=BluetoothDeviceForget + ] Promise<void> forget(); readonly attribute DOMString id; [HighEntropy=Direct, MeasureAs=BluetoothDeviceName] readonly attribute DOMString? name;
diff --git a/third_party/blink/renderer/modules/file_system_access/file_system_access_regular_file_delegate.cc b/third_party/blink/renderer/modules/file_system_access/file_system_access_regular_file_delegate.cc index 19516a1..1787619 100644 --- a/third_party/blink/renderer/modules/file_system_access/file_system_access_regular_file_delegate.cc +++ b/third_party/blink/renderer/modules/file_system_access/file_system_access_regular_file_delegate.cc
@@ -104,6 +104,7 @@ void FileSystemAccessRegularFileDelegate::GetLength( base::OnceCallback<void(base::FileErrorOr<int64_t>)> callback) { + DCHECK(task_runner_->RunsTasksInCurrentSequence()); auto wrapped_callback = CrossThreadOnceFunction<void(base::FileErrorOr<int64_t>)>( std::move(callback)); @@ -252,6 +253,7 @@ void FileSystemAccessRegularFileDelegate::Flush( base::OnceCallback<void(bool)> callback) { + DCHECK(task_runner_->RunsTasksInCurrentSequence()); auto wrapped_callback = CrossThreadOnceFunction<void(bool)>(std::move(callback)); @@ -274,6 +276,7 @@ } void FileSystemAccessRegularFileDelegate::Close(base::OnceClosure callback) { + DCHECK(task_runner_->RunsTasksInCurrentSequence()); auto wrapped_callback = CrossThreadOnceClosure(std::move(callback)); // Close file on a worker thread and reply back to this sequence.
diff --git a/third_party/blink/renderer/modules/mediastream/media_stream_track.cc b/third_party/blink/renderer/modules/mediastream/media_stream_track.cc index 53a7a2c7..a7a28db 100644 --- a/third_party/blink/renderer/modules/mediastream/media_stream_track.cc +++ b/third_party/blink/renderer/modules/mediastream/media_stream_track.cc
@@ -270,7 +270,9 @@ } } -MediaStreamTrack* MediaStreamTrack::Create(ExecutionContext* context) { +MediaStreamTrack* MediaStreamTrack::Create( + ExecutionContext* context, + const base::UnguessableToken& token) { MediaStreamSource* source = MakeGarbageCollected<MediaStreamSource>( "dummy", MediaStreamSource::StreamType::kTypeVideo, "dummy", false /* remote */);
diff --git a/third_party/blink/renderer/modules/mediastream/media_stream_track.h b/third_party/blink/renderer/modules/mediastream/media_stream_track.h index 83c8bf9..d5f4a14 100644 --- a/third_party/blink/renderer/modules/mediastream/media_stream_track.h +++ b/third_party/blink/renderer/modules/mediastream/media_stream_track.h
@@ -72,7 +72,8 @@ base::OnceClosure callback, const String& descriptor_id); // TODO(1288839): Implement to recreate MST after transfer - static MediaStreamTrack* Create(ExecutionContext* context); + static MediaStreamTrack* Create(ExecutionContext* context, + const base::UnguessableToken& token); MediaStreamTrack(ExecutionContext*, MediaStreamComponent*); MediaStreamTrack(ExecutionContext*,
diff --git a/third_party/blink/renderer/modules/webcodecs/video_frame.cc b/third_party/blink/renderer/modules/webcodecs/video_frame.cc index c9300316..bf54d9a 100644 --- a/third_party/blink/renderer/modules/webcodecs/video_frame.cc +++ b/third_party/blink/renderer/modules/webcodecs/video_frame.cc
@@ -611,12 +611,13 @@ // The sync token needs to be updated when |frame| is released, but // AcceleratedStaticBitmapImage::UpdateSyncToken() is not thread-safe. - auto release_cb = media::BindToCurrentLoop(WTF::Bind( - [](scoped_refptr<Image> image, const gpu::SyncToken& sync_token) { - static_cast<StaticBitmapImage*>(image.get()) - ->UpdateSyncToken(sync_token); - }, - std::move(image))); + auto release_cb = + media::BindToCurrentLoop(ConvertToBaseOnceCallback(CrossThreadBindOnce( + [](scoped_refptr<Image> image, const gpu::SyncToken& sync_token) { + static_cast<StaticBitmapImage*>(image.get()) + ->UpdateSyncToken(sync_token); + }, + std::move(image)))); frame = media::VideoFrame::WrapNativeTextures( format, mailbox_holders, std::move(release_cb), coded_size,
diff --git a/third_party/blink/renderer/modules/webgpu/gpu_canvas_configuration.idl b/third_party/blink/renderer/modules/webgpu/gpu_canvas_configuration.idl index 1e4ff0c..b9709c14 100644 --- a/third_party/blink/renderer/modules/webgpu/gpu_canvas_configuration.idl +++ b/third_party/blink/renderer/modules/webgpu/gpu_canvas_configuration.idl
@@ -4,15 +4,9 @@ // https://gpuweb.github.io/gpuweb/ -enum GPUCanvasCompositingAlphaMode { - "opaque", - "premultiplied", -}; - dictionary GPUCanvasConfiguration : GPUObjectDescriptorBase { required GPUDevice device; required GPUTextureFormat format; GPUTextureUsageFlags usage = 16; // GPUTextureUsage.RENDER_ATTACHMENT - GPUCanvasCompositingAlphaMode compositingAlphaMode = "opaque"; GPUExtent3D size; };
diff --git a/third_party/blink/renderer/modules/webgpu/gpu_canvas_context.cc b/third_party/blink/renderer/modules/webgpu/gpu_canvas_context.cc index b39ea0c..b9f4a1e6 100644 --- a/third_party/blink/renderer/modules/webgpu/gpu_canvas_context.cc +++ b/third_party/blink/renderer/modules/webgpu/gpu_canvas_context.cc
@@ -6,7 +6,6 @@ #include "components/viz/common/resources/resource_format_utils.h" #include "third_party/blink/renderer/bindings/core/v8/v8_union_htmlcanvaselement_offscreencanvas.h" -#include "third_party/blink/renderer/bindings/modules/v8/v8_gpu_canvas_compositing_alpha_mode.h" #include "third_party/blink/renderer/bindings/modules/v8/v8_gpu_canvas_configuration.h" #include "third_party/blink/renderer/bindings/modules/v8/v8_union_canvasrenderingcontext2d_gpucanvascontext_imagebitmaprenderingcontext_webgl2renderingcontext_webglrenderingcontext.h" #include "third_party/blink/renderer/bindings/modules/v8/v8_union_gpucanvascontext_imagebitmaprenderingcontext_offscreencanvasrenderingcontext2d_webgl2renderingcontext_webglrenderingcontext.h" @@ -208,9 +207,8 @@ } swapchain_ = MakeGarbageCollected<GPUSwapChain>( - this, configured_device_, usage, format, filter_quality_, - descriptor->compositingAlphaMode().AsEnum(), size); - + this, configured_device_, usage, format, filter_quality_, size); + swapchain_->CcLayer()->SetContentsOpaque(!CreationAttributes().alpha); if (descriptor->hasLabel()) swapchain_->setLabel(descriptor->label());
diff --git a/third_party/blink/renderer/modules/webgpu/gpu_swap_chain.cc b/third_party/blink/renderer/modules/webgpu/gpu_swap_chain.cc index e77c830..f3e12c1 100644 --- a/third_party/blink/renderer/modules/webgpu/gpu_swap_chain.cc +++ b/third_party/blink/renderer/modules/webgpu/gpu_swap_chain.cc
@@ -19,82 +19,22 @@ namespace blink { -GPUSwapChain::GPUSwapChain( - GPUCanvasContext* context, - GPUDevice* device, - WGPUTextureUsage usage, - WGPUTextureFormat format, - cc::PaintFlags::FilterQuality filter_quality, - V8GPUCanvasCompositingAlphaMode::Enum compositing_alpha_mode, - gfx::Size size) +GPUSwapChain::GPUSwapChain(GPUCanvasContext* context, + GPUDevice* device, + WGPUTextureUsage usage, + WGPUTextureFormat format, + cc::PaintFlags::FilterQuality filter_quality, + gfx::Size size) : DawnObjectBase(device->GetDawnControlClient()), device_(device), context_(context), usage_(usage), format_(format), - compositing_alpha_mode_(compositing_alpha_mode), size_(size) { // TODO: Use label from GPUObjectDescriptorBase. swap_buffers_ = base::AdoptRef(new WebGPUSwapBufferProvider( this, GetDawnControlClient(), device->GetHandle(), usage_, format)); swap_buffers_->SetFilterQuality(filter_quality); - - // Note: SetContentsOpaque is only an optimization hint. It doesn't - // actually make the contents opaque. - switch (compositing_alpha_mode) { - case V8GPUCanvasCompositingAlphaMode::Enum::kOpaque: { - CcLayer()->SetContentsOpaque(true); - - WGPUShaderModuleWGSLDescriptor wgsl_desc = { - .chain = {.sType = WGPUSType_ShaderModuleWGSLDescriptor}, - .source = R"( - @stage(vertex) fn vert_main(@builtin(vertex_index) VertexIndex : u32) -> @builtin(position) vec4<f32> { - var pos = array<vec2<f32>, 3>( - vec2<f32>(-1.0, -1.0), - vec2<f32>( 3.0, -1.0), - vec2<f32>(-1.0, 3.0)); - return vec4<f32>(pos[VertexIndex], 0.0, 1.0); - } - - @stage(fragment) fn frag_main() -> @location(0) vec4<f32> { - return vec4<f32>(1.0); - } - )", - }; - WGPUShaderModuleDescriptor shader_module_desc = {.nextInChain = - &wgsl_desc.chain}; - WGPUShaderModule shader_module = GetProcs().deviceCreateShaderModule( - device_->GetHandle(), &shader_module_desc); - - WGPUColorTargetState color_target = { - .format = format_, - .writeMask = WGPUColorWriteMask_Alpha, - }; - WGPUFragmentState fragment = { - .module = shader_module, - .entryPoint = "frag_main", - .targetCount = 1, - .targets = &color_target, - }; - WGPURenderPipelineDescriptor pipeline_desc = { - .vertex = - { - .module = shader_module, - .entryPoint = "vert_main", - }, - .primitive = {.topology = WGPUPrimitiveTopology_TriangleList}, - .multisample = {.count = 1, .mask = 0xFFFFFFFF}, - .fragment = &fragment, - }; - alpha_to_one_pipeline_ = GetProcs().deviceCreateRenderPipeline( - device_->GetHandle(), &pipeline_desc); - GetProcs().shaderModuleRelease(shader_module); - break; - } - case V8GPUCanvasCompositingAlphaMode::Enum::kPremultiplied: - CcLayer()->SetContentsOpaque(false); - break; - } } GPUSwapChain::~GPUSwapChain() { @@ -108,10 +48,6 @@ } void GPUSwapChain::Neuter() { - if (alpha_to_one_pipeline_ != nullptr) { - GetProcs().renderPipelineRelease(alpha_to_one_pipeline_); - alpha_to_one_pipeline_ = nullptr; - } texture_ = nullptr; if (swap_buffers_) { swap_buffers_->Neuter(); @@ -374,54 +310,6 @@ // WebGPUSwapBufferProvider::Client implementation void GPUSwapChain::OnTextureTransferred() { DCHECK(texture_); - // The texture is about to be transferred to the compositor. - // For compositing alpha mode Opaque, clear the alpha channel to - // 1.0. - switch (compositing_alpha_mode_) { - case V8GPUCanvasCompositingAlphaMode::Enum::kOpaque: { - WGPUTextureView attachment_view = - GetProcs().textureCreateView(texture_->GetHandle(), nullptr); - - WGPUDawnEncoderInternalUsageDescriptor internal_usage_desc = { - .chain = {.sType = WGPUSType_DawnEncoderInternalUsageDescriptor}, - .useInternalUsages = true, - }; - WGPUCommandEncoderDescriptor command_encoder_desc = { - .nextInChain = &internal_usage_desc.chain, - }; - WGPUCommandEncoder command_encoder = - GetProcs().deviceCreateCommandEncoder(device_->GetHandle(), - &command_encoder_desc); - - WGPURenderPassColorAttachment color_attachment = { - .view = attachment_view, - .loadOp = WGPULoadOp_Load, - .storeOp = WGPUStoreOp_Store, - }; - WGPURenderPassDescriptor render_pass_desc = { - .colorAttachmentCount = 1, - .colorAttachments = &color_attachment, - }; - WGPURenderPassEncoder pass = GetProcs().commandEncoderBeginRenderPass( - command_encoder, &render_pass_desc); - DCHECK(alpha_to_one_pipeline_); - GetProcs().renderPassEncoderSetPipeline(pass, alpha_to_one_pipeline_); - GetProcs().renderPassEncoderDraw(pass, 3, 1, 0, 0); - GetProcs().renderPassEncoderEnd(pass); - - WGPUCommandBuffer command_buffer = - GetProcs().commandEncoderFinish(command_encoder, nullptr); - GetProcs().queueSubmit(device_->queue()->GetHandle(), 1, &command_buffer); - - GetProcs().renderPassEncoderRelease(pass); - GetProcs().commandEncoderRelease(command_encoder); - GetProcs().commandBufferRelease(command_buffer); - GetProcs().textureViewRelease(attachment_view); - break; - } - case V8GPUCanvasCompositingAlphaMode::Enum::kPremultiplied: - break; - } texture_ = nullptr; }
diff --git a/third_party/blink/renderer/modules/webgpu/gpu_swap_chain.h b/third_party/blink/renderer/modules/webgpu/gpu_swap_chain.h index 2e43efa..3b6a89b 100644 --- a/third_party/blink/renderer/modules/webgpu/gpu_swap_chain.h +++ b/third_party/blink/renderer/modules/webgpu/gpu_swap_chain.h
@@ -5,7 +5,6 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_SWAP_CHAIN_H_ #define THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_SWAP_CHAIN_H_ -#include "third_party/blink/renderer/bindings/modules/v8/v8_gpu_canvas_compositing_alpha_mode.h" #include "third_party/blink/renderer/modules/webgpu/dawn_object.h" #include "third_party/blink/renderer/platform/graphics/gpu/webgpu_swap_buffer_provider.h" #include "third_party/blink/renderer/platform/heap/garbage_collected.h" @@ -31,7 +30,6 @@ WGPUTextureUsage, WGPUTextureFormat, cc::PaintFlags::FilterQuality, - V8GPUCanvasCompositingAlphaMode::Enum, gfx::Size); GPUSwapChain(const GPUSwapChain&) = delete; @@ -79,13 +77,11 @@ Member<GPUDevice> device_; Member<GPUCanvasContext> context_; - const WGPUTextureUsage usage_; - const WGPUTextureFormat format_; - const V8GPUCanvasCompositingAlphaMode::Enum compositing_alpha_mode_; + WGPUTextureUsage usage_; + WGPUTextureFormat format_; const gfx::Size size_; Member<GPUTexture> texture_; - WGPURenderPipeline alpha_to_one_pipeline_ = nullptr; scoped_refptr<StaticBitmapImage> SnapshotInternal( const WGPUTexture& texture,
diff --git a/third_party/blink/renderer/platform/audio/dynamics_compressor.cc b/third_party/blink/renderer/platform/audio/dynamics_compressor.cc index 8a95c75..1342cfe 100644 --- a/third_party/blink/renderer/platform/audio/dynamics_compressor.cc +++ b/third_party/blink/renderer/platform/audio/dynamics_compressor.cc
@@ -60,53 +60,29 @@ unsigned number_of_channels) : number_of_channels_(number_of_channels), sample_rate_(sample_rate), - compressor_(sample_rate, number_of_channels) { + ratio_(kUninitializedValue), + slope_(kUninitializedValue), + linear_threshold_(kUninitializedValue), + db_threshold_(kUninitializedValue), + db_knee_(kUninitializedValue), + knee_threshold_(kUninitializedValue), + knee_threshold_db_(kUninitializedValue), + yknee_threshold_db_(kUninitializedValue), + knee_(kUninitializedValue) { // Uninitialized state - for parameter recalculation. last_filter_stage_ratio_ = -1; last_anchor_ = -1; last_filter_stage_gain_ = -1; SetNumberOfChannels(number_of_channels); + // Initializes most member variables + Reset(); + metering_release_k_ = + static_cast<float>(audio_utilities::DiscreteTimeConstantForSampleRate( + kMeteringReleaseTimeConstant, sample_rate)); InitializeParameters(); } -void DynamicsCompressor::SetParameterValue(unsigned parameter_id, float value) { - DCHECK_LT(parameter_id, static_cast<unsigned>(kParamLast)); - parameters_[parameter_id] = value; -} - -void DynamicsCompressor::InitializeParameters() { - // Initializes compressor to default values. - - parameters_[kParamThreshold] = -24; // dB - parameters_[kParamKnee] = 30; // dB - parameters_[kParamRatio] = 12; // unit-less - parameters_[kParamAttack] = 0.003f; // seconds - parameters_[kParamRelease] = 0.250f; // seconds - parameters_[kParamPreDelay] = 0.006f; // seconds - - // Release zone values 0 -> 1. - parameters_[kParamReleaseZone1] = 0.09f; - parameters_[kParamReleaseZone2] = 0.16f; - parameters_[kParamReleaseZone3] = 0.42f; - parameters_[kParamReleaseZone4] = 0.98f; - - parameters_[kParamFilterStageGain] = 4.4f; // dB - parameters_[kParamFilterStageRatio] = 2; - parameters_[kParamFilterAnchor] = 15000 / Nyquist(); - - parameters_[kParamPostGain] = 0; // dB - parameters_[kParamReduction] = 0; // dB - - // Linear crossfade (0 -> 1). - parameters_[kParamEffectBlend] = 1; -} - -float DynamicsCompressor::ParameterValue(unsigned parameter_id) { - DCHECK_LT(parameter_id, static_cast<unsigned>(kParamLast)); - return parameters_[parameter_id]; -} - void DynamicsCompressor::Process(const AudioBus* source_bus, AudioBus* destination_bus, unsigned frames_to_process) { @@ -116,8 +92,8 @@ // channel up/down mix. Thus we need number_of_channels to do the loop work // for both source_channels_ and destination_channels_. - unsigned number_of_channels = destination_bus->NumberOfChannels(); - unsigned number_of_source_channels = source_bus->NumberOfChannels(); + const unsigned number_of_channels = destination_bus->NumberOfChannels(); + const unsigned number_of_source_channels = source_bus->NumberOfChannels(); DCHECK_EQ(number_of_channels, number_of_channels_); DCHECK(number_of_source_channels); @@ -158,293 +134,85 @@ last_anchor_ = anchor; } - float db_threshold = ParameterValue(kParamThreshold); - float db_knee = ParameterValue(kParamKnee); - float ratio = ParameterValue(kParamRatio); + const float db_threshold = ParameterValue(kParamThreshold); + const float db_knee = ParameterValue(kParamKnee); + const float ratio = ParameterValue(kParamRatio); float attack_time = ParameterValue(kParamAttack); - float release_time = ParameterValue(kParamRelease); - float pre_delay_time = ParameterValue(kParamPreDelay); + const float release_time = ParameterValue(kParamRelease); + const float pre_delay_time = ParameterValue(kParamPreDelay); // This is effectively a make-up gain on the compressed signal // (pre-blending). - float db_post_gain = ParameterValue(kParamPostGain); + const float db_post_gain = ParameterValue(kParamPostGain); // Linear blending value from dry to completely processed (0 -> 1) // 0 means the signal is completely unprocessed. // 1 mixes in only the compressed signal. - float effect_blend = ParameterValue(kParamEffectBlend); + // equal power crossfade + const float effect_blend = ParameterValue(kParamEffectBlend); - float release_zone1 = ParameterValue(kParamReleaseZone1); - float release_zone2 = ParameterValue(kParamReleaseZone2); - float release_zone3 = ParameterValue(kParamReleaseZone3); - float release_zone4 = ParameterValue(kParamReleaseZone4); + const float release_zone1 = ParameterValue(kParamReleaseZone1); + const float release_zone2 = ParameterValue(kParamReleaseZone2); + const float release_zone3 = ParameterValue(kParamReleaseZone3); + const float release_zone4 = ParameterValue(kParamReleaseZone4); // Apply compression to the source signal. - compressor_.Process(source_channels_.get(), destination_channels_.get(), - number_of_channels, frames_to_process, + const float** source_channels = source_channels_.get(); + float** destination_channels = destination_channels_.get(); - db_threshold, db_knee, ratio, attack_time, release_time, - pre_delay_time, db_post_gain, effect_blend, - - release_zone1, release_zone2, release_zone3, - release_zone4); - - // Update the compression amount. - SetParameterValue(kParamReduction, compressor_.MeteringGain()); -} - -void DynamicsCompressor::Reset() { - last_filter_stage_ratio_ = -1; // for recalc - last_anchor_ = -1; - last_filter_stage_gain_ = -1; - - compressor_.Reset(); -} - -void DynamicsCompressor::SetNumberOfChannels(unsigned number_of_channels) { - source_channels_ = std::make_unique<const float* []>(number_of_channels); - destination_channels_ = std::make_unique<float* []>(number_of_channels); - - compressor_.SetNumberOfChannels(number_of_channels); - number_of_channels_ = number_of_channels; -} - -double DynamicsCompressor::TailTime() const { - return compressor_.TailTime(); -} - -DynamicsCompressorKernel::DynamicsCompressorKernel(float sample_rate, - unsigned number_of_channels) - : sample_rate_(sample_rate), - ratio_(kUninitializedValue), - slope_(kUninitializedValue), - linear_threshold_(kUninitializedValue), - db_threshold_(kUninitializedValue), - db_knee_(kUninitializedValue), - knee_threshold_(kUninitializedValue), - knee_threshold_db_(kUninitializedValue), - yknee_threshold_db_(kUninitializedValue), - knee_(kUninitializedValue) { - SetNumberOfChannels(number_of_channels); - - // Initializes most member variables - Reset(); - - metering_release_k_ = - static_cast<float>(audio_utilities::DiscreteTimeConstantForSampleRate( - kMeteringReleaseTimeConstant, sample_rate)); -} - -void DynamicsCompressorKernel::SetNumberOfChannels( - unsigned number_of_channels) { - if (pre_delay_buffers_.size() == number_of_channels) { - return; - } - - pre_delay_buffers_.clear(); - for (unsigned i = 0; i < number_of_channels; ++i) { - pre_delay_buffers_.push_back( - std::make_unique<AudioFloatArray>(kMaxPreDelayFrames)); - } -} - -void DynamicsCompressorKernel::SetPreDelayTime(float pre_delay_time) { - // Re-configure look-ahead section pre-delay if delay time has changed. - unsigned pre_delay_frames = pre_delay_time * SampleRate(); - if (pre_delay_frames > kMaxPreDelayFrames - 1) { - pre_delay_frames = kMaxPreDelayFrames - 1; - } - - if (last_pre_delay_frames_ != pre_delay_frames) { - last_pre_delay_frames_ = pre_delay_frames; - for (auto& pre_delay_buffer : pre_delay_buffers_) { - pre_delay_buffer->Zero(); - } - - pre_delay_read_index_ = 0; - pre_delay_write_index_ = pre_delay_frames; - } -} - -// Exponential curve for the knee. -// It is 1st derivative matched at linear_threshold_ and asymptotically -// approaches the value linear_threshold_ + 1 / k. -float DynamicsCompressorKernel::KneeCurve(float x, float k) const { - // Linear up to threshold. - if (x < linear_threshold_) { - return x; - } - - return linear_threshold_ + (1 - static_cast<float>(exp(static_cast<double>( - -k * (x - linear_threshold_))))) / - k; -} - -// Full compression curve with constant ratio after knee. -float DynamicsCompressorKernel::Saturate(float x, float k) const { - float y; - - if (x < knee_threshold_) { - y = KneeCurve(x, k); - } else { - // Constant ratio after knee. - float x_db = audio_utilities::LinearToDecibels(x); - float y_db = yknee_threshold_db_ + slope_ * (x_db - knee_threshold_db_); - - y = audio_utilities::DecibelsToLinear(y_db); - } - - return y; -} - -// Approximate 1st derivative with input and output expressed in dB. -// This slope is equal to the inverse of the compression "ratio". -// In other words, a compression ratio of 20 would be a slope of 1/20. -float DynamicsCompressorKernel::SlopeAt(float x, float k) const { - if (x < linear_threshold_) { - return 1; - } - - float x2 = x * 1.001; - - float x_db = audio_utilities::LinearToDecibels(x); - float x2_db = audio_utilities::LinearToDecibels(x2); - - float y_db = audio_utilities::LinearToDecibels(KneeCurve(x, k)); - float y2_db = audio_utilities::LinearToDecibels(KneeCurve(x2, k)); - - float m = (y2_db - y_db) / (x2_db - x_db); - - return m; -} - -float DynamicsCompressorKernel::KAtSlope(float desired_slope) const { - float x_db = db_threshold_ + db_knee_; - float x = audio_utilities::DecibelsToLinear(x_db); - - // Approximate k given initial values. - float min_k = 0.1; - float max_k = 10000; - float k = 5; - - for (int i = 0; i < 15; ++i) { - // A high value for k will more quickly asymptotically approach a slope of - // 0. - float slope = SlopeAt(x, k); - - if (slope < desired_slope) { - // k is too high. - max_k = k; - } else { - // k is too low. - min_k = k; - } - - // Re-calculate based on geometric mean. - k = sqrtf(min_k * max_k); - } - - return k; -} - -float DynamicsCompressorKernel::UpdateStaticCurveParameters(float db_threshold, - float db_knee, - float ratio) { - if (db_threshold != db_threshold_ || db_knee != db_knee_ || ratio != ratio_) { - // Threshold and knee. - db_threshold_ = db_threshold; - linear_threshold_ = audio_utilities::DecibelsToLinear(db_threshold); - db_knee_ = db_knee; - - // Compute knee parameters. - ratio_ = ratio; - slope_ = 1 / ratio_; - - float k = KAtSlope(1 / ratio_); - - knee_threshold_db_ = db_threshold + db_knee; - knee_threshold_ = audio_utilities::DecibelsToLinear(knee_threshold_db_); - - yknee_threshold_db_ = - audio_utilities::LinearToDecibels(KneeCurve(knee_threshold_, k)); - - knee_ = k; - } - return knee_; -} - -void DynamicsCompressorKernel::Process( - const float* source_channels[], - float* destination_channels[], - unsigned number_of_channels, - unsigned frames_to_process, - - float db_threshold, - float db_knee, - float ratio, - float attack_time, - float release_time, - float pre_delay_time, - float db_post_gain, - float effect_blend, /* equal power crossfade */ - - float release_zone1, - float release_zone2, - float release_zone3, - float release_zone4) { DCHECK_EQ(pre_delay_buffers_.size(), number_of_channels); - float sample_rate = SampleRate(); + const float sample_rate = SampleRate(); - float dry_mix = 1 - effect_blend; - float wet_mix = effect_blend; + const float dry_mix = 1 - effect_blend; + const float wet_mix = effect_blend; - float k = UpdateStaticCurveParameters(db_threshold, db_knee, ratio); + const float k = UpdateStaticCurveParameters(db_threshold, db_knee, ratio); // Makeup gain. - float full_range_gain = Saturate(1, k); + const float full_range_gain = Saturate(1, k); float full_range_makeup_gain = 1 / full_range_gain; // Empirical/perceptual tuning. full_range_makeup_gain = fdlibm::powf(full_range_makeup_gain, 0.6f); - float linear_post_gain = + const float linear_post_gain = audio_utilities::DecibelsToLinear(db_post_gain) * full_range_makeup_gain; // Attack parameters. attack_time = std::max(0.001f, attack_time); - float attack_frames = attack_time * sample_rate; + const float attack_frames = attack_time * sample_rate; // Release parameters. - float release_frames = sample_rate * release_time; + const float release_frames = sample_rate * release_time; // Detector release time. - float sat_release_time = 0.0025f; - float sat_release_frames = sat_release_time * sample_rate; + constexpr float sat_release_time = 0.0025f; + const float sat_release_frames = sat_release_time * sample_rate; // Create a smooth function which passes through four points. // Polynomial of the form // y = a + b*x + c*x^2 + d*x^3 + e*x^4; - float y1 = release_frames * release_zone1; - float y2 = release_frames * release_zone2; - float y3 = release_frames * release_zone3; - float y4 = release_frames * release_zone4; + const float y1 = release_frames * release_zone1; + const float y2 = release_frames * release_zone2; + const float y3 = release_frames * release_zone3; + const float y4 = release_frames * release_zone4; // All of these coefficients were derived for 4th order polynomial curve // fitting where the y values match the evenly spaced x values as follows: // (y1 : x == 0, y2 : x == 1, y3 : x == 2, y4 : x == 3) - float a = 0.9999999999999998f * y1 + 1.8432219684323923e-16f * y2 - - 1.9373394351676423e-16f * y3 + 8.824516011816245e-18f * y4; - float b = -1.5788320352845888f * y1 + 2.3305837032074286f * y2 - - 0.9141194204840429f * y3 + 0.1623677525612032f * y4; - float c = 0.5334142869106424f * y1 - 1.272736789213631f * y2 + - 0.9258856042207512f * y3 - 0.18656310191776226f * y4; - float d = 0.08783463138207234f * y1 - 0.1694162967925622f * y2 + - 0.08588057951595272f * y3 - 0.00429891410546283f * y4; - float e = -0.042416883008123074f * y1 + 0.1115693827987602f * y2 - - 0.09764676325265872f * y3 + 0.028494263462021576f * y4; + const float a = 0.9999999999999998f * y1 + 1.8432219684323923e-16f * y2 - + 1.9373394351676423e-16f * y3 + 8.824516011816245e-18f * y4; + const float b = -1.5788320352845888f * y1 + 2.3305837032074286f * y2 - + 0.9141194204840429f * y3 + 0.1623677525612032f * y4; + const float c = 0.5334142869106424f * y1 - 1.272736789213631f * y2 + + 0.9258856042207512f * y3 - 0.18656310191776226f * y4; + const float d = 0.08783463138207234f * y1 - 0.1694162967925622f * y2 + + 0.08588057951595272f * y3 - 0.00429891410546283f * y4; + const float e = -0.042416883008123074f * y1 + 0.1115693827987602f * y2 - + 0.09764676325265872f * y3 + 0.028494263462021576f * y4; // x ranges from 0 -> 3 0 1 2 3 // -15 -10 -5 0db @@ -454,29 +222,30 @@ SetPreDelayTime(pre_delay_time); - const int kNDivisionFrames = 32; + constexpr int number_of_division_frames = 32; - const int n_divisions = frames_to_process / kNDivisionFrames; + const int number_of_divisions = frames_to_process / number_of_division_frames; unsigned frame_index = 0; - for (int i = 0; i < n_divisions; ++i) { + for (int i = 0; i < number_of_divisions; ++i) { // Calculate desired gain detector_average_ = EnsureFinite(detector_average_, 1); - float desired_gain = detector_average_; + const float desired_gain = detector_average_; // Pre-warp so we get desired_gain after sin() warp below. - float scaled_desired_gain = fdlibm::asinf(desired_gain) / kPiOverTwoFloat; + const float scaled_desired_gain = + fdlibm::asinf(desired_gain) / kPiOverTwoFloat; // Deal with envelopes - // envelopeRate is the rate we slew from current compressor level to the + // envelope_rate is the rate we slew from current compressor level to the // desired level. The exact rate depends on if we're attacking or // releasing and by how much. float envelope_rate; - bool is_releasing = scaled_desired_gain > compressor_gain_; + const bool is_releasing = scaled_desired_gain > compressor_gain_; // compression_diff_db is the difference between current compression level // and the desired level. @@ -506,13 +275,13 @@ // Compute adaptive release curve using 4th order polynomial. // Normal values for the polynomial coefficients would create a // monotonically increasing function. - float x2 = x * x; - float x3 = x2 * x; - float x4 = x2 * x2; - float calc_release_frames = a + b * x + c * x2 + d * x3 + e * x4; + const float x2 = x * x; + const float x3 = x2 * x; + const float x4 = x2 * x2; + const float calc_release_frames = a + b * x + c * x2 + d * x3 + e * x4; -#define kSpacingDb 5 - float db_per_frame = kSpacingDb / calc_release_frames; + constexpr float spacing_db = 5; + const float db_per_frame = spacing_db / calc_release_frames; envelope_rate = audio_utilities::DecibelsToLinear(db_per_frame); } else { @@ -527,122 +296,129 @@ max_attack_compression_diff_db_ = compression_diff_db; } - float eff_atten_diff_db = std::max(0.5f, max_attack_compression_diff_db_); + const float eff_atten_diff_db = + std::max(0.5f, max_attack_compression_diff_db_); - float x = 0.25f / eff_atten_diff_db; + const float x = 0.25f / eff_atten_diff_db; envelope_rate = 1 - fdlibm::powf(x, 1 / attack_frames); } // Inner loop - calculate shaped power average - apply compression. - { - int pre_delay_read_index = pre_delay_read_index_; - int pre_delay_write_index = pre_delay_write_index_; - float detector_average = detector_average_; - float compressor_gain = compressor_gain_; + int pre_delay_read_index = pre_delay_read_index_; + int pre_delay_write_index = pre_delay_write_index_; + float detector_average = detector_average_; + float compressor_gain = compressor_gain_; - int loop_frames = kNDivisionFrames; - while (loop_frames--) { - float compressor_input = 0; + int loop_frames = number_of_division_frames; + while (loop_frames--) { + float compressor_input = 0; - // Predelay signal, computing compression amount from un-delayed - // version. - for (unsigned j = 0; j < number_of_channels; ++j) { - float* delay_buffer = pre_delay_buffers_[j]->Data(); - float undelayed_source = source_channels[j][frame_index]; - delay_buffer[pre_delay_write_index] = undelayed_source; + // Predelay signal, computing compression amount from un-delayed + // version. + for (unsigned j = 0; j < number_of_channels; ++j) { + float* delay_buffer = pre_delay_buffers_[j]->Data(); + const float undelayed_source = source_channels[j][frame_index]; + delay_buffer[pre_delay_write_index] = undelayed_source; - float abs_undelayed_source = - undelayed_source > 0 ? undelayed_source : -undelayed_source; - if (compressor_input < abs_undelayed_source) { - compressor_input = abs_undelayed_source; - } + const float abs_undelayed_source = + undelayed_source > 0 ? undelayed_source : -undelayed_source; + if (compressor_input < abs_undelayed_source) { + compressor_input = abs_undelayed_source; } - - // Calculate shaped power on undelayed input. - - float scaled_input = compressor_input; - float abs_input = scaled_input > 0 ? scaled_input : -scaled_input; - - // Put through shaping curve. - // This is linear up to the threshold, then enters a "knee" portion - // followed by the "ratio" portion. The transition from the threshold - // to the knee is smooth (1st derivative matched). The transition from - // the knee to the ratio portion is smooth (1st derivative matched). - float shaped_input = Saturate(abs_input, k); - - float attenuation = abs_input <= 0.0001f ? 1 : shaped_input / abs_input; - - float attenuation_db = -audio_utilities::LinearToDecibels(attenuation); - attenuation_db = std::max(2.0f, attenuation_db); - - float db_per_frame = attenuation_db / sat_release_frames; - - float sat_release_rate = - audio_utilities::DecibelsToLinear(db_per_frame) - 1; - - bool is_release = (attenuation > detector_average); - float rate = is_release ? sat_release_rate : 1; - - detector_average += (attenuation - detector_average) * rate; - detector_average = std::min(1.0f, detector_average); - - detector_average = EnsureFinite(detector_average, 1); - - // Exponential approach to desired gain. - if (envelope_rate < 1) { - // Attack - reduce gain to desired. - compressor_gain += - (scaled_desired_gain - compressor_gain) * envelope_rate; - } else { - // Release - exponentially increase gain to 1.0 - compressor_gain *= envelope_rate; - compressor_gain = std::min(1.0f, compressor_gain); - } - - // Warp pre-compression gain to smooth out sharp exponential transition - // points. - float post_warp_compressor_gain = static_cast<float>( - sin(static_cast<double>(kPiOverTwoFloat * compressor_gain))); - - // Calculate total gain using the linear post-gain and effect blend. - float total_gain = - dry_mix + wet_mix * linear_post_gain * post_warp_compressor_gain; - - // Calculate metering. - float db_real_gain = 20 * log10(post_warp_compressor_gain); - if (db_real_gain < metering_gain_) { - metering_gain_ = db_real_gain; - } else { - metering_gain_ += - (db_real_gain - metering_gain_) * metering_release_k_; - } - - // Apply final gain. - for (unsigned j = 0; j < number_of_channels; ++j) { - float* delay_buffer = pre_delay_buffers_[j]->Data(); - destination_channels[j][frame_index] = - delay_buffer[pre_delay_read_index] * total_gain; - } - - frame_index++; - pre_delay_read_index = - (pre_delay_read_index + 1) & kMaxPreDelayFramesMask; - pre_delay_write_index = - (pre_delay_write_index + 1) & kMaxPreDelayFramesMask; } - // Locals back to member variables. - pre_delay_read_index_ = pre_delay_read_index; - pre_delay_write_index_ = pre_delay_write_index; - detector_average_ = - DenormalDisabler::FlushDenormalFloatToZero(detector_average); - compressor_gain_ = - DenormalDisabler::FlushDenormalFloatToZero(compressor_gain); + // Calculate shaped power on undelayed input. + + const float scaled_input = compressor_input; + const float abs_input = scaled_input > 0 ? scaled_input : -scaled_input; + + // Put through shaping curve. + // This is linear up to the threshold, then enters a "knee" portion + // followed by the "ratio" portion. The transition from the threshold + // to the knee is smooth (1st derivative matched). The transition from + // the knee to the ratio portion is smooth (1st derivative matched). + const float shaped_input = Saturate(abs_input, k); + + const float attenuation = + abs_input <= 0.0001f ? 1 : shaped_input / abs_input; + + float attenuation_db = -audio_utilities::LinearToDecibels(attenuation); + attenuation_db = std::max(2.0f, attenuation_db); + + const float db_per_frame = attenuation_db / sat_release_frames; + + const float sat_release_rate = + audio_utilities::DecibelsToLinear(db_per_frame) - 1; + + const bool is_release = (attenuation > detector_average); + const float rate = is_release ? sat_release_rate : 1; + + detector_average += (attenuation - detector_average) * rate; + detector_average = std::min(1.0f, detector_average); + + detector_average = EnsureFinite(detector_average, 1); + + // Exponential approach to desired gain. + if (envelope_rate < 1) { + // Attack - reduce gain to desired. + compressor_gain += + (scaled_desired_gain - compressor_gain) * envelope_rate; + } else { + // Release - exponentially increase gain to 1.0 + compressor_gain *= envelope_rate; + compressor_gain = std::min(1.0f, compressor_gain); + } + + // Warp pre-compression gain to smooth out sharp exponential transition + // points. + const float post_warp_compressor_gain = static_cast<float>( + sin(static_cast<double>(kPiOverTwoFloat * compressor_gain))); + + // Calculate total gain using the linear post-gain and effect blend. + const float total_gain = + dry_mix + wet_mix * linear_post_gain * post_warp_compressor_gain; + + // Calculate metering. + const float db_real_gain = + audio_utilities::LinearToDecibels(post_warp_compressor_gain); + if (db_real_gain < metering_gain_) { + metering_gain_ = db_real_gain; + } else { + metering_gain_ += (db_real_gain - metering_gain_) * metering_release_k_; + } + + // Apply final gain. + for (unsigned j = 0; j < number_of_channels; ++j) { + const float* delay_buffer = pre_delay_buffers_[j]->Data(); + destination_channels[j][frame_index] = + delay_buffer[pre_delay_read_index] * total_gain; + } + + frame_index++; + pre_delay_read_index = + (pre_delay_read_index + 1) & kMaxPreDelayFramesMask; + pre_delay_write_index = + (pre_delay_write_index + 1) & kMaxPreDelayFramesMask; } + + // Locals back to member variables. + pre_delay_read_index_ = pre_delay_read_index; + pre_delay_write_index_ = pre_delay_write_index; + detector_average_ = + DenormalDisabler::FlushDenormalFloatToZero(detector_average); + compressor_gain_ = + DenormalDisabler::FlushDenormalFloatToZero(compressor_gain); } + + // Update the compression amount. + SetParameterValue(kParamReduction, metering_gain_); } -void DynamicsCompressorKernel::Reset() { +void DynamicsCompressor::Reset() { + last_filter_stage_ratio_ = -1; // for recalc + last_anchor_ = -1; + last_filter_stage_gain_ = -1; + detector_average_ = 0; compressor_gain_ = 1; metering_gain_ = 1; @@ -658,7 +434,42 @@ max_attack_compression_diff_db_ = -1; // uninitialized state } -double DynamicsCompressorKernel::TailTime() const { +void DynamicsCompressor::SetNumberOfChannels(unsigned number_of_channels) { + source_channels_ = std::make_unique<const float*[]>(number_of_channels); + destination_channels_ = std::make_unique<float*[]>(number_of_channels); + + if (pre_delay_buffers_.size() == number_of_channels) { + return; + } + + pre_delay_buffers_.clear(); + for (unsigned i = 0; i < number_of_channels; ++i) { + pre_delay_buffers_.push_back( + std::make_unique<AudioFloatArray>(kMaxPreDelayFrames)); + } + + number_of_channels_ = number_of_channels; +} + +void DynamicsCompressor::SetParameterValue(unsigned parameter_id, float value) { + DCHECK_LT(parameter_id, static_cast<unsigned>(kParamLast)); + parameters_[parameter_id] = value; +} + +float DynamicsCompressor::ParameterValue(unsigned parameter_id) const { + DCHECK_LT(parameter_id, static_cast<unsigned>(kParamLast)); + return parameters_[parameter_id]; +} + +float DynamicsCompressor::SampleRate() const { + return sample_rate_; +} + +float DynamicsCompressor::Nyquist() const { + return sample_rate_ / 2; +} + +double DynamicsCompressor::TailTime() const { // The reduction value of the compressor is computed from the gain // using an exponential filter with a time constant of // |kMeteringReleaseTimeConstant|. We need to keep he compressor @@ -670,4 +481,166 @@ return 5 * kMeteringReleaseTimeConstant; } +double DynamicsCompressor::LatencyTime() const { + return last_pre_delay_frames_ / static_cast<double>(SampleRate()); +} + +bool DynamicsCompressor::RequiresTailProcessing() const { + // Always return true even if the tail time and latency might both be zero. + return true; +} + +void DynamicsCompressor::InitializeParameters() { + // Initializes compressor to default values. + + parameters_[kParamThreshold] = -24; // dB + parameters_[kParamKnee] = 30; // dB + parameters_[kParamRatio] = 12; // unit-less + parameters_[kParamAttack] = 0.003f; // seconds + parameters_[kParamRelease] = 0.250f; // seconds + parameters_[kParamPreDelay] = 0.006f; // seconds + + // Release zone values 0 -> 1. + parameters_[kParamReleaseZone1] = 0.09f; + parameters_[kParamReleaseZone2] = 0.16f; + parameters_[kParamReleaseZone3] = 0.42f; + parameters_[kParamReleaseZone4] = 0.98f; + + parameters_[kParamFilterStageGain] = 4.4f; // dB + parameters_[kParamFilterStageRatio] = 2; + parameters_[kParamFilterAnchor] = 15000 / Nyquist(); + + parameters_[kParamPostGain] = 0; // dB + parameters_[kParamReduction] = 0; // dB + + // Linear crossfade (0 -> 1). + parameters_[kParamEffectBlend] = 1; +} + +void DynamicsCompressor::SetPreDelayTime(float pre_delay_time) { + // Re-configure look-ahead section pre-delay if delay time has changed. + unsigned pre_delay_frames = pre_delay_time * SampleRate(); + if (pre_delay_frames > kMaxPreDelayFrames - 1) { + pre_delay_frames = kMaxPreDelayFrames - 1; + } + + if (last_pre_delay_frames_ != pre_delay_frames) { + last_pre_delay_frames_ = pre_delay_frames; + for (auto& pre_delay_buffer : pre_delay_buffers_) { + pre_delay_buffer->Zero(); + } + + pre_delay_read_index_ = 0; + pre_delay_write_index_ = pre_delay_frames; + } +} + +// Exponential curve for the knee. +// It is 1st derivative matched at linear_threshold_ and asymptotically +// approaches the value linear_threshold_ + 1 / k. +float DynamicsCompressor::KneeCurve(float x, float k) const { + // Linear up to threshold. + if (x < linear_threshold_) { + return x; + } + + return linear_threshold_ + (1 - static_cast<float>(exp(static_cast<double>( + -k * (x - linear_threshold_))))) / + k; +} + +// Full compression curve with constant ratio after knee. +float DynamicsCompressor::Saturate(float x, float k) const { + float y; + + if (x < knee_threshold_) { + y = KneeCurve(x, k); + } else { + // Constant ratio after knee. + const float x_db = audio_utilities::LinearToDecibels(x); + const float y_db = + yknee_threshold_db_ + slope_ * (x_db - knee_threshold_db_); + + y = audio_utilities::DecibelsToLinear(y_db); + } + + return y; +} + +// Approximate 1st derivative with input and output expressed in dB. +// This slope is equal to the inverse of the compression "ratio". +// In other words, a compression ratio of 20 would be a slope of 1/20. +float DynamicsCompressor::SlopeAt(float x, float k) const { + if (x < linear_threshold_) { + return 1; + } + + const float x2 = x * 1.001; + + const float x_db = audio_utilities::LinearToDecibels(x); + const float x2_db = audio_utilities::LinearToDecibels(x2); + + const float y_db = audio_utilities::LinearToDecibels(KneeCurve(x, k)); + const float y2_db = audio_utilities::LinearToDecibels(KneeCurve(x2, k)); + + const float m = (y2_db - y_db) / (x2_db - x_db); + + return m; +} + +float DynamicsCompressor::KAtSlope(float desired_slope) const { + const float x_db = db_threshold_ + db_knee_; + const float x = audio_utilities::DecibelsToLinear(x_db); + + // Approximate k given initial values. + float min_k = 0.1; + float max_k = 10000; + float k = 5; + + for (int i = 0; i < 15; ++i) { + // A high value for k will more quickly asymptotically approach a slope of + // 0. + float slope = SlopeAt(x, k); + + if (slope < desired_slope) { + // k is too high. + max_k = k; + } else { + // k is too low. + min_k = k; + } + + // Re-calculate based on geometric mean. + k = sqrtf(min_k * max_k); + } + + return k; +} + +float DynamicsCompressor::UpdateStaticCurveParameters(float db_threshold, + float db_knee, + float ratio) { + if (db_threshold != db_threshold_ || db_knee != db_knee_ || ratio != ratio_) { + // Threshold and knee. + db_threshold_ = db_threshold; + linear_threshold_ = audio_utilities::DecibelsToLinear(db_threshold); + db_knee_ = db_knee; + + // Compute knee parameters. + ratio_ = ratio; + slope_ = 1 / ratio_; + + const float k = KAtSlope(1 / ratio_); + + knee_threshold_db_ = db_threshold + db_knee; + knee_threshold_ = audio_utilities::DecibelsToLinear(knee_threshold_db_); + + yknee_threshold_db_ = + audio_utilities::LinearToDecibels(KneeCurve(knee_threshold_, k)); + + knee_ = k; + } + return knee_; +} + } // namespace blink
diff --git a/third_party/blink/renderer/platform/audio/dynamics_compressor.h b/third_party/blink/renderer/platform/audio/dynamics_compressor.h index f6ca8fd..30a09198 100644 --- a/third_party/blink/renderer/platform/audio/dynamics_compressor.h +++ b/third_party/blink/renderer/platform/audio/dynamics_compressor.h
@@ -37,106 +37,6 @@ namespace blink { -class DynamicsCompressorKernel { - DISALLOW_NEW(); - - public: - DynamicsCompressorKernel(float sample_rate, unsigned number_of_channels); - DynamicsCompressorKernel(const DynamicsCompressorKernel&) = delete; - DynamicsCompressorKernel& operator=(const DynamicsCompressorKernel&) = delete; - - void SetNumberOfChannels(unsigned); - - // Performs stereo-linked compression. - void Process(const float* source_channels[], - float* destination_channels[], - unsigned number_of_channels, - unsigned frames_to_process, - - float db_threshold, - float db_knee, - float ratio, - float attack_time, - float release_time, - float pre_delay_time, - float db_post_gain, - float effect_blend, - - float release_zone1, - float release_zone2, - float release_zone3, - float release_zone4); - - void Reset(); - - unsigned LatencyFrames() const { return last_pre_delay_frames_; } - - float SampleRate() const { return sample_rate_; } - - float MeteringGain() const { return metering_gain_; } - - double TailTime() const; - - protected: - float sample_rate_; - - float detector_average_; - float compressor_gain_; - - // Metering - float metering_release_k_; - float metering_gain_; - - // Lookahead section. - enum { kMaxPreDelayFrames = 1024 }; - enum { kMaxPreDelayFramesMask = kMaxPreDelayFrames - 1 }; - enum { - kDefaultPreDelayFrames = 256 - }; // SetPreDelayTime() will override this initial value - unsigned last_pre_delay_frames_ = kDefaultPreDelayFrames; - void SetPreDelayTime(float); - - Vector<std::unique_ptr<AudioFloatArray>> pre_delay_buffers_; - int pre_delay_read_index_ = 0; - int pre_delay_write_index_ = kDefaultPreDelayFrames; - - float max_attack_compression_diff_db_; - - // Static compression curve. - float KneeCurve(float x, float k) const; - float Saturate(float x, float k) const; - float SlopeAt(float x, float k) const; - float KAtSlope(float desired_slope) const; - - float UpdateStaticCurveParameters(float db_threshold, - float db_knee, - float ratio); - - // Amount of input change in dB required for 1 dB of output change. - // This applies to the portion of the curve above knee_threshold_db_ (see - // below). - float ratio_; - float slope_; // Inverse ratio. - - // The input to output change below the threshold is linear 1:1. - float linear_threshold_; - float db_threshold_; - - // db_knee_ is the number of dB above the threshold before we enter the - // "ratio" portion of the curve. - // knee_threshold_db_ = db_threshold_ + db_knee_ - // The portion between db_threshold_ and knee_threshold_db_ is the "soft knee" - // portion of the curve which transitions smoothly from the linear portion to - // the ratio portion. - float db_knee_; - float knee_threshold_; - float knee_threshold_db_; - float yknee_threshold_db_; - - // Internal parameter for the knee portion of the curve. - float knee_; -}; - class AudioBus; // DynamicsCompressor implements a flexible audio dynamics compression effect @@ -172,6 +72,7 @@ DynamicsCompressor(const DynamicsCompressor&) = delete; DynamicsCompressor& operator=(const DynamicsCompressor&) = delete; + // Performs stereo-linked compression. void Process(const AudioBus* source_bus, AudioBus* destination_bus, unsigned frames_to_process); @@ -179,26 +80,35 @@ void SetNumberOfChannels(unsigned); void SetParameterValue(unsigned parameter_id, float value); - float ParameterValue(unsigned parameter_id); + float ParameterValue(unsigned parameter_id) const; - float SampleRate() const { return sample_rate_; } - float Nyquist() const { return sample_rate_ / 2; } + float SampleRate() const; + float Nyquist() const; double TailTime() const; - double LatencyTime() const { - return compressor_.LatencyFrames() / static_cast<double>(SampleRate()); - } - bool RequiresTailProcessing() const { - // Always return true even if the tail time and latency might both be zero. - return true; - } + double LatencyTime() const; + + bool RequiresTailProcessing() const; protected: + void InitializeParameters(); + + void SetPreDelayTime(float); + + // Static compression curve. + float KneeCurve(float x, float k) const; + float Saturate(float x, float k) const; + float SlopeAt(float x, float k) const; + float KAtSlope(float desired_slope) const; + + float UpdateStaticCurveParameters(float db_threshold, + float db_knee, + float ratio); + unsigned number_of_channels_; // parameters_ holds the tweakable compressor parameters. float parameters_[kParamLast]; - void InitializeParameters(); float sample_rate_; @@ -210,8 +120,50 @@ std::unique_ptr<const float*[]> source_channels_; std::unique_ptr<float*[]> destination_channels_; - // The core compressor. - DynamicsCompressorKernel compressor_; + float detector_average_; + float compressor_gain_; + + // Metering + float metering_release_k_; + float metering_gain_; + + // Lookahead section. + enum { kMaxPreDelayFrames = 1024 }; + enum { kMaxPreDelayFramesMask = kMaxPreDelayFrames - 1 }; + enum { + kDefaultPreDelayFrames = 256 + }; // SetPreDelayTime() will override this initial value + unsigned last_pre_delay_frames_ = kDefaultPreDelayFrames; + + Vector<std::unique_ptr<AudioFloatArray>> pre_delay_buffers_; + int pre_delay_read_index_ = 0; + int pre_delay_write_index_ = kDefaultPreDelayFrames; + + float max_attack_compression_diff_db_; + + // Amount of input change in dB required for 1 dB of output change. + // This applies to the portion of the curve above knee_threshold_db_ (see + // below). + float ratio_; + float slope_; // Inverse ratio. + + // The input to output change below the threshold is linear 1:1. + float linear_threshold_; + float db_threshold_; + + // db_knee_ is the number of dB above the threshold before we enter the + // "ratio" portion of the curve. + // knee_threshold_db_ = db_threshold_ + db_knee_ + // The portion between db_threshold_ and knee_threshold_db_ is the "soft knee" + // portion of the curve which transitions smoothly from the linear portion to + // the ratio portion. + float db_knee_; + float knee_threshold_; + float knee_threshold_db_; + float yknee_threshold_db_; + + // Internal parameter for the knee portion of the curve. + float knee_; }; } // namespace blink
diff --git a/third_party/blink/renderer/platform/loader/fetch/response_body_loader.cc b/third_party/blink/renderer/platform/loader/fetch/response_body_loader.cc index 5b61304..8e5a79d 100644 --- a/third_party/blink/renderer/platform/loader/fetch/response_body_loader.cc +++ b/third_party/blink/renderer/platform/loader/fetch/response_body_loader.cc
@@ -46,6 +46,9 @@ if (loader_->IsSuspended()) { return Result::kShouldWait; } + if (state_ == State::kCancelled) { + return Result::kDone; + } auto result = bytes_consumer_->BeginRead(buffer, available); if (result == Result::kOk) { *available = std::min(*available, lookahead_bytes_); @@ -124,15 +127,14 @@ } state_ = State::kCancelled; - bytes_consumer_->Cancel(); if (in_on_state_change_) { has_pending_state_change_signal_ = true; return; } - task_runner_->PostTask( - FROM_HERE, base::BindOnce(&ResponseBodyLoader::DidCancelLoadingBody, - WrapWeakPersistent(loader_.Get()))); + task_runner_->PostTask(FROM_HERE, + base::BindOnce(&DelegatingBytesConsumer::CancelSync, + WrapWeakPersistent(this))); } PublicState GetPublicState() const override { if (loader_->IsAborted()) @@ -221,7 +223,7 @@ loader_->DidFailLoadingBody(); break; case State::kCancelled: - loader_->DidCancelLoadingBody(); + CancelSync(); break; } } @@ -242,6 +244,11 @@ kCancelled, }; + void CancelSync() { + bytes_consumer_->Cancel(); + loader_->DidCancelLoadingBody(); + } + void HandleResult(Result result) { if (state_ != State::kLoading) { return;
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5 index bdece37..8833778 100644 --- a/third_party/blink/renderer/platform/runtime_enabled_features.json5 +++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -1304,7 +1304,7 @@ { name: "LayoutNGBlockFragmentation", implied_by: ["LayoutNGFlexFragmentation", "LayoutNGGridFragmentation", "LayoutNGPrinting", "LayoutNGTableFragmentation"], - status: "test", + status: "stable", }, { name: "LayoutNGBlockInInline",
diff --git a/third_party/blink/tools/blinkpy/common/net/web_test_results.py b/third_party/blink/tools/blinkpy/common/net/web_test_results.py index 733170f..14f0921 100644 --- a/third_party/blink/tools/blinkpy/common/net/web_test_results.py +++ b/third_party/blink/tools/blinkpy/common/net/web_test_results.py
@@ -207,5 +207,33 @@ def didnt_run_as_expected_results(self): return self._filter_tests(lambda r: not r.did_run_as_expected()) + # Returns non flaky failing results + def failed_unexpected_resultdb(self): + results = [] + prev = None + flaky = False + for result in self._results: + if not prev: + prev = result + elif result[u'testId'] != prev[u'testId']: + if not flaky: + results.append(prev) + prev = result + flaky = False + elif result[u'status'] != prev[u'status']: + flaky = True + if not flaky: + results.append(prev) + failed_results = [] + for result in results: + if result[u'status'] == u"FAIL": + failed_results.append(result) + return failed_results + + def fail_result_exists_resultdb(self, test): + for result in self._results: + if test in result[u'testId'] and result[u'status'] == u"FAIL": + return True + def test_results_resultdb(self): return self._results
diff --git a/third_party/blink/tools/blinkpy/common/net/web_test_results_unittest.py b/third_party/blink/tools/blinkpy/common/net/web_test_results_unittest.py index e42ee7abb2..f3b8497 100644 --- a/third_party/blink/tools/blinkpy/common/net/web_test_results_unittest.py +++ b/third_party/blink/tools/blinkpy/common/net/web_test_results_unittest.py
@@ -121,6 +121,87 @@ "builder_name": "mock_builder_name" });""" + example_resultsdb_unexpected_json = [ + { + "name": "tests/example/flaky.html/results/1", + "testId": "ninja://:blink_web_tests/example/flaky.html", + "resultId": "1", + "variant": { + "def": { + "builder": "linux-blink-rel", + "os": "Ubuntu-18.04", + "test_suite": "blink_web_tests" + } + }, + "status": "FAIL", + }, + { + "name": "tests/example/flaky.html/results/2", + "testId": "ninja://:blink_web_tests/example/flaky.html", + "resultId": "2", + "variant": { + "def": { + "builder": "linux-blink-rel", + "os": "Ubuntu-18.04", + "test_suite": "blink_web_tests" + } + }, + "status": "PASS", + }, + { + "name": "tests/example/flaky.html/results/3", + "testId": "ninja://:blink_web_tests/example/unexpected_fail.html", + "resultId": "3", + "variant": { + "def": { + "builder": "linux-blink-rel", + "os": "Ubuntu-18.04", + "test_suite": "blink_web_tests" + } + }, + "status": "FAIL", + }, + { + "name": "tests/example/flaky.html/results/4", + "testId": "ninja://:blink_web_tests/example/unexpected_fail.html", + "resultId": "4", + "variant": { + "def": { + "builder": "linux-blink-rel", + "os": "Ubuntu-18.04", + "test_suite": "blink_web_tests" + } + }, + "status": "FAIL", + }, + { + "name": "tests/example/flaky.html/results/5", + "testId": "ninja://:blink_web_tests/example/unexpected_pass.html", + "resultId": "5", + "variant": { + "def": { + "builder": "linux-blink-rel", + "os": "Ubuntu-18.04", + "test_suite": "blink_web_tests" + } + }, + "status": "PASS", + }, + { + "name": "tests/example/flaky.html/results/6", + "testId": "ninja://:blink_web_tests/example/unexpected_pass.html", + "resultId": "6", + "variant": { + "def": { + "builder": "linux-blink-rel", + "os": "Ubuntu-18.04", + "test_suite": "blink_web_tests" + } + }, + "status": "PASS", + }, + ] + def test_empty_results_from_string(self): self.assertIsNone(WebTestResults.results_from_string(None)) self.assertIsNone(WebTestResults.results_from_string('')) @@ -215,3 +296,24 @@ self.assertSetEqual( results.result_for_test('fast/dom/missing-text.html'). suffixes_for_test_result(), {'txt'}) + + def test_failed_unexpected_resultdb(self): + results = WebTestResults.results_from_resultdb( + self.example_resultsdb_unexpected_json) + failed_results = results.failed_unexpected_resultdb() + self.assertEqual(len(failed_results), 1) + self.assertDictEqual( + { + 'status': 'FAIL', + 'variant': { + 'def': { + 'builder': 'linux-blink-rel', + 'test_suite': 'blink_web_tests', + 'os': 'Ubuntu-18.04' + } + }, + 'resultId': '3', + 'name': 'tests/example/flaky.html/results/3', + 'testId': + 'ninja://:blink_web_tests/example/unexpected_fail.html' + }, failed_results[0])
diff --git a/third_party/blink/tools/blinkpy/presubmit/audit_non_blink_usage.py b/third_party/blink/tools/blinkpy/presubmit/audit_non_blink_usage.py index 957de3f..a23d0a29 100755 --- a/third_party/blink/tools/blinkpy/presubmit/audit_non_blink_usage.py +++ b/third_party/blink/tools/blinkpy/presubmit/audit_non_blink_usage.py
@@ -159,9 +159,6 @@ # //base/memory/ptr_util.h. 'base::WrapUnique', - # //base/allocator/partition_allocator/oom_callback.h. - 'base::SetPartitionAllocOomCallback', - # //base/containers/adapters.h 'base::Reversed',
diff --git a/third_party/blink/tools/blinkpy/tool/commands/rebaseline.py b/third_party/blink/tools/blinkpy/tool/commands/rebaseline.py index f0a8d89b..356742e 100644 --- a/third_party/blink/tools/blinkpy/tool/commands/rebaseline.py +++ b/third_party/blink/tools/blinkpy/tool/commands/rebaseline.py
@@ -340,19 +340,20 @@ # test of interest than sending out the RPC for every test. webtest_results_resultdb = self._tool.results_fetcher.fetch_results_from_resultdb_layout_tests( self._tool, build, True) - results_list = webtest_results_resultdb.test_results_resultdb() artifact_fetch_urls = [] - done = False - for result in results_list: - if done: - break - if test_name in result['testId']: - artifact_list = self._tool.results_fetcher.get_artifact_list_for_test( - self._tool, result['name']) - for artifact in artifact_list: - if 'actual' in artifact['artifactId']: - artifact_fetch_urls.append(artifact['fetchUrl']) - done = True + if webtest_results_resultdb: + results_list = webtest_results_resultdb.test_results_resultdb() + done = False + for result in results_list: + if done: + break + if test_name in result['testId']: + artifact_list = self._tool.results_fetcher.get_artifact_list_for_test( + self._tool, result['name']) + for artifact in artifact_list: + if 'actual' in artifact['artifactId']: + artifact_fetch_urls.append(artifact['fetchUrl']) + done = True return artifact_fetch_urls def _rebaseline_commands(self, test_baseline_set, options): @@ -361,6 +362,8 @@ copy_baseline_commands = [] rebaseline_commands = [] lines_to_remove = {} + fetch_urls = [] + suffixes = [] builders_to_fetch_from = self._builders_to_fetch_from( test_baseline_set.all_builders()) @@ -368,10 +371,13 @@ if build.builder_name not in builders_to_fetch_from: continue - suffixes = list(self._suffixes_for_actual_failures(test, build)) - # Sorting it here so we can have a deterministic order for comparing - # the suffixes in unit tests. - suffixes.sort() + if options.resultDB: + fetch_urls = self.baseline_fetch_url_resultdb(test, build) + suffixes = list( + self._suffixes_for_actual_failures_resultdb(test, build)) + else: + suffixes = list(self._suffixes_for_actual_failures( + test, build)) if not suffixes: # Only try to remove the expectation if the test # 1. ran and passed ([ Skip ], [ WontFix ] should be kept) @@ -386,6 +392,9 @@ lines_to_remove[test].append(port_name) continue + # Sorting it here so we can have a deterministic order for comparing + # the suffixes in unit tests. + suffixes.sort() args = [] if options.verbose: args.append('--verbose') @@ -426,14 +435,15 @@ build.builder_name)): args.extend(['--flag-specific', options.flag_specific]) - step_name = self._tool.results_fetcher.get_layout_test_step_name( - build) + step_name = "" + if not options.resultDB: + step_name = self._tool.results_fetcher.get_layout_test_step_name( + build) if step_name: args.extend(['--step-name', step_name]) if options.resultDB: args.append('--resultDB') - fetch_urls = self.baseline_fetch_url_resultdb(test, build) args.extend(['--fetch-url', ','.join(fetch_urls)]) rebaseline_command = [ @@ -464,7 +474,10 @@ _log.debug('Could not add file based off output "%s"', stdout) return change_set - def _optimize_baselines(self, test_baseline_set, verbose=False): + def _optimize_baselines(self, + test_baseline_set, + verbose=False, + resultDB=False): """Returns a list of commands to run in parallel to de-duplicate baselines.""" tests_to_suffixes = collections.defaultdict(set) builders_to_fetch_from = self._builders_to_fetch_from( @@ -484,8 +497,12 @@ build.builder_name): continue - tests_to_suffixes[test].update( - self._suffixes_for_actual_failures(test, build)) + if resultDB: + tests_to_suffixes[test].update( + self._suffixes_for_actual_failures_resultdb(test, build)) + else: + tests_to_suffixes[test].update( + self._suffixes_for_actual_failures(test, build)) optimize_commands = [] for test, suffixes in tests_to_suffixes.items(): @@ -585,10 +602,8 @@ copy_baseline_commands, rebaseline_commands, extra_lines_to_remove = self._rebaseline_commands( test_baseline_set, options) lines_to_remove = {} - self._run_in_parallel(copy_baseline_commands) lines_to_remove = self._run_in_parallel(rebaseline_commands) - for test in extra_lines_to_remove: if test in lines_to_remove: lines_to_remove[test] = ( @@ -601,7 +616,8 @@ if options.optimize: self._run_in_parallel( - self._optimize_baselines(test_baseline_set, options.verbose)) + self._optimize_baselines(test_baseline_set, options.verbose, + options.resultDB)) self._tool.git().add_list(self.unstaged_baselines()) @@ -637,6 +653,20 @@ def _web_tests_dir(self): return self._tool.port_factory.get().web_tests_dir() + def _suffixes_for_actual_failures_resultdb(self, test, build): + suffixes = set() + fetch_url_list = self.baseline_fetch_url_resultdb(test, build) + for artifact_fetch_url in fetch_url_list: + if 'actual_image' in artifact_fetch_url: + suffixes.add('png') + if 'actual_text' in artifact_fetch_url: + suffixes.add('txt') + if 'actual_audio' in artifact_fetch_url: + suffixes.add('wav') + if self._tool.builders.is_wpt_builder(build.builder_name): + suffixes.add('txt') + return suffixes + def _suffixes_for_actual_failures(self, test, build): """Gets the baseline suffixes for actual mismatch failures in some results.
diff --git a/third_party/blink/tools/blinkpy/tool/commands/rebaseline_cl.py b/third_party/blink/tools/blinkpy/tool/commands/rebaseline_cl.py index f7b6fc3..58bbf4752 100644 --- a/third_party/blink/tools/blinkpy/tool/commands/rebaseline_cl.py +++ b/third_party/blink/tools/blinkpy/tool/commands/rebaseline_cl.py
@@ -334,8 +334,16 @@ test = test.strip() if not test or test.startswith('#'): continue - for build in builds_to_results: - test_baseline_set.add(test, build) + for build, results in builds_to_results.items(): + if self._resultdb_fetcher: + # In the current flow, similar check to check for the presence of + # a result is done later in rebaseline by sending the request again. + # This can be done here itself to get an optimal test_baseline_set. + if results and results.fail_result_exists_resultdb( + test): + test_baseline_set.add(test, build) + else: + test_baseline_set.add(test, build) except IOError: _log.info('Could not read test names from %s', filename) return test_baseline_set @@ -352,8 +360,12 @@ """ test_baseline_set = TestBaselineSet(self._tool) for test in tests: - for build in builds_to_results: - test_baseline_set.add(test, build) + for build, results in builds_to_results.items(): + if self._resultdb_fetcher: + if results and results.fail_result_exists_resultdb(test): + test_baseline_set.add(test, build) + else: + test_baseline_set.add(test, build) return test_baseline_set def _make_test_baseline_set(self, builds_to_results, only_changed_tests): @@ -373,7 +385,12 @@ """ builds_to_tests = {} for build, results in builds_to_results.items(): - builds_to_tests[build] = self._tests_to_rebaseline(build, results) + if self._resultdb_fetcher: + builds_to_tests[build] = self._tests_to_rebaseline_resultDB( + build, results) + else: + builds_to_tests[build] = self._tests_to_rebaseline( + build, results) if only_changed_tests: files_in_cl = self._tool.git().changed_files(diff_filter='AM') # In the changed files list from Git, paths always use "/" as @@ -399,6 +416,35 @@ return self._tool.filesystem.relpath( finder.web_tests_dir(), finder.path_from_chromium_base()) + '/' + def _tests_to_rebaseline_resultDB(self, build, web_test_results): + """Fetches a list of tests that should be rebaselined for some build. + + Args: + build: A Build instance. + web_test_results: A WebTestResults instance or None. + + Returns: + A sorted list of tests to rebaseline for this build. + """ + if web_test_results is None: + return [] + + failed_tests = web_test_results.failed_unexpected_resultdb() + failed_test_names = [ + r['testId'][len('ninja://:blink_web_tests') + 1:] + for r in failed_tests + ] + + # we do not create baselines for reftests. + port_name = self._tool.builders.port_name_for_builder_name( + build.builder_name) + port = self._tool.port_factory.get(port_name, None) + tests_to_rebaseline = [] + for test_name in failed_test_names: + if not port.reference_files(test_name): + tests_to_rebaseline.append(test_name) + return tests_to_rebaseline + def _tests_to_rebaseline(self, build, web_test_results): """Fetches a list of tests that should be rebaselined for some build.
diff --git a/third_party/blink/tools/blinkpy/tool/commands/rebaseline_cl_unittest.py b/third_party/blink/tools/blinkpy/tool/commands/rebaseline_cl_unittest.py index 5f2036c..ce5b9851 100644 --- a/third_party/blink/tools/blinkpy/tool/commands/rebaseline_cl_unittest.py +++ b/third_party/blink/tools/blinkpy/tool/commands/rebaseline_cl_unittest.py
@@ -148,34 +148,43 @@ }, }, }) - self.web_test_resultsdb = WebTestResults([ - { - "name": "tests/two/image-fail.html/results/2", - "testId": "ninja://:blink_web_tests/two/image-fail.html", - "resultId": "2", - "variant": { - "def": { - "builder": "", - "os": "", - "test_suite": "blink_web_tests" - } - }, - "status": "FAIL" + self.web_test_resultsdb = WebTestResults([{ + "name": "tests/two/image-fail.html/results/2", + "testId": "ninja://:blink_web_tests/two/image-fail.html", + "resultId": "2", + "variant": { + "def": { + "builder": "", + "os": "", + "test_suite": "blink_web_tests" + } }, - { - "name": "tests/one/missing.html/results/1", - "testId": "ninja://:blink_web_tests/one/image-fail.html", - "resultId": "1", - "variant": { - "def": { - "builder": "", - "os": "", - "test_suite": "blink_web_tests" - } - }, - "status": "FAIL" + "status": "FAIL" + }, { + "name": "tests/one/missing.html/results/1", + "testId": "ninja://:blink_web_tests/one/missing.html", + "resultId": "1", + "variant": { + "def": { + "builder": "", + "os": "", + "test_suite": "blink_web_tests" + } }, - ]) + "status": "FAIL" + }, { + "name": "tests/one/crash.html/results/3", + "testId": "ninja://:blink_web_tests/one/crash.html", + "resultId": "3", + "variant": { + "def": { + "builder": "", + "os": "", + "test_suite": "blink_web_tests" + } + }, + "status": "CRASH" + }]) self.test_artifacts_list = { "tests/one/missing.html/results/1": [{ "name": @@ -192,6 +201,14 @@ "fetchUrl": "https://results.usercontent.cr.dev/invocations/task-chromium-swarm.appspot.com-2/tests/ninja:%2F%2F:blink_web_tests%2Ftwo%2Fimage-fail.html/results/artifacts/actual_image?token=2", "contentType": "image/png", + }], + "tests/one/crash.html/results/3": [{ + "name": + "invocations/task-chromium-swarm.appspot.com-2/tests/ninja:%2F%2F:blink_web_tests%2Ftwo%2Fcrash.html/results/3", + "artifactId": "actual_text", + "fetchUrl": + "https://results.usercontent.cr.dev/invocations/task-chromium-swarm.appspot.com-2/tests/ninja:%2F%2F:blink_web_tests%2Fone%2Fcrash.html/results/artifacts/actual_text?token=3", + "contentType": "text", }] } @@ -250,6 +267,26 @@ options.update(kwargs) return optparse.Values(dict(**options)) + @staticmethod + def command_options_resultDB(**kwargs): + options = { + 'dry_run': False, + 'only_changed_tests': False, + 'trigger_jobs': True, + 'fill_missing': None, + 'optimize': True, + 'results_directory': None, + 'test_name_file': None, + 'verbose': False, + 'builders': [], + 'patchset': None, + 'use_blink_try_bots_only': False, + 'flag_specific': None, + 'resultDB': True + } + options.update(kwargs) + return optparse.Values(dict(**options)) + def test_execute_basic(self): # By default, with no arguments or options, rebaseline-cl rebaselines # all of the tests that unexpectedly failed. @@ -264,6 +301,23 @@ 'INFO: Rebaselining two/image-fail.html\n', ]) + def test_execute_basic_resultDB(self): + # By default, with no arguments or options, rebaseline-cl rebaselines + # all of the tests that unexpectedly failed. + for build in self.builds: + self.tool.results_fetcher.set_results_to_resultdb( + build, self.web_test_resultsdb) + self.tool.results_fetcher.set_artifact_list_for_test( + build, self.test_artifacts_list) + exit_code = self.command.execute(self.command_options_resultDB(), [], + self.tool) + self.assertEqual(exit_code, 0) + self.assertLog([ + 'INFO: Finished try jobs found for all try bots.\n', + 'INFO: Rebaselining one/missing.html\n', + 'INFO: Rebaselining two/image-fail.html\n', + ]) + def test_execute_with_test_name_file(self): fs = self.mac_port.host.filesystem test_name_file = fs.mktemp()
diff --git a/third_party/blink/tools/blinkpy/tool/commands/rebaseline_test.py b/third_party/blink/tools/blinkpy/tool/commands/rebaseline_test.py index a33476c..b1d55f4 100644 --- a/third_party/blink/tools/blinkpy/tool/commands/rebaseline_test.py +++ b/third_party/blink/tools/blinkpy/tool/commands/rebaseline_test.py
@@ -67,6 +67,8 @@ suffix = 'txt' if 'actual_audio' in artifact_fetch_url: suffix = 'wav' + if self._tool.builders.is_wpt_builder(options.builder): + suffix = 'txt' self._rebaseline_test(port_name, test_name, suffix,
diff --git a/third_party/blink/web_tests/SlowTests b/third_party/blink/web_tests/SlowTests index d2032fc..5e7aa50 100644 --- a/third_party/blink/web_tests/SlowTests +++ b/third_party/blink/web_tests/SlowTests
@@ -797,3 +797,5 @@ crbug.com/1263580 editing/deleting/delete-many-lines-of-text.html [ Slow ] crbug.com/1255482 external/wpt/css/css-fonts/crash-large-grapheme-cluster.html [ Slow ] + +crbug.com/1298800 http/tests/misc/drag-bookmark.html [ Slow ]
diff --git a/third_party/blink/web_tests/TestExpectations b/third_party/blink/web_tests/TestExpectations index 605ccb2..59a5e3f8 100644 --- a/third_party/blink/web_tests/TestExpectations +++ b/third_party/blink/web_tests/TestExpectations
@@ -917,6 +917,8 @@ crbug.com/1299442 [ Mac ] virtual/off-main-thread-css-paint/external/wpt/css/css-paint-api/registered-property-interpolation-006.https.html [ Failure ] crbug.com/1299442 [ Mac10.15 ] virtual/off-main-thread-css-paint/external/wpt/css/css-paint-api/setTransform-002.https.html [ Failure ] crbug.com/1299442 virtual/off-main-thread-css-paint/external/wpt/css/css-paint-api/parse-input-arguments-007.https.html [ Failure Pass ] +crbug.com/1299442 [ Mac ] virtual/off-main-thread-css-paint/external/wpt/css/css-paint-api/geometry-background-image-001.https.html [ Failure Pass ] +crbug.com/1299442 [ Mac ] virtual/off-main-thread-css-paint/external/wpt/css/css-paint-api/setTransform-001.https.html [ Failure Pass ] # ====== Paint team owned tests to here ====== @@ -7557,7 +7559,6 @@ crbug.com/1271296 virtual/no-forced-frame-updates/external/wpt/html/dom/render-blocking/parser-inserted-preload-link.tentative.html [ Skip ] crbug.com/1271296 virtual/no-forced-frame-updates/external/wpt/html/dom/render-blocking/render-blocked-apis-by-preload-link.tentative.html [ Skip ] crbug.com/1271296 virtual/no-forced-frame-updates/external/wpt/html/dom/render-blocking/script-inserted-preload-link.tentative.html [ Skip ] -crbug.com/1271296 virtual/no-forced-frame-updates/external/wpt/html/dom/render-blocking/script-inserted-stylesheet-link.tentative.html [ Skip ] crbug.com/1271296 virtual/no-forced-frame-updates/external/wpt/html/dom/render-blocking/parser-inserted-async-script.tentative.html [ Skip ] crbug.com/1271296 virtual/no-forced-frame-updates/external/wpt/html/dom/render-blocking/parser-inserted-defer-script.tentative.html [ Skip ] crbug.com/1271296 virtual/no-forced-frame-updates/external/wpt/html/dom/render-blocking/parser-inserted-module-script.tentative.html [ Skip ] @@ -7673,3 +7674,7 @@ crbug.com/1298836 external/wpt/fetch/api/basic/response-null-body.any.* [ Failure Pass ] crbug.com/1298836 virtual/plz-dedicated-worker/external/wpt/fetch/api/basic/response-null-body.any.* [ Failure Pass ] + +# Sheriff 2022-03-10 +crbug.com/1304956 storage/indexeddb/dont-wedge.html [ Failure Pass ] +crbug.com/1305023 [ Mac10.12 ] virtual/partitioned-cookies-first-party-sets/http/tests/inspector-protocol/network/cross-origin-isolation/coep-load-error-reporting-worker.js [ Failure Pass ]
diff --git a/third_party/blink/web_tests/VIRTUAL_OWNERS b/third_party/blink/web_tests/VIRTUAL_OWNERS index 30fd1d0..e6bb716 100644 --- a/third_party/blink/web_tests/VIRTUAL_OWNERS +++ b/third_party/blink/web_tests/VIRTUAL_OWNERS
@@ -16,6 +16,7 @@ # # [1] https://chromium.googlesource.com/chromium/src/+/main/docs/testing/web_tests.md#testing-runtime-flags +dom@chromium.org ikilpatrick@chromium.org kojii@chromium.org masonf@chromium.org
diff --git a/third_party/blink/web_tests/WebGPUExpectations b/third_party/blink/web_tests/WebGPUExpectations index 0441a06..5392837 100644 --- a/third_party/blink/web_tests/WebGPUExpectations +++ b/third_party/blink/web_tests/WebGPUExpectations
@@ -169,20 +169,6 @@ wpt_internal/webgpu/cts.https.html?q=webgpu:api,validation,attachment_compatibility:render_pass_and_bundle,depth_format:* [ Failure ] wpt_internal/webgpu/cts.https.html?q=webgpu:api,operation,command_buffer,image_copy:rowsPerImage_and_bytesPerRow_depth_stencil:* [ Skip ] # Skipped because it conflicted with a Slow expectation. wpt_internal/webgpu/cts.https.html?q=webgpu:api,operation,command_buffer,image_copy:offsets_and_sizes_copy_depth_stencil:* [ Failure ] -wpt_internal/webgpu/cts.https.html?q=webgpu:api,operation,command_buffer,copyTextureToTexture:copy_multisampled_depth:* [ Failure ] -wpt_internal/webgpu/cts.https.html?q=webgpu:api,operation,render_pass,storeOp:render_pass_store_op,color_attachment_with_depth_stencil_attachment:* [ Failure ] -wpt_internal/webgpu/cts.https.html?q=webgpu:api,operation,render_pass,storeOp:render_pass_store_op,depth_stencil_attachment_only:* [ Failure ] -wpt_internal/webgpu/cts.https.html?q=webgpu:api,operation,render_pipeline,culling_tests:culling:* [ Failure ] -wpt_internal/webgpu/cts.https.html?q=webgpu:api,operation,rendering,depth:depth_compare_func:* [ Failure ] -wpt_internal/webgpu/cts.https.html?q=webgpu:api,operation,rendering,depth:reverse_depth:* [ Failure ] -wpt_internal/webgpu/cts.https.html?q=webgpu:api,operation,resource_init,texture_zero:uninitialized_texture_is_zero:dimension="2d";readMethod="CopyToBuffer";format="depth32float";* [ Failure ] -wpt_internal/webgpu/cts.https.html?q=webgpu:api,operation,resource_init,texture_zero:uninitialized_texture_is_zero:dimension="2d";readMethod="CopyToTexture";format="depth32float";* [ Failure ] -wpt_internal/webgpu/cts.https.html?q=webgpu:api,operation,resource_init,texture_zero:uninitialized_texture_is_zero:dimension="2d";readMethod="DepthTest";format="depth24plus";* [ Failure ] -wpt_internal/webgpu/cts.https.html?q=webgpu:api,operation,resource_init,texture_zero:uninitialized_texture_is_zero:dimension="2d";readMethod="DepthTest";format="depth32float";* [ Failure ] -wpt_internal/webgpu/cts.https.html?q=webgpu:api,validation,attachment_compatibility:render_pass_or_bundle_and_pipeline,depth_format:* [ Failure ] -wpt_internal/webgpu/cts.https.html?q=webgpu:api,validation,resource_usages,texture,in_pass_encoder:subresources_and_binding_types_combination_for_aspect:compute=false;* [ Failure ] -wpt_internal/webgpu/cts.https.html?q=webgpu:api,validation,texture,destroy:submit_a_destroyed_texture_as_attachment:* [ Failure ] -wpt_internal/webgpu/cts.https.html?worker=1&q=webgpu:api,operation,render_pass,storeOp:* [ Failure ] # Our automated build does not support mp4 currently (fails on Linux, Mac, and Win Intel) wpt_internal/webgpu/cts.https.html?q=webgpu:web_platform,external_texture,video:importExternalTexture,sample:videoSource="red-green.mp4" [ Failure ]
diff --git a/third_party/blink/web_tests/android/WebLayerWPTOverrideExpectations b/third_party/blink/web_tests/android/WebLayerWPTOverrideExpectations index b7dd739..8c6fe2a 100644 --- a/third_party/blink/web_tests/android/WebLayerWPTOverrideExpectations +++ b/third_party/blink/web_tests/android/WebLayerWPTOverrideExpectations
@@ -637,7 +637,6 @@ crbug.com/1050754 external/wpt/css/css-color/system-color-compute.html [ Failure Pass ] crbug.com/1050754 external/wpt/css/css-contain/contain-size-grid-003.html [ Failure ] crbug.com/1050754 external/wpt/css/css-contain/contain-size-grid-004.html [ Failure ] -crbug.com/1050754 external/wpt/css/css-contain/content-visibility/content-visibility-044.html [ Failure Pass ] crbug.com/1050754 external/wpt/css/css-contain/content-visibility/content-visibility-047.html [ Crash Failure Pass ] crbug.com/1050754 external/wpt/css/css-contain/content-visibility/content-visibility-053.html [ Crash Failure Pass ] crbug.com/1050754 external/wpt/css/css-contain/content-visibility/content-visibility-068.html [ Failure ] @@ -1844,7 +1843,6 @@ crbug.com/1050754 external/wpt/webmessaging/multi-globals/broadcastchannel-incumbent.sub.html [ Pass ] crbug.com/1050754 external/wpt/webrtc-encoded-transform/RTCPeerConnection-insertable-streams-simulcast.https.html [ Pass Timeout ] crbug.com/1050754 external/wpt/webrtc-extensions/transfer-datachannel-service-worker.https.html [ Failure ] -crbug.com/1050754 external/wpt/webrtc-extensions/transfer-datachannel.html [ Failure ] crbug.com/1050754 external/wpt/webrtc-insertable-streams/RTCPeerConnection-insertable-streams-simulcast.https.html [ Pass Timeout ] crbug.com/1050754 external/wpt/webrtc/RTCDTMFSender-ontonechange.https.html [ Failure Timeout ] crbug.com/1050754 external/wpt/webrtc/RTCIceConnectionState-candidate-pair.https.html [ Failure Pass ]
diff --git a/third_party/blink/web_tests/external/Version b/third_party/blink/web_tests/external/Version index ecb9fd3..e7eb3838 100644 --- a/third_party/blink/web_tests/external/Version +++ b/third_party/blink/web_tests/external/Version
@@ -1 +1 @@ -Version: aee3583a2c92911540493123490d8db028b38eca +Version: db1d8d994f24b6d031e5cab56145082af682cd70
diff --git a/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json b/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json index 84ba327..7e7f386 100644 --- a/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json +++ b/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json
@@ -434,6 +434,13 @@ ] ] }, + "float-after-self-collapsing-block-in-inline-crash.html": [ + "1ab512748cab6d010bea00361af3344834dc9771", + [ + null, + {} + ] + ], "fragmentainer-1px-clamping-000-crash.html": [ "78bf7a3f799aa9e712abbdbb4ba2745ae4964a93", [ @@ -80294,7 +80301,7 @@ ] ], "multi-line-row-flex-fragmentation-046.html": [ - "03f6770e57c9d29771a76d615acc38d605bb99e2", + "99e25337920a9f0d458dc941bb779def3f850388", [ null, [ @@ -81100,7 +81107,7 @@ ] ], "single-line-row-flex-fragmentation-026.html": [ - "d88d93b28bf64179bae392cd17d76bc901849563", + "9a78bf503b7238cf04cdb969c01ead6ef1affd56", [ null, [ @@ -137221,6 +137228,19 @@ {} ] ], + "multicol-span-all-017.html": [ + "00764ccdb1bfe91bc6045d6a5bd03bb43c354334", + [ + null, + [ + [ + "/css/reference/ref-filled-green-100px-square.xht", + "==" + ] + ], + {} + ] + ], "multicol-span-all-block-sibling-003.xht": [ "abaa45f0a85023f3f07a9db483629b74d2b09d71", [ @@ -142722,6 +142742,19 @@ {} ] ], + "position-absolute-multicol-001.html": [ + "08132188cece2b913187e9662d577c319de02cb3", + [ + null, + [ + [ + "/css/reference/pass_if_pass_below.html", + "==" + ] + ], + {} + ] + ], "position-absolute-replaced-intrinsic-size.tentative.html": [ "4e2ecb63abbb990ec565012c87160de046bbe7bf", [ @@ -231728,7 +231761,7 @@ }, "app-history": { "META.yml": [ - "ec4e3701cc73038246b0daaa9bb398c6c066d32e", + "de4f6c9a335bd4b7d5e99d14d37b904fe5d54182", [] ], "OWNERS": [ @@ -233008,7 +233041,7 @@ [] ], "clear-site-data.html.headers": [ - "a0077c0577fc31220a63d0424f3fd4d1ab2de2bc", + "955424f246f15b518ca13479ca0efe36f7471061", [] ], "do-expect-received.py": [ @@ -233167,6 +233200,54 @@ [] ] }, + "sandbox": { + "iframe-csp-same-origin.https.html.headers": [ + "cf57761d12098eddb0de207e4f5be75d7b33e7f1", + [] + ], + "iframe-csp.https.html.headers": [ + "e0deb770b48e6095b7caf78e991ee92dd047edbd", + [] + ], + "iframe-iframe-popups.https.html.headers": [ + "53fe8f542386a677413e39772545308e9faa4911", + [] + ], + "iframe-popups-escape-sandbox.https.html.headers": [ + "53fe8f542386a677413e39772545308e9faa4911", + [] + ], + "iframe-popups.https.html.headers": [ + "53fe8f542386a677413e39772545308e9faa4911", + [] + ], + "iframe-same-origin.https.html.headers": [ + "53fe8f542386a677413e39772545308e9faa4911", + [] + ], + "iframe.https.html.headers": [ + "53fe8f542386a677413e39772545308e9faa4911", + [] + ], + "resources": { + "embedded-popup-expect-hints.html": [ + "6cd5f0a29ee1237d1531258db55a38a9d32c3c0a", + [] + ], + "embedded-popup-expect-no-hints.html": [ + "46dbb7f23655e200f350931ce4934bf26c6f2288", + [] + ], + "iframe-with-embedded-popup-expect-no-hints.html": [ + "21efd76180c1542d6d06b2c67b5c57ffe8b9676b", + [] + ], + "util.js": [ + "79e9a87bc043dff8b6fb026bd14611652d58fc0c", + [] + ] + } + }, "sec-ch-quotes.https.html.headers": [ "abec79a3582a6de1cba0601332e4abb76618a265", [] @@ -240437,6 +240518,10 @@ "cda68a773462467bbcf8e0911c5dbfc85a52f295", [] ], + "block-in-inline-vertical-align-001-ref.html": [ + "20a8ae08c0e56f6a5fc7f2b244b51134aa97c864", + [] + ], "block-in-inline-whitespace-001-ref.xht": [ "263fd25ecb1231ff6e751ac67d99355a835dc003", [] @@ -297621,7 +297706,7 @@ }, "form-controls": { "input-line-height-computed-expected.txt": [ - "0d3b48a912ee40683ad4b7721917096a3a54288f", + "ee74b1b6bf7b26b451b99ccb43f3ae0df7d3bfb3", [] ], "input-line-height-ref.html": [ @@ -300985,10 +301070,6 @@ "11961886a23b2a0857ab34a9789b849776624c6e", [] ], - "106-import-xhtml-expected.txt": [ - "895c1244d8dfc0da1969265a387ec2cdc6005c4e", - [] - ], "106-module-import-expected.txt": [ "850d797f283d1560f415bba71258386984767d07", [] @@ -300997,10 +301078,6 @@ "850d797f283d1560f415bba71258386984767d07", [] ], - "106-noimport-xhtml-expected.txt": [ - "c1dac735ceade2af73c23179e0e9a7c668985274", - [] - ], "128-expected.txt": [ "4c6504ee207535b1b97fb81e196c5eb8a3aa075b", [] @@ -304332,7 +304409,7 @@ [] ], "handler-tools.js": [ - "073287265cfe5f5b219ad6f61ffed89556a1e5cb", + "88c62ec373d1c696a06a083458d573eac303ecc7", [] ], "handler.html": [ @@ -306875,12 +306952,12 @@ "loading": { "early-hints": { "resources": { - "early-hints-helpers.js": [ - "e2fc1e7d03238e5d1f3566f4209884dc5da30187", + "early-hints-helpers.sub.js": [ + "72cebf9540ca0240a3360feb1cb5ce47e8b5838d", [] ], "early-hints-test-loader.h2.py": [ - "92ce586f378fbd9bd0f16d142911d232e831f094", + "aa9188c6dbc3920055095421bc880ec5595b0bbb", [] ], "empty.js": [ @@ -306896,19 +306973,19 @@ [] ], "get-fetch-timing-and-headers.h2.py": [ - "ff4f8bedd2b473599828866e0c9353d5c63f5723", + "59f67be3cf929d89ecc6ec8598ee7276b1648fa3", [] ], "preload-initiator-type.html": [ - "34188df2fe437fdbc8d6814ad33c83c8dac23391", + "39b0db0f89534c1f012985f9e7e86b715dccf6a9", [] ], "referrer-policy-test-loader.h2.py": [ - "ad48cbb71d3bb577be86c5a7ab02134ad018d2e9", + "901d64a01f17465fe6c842856aa5d61c054608a8", [] ], "referrer-policy-test.html": [ - "514e6c6539ca90e09756209d46b47e9321735148", + "af4f393d56f13ce62e9a436d60f97eb3749f40f7", [] ], "utils.py": [ @@ -315653,7 +315730,7 @@ [] ], "partitioned-service-worker-getRegistrations.tentative.https-expected.txt": [ - "318c2cbf9e749e08dc509baf58046f5b9ba33921", + "ccc4e1befa0bf852ecbc18f4e6c90fca46d65841", [] ], "partitioned-service-worker-matchAll.tentative.https-expected.txt": [ @@ -316650,23 +316727,23 @@ [] ], "partitioned-service-worker-iframe-claim.html": [ - "c0f8d76901a2a7a7ef552da13571505af9699c1d", + "8135d2751a968527983a59968117097e5477070a", [] ], "partitioned-service-worker-third-party-iframe-getRegistrations.html": [ - "f7b99cb358a2343758fcb9d359778eb02aaf1f69", + "4aceb56b315c2fd6cc9333df2af907fb0177c998", [] ], "partitioned-service-worker-third-party-iframe-matchAll.html": [ - "ba17b4ddce13dbd2bac59d7e6150129661cb2fb1", + "8be121036fa5af70fed37288503c3ff702ab56ca", [] ], "partitioned-service-worker-third-party-iframe.html": [ - "b7bb3514acfaef7c55450f3db0af1bdf281740d9", + "624a8e25eef661b9129bdcda01b96aeccdc5bff4", [] ], "partitioned-service-worker-third-party-window.html": [ - "65ac002bd5389061996ba99b1db88b96457b3116", + "86384ce28087422a46bcc6eef2dbda9771859508", [] ], "partitioned-storage-sw.js": [ @@ -345880,6 +345957,86 @@ } }, "device": { + "forget": { + "connect-after-forget.https.window.js": [ + "0b15b4d060d9ae8e4795b2a4fbb684db53218f69", + [ + "bluetooth/device/forget/connect-after-forget.https.window.html", + { + "script_metadata": [ + [ + "script", + "/resources/testdriver.js" + ], + [ + "script", + "/resources/testdriver-vendor.js" + ], + [ + "script", + "/bluetooth/resources/bluetooth-test.js" + ], + [ + "script", + "/bluetooth/resources/bluetooth-fake-devices.js" + ] + ] + } + ] + ], + "detachedIframe.https.window.js": [ + "c34a3c41f25099defe0f3c63b9f8a122add41a9c", + [ + "bluetooth/device/forget/detachedIframe.https.window.html", + { + "script_metadata": [ + [ + "script", + "/resources/testdriver.js" + ], + [ + "script", + "/resources/testdriver-vendor.js" + ], + [ + "script", + "/bluetooth/resources/bluetooth-test.js" + ], + [ + "script", + "/bluetooth/resources/bluetooth-fake-devices.js" + ] + ] + } + ] + ], + "getDevices.https.window.js": [ + "e9ce65631932ca937306e34e6032c0a8c29a6bb5", + [ + "bluetooth/device/forget/getDevices.https.window.html", + { + "script_metadata": [ + [ + "script", + "/resources/testdriver.js" + ], + [ + "script", + "/resources/testdriver-vendor.js" + ], + [ + "script", + "/bluetooth/resources/bluetooth-test.js" + ], + [ + "script", + "/bluetooth/resources/bluetooth-fake-devices.js" + ] + ] + } + ] + ] + }, "gattserverdisconnected-event": { "disconnected.https.window.js": [ "43a11a88cbf655ee4aab6ac70215ae3fb5f9a541", @@ -351126,6 +351283,57 @@ {} ] ], + "sandbox": { + "iframe-csp-same-origin.https.html": [ + "f96e642fa238b41cfe8946667148f9fd2d49fff0", + [ + null, + {} + ] + ], + "iframe-csp.https.html": [ + "6412eb67a2cc0d2ff8a96fd0b8b1fca0fc4187a1", + [ + null, + {} + ] + ], + "iframe-iframe-popups.https.html": [ + "e8852c9fc255553504124c6bf7a1793ec7b02c2a", + [ + null, + {} + ] + ], + "iframe-popups-escape-sandbox.https.html": [ + "fbe723bee85d95552fc6d989fb745ec149e125e8", + [ + null, + {} + ] + ], + "iframe-popups.https.html": [ + "9cb0713ad26967a74d5e5259eb63cea310d8444d", + [ + null, + {} + ] + ], + "iframe-same-origin.https.html": [ + "e9a01f53f9625df675e46b9261bd8768b0029741", + [ + null, + {} + ] + ], + "iframe.https.html": [ + "2d3e63ccdfaf517060173fa0d723a5c2fb09e39b", + [ + null, + {} + ] + ] + }, "sec-ch-quotes.https.html": [ "9d822df2d80110a1c150764d4cd44127dcd9d155", [ @@ -351633,6 +351841,15 @@ } }, "close-watcher": { + "abortsignal.html": [ + "eb70ffed1b05e58fe4d5f31d49840ce4422846d0", + [ + null, + { + "testdriver": true + } + ] + ], "basic.html": [ "cb8bdaaa6ff238d2b992a57c41abd475b27992c6", [ @@ -365417,7 +365634,7 @@ ] ], "content-visibility-044.html": [ - "7378bcd71554a3c5299f361d91b1f29ceac81a8b", + "f8b94634476a05b3b756e533e7a723766fb5afb7", [ null, {} @@ -388896,6 +389113,13 @@ {} ] ], + "pt-to-px-width.html": [ + "485149ac74ab16ce980105be599982420b36b548", + [ + null, + {} + ] + ], "resize-event-on-initial-layout.html": [ "dc2f04bcced73dffc16d0c439ea029469da2017d", [ @@ -474561,28 +474785,104 @@ "loading": { "early-hints": { "preload-initiator-type.h2.window.js": [ - "33f2c812fd57ec0886264100254b7c9f86289cc2", + "959aacef4978b935b44fec694d5f3ca3cb074485", [ "loading/early-hints/preload-initiator-type.h2.window.html", { "script_metadata": [ [ "script", - "resources/early-hints-helpers.js" + "resources/early-hints-helpers.sub.js" ] ] } ] ], - "referrer-policy.h2.window.js": [ - "28756c9f857704c0373f622d5778e219c8a2af94", + "referrer-policy-no-referrer.h2.window.js": [ + "10f2c2c4bcda67541489dd1dd1a14426568d61a3", [ - "loading/early-hints/referrer-policy.h2.window.html", + "loading/early-hints/referrer-policy-no-referrer.h2.window.html", { "script_metadata": [ [ "script", "/common/utils.js" + ], + [ + "script", + "resources/early-hints-helpers.sub.js" + ] + ] + } + ] + ], + "referrer-policy-origin-when-cross-origin.h2.window.js": [ + "250f350877942087e03aad2527f7157393cfcd51", + [ + "loading/early-hints/referrer-policy-origin-when-cross-origin.h2.window.html", + { + "script_metadata": [ + [ + "script", + "/common/utils.js" + ], + [ + "script", + "resources/early-hints-helpers.sub.js" + ] + ] + } + ] + ], + "referrer-policy-origin.h2.window.js": [ + "3fbe9dff76eacb84796499676219b1015b26c0e8", + [ + "loading/early-hints/referrer-policy-origin.h2.window.html", + { + "script_metadata": [ + [ + "script", + "/common/utils.js" + ], + [ + "script", + "resources/early-hints-helpers.sub.js" + ] + ] + } + ] + ], + "referrer-policy-same-origin.h2.window.js": [ + "4d24e1bf9813ced4baf38a0830781738c287052b", + [ + "loading/early-hints/referrer-policy-same-origin.h2.window.html", + { + "script_metadata": [ + [ + "script", + "/common/utils.js" + ], + [ + "script", + "resources/early-hints-helpers.sub.js" + ] + ] + } + ] + ], + "referrer-policy-unsafe-url.h2.window.js": [ + "a0c304cb10fa6accc67ba36d2a4480a738f30651", + [ + "loading/early-hints/referrer-policy-unsafe-url.h2.window.html", + { + "script_metadata": [ + [ + "script", + "/common/utils.js" + ], + [ + "script", + "resources/early-hints-helpers.sub.js" ] ] } @@ -477372,7 +477672,7 @@ ] ], "VideoTrackGenerator.https.html": [ - "afcc1a04e91f77859fb0c700e5d2f28e29f62689", + "2c81c7604ab4362e5f2eeb018ece5f0147818dba", [ null, {} @@ -506553,7 +506853,7 @@ ] ], "partitioned-service-worker-getRegistrations.tentative.https.html": [ - "81d275194ef61ea9cff192b5d07913c32bdba8af", + "7c4d4f1e028b3966afdcfef10c060aefee54e344", [ null, {} @@ -536657,7 +536957,7 @@ ] ], "transfer-datachannel.html": [ - "a1e5dcec6d2777231e0db6ec7b86b5145e7cdceb", + "9759a67a24463d874a4bbf426b06d38adba114b4", [ null, {} @@ -561651,6 +561951,13 @@ {} ] ], + "block-in-inline-vertical-align-001.html": [ + "406774c453729b6fe149fe75ee777de24fcd28d2", + [ + null, + {} + ] + ], "block-non-replaced-height-002.xht": [ "9d27f433c4be84a61c991a5f8a6211f1aeb8a67f", [ @@ -569940,13 +570247,6 @@ null, {} ] - ], - "multicol-span-all-017.tentative.html": [ - "7d19bb53fbee1b9c4afa97fe2bf51dce2dee283b", - [ - null, - {} - ] ] }, "css-namespaces": {
diff --git a/third_party/blink/web_tests/external/wpt/app-history/META.yml b/third_party/blink/web_tests/external/wpt/app-history/META.yml index ec4e370..de4f6c9 100644 --- a/third_party/blink/web_tests/external/wpt/app-history/META.yml +++ b/third_party/blink/web_tests/external/wpt/app-history/META.yml
@@ -1,4 +1,4 @@ -spec: https://wicg.github.io/app-history/ +spec: https://wicg.github.io/navigation-api/ suggested_reviewers: - domenic - natechapin
diff --git a/third_party/blink/web_tests/external/wpt/bluetooth/device/forget/connect-after-forget.https.window.js b/third_party/blink/web_tests/external/wpt/bluetooth/device/forget/connect-after-forget.https.window.js new file mode 100644 index 0000000..0b15b4d --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/bluetooth/device/forget/connect-after-forget.https.window.js
@@ -0,0 +1,11 @@ +// META: script=/resources/testdriver.js +// META: script=/resources/testdriver-vendor.js +// META: script=/bluetooth/resources/bluetooth-test.js +// META: script=/bluetooth/resources/bluetooth-fake-devices.js + +bluetooth_test(async (t) => { + const { device } = await getConnectedHealthThermometerDevice(); + await device.forget(); + + await promise_rejects_dom(t, 'SecurityError', device.gatt.connect()); +}, 'gatt.connect() rejects after forget().');
diff --git a/third_party/blink/web_tests/external/wpt/bluetooth/device/forget/detachedIframe.https.window.js b/third_party/blink/web_tests/external/wpt/bluetooth/device/forget/detachedIframe.https.window.js new file mode 100644 index 0000000..c34a3c4 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/bluetooth/device/forget/detachedIframe.https.window.js
@@ -0,0 +1,26 @@ +// META: script=/resources/testdriver.js +// META: script=/resources/testdriver-vendor.js +// META: script=/bluetooth/resources/bluetooth-test.js +// META: script=/bluetooth/resources/bluetooth-fake-devices.js + +bluetooth_test(async () => { + let iframe = document.createElement('iframe'); + let error; + + const {device} = await getHealthThermometerDeviceFromIframe(iframe); + + iframe.remove(); + // Set iframe to null to ensure that the GC cleans up as much as possible. + iframe = null; + await runGarbageCollection(); + + try { + await device.forget(); + } catch (e) { + // Cannot use promise_rejects_dom() because |e| is thrown from a different + // global. + error = e; + } + assert_not_equals(error, undefined); + assert_equals(error.name, 'TypeError'); +}, 'forget() rejects in a detached context');
diff --git a/third_party/blink/web_tests/external/wpt/bluetooth/device/forget/getDevices.https.window.js b/third_party/blink/web_tests/external/wpt/bluetooth/device/forget/getDevices.https.window.js new file mode 100644 index 0000000..e9ce656 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/bluetooth/device/forget/getDevices.https.window.js
@@ -0,0 +1,18 @@ +// META: script=/resources/testdriver.js +// META: script=/resources/testdriver-vendor.js +// META: script=/bluetooth/resources/bluetooth-test.js +// META: script=/bluetooth/resources/bluetooth-fake-devices.js + +bluetooth_test(async () => { + await getConnectedHealthThermometerDevice(); + const devicesBeforeForget = await navigator.bluetooth.getDevices(); + assert_equals( + devicesBeforeForget.length, 1, 'getDevices() should return the granted device.'); + + const device = devicesBeforeForget[0]; + await device.forget(); + const devicesAfterForget = await navigator.bluetooth.getDevices(); + assert_equals( + devicesAfterForget.length, 0, + 'getDevices() is empty after device.forget().'); +}, 'forget() removes devices from getDevices().');
diff --git a/third_party/blink/web_tests/external/wpt/css/css-contain/content-visibility/content-visibility-044.html b/third_party/blink/web_tests/external/wpt/css/css-contain/content-visibility/content-visibility-044.html index 7378bcd..f8b94634 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-contain/content-visibility/content-visibility-044.html +++ b/third_party/blink/web_tests/external/wpt/css/css-contain/content-visibility/content-visibility-044.html
@@ -12,7 +12,7 @@ <body style="margin: 0"> <div id=host> -<input id=slotted> +<input id=slotted style="margin: 0"> <script> async_test((t) => {
diff --git a/third_party/blink/web_tests/external/wpt/css/css-multicol/multicol-span-all-017.tentative.html b/third_party/blink/web_tests/external/wpt/css/css-multicol/multicol-span-all-017.html similarity index 88% rename from third_party/blink/web_tests/external/wpt/css/css-multicol/multicol-span-all-017.tentative.html rename to third_party/blink/web_tests/external/wpt/css/css-multicol/multicol-span-all-017.html index 7d19bb53..00764cc 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-multicol/multicol-span-all-017.tentative.html +++ b/third_party/blink/web_tests/external/wpt/css/css-multicol/multicol-span-all-017.html
@@ -1,6 +1,7 @@ <!DOCTYPE html> <link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org"> <link rel="help" href="https://github.com/w3c/csswg-drafts/issues/6805"> +<link rel="match" href="../reference/ref-filled-green-100px-square.xht"> <meta name="assert" content="Test that column-span all inside a transform doesn't create a spanner"> <p>Test passes if there is a filled green square and <strong>no red</strong>.</p> <div style="columns:2; column-fill:auto; column-gap:0; width:100px; height:100px; background:red;">
diff --git a/third_party/blink/web_tests/external/wpt/css/css-position/position-absolute-multicol-001.html b/third_party/blink/web_tests/external/wpt/css/css-position/position-absolute-multicol-001.html new file mode 100644 index 0000000..0813218 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-position/position-absolute-multicol-001.html
@@ -0,0 +1,15 @@ +<!DOCTYPE html> +<meta charset=utf-8> +<title>CSS Positioned Layout Test: Absolute positioned element inside multicol</title> +<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> +<link rel="help" href="https://drafts.csswg.org/css-position/#valdef-position-absolute"> +<link rel="match" href="/css/reference/pass_if_pass_below.html"> +<meta name=assert content="Checks that an absolute positioned element inside multicol is rendered, when a previous absolute positioned element has been rendered already."> +<p>Test passes if there is the word "PASS" below.</p> +<div style="position: relative;"> + <div style="position: absolute;"> + </div> + <div style="column-count: 2;"> + <div style="position: absolute;">PASS</div> + </div> +</div>
diff --git a/third_party/blink/web_tests/external/wpt/html/rendering/non-replaced-elements/form-controls/input-line-height-computed-expected.txt b/third_party/blink/web_tests/external/wpt/html/rendering/non-replaced-elements/form-controls/input-line-height-computed-expected.txt index 0d3b48a..ee74b1b 100644 --- a/third_party/blink/web_tests/external/wpt/html/rendering/non-replaced-elements/form-controls/input-line-height-computed-expected.txt +++ b/third_party/blink/web_tests/external/wpt/html/rendering/non-replaced-elements/form-controls/input-line-height-computed-expected.txt
@@ -3,8 +3,8 @@ PASS <input type=text>.computedStyleMap().get('line-height') should not be affected by the used value clamping FAIL getComputedStyle(<input type=tel>).lineHeight should return a used value that is no smaller than 'normal' (but should not literally be 'normal') assert_not_equals: usedLineHeight got disallowed value "1px" PASS <input type=tel>.computedStyleMap().get('line-height') should not be affected by the used value clamping -FAIL getComputedStyle(<input type=search>).lineHeight should return a used value that is no smaller than 'normal' (but should not literally be 'normal') assert_not_equals: usedLineHeight got disallowed value "normal" -FAIL <input type=search>.computedStyleMap().get('line-height') should not be affected by the used value clamping assert_equals: computedLineHeight.value expected (number) 1 but got (string) "normal" +FAIL getComputedStyle(<input type=search>).lineHeight should return a used value that is no smaller than 'normal' (but should not literally be 'normal') assert_not_equals: usedLineHeight got disallowed value "1px" +PASS <input type=search>.computedStyleMap().get('line-height') should not be affected by the used value clamping FAIL getComputedStyle(<input type=url>).lineHeight should return a used value that is no smaller than 'normal' (but should not literally be 'normal') assert_not_equals: usedLineHeight got disallowed value "1px" PASS <input type=url>.computedStyleMap().get('line-height') should not be affected by the used value clamping FAIL getComputedStyle(<input type=email>).lineHeight should return a used value that is no smaller than 'normal' (but should not literally be 'normal') assert_not_equals: usedLineHeight got disallowed value "1px"
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/scripting-1/the-script-element/execution-timing/106-import-xhtml-expected.txt b/third_party/blink/web_tests/external/wpt/html/semantics/scripting-1/the-script-element/execution-timing/106-import-xhtml-expected.txt deleted file mode 100644 index 895c124..0000000 --- a/third_party/blink/web_tests/external/wpt/html/semantics/scripting-1/the-script-element/execution-timing/106-import-xhtml-expected.txt +++ /dev/null
@@ -1,4 +0,0 @@ -This is a testharness.js-based test. -FAIL Stylesheet in XHTML HEAD with @import blocking scripts assert_equals: expected "fixed" but got "static" -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/scripting-1/the-script-element/execution-timing/106-noimport-xhtml-expected.txt b/third_party/blink/web_tests/external/wpt/html/semantics/scripting-1/the-script-element/execution-timing/106-noimport-xhtml-expected.txt deleted file mode 100644 index c1dac73..0000000 --- a/third_party/blink/web_tests/external/wpt/html/semantics/scripting-1/the-script-element/execution-timing/106-noimport-xhtml-expected.txt +++ /dev/null
@@ -1,4 +0,0 @@ -This is a testharness.js-based test. -FAIL Stylesheet in XHTML HEAD blocking scripts assert_equals: expected "fixed" but got "static" -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/external/wpt/html/webappapis/system-state-and-capabilities/the-navigator-object/resources/handler-tools.js b/third_party/blink/web_tests/external/wpt/html/webappapis/system-state-and-capabilities/the-navigator-object/resources/handler-tools.js index 0732872..88c62ec 100644 --- a/third_party/blink/web_tests/external/wpt/html/webappapis/system-state-and-capabilities/the-navigator-object/resources/handler-tools.js +++ b/third_party/blink/web_tests/external/wpt/html/webappapis/system-state-and-capabilities/the-navigator-object/resources/handler-tools.js
@@ -41,7 +41,7 @@ resultingURL = e.data; assert_equals(stringBetweenMarkers(resultingURL, "QES", "QEE"), "%86", "query baseline"); assert_equals(stringBetweenMarkers(resultingURL, "FES", "FEE"), "%E2%80%A0", "fragment baseline"); - assert_equals(stringBetweenMarkers(resultingURL, "PSS", "PSE"), `${encodeURIComponent(scheme)}%3A${includeNull ? "%2500" : ""}%2501%2502%2503%2504%2505%2506%2507%2508%250B%250C%250E%250F%2510%2511%2512%2513%2514%2515%2516%2517%2518%2519%251A%251B%251C%251D%251E%251F%20!%22%23%24%25%26${type === "query" ? "%27" : "'"}()*%2B%2C-.%2F0123456789%3A%3B%3C%3D%3E%3F%40ABCDEFGHIJKLMNOPQRSTUVWXYZ%5B%5C%5D%5E_%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D~%257F%25C2%2580%25C2%2581`, "actual test"); + assert_equals(stringBetweenMarkers(resultingURL, "PSS", "PSE"), `${encodeURIComponent(scheme)}%3A${includeNull ? "%2500" : ""}%2501%2502%2503%2504%2505%2506%2507%2508%250B%250C%250E%250F%2510%2511%2512%2513%2514%2515%2516%2517%2518%2519%251A%251B%251C%251D%251E%251F%20!%22%23%24%25%26${type === "query" ? "%27" : "'"}()*%2B%2C-.%2F0123456789%3A%3B%253C%3D%253E%3F%40ABCDEFGHIJKLMNOPQRSTUVWXYZ%5B%5C%5D%5E_%2560abcdefghijklmnopqrstuvwxyz%7B%7C%7D~%257F%25C2%2580%25C2%2581`, "actual test"); resolve(); }); });
diff --git a/third_party/blink/web_tests/external/wpt/loading/early-hints/preload-initiator-type.h2.window.js b/third_party/blink/web_tests/external/wpt/loading/early-hints/preload-initiator-type.h2.window.js index 33f2c81..959aacef 100644 --- a/third_party/blink/web_tests/external/wpt/loading/early-hints/preload-initiator-type.h2.window.js +++ b/third_party/blink/web_tests/external/wpt/loading/early-hints/preload-initiator-type.h2.window.js
@@ -1,4 +1,4 @@ -// META: script=resources/early-hints-helpers.js +// META: script=resources/early-hints-helpers.sub.js test(() => { const preloads = [{
diff --git a/third_party/blink/web_tests/external/wpt/loading/early-hints/referrer-policy-no-referrer.h2.window.js b/third_party/blink/web_tests/external/wpt/loading/early-hints/referrer-policy-no-referrer.h2.window.js new file mode 100644 index 0000000..10f2c2c --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/loading/early-hints/referrer-policy-no-referrer.h2.window.js
@@ -0,0 +1,4 @@ +// META: script=/common/utils.js +// META: script=resources/early-hints-helpers.sub.js + +test(() => testReferrerPolicy("no-referrer"));
diff --git a/third_party/blink/web_tests/external/wpt/loading/early-hints/referrer-policy-origin-when-cross-origin.h2.window.js b/third_party/blink/web_tests/external/wpt/loading/early-hints/referrer-policy-origin-when-cross-origin.h2.window.js new file mode 100644 index 0000000..250f3508 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/loading/early-hints/referrer-policy-origin-when-cross-origin.h2.window.js
@@ -0,0 +1,4 @@ +// META: script=/common/utils.js +// META: script=resources/early-hints-helpers.sub.js + +test(() => testReferrerPolicy("origin-when-cross-origin"));
diff --git a/third_party/blink/web_tests/external/wpt/loading/early-hints/referrer-policy-origin.h2.window.js b/third_party/blink/web_tests/external/wpt/loading/early-hints/referrer-policy-origin.h2.window.js new file mode 100644 index 0000000..3fbe9dff --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/loading/early-hints/referrer-policy-origin.h2.window.js
@@ -0,0 +1,4 @@ +// META: script=/common/utils.js +// META: script=resources/early-hints-helpers.sub.js + +test(() => testReferrerPolicy("origin"));
diff --git a/third_party/blink/web_tests/external/wpt/loading/early-hints/referrer-policy-same-origin.h2.window.js b/third_party/blink/web_tests/external/wpt/loading/early-hints/referrer-policy-same-origin.h2.window.js new file mode 100644 index 0000000..4d24e1b --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/loading/early-hints/referrer-policy-same-origin.h2.window.js
@@ -0,0 +1,4 @@ +// META: script=/common/utils.js +// META: script=resources/early-hints-helpers.sub.js + +test(() => testReferrerPolicy("same-origin"));
diff --git a/third_party/blink/web_tests/external/wpt/loading/early-hints/referrer-policy-unsafe-url.h2.window.js b/third_party/blink/web_tests/external/wpt/loading/early-hints/referrer-policy-unsafe-url.h2.window.js new file mode 100644 index 0000000..a0c304c --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/loading/early-hints/referrer-policy-unsafe-url.h2.window.js
@@ -0,0 +1,4 @@ +// META: script=/common/utils.js +// META: script=resources/early-hints-helpers.sub.js + +test(() => testReferrerPolicy("unsafe-url"));
diff --git a/third_party/blink/web_tests/external/wpt/loading/early-hints/referrer-policy.h2.window.js b/third_party/blink/web_tests/external/wpt/loading/early-hints/referrer-policy.h2.window.js deleted file mode 100644 index 28756c9f..0000000 --- a/third_party/blink/web_tests/external/wpt/loading/early-hints/referrer-policy.h2.window.js +++ /dev/null
@@ -1,14 +0,0 @@ -// META: script=/common/utils.js - -function test_referrer_policy(referrer_policy) { - const params = new URLSearchParams(); - const preload_url = "fetch-and-record-js.h2.py?id=" + token(); - params.set("preload-url", preload_url); - params.set("referrer-policy", referrer_policy); - const path = "resources/referrer-policy-test-loader.h2.py?" + params.toString(); - const url = new URL(path, window.location); - window.location.replace(url); -} - -// TODO(https://crbug.com/1302851): Add more test cases. -test(() => test_referrer_policy("no-referrer"));
diff --git a/third_party/blink/web_tests/external/wpt/loading/early-hints/resources/early-hints-helpers.js b/third_party/blink/web_tests/external/wpt/loading/early-hints/resources/early-hints-helpers.sub.js similarity index 60% rename from third_party/blink/web_tests/external/wpt/loading/early-hints/resources/early-hints-helpers.js rename to third_party/blink/web_tests/external/wpt/loading/early-hints/resources/early-hints-helpers.sub.js index e2fc1e7d..72cebf9 100644 --- a/third_party/blink/web_tests/external/wpt/loading/early-hints/resources/early-hints-helpers.js +++ b/third_party/blink/web_tests/external/wpt/loading/early-hints/resources/early-hints-helpers.sub.js
@@ -35,4 +35,22 @@ preloads.push(JSON.parse(encoded)); } return preloads; -} \ No newline at end of file +} + +/** + * Navigate to the referrer policy test page. + * + * @param {string} referrer_policy - A value of Referrer-Policy to test. + */ +function testReferrerPolicy(referrer_policy) { + const params = new URLSearchParams(); + params.set("referrer-policy", referrer_policy); + const same_origin_preload_url = "https://{{host}}:{{ports[h2][0]}}/loading/early-hints/resources/fetch-and-record-js.h2.py?id=" + token(); + params.set("same-origin-preload-url", same_origin_preload_url); + const cross_origin_preload_url = "https://{{hosts[alt][www]}}:{{ports[h2][0]}}/loading/early-hints/resources/fetch-and-record-js.h2.py?id=" + token(); + params.set("cross-origin-preload-url", cross_origin_preload_url); + + const path = "resources/referrer-policy-test-loader.h2.py?" + params.toString(); + const url = new URL(path, window.location); + window.location.replace(url); +}
diff --git a/third_party/blink/web_tests/external/wpt/loading/early-hints/resources/early-hints-test-loader.h2.py b/third_party/blink/web_tests/external/wpt/loading/early-hints/resources/early-hints-test-loader.h2.py index 92ce586f3..aa9188c6d 100644 --- a/third_party/blink/web_tests/external/wpt/loading/early-hints/resources/early-hints-test-loader.h2.py +++ b/third_party/blink/web_tests/external/wpt/loading/early-hints/resources/early-hints-test-loader.h2.py
@@ -1,6 +1,6 @@ # An HTTP/2 handler for testing Early Hints. Used as an entry point of Early # Hints related tests to inject Early Hints response. See comments in -# `early-hints-helpers.js`. +# `early-hints-helpers.sub.js`. import json import os
diff --git a/third_party/blink/web_tests/external/wpt/loading/early-hints/resources/get-fetch-timing-and-headers.h2.py b/third_party/blink/web_tests/external/wpt/loading/early-hints/resources/get-fetch-timing-and-headers.h2.py index ff4f8bed..59f67be 100644 --- a/third_party/blink/web_tests/external/wpt/loading/early-hints/resources/get-fetch-timing-and-headers.h2.py +++ b/third_party/blink/web_tests/external/wpt/loading/early-hints/resources/get-fetch-timing-and-headers.h2.py
@@ -4,6 +4,9 @@ def main(request, response): - headers = [("Content-Type", "application/json")] + headers = [ + ("Content-Type", "application/json"), + ("Access-Control-Allow-Origin", "*"), + ] body = utils.get_request_timing_and_headers(request) return (200, "OK"), headers, body
diff --git a/third_party/blink/web_tests/external/wpt/loading/early-hints/resources/preload-initiator-type.html b/third_party/blink/web_tests/external/wpt/loading/early-hints/resources/preload-initiator-type.html index 34188df..39b0db0f 100644 --- a/third_party/blink/web_tests/external/wpt/loading/early-hints/resources/preload-initiator-type.html +++ b/third_party/blink/web_tests/external/wpt/loading/early-hints/resources/preload-initiator-type.html
@@ -2,7 +2,7 @@ <meta charset=utf-8> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="early-hints-helpers.js"></script> +<script src="early-hints-helpers.sub.js"></script> <body> <script> async_test((t) => {
diff --git a/third_party/blink/web_tests/external/wpt/loading/early-hints/resources/referrer-policy-test-loader.h2.py b/third_party/blink/web_tests/external/wpt/loading/early-hints/resources/referrer-policy-test-loader.h2.py index ad48cbb..901d64a 100644 --- a/third_party/blink/web_tests/external/wpt/loading/early-hints/resources/referrer-policy-test-loader.h2.py +++ b/third_party/blink/web_tests/external/wpt/loading/early-hints/resources/referrer-policy-test-loader.h2.py
@@ -6,7 +6,11 @@ headers = [] referrer_policy = request.GET.first(b"referrer-policy") headers.append((b"referrer-policy", referrer_policy)) - preload_url = request.GET.first(b"preload-url").decode() + + preload_url = request.GET.first(b"same-origin-preload-url").decode() + link_header_value = "<{}>; rel=preload; as=script".format(preload_url) + headers.append((b"link", link_header_value)) + preload_url = request.GET.first(b"cross-origin-preload-url").decode() link_header_value = "<{}>; rel=preload; as=script".format(preload_url) headers.append((b"link", link_header_value))
diff --git a/third_party/blink/web_tests/external/wpt/loading/early-hints/resources/referrer-policy-test.html b/third_party/blink/web_tests/external/wpt/loading/early-hints/resources/referrer-policy-test.html index 514e6c6..af4f393d 100644 --- a/third_party/blink/web_tests/external/wpt/loading/early-hints/resources/referrer-policy-test.html +++ b/third_party/blink/web_tests/external/wpt/loading/early-hints/resources/referrer-policy-test.html
@@ -2,7 +2,7 @@ <meta charset=utf-8> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="early-hints-helpers.js"></script> +<script src="early-hints-helpers.sub.js"></script> <body> <script> const SEARCH_PARAMS = new URLSearchParams(window.location.search); @@ -17,37 +17,58 @@ }); } -async function get_fetch_timing_and_headers(url) { - const index = url.lastIndexOf("?"); - const params = new URLSearchParams(url.substring(index)); - const id = params.get("id"); +async function get_fetch_timing_and_headers(url_string) { + const url = new URL(url_string); + const id = url.searchParams.get("id"); if (id === null) { - throw new Error(`"${url}" does not contain id parameter`); + throw new Error(`"${url.href}" does not contain id parameter`); } - const response = await fetch("get-fetch-timing-and-headers.h2.py?id=" + id); + const response = await fetch(`${url.origin}/loading/early-hints/resources/get-fetch-timing-and-headers.h2.py?id=${id}`); const json = await response.json(); return json; } -function get_expected_referrer() { +function get_expected_referrer(is_same_origin) { + const full = window.location.href; + const origin = self.origin + "/"; + // There is no support for security level related policies such as + // "no-referrer-when-downgrade" since the test is available only on HTTP/2. switch (REFERRER_POLICY) { - case "no-referrer": return undefined; - default: new Error(`Unknown referrer policy: ${REFERRER_POLICY}`); + case "no-referrer": + return undefined; + case "origin": + return origin; + case "origin-when-cross-origin": + return is_same_origin ? full : origin; + case "same-origin": + return is_same_origin ? full : undefined; + case "unsafe-url": + return full; + default: + throw new Error(`Unsupported referrer policy: ${REFERRER_POLICY}`); } } -promise_test(async (t) => { - const preload_url = SEARCH_PARAMS.get("preload-url"); - await fetch_script(preload_url); +async function check_referrer(url, expected_referrer) { + await fetch_script(url); - const { headers } = await get_fetch_timing_and_headers(preload_url); - const expected_referrer = get_expected_referrer(); - assert_equals(headers["referrer"], expected_referrer); + const { headers } = await get_fetch_timing_and_headers(url); + assert_equals(headers["referer"], expected_referrer); - const name = new URL(preload_url, window.location); + const name = new URL(url, window.location); const entries = performance.getEntriesByName(name); assert_equals(entries.length, 1); assert_equals(entries[0].initiatorType, "early-hints"); +} + +promise_test(async (t) => { + const same_origin_preload_url = SEARCH_PARAMS.get("same-origin-preload-url"); + const same_origin_expected = get_expected_referrer(true); + await check_referrer(same_origin_preload_url, same_origin_expected); + + const cross_origin_preload_url = SEARCH_PARAMS.get("cross-origin-preload-url"); + const cross_origin_expected = get_expected_referrer(false); + await check_referrer(cross_origin_preload_url, cross_origin_expected); }, `Referrer policy: ${REFERRER_POLICY}`); </script> </body>
diff --git a/third_party/blink/web_tests/external/wpt/webrtc-extensions/transfer-datachannel.html b/third_party/blink/web_tests/external/wpt/webrtc-extensions/transfer-datachannel.html index a1e5dcec..9759a67 100644 --- a/third_party/blink/web_tests/external/wpt/webrtc-extensions/transfer-datachannel.html +++ b/third_party/blink/web_tests/external/wpt/webrtc-extensions/transfer-datachannel.html
@@ -53,7 +53,7 @@ createConnections(test, (firstConnection) => { localChannel = firstConnection.createDataChannel('sendDataChannel'); worker.postMessage({channel: localChannel}, [localChannel]); - + data = new Promise(resolve => worker.onmessage = (event) => resolve(event.data)); }, (secondConnection) => { secondConnection.ondatachannel = (event) => { remoteChannel = event.channel; @@ -62,6 +62,8 @@ }); }); + assert_equals(await data, "opened"); + data = new Promise(resolve => worker.onmessage = (event) => resolve(event.data)); remoteChannel.send("OK"); assert_equals(await data, "OK");
diff --git a/third_party/blink/web_tests/http/tests/devtools/bindings/jssourcemap-navigator-overlapping-sources.js b/third_party/blink/web_tests/http/tests/devtools/bindings/jssourcemap-navigator-overlapping-sources.js index 5d4e52e..d4363a54 100644 --- a/third_party/blink/web_tests/http/tests/devtools/bindings/jssourcemap-navigator-overlapping-sources.js +++ b/third_party/blink/web_tests/http/tests/devtools/bindings/jssourcemap-navigator-overlapping-sources.js
@@ -2,6 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +const GC = async () => { + await TestRunner.evaluateInPageAsync(`new Promise(resolve => + GCController.asyncCollectAll(resolve))`); +}; + (async function () { TestRunner.addResult(`Verify that JavaScript SourceMap handle different sourcemaps with overlapping sources.`); await TestRunner.loadLegacyModule('sources'); await TestRunner.loadTestModule('sources_test_runner'); @@ -36,17 +41,17 @@ TestRunner.markStep('detachAnotherFrame1'); await BindingsTestRunner.detachFrame('anotherFrame1', '_test_detach-anotherFrame1.js'); - await TestRunner.evaluateInPageAnonymously('GCController.collectAll()'); + await GC(); SourcesTestRunner.dumpNavigatorView(sourcesNavigator, false); TestRunner.markStep('detachFrame2'); await BindingsTestRunner.detachFrame('frame2', '_test_detachFrame2.js'); - await TestRunner.evaluateInPageAnonymously('GCController.collectAll()'); + await GC(); SourcesTestRunner.dumpNavigatorView(sourcesNavigator, false); TestRunner.markStep('detachFrame1'); await BindingsTestRunner.detachFrame('frame1', '_test_detachFrame1.js'); - await TestRunner.evaluateInPageAnonymously('GCController.collectAll()'); + await GC(); SourcesTestRunner.dumpNavigatorView(sourcesNavigator, false); TestRunner.completeTest();
diff --git a/third_party/blink/web_tests/http/tests/devtools/bindings/sourcemap-bindings-multiple-frames.js b/third_party/blink/web_tests/http/tests/devtools/bindings/sourcemap-bindings-multiple-frames.js index f29ec71b..ad749af 100644 --- a/third_party/blink/web_tests/http/tests/devtools/bindings/sourcemap-bindings-multiple-frames.js +++ b/third_party/blink/web_tests/http/tests/devtools/bindings/sourcemap-bindings-multiple-frames.js
@@ -2,6 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +const GC = async () => { + await TestRunner.evaluateInPageAsync(`new Promise(resolve => + GCController.asyncCollectAll(resolve))`); +}; + (async function () { TestRunner.addResult(`Verify that SourceMap bindings are generating UISourceCodes properly.\n`); await TestRunner.loadTestModule('bindings_test_runner'); @@ -20,12 +25,12 @@ TestRunner.markStep('detachFrame1'); await BindingsTestRunner.detachFrame('frame1', '_test_detachFrame1.js'); - await TestRunner.evaluateInPageAnonymously('GCController.collectAll()'); + await GC(); snapshot = BindingsTestRunner.dumpWorkspace(snapshot); TestRunner.markStep('detachFrame2'); await BindingsTestRunner.detachFrame('frame2', '_test_detachFrame2.js'); - await TestRunner.evaluateInPageAnonymously('GCController.collectAll()'); + await GC(); snapshot = BindingsTestRunner.dumpWorkspace(snapshot); TestRunner.completeTest();
diff --git a/third_party/blink/web_tests/platform/linux/fast/forms/control-restrict-line-height-expected.png b/third_party/blink/web_tests/platform/linux/fast/forms/control-restrict-line-height-expected.png index 59c10bbe..a8a692f 100644 --- a/third_party/blink/web_tests/platform/linux/fast/forms/control-restrict-line-height-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/forms/control-restrict-line-height-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/fast/forms/control-restrict-line-height-expected.png b/third_party/blink/web_tests/platform/mac/fast/forms/control-restrict-line-height-expected.png index 1f1ebf5..a2964643 100644 --- a/third_party/blink/web_tests/platform/mac/fast/forms/control-restrict-line-height-expected.png +++ b/third_party/blink/web_tests/platform/mac/fast/forms/control-restrict-line-height-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/forms/control-restrict-line-height-expected.png b/third_party/blink/web_tests/platform/win/fast/forms/control-restrict-line-height-expected.png index 366911e..d9c33e3 100644 --- a/third_party/blink/web_tests/platform/win/fast/forms/control-restrict-line-height-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/forms/control-restrict-line-height-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/webexposed/global-interface-listing-platform-specific-expected.txt b/third_party/blink/web_tests/webexposed/global-interface-listing-platform-specific-expected.txt index c4d6a2e2..24d47e6 100644 --- a/third_party/blink/web_tests/webexposed/global-interface-listing-platform-specific-expected.txt +++ b/third_party/blink/web_tests/webexposed/global-interface-listing-platform-specific-expected.txt
@@ -38,6 +38,7 @@ getter ongattserverdisconnected getter watchingAdvertisements method constructor + method forget method watchAdvertisements setter onadvertisementreceived setter ongattserverdisconnected
diff --git a/third_party/blink/web_tests/wpt_internal/html/semantics/parser-blocking-stylesheets/parser-blocking-stylesheet-004-expected.txt b/third_party/blink/web_tests/wpt_internal/html/semantics/parser-blocking-stylesheets/parser-blocking-stylesheet-004-expected.txt deleted file mode 100644 index 046f2f7..0000000 --- a/third_party/blink/web_tests/wpt_internal/html/semantics/parser-blocking-stylesheets/parser-blocking-stylesheet-004-expected.txt +++ /dev/null
@@ -1,4 +0,0 @@ -This is a testharness.js-based test. -FAIL setTimeout() triggered while the stylesheet is loading. assert_equals: #after-sheet element should not have been inserted into the DOM. expected null but got Element node <meta id="after-sheet"></meta> -Harness: the test ran to completion. -
diff --git a/third_party/closure_compiler/externs/automation.js b/third_party/closure_compiler/externs/automation.js index 3bf58d4..0c1aa17 100644 --- a/third_party/closure_compiler/externs/automation.js +++ b/third_party/closure_compiler/externs/automation.js
@@ -405,6 +405,7 @@ LOAD_INLINE_TEXT_BOXES: 'loadInlineTextBoxes', REPLACE_SELECTED_TEXT: 'replaceSelectedText', RESUME_MEDIA: 'resumeMedia', + RUN_SCREEN_AI: 'runScreenAi', SCROLL_BACKWARD: 'scrollBackward', SCROLL_DOWN: 'scrollDown', SCROLL_FORWARD: 'scrollForward',
diff --git a/third_party/crashpad/README.chromium b/third_party/crashpad/README.chromium index 39515b043..59f05f4 100644 --- a/third_party/crashpad/README.chromium +++ b/third_party/crashpad/README.chromium
@@ -2,7 +2,7 @@ Short Name: crashpad URL: https://crashpad.chromium.org/ Version: unknown -Revision: 0affe616899ec552ffb63a663bdc12abb80a815e +Revision: 13202c2ffe4b02303c721bb2f6e8efda1999aa1e License: Apache 2.0 License File: crashpad/LICENSE Security Critical: yes
diff --git a/third_party/crashpad/crashpad/client/crashpad_client_linux.cc b/third_party/crashpad/crashpad/client/crashpad_client_linux.cc index 35742be..53c2dada 100644 --- a/third_party/crashpad/crashpad/client/crashpad_client_linux.cc +++ b/third_party/crashpad/crashpad/client/crashpad_client_linux.cc
@@ -351,17 +351,11 @@ } pid = creds.pid; } - if (pid > 0 && prctl(PR_SET_PTRACER, pid, 0, 0, 0) != 0) { - PLOG(WARNING) << "prctl"; - // TODO(jperaza): If this call to set the ptracer failed, it might be - // possible to try again just before a dump request, in case the - // environment has changed. Revisit ExceptionHandlerClient::SetPtracer() - // and consider saving the result of this call in ExceptionHandlerClient - // or as a member in this signal handler. ExceptionHandlerClient hasn't - // been responsible for maintaining state and a new ExceptionHandlerClient - // has been constructed as a local whenever a client needs to communicate - // with the handler. ExceptionHandlerClient lifetimes and ownership will - // need to be reconsidered if it becomes responsible for state. + if (pid > 0) { + pthread_atfork(nullptr, nullptr, SetPtracerAtFork); + if (prctl(PR_SET_PTRACER, pid, 0, 0, 0) != 0) { + PLOG(WARNING) << "prctl"; + } } sock_to_handler_.reset(sock.release()); handler_pid_ = pid; @@ -382,6 +376,13 @@ } void HandleCrashImpl() override { + // Attempt to set the ptracer again, in case a crash occurs after a fork, + // before SetPtracerAtFork() has been called. Ignore errors because the + // system call may be disallowed if the sandbox is engaged. + if (handler_pid_ > 0) { + sys_prctl(PR_SET_PTRACER, handler_pid_, 0, 0, 0); + } + ExceptionHandlerProtocol::ClientInformation info = {}; info.exception_information_address = FromPointerCast<VMAddress>(&GetExceptionInfo()); @@ -404,6 +405,14 @@ ~RequestCrashDumpHandler() = delete; + static void SetPtracerAtFork() { + auto handler = RequestCrashDumpHandler::Get(); + if (handler->handler_pid_ > 0 && + prctl(PR_SET_PTRACER, handler->handler_pid_, 0, 0, 0) != 0) { + PLOG(WARNING) << "prctl"; + } + } + ScopedFileHandle sock_to_handler_; pid_t handler_pid_ = -1;
diff --git a/third_party/crashpad/update.py b/third_party/crashpad/update.py index 75756925..4f8bfb4 100755 --- a/third_party/crashpad/update.py +++ b/third_party/crashpad/update.py
@@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # coding: utf-8 # Copyright 2015 The Chromium Authors. All rights reserved.
diff --git a/third_party/libxml/BUILD.gn b/third_party/libxml/BUILD.gn index c378b79..9f6403fa 100644 --- a/third_party/libxml/BUILD.gn +++ b/third_party/libxml/BUILD.gn
@@ -171,7 +171,6 @@ #"src/debugXML.c", "src/dict.c", - "src/elfgcchack.h", "src/enc.h", "src/encoding.c", "src/entities.c",
diff --git a/third_party/libxml/README.chromium b/third_party/libxml/README.chromium index 03822a1..982eb77 100644 --- a/third_party/libxml/README.chromium +++ b/third_party/libxml/README.chromium
@@ -1,6 +1,6 @@ Name: libxml URL: http://xmlsoft.org -Version: eab86522163ec52602a020f62baa9f6cf87ec870 +Version: 37ebf8a8b2789037792cfc0264b814d742cda2d9 CPEPrefix: cpe:/a:xmlsoft:libxml2:2.9.12 License: MIT License File: src/Copyright
diff --git a/third_party/libxml/chromium/roll.py b/third_party/libxml/chromium/roll.py index e936c25..e91d8c0 100755 --- a/third_party/libxml/chromium/roll.py +++ b/third_party/libxml/chromium/roll.py
@@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Copyright 2017 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be @@ -319,7 +319,8 @@ with WorkingDir(libxml2_repo_path): commit = subprocess.check_output( - ['git', 'log', '-n', '1', '--pretty=format:%H', 'HEAD']) + ['git', 'log', '-n', '1', '--pretty=format:%H', + 'HEAD']).decode('ascii') subprocess.check_call( 'git archive HEAD | tar -x -C "%s"' % temp_src_path, shell=True) @@ -341,7 +342,7 @@ tar_file = subprocess.check_output( '''awk '/PACKAGE =/ {p=$3} /VERSION =/ {v=$3} ''' '''END {printf("%s-%s.tar.gz", p, v)}' Makefile''', - shell=True) + shell=True).decode('ascii') return commit, os.path.abspath(tar_file) @@ -421,8 +422,9 @@ sed_in_place('config.h', 's/#define HAVE_RAND_R 1//') with WorkingDir(full_path_to_third_party_libxml): - commit = subprocess.check_output(['awk', '/Version:/ {print $2}', - 'README.chromium']) + commit = subprocess.check_output( + ['awk', '/Version:/ {print $2}', + 'README.chromium']).decode('ascii') remove_tracked_files(FILES_TO_REMOVE) commit_message = 'Roll libxml to %s' % commit git('commit', '-am', commit_message) @@ -431,7 +433,8 @@ def check_clean(path): with WorkingDir(path): - status = subprocess.check_output(['git', 'status', '-s']) + status = subprocess.check_output(['git', 'status', + '-s']).decode('ascii') if len(status) > 0: raise Exception('repository at %s is not clean' % path)
diff --git a/third_party/libxml/linux/config.h b/third_party/libxml/linux/config.h index bccbf1e..c702e79 100644 --- a/third_party/libxml/linux/config.h +++ b/third_party/libxml/linux/config.h
@@ -19,13 +19,6 @@ /* Whether struct sockaddr::__ss_family exists */ /* #undef HAVE_BROKEN_SS_FAMILY */ -/* Define to 1 if you have the <ctype.h> header file. */ -#define HAVE_CTYPE_H 1 - -/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'. - */ -#define HAVE_DIRENT_H 1 - /* Define to 1 if you have the <dlfcn.h> header file. */ #define HAVE_DLFCN_H 1 @@ -35,18 +28,9 @@ /* Define to 1 if you have the <dl.h> header file. */ /* #undef HAVE_DL_H */ -/* Define to 1 if you have the <errno.h> header file. */ -#define HAVE_ERRNO_H 1 - /* Define to 1 if you have the <fcntl.h> header file. */ #define HAVE_FCNTL_H 1 -/* Define to 1 if you have the <float.h> header file. */ -#define HAVE_FLOAT_H 1 - -/* Define to 1 if you have the `fprintf' function. */ -#define HAVE_FPRINTF 1 - /* Define to 1 if you have the `ftime' function. */ #define HAVE_FTIME 1 @@ -68,21 +52,9 @@ /* Define if readline library is there (-lreadline) */ /* #undef HAVE_LIBREADLINE */ -/* Define to 1 if you have the <limits.h> header file. */ -#define HAVE_LIMITS_H 1 - -/* Define to 1 if you have the `localtime' function. */ -#define HAVE_LOCALTIME 1 - /* Define to 1 if you have the <lzma.h> header file. */ /* #undef HAVE_LZMA_H */ -/* Define to 1 if you have the <malloc.h> header file. */ -#define HAVE_MALLOC_H 1 - -/* Define to 1 if you have the <math.h> header file. */ -#define HAVE_MATH_H 1 - /* Define to 1 if you have the `mmap' function. */ #define HAVE_MMAP 1 @@ -94,9 +66,6 @@ # undef /**/ HAVE_MMAP #endif -/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */ -/* #undef HAVE_NDIR_H */ - /* Define to 1 if you have the <netdb.h> header file. */ #define HAVE_NETDB_H 1 @@ -106,18 +75,12 @@ /* Define to 1 if you have the <poll.h> header file. */ #define HAVE_POLL_H 1 -/* Define to 1 if you have the `printf' function. */ -#define HAVE_PRINTF 1 - /* Define if <pthread.h> is there */ /* #undef HAVE_PTHREAD_H */ /* Define to 1 if you have the `putenv' function. */ #define HAVE_PUTENV 1 -/* Define to 1 if you have the `rand' function. */ -#define HAVE_RAND 1 - /* Define to 1 if you have the `rand_r' function. */ @@ -127,30 +90,12 @@ /* Have shl_load based dso */ /* #undef HAVE_SHLLOAD */ -/* Define to 1 if you have the `signal' function. */ -#define HAVE_SIGNAL 1 - -/* Define to 1 if you have the <signal.h> header file. */ -#define HAVE_SIGNAL_H 1 - /* Define to 1 if you have the `snprintf' function. */ #define HAVE_SNPRINTF 1 -/* Define to 1 if you have the `sprintf' function. */ -#define HAVE_SPRINTF 1 - -/* Define to 1 if you have the `srand' function. */ -#define HAVE_SRAND 1 - -/* Define to 1 if you have the `sscanf' function. */ -#define HAVE_SSCANF 1 - /* Define to 1 if you have the `stat' function. */ #define HAVE_STAT 1 -/* Define to 1 if you have the <stdarg.h> header file. */ -#define HAVE_STDARG_H 1 - /* Define to 1 if you have the <stdint.h> header file. */ #define HAVE_STDINT_H 1 @@ -160,26 +105,15 @@ /* Define to 1 if you have the <stdlib.h> header file. */ #define HAVE_STDLIB_H 1 -/* Define to 1 if you have the `strftime' function. */ -#define HAVE_STRFTIME 1 - /* Define to 1 if you have the <strings.h> header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the <string.h> header file. */ #define HAVE_STRING_H 1 -/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'. - */ -/* #undef HAVE_SYS_DIR_H */ - /* Define to 1 if you have the <sys/mman.h> header file. */ #define HAVE_SYS_MMAN_H 1 -/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'. - */ -/* #undef HAVE_SYS_NDIR_H */ - /* Define to 1 if you have the <sys/select.h> header file. */ #define HAVE_SYS_SELECT_H 1 @@ -198,27 +132,15 @@ /* Define to 1 if you have the <sys/types.h> header file. */ #define HAVE_SYS_TYPES_H 1 -/* Define to 1 if you have the `time' function. */ -#define HAVE_TIME 1 - -/* Define to 1 if you have the <time.h> header file. */ -#define HAVE_TIME_H 1 - /* Define to 1 if you have the <unistd.h> header file. */ #define HAVE_UNISTD_H 1 /* Whether va_copy() is available */ #define HAVE_VA_COPY 1 -/* Define to 1 if you have the `vfprintf' function. */ -#define HAVE_VFPRINTF 1 - /* Define to 1 if you have the `vsnprintf' function. */ #define HAVE_VSNPRINTF 1 -/* Define to 1 if you have the `vsprintf' function. */ -#define HAVE_VSPRINTF 1 - /* Define to 1 if you have the <zlib.h> header file. */ /* #undef HAVE_ZLIB_H */ @@ -241,7 +163,7 @@ #define PACKAGE_NAME "libxml2" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "libxml2 2.9.12" +#define PACKAGE_STRING "libxml2 2.9.13" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "libxml2" @@ -250,7 +172,7 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "2.9.12" +#define PACKAGE_VERSION "2.9.13" /* Type cast for the send() function 2nd arg */ #define SEND_ARG2_CAST /**/ @@ -267,7 +189,7 @@ #define VA_LIST_IS_ARRAY 1 /* Version number of package */ -#define VERSION "2.9.12" +#define VERSION "2.9.13" /* Determine what socket length (socklen_t) data type is */ #define XML_SOCKLEN_T socklen_t
diff --git a/third_party/libxml/linux/include/libxml/xmlversion.h b/third_party/libxml/linux/include/libxml/xmlversion.h index 4c364e64..fae4bf0 100644 --- a/third_party/libxml/linux/include/libxml/xmlversion.h +++ b/third_party/libxml/linux/include/libxml/xmlversion.h
@@ -29,26 +29,26 @@ * * the version string like "1.2.3" */ -#define LIBXML_DOTTED_VERSION "2.9.12" +#define LIBXML_DOTTED_VERSION "2.9.13" /** * LIBXML_VERSION: * * the version number: 1.2.3 value is 10203 */ -#define LIBXML_VERSION 20912 +#define LIBXML_VERSION 20913 /** * LIBXML_VERSION_STRING: * * the version number string, 1.2.3 value is "10203" */ -#define LIBXML_VERSION_STRING "20912" +#define LIBXML_VERSION_STRING "20913" /** * LIBXML_VERSION_EXTRA: * - * extra version information, used to show a CVS compilation + * extra version information, used to show a git commit description */ #define LIBXML_VERSION_EXTRA "" @@ -58,7 +58,7 @@ * Macro to check that the libxml version in use is compatible with * the version the software has been compiled against */ -#define LIBXML_TEST_VERSION xmlCheckVersion(20912); +#define LIBXML_TEST_VERSION xmlCheckVersion(20913); #ifndef VMS #if 0 @@ -456,6 +456,15 @@ # define LIBXML_ATTR_FORMAT(fmt,args) #endif +#ifndef XML_DEPRECATED +# ifdef IN_LIBXML +# define XML_DEPRECATED +# else +/* Available since at least GCC 3.1 */ +# define XML_DEPRECATED __attribute__((deprecated)) +# endif +#endif + #else /* ! __GNUC__ */ /** * ATTRIBUTE_UNUSED: @@ -475,6 +484,15 @@ * Macro used to indicate to GCC the parameter are printf like */ #define LIBXML_ATTR_FORMAT(fmt,args) +/** + * XML_DEPRECATED: + * + * Macro used to indicate that a function, variable, type or struct member + * is deprecated. + */ +#ifndef XML_DEPRECATED +#define XML_DEPRECATED +#endif #endif /* __GNUC__ */ #ifdef __cplusplus
diff --git a/third_party/libxml/linux/xml2-config b/third_party/libxml/linux/xml2-config index 3717ff9..28e7f23 100755 --- a/third_party/libxml/linux/xml2-config +++ b/third_party/libxml/linux/xml2-config
@@ -58,7 +58,7 @@ ;; --version) - echo 2.9.12 + echo 2.9.13 exit 0 ;;
diff --git a/third_party/libxml/mac/config.h b/third_party/libxml/mac/config.h index 3341a76..c702e79 100644 --- a/third_party/libxml/mac/config.h +++ b/third_party/libxml/mac/config.h
@@ -19,13 +19,6 @@ /* Whether struct sockaddr::__ss_family exists */ /* #undef HAVE_BROKEN_SS_FAMILY */ -/* Define to 1 if you have the <ctype.h> header file. */ -#define HAVE_CTYPE_H 1 - -/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'. - */ -#define HAVE_DIRENT_H 1 - /* Define to 1 if you have the <dlfcn.h> header file. */ #define HAVE_DLFCN_H 1 @@ -35,18 +28,9 @@ /* Define to 1 if you have the <dl.h> header file. */ /* #undef HAVE_DL_H */ -/* Define to 1 if you have the <errno.h> header file. */ -#define HAVE_ERRNO_H 1 - /* Define to 1 if you have the <fcntl.h> header file. */ #define HAVE_FCNTL_H 1 -/* Define to 1 if you have the <float.h> header file. */ -#define HAVE_FLOAT_H 1 - -/* Define to 1 if you have the `fprintf' function. */ -#define HAVE_FPRINTF 1 - /* Define to 1 if you have the `ftime' function. */ #define HAVE_FTIME 1 @@ -68,21 +52,9 @@ /* Define if readline library is there (-lreadline) */ /* #undef HAVE_LIBREADLINE */ -/* Define to 1 if you have the <limits.h> header file. */ -#define HAVE_LIMITS_H 1 - -/* Define to 1 if you have the `localtime' function. */ -#define HAVE_LOCALTIME 1 - /* Define to 1 if you have the <lzma.h> header file. */ /* #undef HAVE_LZMA_H */ -/* Define to 1 if you have the <malloc.h> header file. */ -/* #undef HAVE_MALLOC_H */ - -/* Define to 1 if you have the <math.h> header file. */ -#define HAVE_MATH_H 1 - /* Define to 1 if you have the `mmap' function. */ #define HAVE_MMAP 1 @@ -94,9 +66,6 @@ # undef /**/ HAVE_MMAP #endif -/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */ -/* #undef HAVE_NDIR_H */ - /* Define to 1 if you have the <netdb.h> header file. */ #define HAVE_NETDB_H 1 @@ -106,18 +75,12 @@ /* Define to 1 if you have the <poll.h> header file. */ #define HAVE_POLL_H 1 -/* Define to 1 if you have the `printf' function. */ -#define HAVE_PRINTF 1 - /* Define if <pthread.h> is there */ /* #undef HAVE_PTHREAD_H */ /* Define to 1 if you have the `putenv' function. */ #define HAVE_PUTENV 1 -/* Define to 1 if you have the `rand' function. */ -#define HAVE_RAND 1 - /* Define to 1 if you have the `rand_r' function. */ @@ -127,30 +90,12 @@ /* Have shl_load based dso */ /* #undef HAVE_SHLLOAD */ -/* Define to 1 if you have the `signal' function. */ -#define HAVE_SIGNAL 1 - -/* Define to 1 if you have the <signal.h> header file. */ -#define HAVE_SIGNAL_H 1 - /* Define to 1 if you have the `snprintf' function. */ #define HAVE_SNPRINTF 1 -/* Define to 1 if you have the `sprintf' function. */ -#define HAVE_SPRINTF 1 - -/* Define to 1 if you have the `srand' function. */ -#define HAVE_SRAND 1 - -/* Define to 1 if you have the `sscanf' function. */ -#define HAVE_SSCANF 1 - /* Define to 1 if you have the `stat' function. */ #define HAVE_STAT 1 -/* Define to 1 if you have the <stdarg.h> header file. */ -#define HAVE_STDARG_H 1 - /* Define to 1 if you have the <stdint.h> header file. */ #define HAVE_STDINT_H 1 @@ -160,26 +105,15 @@ /* Define to 1 if you have the <stdlib.h> header file. */ #define HAVE_STDLIB_H 1 -/* Define to 1 if you have the `strftime' function. */ -#define HAVE_STRFTIME 1 - /* Define to 1 if you have the <strings.h> header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the <string.h> header file. */ #define HAVE_STRING_H 1 -/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'. - */ -/* #undef HAVE_SYS_DIR_H */ - /* Define to 1 if you have the <sys/mman.h> header file. */ #define HAVE_SYS_MMAN_H 1 -/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'. - */ -/* #undef HAVE_SYS_NDIR_H */ - /* Define to 1 if you have the <sys/select.h> header file. */ #define HAVE_SYS_SELECT_H 1 @@ -198,27 +132,15 @@ /* Define to 1 if you have the <sys/types.h> header file. */ #define HAVE_SYS_TYPES_H 1 -/* Define to 1 if you have the `time' function. */ -#define HAVE_TIME 1 - -/* Define to 1 if you have the <time.h> header file. */ -#define HAVE_TIME_H 1 - /* Define to 1 if you have the <unistd.h> header file. */ #define HAVE_UNISTD_H 1 /* Whether va_copy() is available */ #define HAVE_VA_COPY 1 -/* Define to 1 if you have the `vfprintf' function. */ -#define HAVE_VFPRINTF 1 - /* Define to 1 if you have the `vsnprintf' function. */ #define HAVE_VSNPRINTF 1 -/* Define to 1 if you have the `vsprintf' function. */ -#define HAVE_VSPRINTF 1 - /* Define to 1 if you have the <zlib.h> header file. */ /* #undef HAVE_ZLIB_H */ @@ -241,7 +163,7 @@ #define PACKAGE_NAME "libxml2" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "libxml2 2.9.12" +#define PACKAGE_STRING "libxml2 2.9.13" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "libxml2" @@ -250,7 +172,7 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "2.9.12" +#define PACKAGE_VERSION "2.9.13" /* Type cast for the send() function 2nd arg */ #define SEND_ARG2_CAST /**/ @@ -267,7 +189,7 @@ #define VA_LIST_IS_ARRAY 1 /* Version number of package */ -#define VERSION "2.9.12" +#define VERSION "2.9.13" /* Determine what socket length (socklen_t) data type is */ #define XML_SOCKLEN_T socklen_t
diff --git a/third_party/libxml/mac/include/libxml/xmlversion.h b/third_party/libxml/mac/include/libxml/xmlversion.h index 4c364e64..fae4bf0 100644 --- a/third_party/libxml/mac/include/libxml/xmlversion.h +++ b/third_party/libxml/mac/include/libxml/xmlversion.h
@@ -29,26 +29,26 @@ * * the version string like "1.2.3" */ -#define LIBXML_DOTTED_VERSION "2.9.12" +#define LIBXML_DOTTED_VERSION "2.9.13" /** * LIBXML_VERSION: * * the version number: 1.2.3 value is 10203 */ -#define LIBXML_VERSION 20912 +#define LIBXML_VERSION 20913 /** * LIBXML_VERSION_STRING: * * the version number string, 1.2.3 value is "10203" */ -#define LIBXML_VERSION_STRING "20912" +#define LIBXML_VERSION_STRING "20913" /** * LIBXML_VERSION_EXTRA: * - * extra version information, used to show a CVS compilation + * extra version information, used to show a git commit description */ #define LIBXML_VERSION_EXTRA "" @@ -58,7 +58,7 @@ * Macro to check that the libxml version in use is compatible with * the version the software has been compiled against */ -#define LIBXML_TEST_VERSION xmlCheckVersion(20912); +#define LIBXML_TEST_VERSION xmlCheckVersion(20913); #ifndef VMS #if 0 @@ -456,6 +456,15 @@ # define LIBXML_ATTR_FORMAT(fmt,args) #endif +#ifndef XML_DEPRECATED +# ifdef IN_LIBXML +# define XML_DEPRECATED +# else +/* Available since at least GCC 3.1 */ +# define XML_DEPRECATED __attribute__((deprecated)) +# endif +#endif + #else /* ! __GNUC__ */ /** * ATTRIBUTE_UNUSED: @@ -475,6 +484,15 @@ * Macro used to indicate to GCC the parameter are printf like */ #define LIBXML_ATTR_FORMAT(fmt,args) +/** + * XML_DEPRECATED: + * + * Macro used to indicate that a function, variable, type or struct member + * is deprecated. + */ +#ifndef XML_DEPRECATED +#define XML_DEPRECATED +#endif #endif /* __GNUC__ */ #ifdef __cplusplus
diff --git a/third_party/libxml/src/AUTHORS b/third_party/libxml/src/AUTHORS deleted file mode 100644 index cf2e9a6..0000000 --- a/third_party/libxml/src/AUTHORS +++ /dev/null
@@ -1,5 +0,0 @@ -Daniel Veillard <daniel@veillard.com> -Bjorn Reese <breese@users.sourceforge.net> -William Brack <wbrack@mmm.com.hk> -Igor Zlatkovic <igor@zlatkovic.com> for the Windows port -Aleksey Sanin <aleksey@aleksey.com>
diff --git a/third_party/libxml/src/CMakeLists.txt b/third_party/libxml/src/CMakeLists.txt index 7e1aa08d..d6794148 100644 --- a/third_party/libxml/src/CMakeLists.txt +++ b/third_party/libxml/src/CMakeLists.txt
@@ -117,7 +117,7 @@ set(PACKAGE_NAME "libxml2") set(PACKAGE_STRING "libxml2 ${VERSION}") set(PACKAGE_TARNAME "libxml2") -set(PACKAGE_URL "http://www.xmlsoft.org/") +set(PACKAGE_URL "https://gitlab.gnome.org/GNOME/libxml2") set(PACKAGE_VERSION ${VERSION}) if(LIBLZMA_FOUND) @@ -160,15 +160,11 @@ set(ss_family __ss_family) endif() check_function_exists(class HAVE_CLASS) - check_include_files(ctype.h HAVE_CTYPE_H) check_include_files(dlfcn.h HAVE_DLFCN_H) check_library_exists(dl dlopen "" HAVE_DLOPEN) check_include_files(dl.h HAVE_DL_H) - check_include_files(errno.h HAVE_ERRNO_H) check_include_files(fcntl.h HAVE_FCNTL_H) - check_include_files(float.h HAVE_FLOAT_H) check_function_exists(fpclass HAVE_FPCLASS) - check_function_exists(fprintf HAVE_FPRINTF) check_function_exists(ftime HAVE_FTIME) check_function_exists(getaddrinfo HAVE_GETADDRINFO) check_function_exists(gettimeofday HAVE_GETTIMEOFDAY) @@ -176,34 +172,18 @@ check_function_exists(isascii HAVE_ISASCII) check_library_exists(history append_history "" HAVE_LIBHISTORY) check_library_exists(readline readline "" HAVE_LIBREADLINE) - check_include_files(limits.h HAVE_LIMITS_H) - check_function_exists(localtime HAVE_LOCALTIME) - check_include_files(malloc.h HAVE_MALLOC_H) - check_include_files(math.h HAVE_MATH_H) check_function_exists(mmap HAVE_MMAP) check_function_exists(munmap HAVE_MUNMAP) check_include_files(netdb.h HAVE_NETDB_H) check_include_files(netinet/in.h HAVE_NETINET_IN_H) check_include_files(poll.h HAVE_POLL_H) - check_function_exists(printf HAVE_PRINTF) check_include_files(pthread.h HAVE_PTHREAD_H) check_function_exists(putenv HAVE_PUTENV) - check_function_exists(rand HAVE_RAND) check_function_exists(rand_r HAVE_RAND_R) check_include_files(resolv.h HAVE_RESOLV_H) check_library_exists(dld shl_load "" HAVE_SHLLOAD) - check_include_files(signal.h HAVE_SIGNAL_H) - check_function_exists(snprintf HAVE_SNPRINTF) - check_function_exists(sprintf HAVE_SPRINTF) - check_function_exists(srand HAVE_SRAND) - check_function_exists(sscanf HAVE_SSCANF) check_function_exists(stat HAVE_STAT) - check_include_files(stdarg.h HAVE_STDARG_H) check_include_files(stdint.h HAVE_STDINT_H) - check_include_files(stdlib.h HAVE_STDLIB_H) - check_function_exists(strftime HAVE_STRFTIME) - check_include_files(strings.h HAVE_STRINGS_H) - check_include_files(string.h HAVE_STRING_H) check_include_files(sys/mman.h HAVE_SYS_MMAN_H) check_include_files(sys/select.h HAVE_SYS_SELECT_H) check_include_files(sys/socket.h HAVE_SYS_SOCKET_H) @@ -211,13 +191,8 @@ check_include_files(sys/timeb.h HAVE_SYS_TIMEB_H) check_include_files(sys/time.h HAVE_SYS_TIME_H) check_include_files(sys/types.h HAVE_SYS_TYPES_H) - check_function_exists(time HAVE_TIME) - check_include_files(time.h HAVE_TIME_H) check_include_files(unistd.h HAVE_UNISTD_H) check_function_exists(va_copy HAVE_VA_COPY) - check_function_exists(vfprintf HAVE_VFPRINTF) - check_function_exists(vsnprintf HAVE_VSNPRINTF) - check_function_exists(vsprintf HAVE_VSPRINTF) check_function_exists(__va_copy HAVE___VA_COPY) check_c_source_compiles(" #include <stdlib.h> @@ -686,11 +661,6 @@ configure_file(include/libxml/xmlversion.h.in libxml/xmlversion.h) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libxml/xmlversion.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libxml2/libxml COMPONENT development) -if(MSVC) - configure_file(include/libxml/xmlwin32version.h.in libxml/xmlwin32version.h) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libxml/xmlwin32version.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libxml2/libxml COMPONENT development) -endif() - if(LIBXML2_WITH_PYTHON) set(prefix "${CMAKE_INSTALL_PREFIX}") configure_file(python/setup.py.in setup.py @ONLY)
diff --git a/third_party/libxml/src/ChangeLog b/third_party/libxml/src/ChangeLog deleted file mode 100644 index 2640670..0000000 --- a/third_party/libxml/src/ChangeLog +++ /dev/null
@@ -1,19678 +0,0 @@ -Fri Jul 10 16:11:34 CEST 2009 Daniel Veillard <daniel@veillard.com> - - * parser.c: fix a regression in entity parsing when using the reader - introduced because we were not reusing _private on entities parsing - context - -Thu Jul 9 10:21:00 CEST 2009 Daniel Veillard <daniel@veillard.com> - - Aleksey Sanin support for c14n 1.1 - * c14n.c include/libxml/c14n.h: adds support for C14N 1.1, - new flags at the API level - * runtest.c Makefile.am testC14N.c xmllint.c: add support in CLI - tools and test binaries - * result/c14n/1-1-without-comments/* test/c14n/1-1-without-comments/*: - add a new batch of tests - -Thu Jul 9 08:52:35 CEST 2009 Daniel Veillard <daniel@veillard.com> - - * config.h.in: update of libtool seems to have modified it - * python/libxml2class.txt: python update modified the order - of classes apparently - -Thu Jul 9 08:43:06 CEST 2009 Daniel Veillard <daniel@veillard.com> - - * tree.c: avoid calling xmlAddID with NULL values - * parser.c: add a few xmlInitParser in some entry points - -Fri Jun 19 19:51:08 CEST 2009 Rob Richards <rrichards@cdatazone.org> - - * parser.c: use options from current parser context when creating - a parser context within xmlParseCtxtExternalEntity - * xmlwriter.c: fix error message when unable to create output file - -Thu Jun 4 11:17:23 CEST 2009 Daniel Veillard <daniel@veillard.com> - - * c14n.c debugXML.c doc/examples/io2.c parser.c schematron.c - valid.c xmlschemas.c xmlwriter.c xpath.c: use %s to printf string - patch by Christian Persch, fixes #581612 - -Thu Jun 4 11:06:07 CEST 2009 Daniel Veillard <daniel@veillard.com> - - * parser.c threads.c: change the threading initialization sequence - as suggested by Igor Novoseltsev to avoid crash if xmlInitParser() - is called from a thread which is not the main one, should fix - #584605 - -Fri May 15 17:54:48 CEST 2009 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: make sure we keep line numbers fixes #580705 - based Aaron Patterson patch - -Tue May 12 09:13:58 CEST 2009 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: a broken HTML table attributes initialization, - fixes #581803, by Roland Steiner <rolandsteiner@google.com> - -Tue May 12 08:54:20 CEST 2009 Daniel Veillard <daniel@veillard.com> - - * libxml2.doap: adding RDF dope file. - -Tue May 12 08:42:52 CEST 2009 Daniel Veillard <daniel@veillard.com> - - * configure.in: adapt the extra version detection code to git - -Wed Apr 29 16:09:38 CEST 2009 Rob Richards <rrichards@cdatazone.org> - - * parser.c: do not set error code in xmlNsWarn - -Wed Apr 15 11:18:24 CEST 2009 Daniel Veillard <daniel@veillard.com> - - * include/libxml/parser.h include/libxml/xmlwriter.h - include/libxml/relaxng.h include/libxml/xmlversion.h.in - include/libxml/xmlwin32version.h.in include/libxml/valid.h - include/libxml/xmlschemas.h include/libxml/xmlerror.h: change - ATTRIBUTE_PRINTF into LIBXML_ATTR_FORMAT to avoid macro name - collisions with other packages and headers as reported by - Belgabor and Mike Hommey - -Thu Apr 2 13:57:15 CEST 2009 Daniel Veillard <daniel@veillard.com> - - * error.c: fix structured error handling problems #564217 - -Thu Mar 26 19:08:08 CET 2009 Rob Richards <rrichards@cdatazone.org> - - * parser.c: use options from current parser context when creating - an entity parser context - -Wed Mar 25 11:40:34 CET 2009 Daniel Veillard <daniel@veillard.com> - - * doc/*: updated SVN URL for GNOME as pointed by Vincent Lefevre - and regenerated docs - -Wed Mar 25 11:21:26 CET 2009 Daniel Veillard <daniel@veillard.com> - - * parser.c: hide the nbParse* variables used for debugging - as pointed by Mike Hommey - -Wed Mar 25 10:50:05 CET 2009 Daniel Veillard <daniel@veillard.com> - - * include/wsockcompat.h win32/Makefile.bcb xpath.c: fixes for - Borland/CodeGear/Embarcadero compilers by Eric Zurcher - -Wed Mar 25 10:43:07 CET 2009 Daniel Veillard <daniel@veillard.com> - - * xpath.c: xmlXPathRegisterNs should not allow enpty prefixes - -Mon Mar 23 20:27:15 CET 2009 Daniel Veillard <daniel@veillard.com> - - * tree.c: add a missing check in xmlAddSibling, patch by Kris Breuker - * xmlIO.c: avoid xmlAllocOutputBuffer using XML_BUFFER_EXACT which - leads to performances problems especially on Windows. - -Tue Mar 3 14:30.28 HKT 2009 William Brack <wbrack@mmm.com.hk> - - * trio.h: changed include of config.h to be surrounded by - quotation marks #570806 - -Sat Feb 21 10:20:34 CET 2009 Daniel Veillard <daniel@veillard.com> - - * threads.c parser.c: more warnings about xmlCleanupThreads and - xmlCleanupParser to avoid troubles like #571409 - -Fri Feb 20 09:40:04 CET 2009 Daniel Veillard <daniel@veillard.com> - - * xmlwriter.c: cleanups and error reports when xmlTextWriterVSprintf - fails, by Jinmei Tatuya - -Fri Feb 20 09:18:56 CET 2009 Daniel Veillard <daniel@veillard.com> - - * xmlwriter.c: remove a couple of leaks on errors reported by - Jinmei Tatuya - -Sun Jan 18 22:37:59 CET 2009 Daniel Veillard <daniel@veillard.com> - - * configure.in doc/xml.html doc/*: preparing 0.7.3 release - * include/libxml/parserInternals.h SAX2.c: fix a typo in a name - -Sun Jan 18 21:48:28 CET 2009 Daniel Veillard <daniel@veillard.com> - - * include/libxml/parser.h include/libxml/xmlwriter.h - include/libxml/relaxng.h include/libxml/xmlversion.h.in - include/libxml/xmlwin32version.h.in include/libxml/valid.h - include/libxml/xmlschemas.h include/libxml/xmlerror.h: - port patch from Marcus Meissner to add gcc checking for - printf like functions parameters, should fix #65068 - * doc/apibuild.py doc/*: modified the script accordingly - and regenerated - * xpath.c xmlmemory.c threads.c: fix a few warnings - -Sun Jan 18 20:40:42 CET 2009 Daniel Veillard <daniel@veillard.com> - - * include/libxml/xmlwin32version.h.in: windows header should - get the same define - -Sun Jan 18 18:22:33 CET 2009 Daniel Veillard <daniel@veillard.com> - - * include/libxml/xmlversion.h.in include/libxml/xmlmemory.h: - apply patch from Marcus Meissner to add gcc attribute alloc_size - should fix #552505 - * doc/apibuild.py doc/* testapi.c: regenerate the API - * include/libxml/parserInternals.h: fix a comment problem raised - by apibuild.py - -Sun Jan 18 16:39:01 CET 2009 Daniel Veillard <daniel@veillard.com> - - * threads.c: also remove pthread key when stopping thread - support, patch based on Alex Ott one should fix #564723 - -Sun Jan 18 15:55:18 CET 2009 Daniel Veillard <daniel@veillard.com> - - * threads.c: patch from Daniel Zimmermann fixing a memory leak - in an edge case, solves #562230 - -Sun Jan 18 15:06:05 CET 2009 Daniel Veillard <daniel@veillard.com> - - * include/libxml/parserInternals.h SAX2.c: add a new define - XML_MAX_TEXT_LENGTH limiting the maximum size of a single text - node, the defaultis 10MB and can be removed with the HUGE - parsing option - -Mon Jan 05 18:28:41 CET 2009 Rob Richards <rrichards@cdatazone.org> - - * include/libxml/parser.h parser.c: add XML_PARSE_OLDSAX parser - option to enable pre 2.7 SAX behavior. - -Wed Dec 31 23:11:37 CET 2008 Rob Richards <rrichards@cdatazone.org> - - * tree.c: set doc on last child tree in xmlAddChildList for - bug #546772. Fix problem adding an attribute via with xmlAddChild - reported by Kris Breuker. - -Sun Dec 27 14:16:13 CET 2008 Rob Richards <rrichards@cdatazone.org> - - * xmlwriter.c: fix indenting in xmlTextWriterFullEndElement for - bug# 554353. - -Thu Nov 27 16:24:52 CET 2008 Daniel Veillard <daniel@veillard.com> - - * include/libxml/tree.h tree.c python/generator.py: adds - element traversal support - * valid.c: avoid a warning - * doc/*: regenerated - -Mon Nov 17 16:56:18 CET 2008 Daniel Veillard <daniel@veillard.com> - - * SAX2.c parser.c: fix for CVE-2008-4226, a memory overflow - when building gigantic text nodes, and a bit of cleanup - to better handled out of memory problem in that code. - * tree.c: fix for CVE-2008-4225, lack of testing leads to - a busy loop test assuming one have enough core memory. - -Thu Nov 6 14:34:35 CET 2008 Daniel Veillard <daniel@veillard.com> - - * xmllint.c: Matthias Kaehlcke reported a build problem when - not compiling HTML support in. - -Fri Oct 17 15:24:08 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * configure.in doc/Makefile.am: patch from Adrian Bunk which - adds --disable-rebuild-docs to avoid rebuilding them - -Fri Oct 3 09:43:45 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * configure.in doc/* NEWS: preparing the release of 2.7.2 - * dict.c: fix the Solaris portability issue - * parser.c: additional cleanup on #554660 fix - * test/ent13 result/ent13* result/noent/ent13*: added the - example in the regression test suite. - * HTMLparser.c: handle leading BOM in htmlParseElement() - -Thu Oct 2 22:53:39 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * parser.c: fix a nasty bug introduced when cleaning up - entities processing in 2.7.x , fixes #554660 - -Thu Sep 25 18:04:20 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: fix an HTML parsing error on large data sections - reported by Mike Day - * test/HTML/utf8bug.html result/HTML/utf8bug.html.err - result/HTML/utf8bug.html.sax result/HTML/utf8bug.html: add the - reproducer to the test suite - -Thu Sep 25 17:35:57 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * runxmlconf.c: fix compilation if XPath is not included - -Thu Sep 25 16:54:04 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * xmlreader.c: patch from Riccardo Scussat fixing custom error - handlers problems. - -Thu Sep 25 16:30:11 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * include/libxml/xmlsave.h xmlsave.c: new options to serialize - as XML/HTML/XHTML and restore old entry point behaviours - -Mon Sep 1 16:49:05 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * doc/xml.html doc/news.html configure.in python/setup.py NEWS: - prepare release of 2.7.1 - -Mon Sep 1 15:35:13 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * schematron.c xpath.c: applied a couple of patches from Martin - avoiding some leaks, fixinq QName checks in XPath, XPath debugging - and schematron code cleanups. - * python/tests/Makefile.am python/tests/xpathleak.py: add the - specific regression tests, just tweak it to avoid output by default - -Mon Sep 1 15:02:05 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * trionan.c: Borland C fix from Moritz Both - * testapi.c: regenerate, workaround a problem for buffer testing - * xmlIO.c HTMLtree.c: new internal entry point to hide even better - xmlAllocOutputBufferInternal - * tree.c: harden the code around buffer allocation schemes - * parser.c: restore the warning when namespace names are not absolute - URIs - * runxmlconf.c: continue regression tests if we get the expected - number of errors - * Makefile.am: run the python tests on make check - * xmlsave.c: handle the HTML documents and trees - * python/libxml.c: convert python serialization to the xmlSave APIs - and avoid some horrible hacks - -Sat Aug 30 16:58:40 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * configure.in, doc/*: preparing 2.7.0 release - * tree.c: remove some testing traces - * parser.c xmlIO.c xmlschemas.c: remove some warnings - -Sat Aug 30 14:50:16 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * include/libxml/tree.h tree.c: make a new kind of buffer where - shrinking and adding in head can avoid reallocation or full - buffer memmoves - * encoding.c xmlIO.c: use the new kind of buffers for output - buffers - -Sat Aug 30 10:18:13 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * doc/* testapi.c: regenerated - -Fri Aug 29 21:53:12 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * doc/examples/reader3.c: patch from Robert Schwebel , allows to - compile the example if configured without output support fixes - #545582 - * Makefile.am: add testrecurse to the make check tests - * HTMLparser.c: if the parser got a encoding argument it should be - used over what the meta specifies, patch fixing #536346 - -Fri Aug 29 14:41:38 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * parser.c: a couple more fixes - * nanohttp.c nanoftp.c: patch from Andreas Färber to compile on Haiku - fixes #527880 - * doc/examples/*: regenerated - -Thu Aug 28 17:31:46 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * parser.c include/libxml/parser.h: completely different fix for - the recursion detection based on entity density, big cleanups - in the entity parsing code too - * result/*.sax*: the parser should not ask for used defined versions - of the predefined entities - * testrecurse.c: automatic test for entity recursion checks - * Makefile.am: added testrecurse - * test/recurse/lol* test/recurse/good*: a first set of tests for - the recursion - -Wed Aug 27 21:55:34 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * include/libxml/xmlerror.h parser.c: a bit of cleanup and - added checks based on the regression tests of the xmlconf suite - -Wed Aug 27 19:22:35 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * uri.c: bug in parsing RFC 3986 uris with port numbers - -Wed Aug 27 17:30:48 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * configure.in Makefile.am: add an --with-coverage configure option - and a 'make cov' target based on gcc profiling and the lcov - tool. Currently at 68.9% coverage out of 'make check' and - runsuite executions. - * xmlreader.c: remove warnings due to C++ comments - -Wed Aug 27 15:00:54 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * include/libxml/parserInternals.h parser.c: cleanup entity - pushing error handling based on a patch from Ashwin - -Wed Aug 27 13:41:26 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * threads.c: fix a small initialization problem raised by Ashwin - * testapi.c gentest.py: increase testing especially for document - with an internal subset, and entities - * tree.c: fix a deallocation issue when unlinking entities from - a document. - * valid.c: fix a missing entry point test not found previously. - * doc/*: regenerated the APIs, docs etc. - -Tue Aug 26 15:02:58 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * include/libxml/parser.h parser.c xmllint.c: strengthen some - of the internal parser limits, add an XML_PARSE_HUGE option - to bypass them all. More internal parser limits will still need - to be added. - -Tue Aug 26 09:42:08 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * Makefile.am: add the testchar to 'make check' - * xmlschemas.c: Volker Grabsch pointed out a typo - * xmlregexp.c: production [19] from XML Schemas regexps were a - mistake removed in version REC-xmlschema-2-20041028, Volker Grabsch - provided a patch to remove it - * test/schemas/regexp-char-ref_0.xml test/schemas/regexp-char-ref_0.xsd - test/schemas/regexp-char-ref_1.xsd result/schemas/regexp-char-ref_0_0 - result/schemas/regexp-char-ref_1_0: Volker Grabsch also provided - regression tests for this - -Tue Aug 26 09:25:39 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * include/libxml/parser.h xinclude.c xmllint.c: patch based on - Wieant Nielander contribution to add the option of not doing - URI base fixup in XInclude - -Mon Aug 25 16:52:53 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * xmlreader.c: applied patch from Aswin to fix tree skipping - * include/libxml/entities.h entities.c: fixed a comment and - added a new xmlNewEntity() entry point - * runtest.c: be less verbose - * tree.c: space and tabs cleanups - -Mon Aug 25 10:56:30 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * include/libxml/entities.h entities.c SAX2.c parser.c: rework - the patch to avoid some ABI issue with people allocating - entities structure directly - -Wed Aug 20 19:02:01 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * include/libxml/parser.h include/libxml/entities.h entities.c - parserInternals.c parser.c: fix for CVE-2008-3281 - -Sun Aug 10 17:06:13 CEST 2008 Rob Richards <rrichards@ctindustries.net> - - * dict.c: fix non GNUC builds. - -Fri Aug 8 14:13:06 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * makefile.am: adding a check-valgrind target - -Fri Aug 8 14:01:59 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * Makefile.am testdict.c: add the new test in 'make check' and - update it to check subdictionaries processing. - -Fri Aug 8 12:07:20 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * testdict.c: added a program to regression test the dictionary code - * dict.c: improve the lookup efficiency by caching the key. - -Thu Aug 7 18:30:55 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * dict.c: chased and found a couple of nasty issues - -Thu Aug 7 15:51:31 CEST 2008 Sven Herzberg <sven@imendio.com> - - Bug 546629 – runtests doesn't pass on my mac - Reviewed by William M. Brack. - - * runtest.c: use libpthread on Mac OS X as well - -Wed Aug 6 12:24:33 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * uri.c: allow [ and ] in fragment identifiers, 3986 disallow them - but it's widely used for XPointer, and would break DocBook - processing among others - -Wed Aug 6 11:32:21 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * dict.c: change the big key algorithm to work properly with QName - too, fix a bug with dict size and sub dictionaries - -Mon Aug 4 17:27:27 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * uri.c include/libxml/uri.h: rewrite the URI parser to update to - rfc3986 (from 2396) - * test/errors/webdav.xml result/errors/webdav.xml*: removed the - error test, 'DAV:' is a correct URI under 3986 - * Makefile.am: small cleanup in make check - -Thu Jul 31 21:49:45 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * runxmlconf.c: more progresses against the official regression tests - * runsuite.c: small cleanup for non-leak reports - * include/libxml/tree.h: parsing flags and other properties are - now added to the document node, this is generally useful and - allow to make Name and NmToken validations based on the parser - flags, more specifically the 5th edition of XML or not - * HTMLparser.c tree.c: small side effects for the previous changes - * parser.c SAX2.c valid.c: the bulk of the changes are here, - the parser and validation behaviour can be affected, parsing - flags need to be copied, lot of changes. Also fixing various - validation problems in the regression tests. - -Thu Jul 31 10:15:53 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * runxmlconf.c: added a skipped list, insert rmt-ns10-035 - * Makefile.am: improve 'make check' - * include/libxml/xmlerror.h parser.c: clean up namespace errors - checking and reporting, errors when a document is labelled - as UTF-16 while it is parsed as UTF-8 and no encoding was given - explicitly. - * result/errors/webdav.xml.*: some warnings are no recategorized - as Namespace errors - -Wed Jul 30 14:55:54 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * include/libxml/xmlmemory.h xmlmemory.c: add xmlMemDisplayLast to - help debug incremental memory leaks, and some cleanups - * runxmlconf.c: use that new call and avoid ever touching the - system catalog in the regression tests - -Wed Jul 30 14:33:33 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * parser.c include/libxml/xmlerror.h: an XML-1.0 document can't load - an 1.1 entity - * runxmlconf.c: when using entities make sure we load them - -Tue Jul 29 18:43:07 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * parser.c: fix a bug not detecting cross entity comments probably - when comment parsing got optimized. - * Makefile.am: add make check - * runxmlconf.c: fix the log file name - -Tue Jul 29 18:09:26 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * runxmlconf.c Makefile.am: add a C program to run the W3C test - suite, work in progress - * xmllint.c: add a new option --oldxml10 to use the old parser - * parser.c: fix the XML_PARSE_OLD10 processing of the new option - and a bug in version parsing - -Tue Jul 29 11:12:40 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * xpath.c: space and tabs cleanup - -Tue Jul 29 10:59:36 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * include/libxml/parser.h include/libxml/xmlerror.h parser.c: - implement XML-1.0 5th edition, add parser option XML_PARSE_OLD10 - to stick to old behaviour - * testapi.c gentest.py: modified slightly and regenerated - * Makefile.am: add testchar - -Thu Jul 24 16:57:20 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * Makefile.am testchar.c Makefile.tests README.tests: add a - new regression test program for testing character ranges and - UTF8 encoding/decoding - -Wed Jul 23 15:32:39 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * libxml.spec.in: fix the build root - -Wed Jul 16 22:28:48 PDT 2008 William Brack <wbrack@mmm.com.hk> - - * pattern.c: fix problem with xmlStreamPop when pattern includes - a "." element (see discussion on libxslt list) - -Mon Jul 7 15:49:59 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * SAX2.c: fix line number on text nodes, problem raised by Ralf Junker - -Sun Jun 29 17:04:28 CEST 2008 Rob Richards <rrichards@ctindustries.net> - * xmlschemas.c: fix crash with invalid whitespace facet - -Wed Jun 11 10:13:02 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * doc/xml.html doc/FAQ.html: add a section in the FAQ about - multithread and xmlCleanupParser - -Tue Jun 10 16:52:17 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * catalog.c: apply a couple of fixes based on a Coverity report - forwarded by Derrick Price. - * VxWorks/README VxWorks/Makefile VxWorks/build.sh: instructions - Makefile, and shell script to build on VxWorks 6.4+ provided by - Jim Wert. - -Tue Jun 3 18:07:13 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * python/generator.py python/setup.py: apply patch from Martin fixing - python whitespaces - * NEWS: following previous commit rebuilt now in UTF-8 - -Mon Jun 2 17:39:42 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * ChangeLog: patch from Hans de Goede to switch the file to UTF-8 - * doc/news.xsl: switch to generate the NEWS file in UTF-8 instead of - ISO-8859-1 - -Mon May 12 15:12:44 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * xmlregexp.c: avoid a regexp crash, should fix #523738 - -Mon May 12 14:56:06 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * xmlschemas.c runtest.c testapi.c include/libxml/xmlreader.h - python/types.c python/libxml_wrap.h python/libxml.c: fx compilation - when configured without the reader should fix #513110 - * doc/*: regenerated - -Sat May 3 14:33:29 CEST 2008 Rob Richards <rrichards@ctindustries.net> - - * dict.c: check for stdint.h and define types when using MSVC - -Mon Apr 28 20:06:12 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * parserInternals.c: applied patch from Ashwin to avoid a potential - double-free - -Thu Apr 24 13:56:53 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * uri.c: applied patch from Ashwin fixing a number of realloc problems - * HTMLparser.c: improve handling for misplaced html/head/body - -Tue Apr 22 10:27:17 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * dict.c: improvement on the hashing of the dictionary, with visible - speed up as the number of strings in the hash increases, work from - Stefan Behnel - -Fri Apr 11 14:44:00 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * include/libxml/xmlschemas.h xmlschemas.c: added new function - xmlSchemaValidCtxtGetParserCtxt based on Holger Kaelberer patch - * doc/apibuild.py doc/*: regenerated the doc, chased why the new - function didn't got any documentation, added more checking in the - generator - * include/libxml/relaxng.h include/libxml/schematron.h - include/libxml/xmlschemas.h include/libxml/c14n.h - include/libxml/xmlregexp.h include/libxml/globals.h - include/libxml/xmlreader.h threads.c xmlschemas.c: various changes - and cleanups following the new reports - - -Thu Apr 10 10:07:00 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * Makefile.am: extend the cleanup rule - * xmlschemas.c: space cleanup - -Wed Apr 9 19:43:25 CEST 2008 Rob Richards <rrichards@ctindustries.net> - - * include/wsockcompat.h: support older win32 platforms when building - with newer versions of VS - -Tue Apr 8 16:56:07 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * configure.in NEWS doc/*: preparing release of 2.6.32 - -Tue Apr 8 10:19:01 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * tree.c: fix a bug introduced when fixing #438208 and reported by - Ashwin - * python/generator.py: fix an infinite loop bug - -Mon Apr 7 14:44:51 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * xmlreader.c: fix a link to XmlNodeType doc reported by Martijn Arts - * docs/*: rebuilt - -Fri Apr 4 18:09:50 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * parser.c: improve the *Recover* functions documentation - -Thu Apr 3 14:57:15 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * parser.c: patch from Mark Rowe fixing BOM or encoding detection - in external parsed entities, should fix #440415 - -Thu Apr 3 13:16:01 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * tree.c: fix some problems with the *EatName functions when - running out of memory raised by Eric Schrock , should fix #438208 - -Thu Apr 3 12:41:29 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * xmlschemastypes.c: horror around the definition of the lexical - values for decimal and derived types, fixing to reject empty - values, should fix #503268 - -Thu Apr 3 11:44:57 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * encoding.c: buffer may not be large enough to convert to - UCS4, patch from Christian Fruth , fixes #504015 - -Thu Apr 3 11:02:02 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: apparently it's okay to forget the semicolon after - entity refs in HTML, fixing char refs parsing accordingly based on - T. Manske patch, this should fix #517653 - -Thu Apr 3 09:30:29 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * error.c: avoid a scary realloc() loop should fix #520383 - -Thu Apr 3 08:22:52 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * parser.c: more realloc problems pointed out by Ashwin - -Thu Apr 3 07:40:13 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * xstc/Makefile.am: applied patch from Mike Hommey fixing distclean, - fixes #520387 - -Thu Apr 3 06:52:32 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * include/libxml/xpath.h: small doc improvement for xmlXPathContext - from Jack Jansen, fixes #524759 - * doc/newapi.xsl doc/*: fixed a problem and regenerated the docs - -Tue Apr 1 09:59:22 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * xpath.c: two patches from Alvaro Herrera to avoid problem when - running out of memory in XPath evaluations. - -Mon Mar 31 11:23:19 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * parser.c: lot of out of memory handling fixes from Ashwin - * elfgcchack.h doc/elfgcchack.xsl: work around a problem with xmlDllMain - * include/libxml/threads.h: indenting cleanups - -Mon Mar 31 10:25:37 CEST 2008 Daniel Veillard <daniel@veillard.com> - - * parser.c docs/*: trying to clarify even more the xmlCleanupParser() - use and the memory documentation - -Wed Mar 26 18:39:58 CET 2008 Daniel Veillard <daniel@veillard.com> - - * parser.c: changes based on Alex Khesin patch where xmlParseCharRef - seems to not be checked correctly, fixes #520198 - -Wed Mar 26 15:03:49 CET 2008 Daniel Veillard <daniel@veillard.com> - - * parser.c: patch from Ashwin to avoid a problem of attribute - redefinition in the DTD. Remove a warning too. - -Wed Mar 26 14:38:31 CET 2008 Daniel Veillard <daniel@veillard.com> - - * xmlschemas.c: fix a problem in externalSubsetSplit with a patch - from Ashwin - -Tue Mar 25 17:48:02 CET 2008 Daniel Veillard <daniel@veillard.com> - - * parser.c: fix various attribute normalisation problems reported - by Ashwin - * result/c14n/without-comments/example-4 - result/c14n/with-comments/example-4: this impacted the result of - two c14n tests :-\ - * test/att9 test/att10 test/att11 result//att9* result//att10* - result//att11*: added 3 specific regression tests coming from the - XML spec revision and from Ashwin - -Tue Mar 25 14:20:49 CET 2008 Daniel Veillard <daniel@veillard.com> - - * uri.c: fix saving for file:///X:/ URI embedding Windows file paths - should fix #524253 - -Mon Mar 24 21:42:33 CET 2008 Daniel Veillard <daniel@veillard.com> - - * parser.c: fix a problem reported by Ashwin for system parameter - entities referenced from entities in external subset, add a - specific loading routine. - * test/valid/dtds/external.ent test/valid/dtds/external2.ent - test/valid/t11.xml result/valid/t11.xml*: added the test to - the regression suite - -Mon Mar 24 15:04:54 CET 2008 Daniel Veillard <daniel@veillard.com> - - * xmlschemas.c: fix an XML Schemas crash raised by Stefan Behnel - when testing with W3C test suite - -Mon Mar 24 12:12:00 CET 2008 Daniel Veillard <daniel@veillard.com> - - * threads.c: check some allocation with Ashwin patch - -Wed Mar 19 16:41:52 CET 2008 Daniel Veillard <daniel@veillard.com> - - * vms/build_libxml.com: update from Tycho Hilhorst, should fix #523378 - -Tue Mar 18 09:23:05 CET 2008 Daniel Veillard <daniel@veillard.com> - - * threads.c: check some malloc returns with Ashwin patch, add - error messages and reindent the module. - -Fri Mar 14 15:28:43 CET 2008 Daniel Veillard <daniel@veillard.com> - - * xmlreader.c: patch from Ashwin removing duplicate tests - -Fri Mar 14 13:44:29 CET 2008 Daniel Veillard <daniel@veillard.com> - - * include/libxml/schematron.h include/libxml/xmlerror.h schematron.c: - applied patch from Tobias Minich to allow plugin schematron error - reporting in the normal error system, should fix #513998 - -Fri Mar 14 11:52:09 CET 2008 Daniel Veillard <daniel@veillard.com> - - * parser.c xinclude.c: patch from Vasily Chekalkin fixes memory - leaks, should fix 512647 - -Thu Mar 13 08:17:58 CET 2008 Daniel Veillard <daniel@veillard.com> - - * xmlregexp.c: found a nasty bug in regexp automata build, - reported by Ashwin and Bjorn Reese - -Wed Mar 12 18:56:22 CET 2008 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: patch from Arnold Hendriks improving parsing of - html within html bogus data, still not a complete fix though - -Wed Mar 12 10:22:01 CET 2008 Daniel Veillard <daniel@veillard.com> - - * python/types.c: fix a memory error when using namespace nodes - returned from XPath queries, should fix #521699 - * python/tests/Makefile.am python/tests/xpathns.py: add a specific - regression test for it - -Mon Mar 10 16:25:32 CET 2008 Rob Richards <rrichards@ctindustries.net> - - * include/win32config.h: add ICONV_CONST define for win32 build - to satisfy encoding.c change in rev 3693 - -Fri Mar 7 17:45:27 CET 2008 Daniel Veillard <daniel@veillard.com> - - * xmlsave.c parser.c: fix handling of empty CDATA nodes as - reported and discussed around #514181 and associated patches - * test/emptycdata.xml result/emptycdata.xml* - result/noent/emptycdata.xml: added a specific test in the - regression suite. - -Thu Mar 6 15:23:10 CET 2008 Daniel Veillard <daniel@veillard.com> - - * encoding.c: poblem with encoding detection for UTF-16 reported by - Ashwin and found by Bill - * test/valid/dtds/utf16b.ent test/valid/dtds/utf16l.ent - test/valid/UTF16Entity.xml result/valid/UTF16Entity.xml*: added - the example to the regression tests - -Tue Mar 4 14:16:38 CET 2008 Daniel Veillard <daniel@veillard.com> - - * xmlwriter.c: patch from Alex Khesin fixing CDATA output after - a text node. - * parser.c: fixed the comment for xmlParserCleanup - * globals.c: fixed indentation - -Mon Feb 25 16:42:19 CET 2008 Daniel Veillard <daniel@veillard.com> - - * testModule.c: patch from Florent Guiliani to fix build on - SCO OpenServer - -Thu Feb 21 22:46:08 CET 2008 Daniel Veillard <daniel@veillard.com> - - * debugXML.c: made one of the changes suggested by Brian Krahmer - * testRegexp.c: allow to pass '--' on the command line to allow - regexps starting with the character '-' - -Tue Feb 19 08:49:32 CET 2008 Daniel Veillard <daniel@veillard.com> - - * python/Makefile.am python/tests/Makefile.am: applied cleanup - patches for cross compilation and MinGW from Roumen Petrov - -Sat Feb 16 11:06:54 CET 2008 Daniel Veillard <daniel@veillard.com> - - * xmlIO.c: fix output bug reported by Petr Pajas and analyzed by - Bill - -Fri Feb 15 09:32:11 CET 2008 Daniel Veillard <daniel@veillard.com> - - * include/libxml/xmlerror.h tree.c: patch from Julien Charbon - to simplify the processing of xmlSetProp() - -Fri Feb 15 08:45:32 CET 2008 Daniel Veillard <daniel@veillard.com> - - * config.h.in configure.in encoding.c: patch from Roumen Petrov - to detect if iconv() needs a const for the second parameter - -Fri Feb 15 08:41:31 CET 2008 Daniel Veillard <daniel@veillard.com> - - * macos/src/XMLTestPrefix2.h win32/Makefile.msvc: EOL cleanups - from Florent Guiliani - -Wed Feb 13 10:56:38 CET 2008 Daniel Veillard <daniel@veillard.com> - - * xmlwriter.c: applied patch from Alfred Mickautsch to flush the - output at the end of document. - -Fri Feb 8 11:57:03 CET 2008 Daniel Veillard <daniel@veillard.com> - - * doc/examples/examples.xml: regenerated, it was truncated. - -Fri Feb 8 11:47:18 CET 2008 Daniel Veillard <daniel@veillard.com> - - * xmlmodule.c: apply simple patch from Carlo Bramini to avoid - compilation problems with Mingw32 - -Fri Feb 8 11:33:15 CET 2008 Daniel Veillard <daniel@veillard.com> - - * xmlregexp.c: apply patch from Andrew Tosh to fix behaviour - when '.' is used in a posCharGroup - * test/schemas/poschargrp0_0.* result/schemas/poschargrp0_0_0*: - added the test to the regression suite - -Fri Feb 8 10:54:09 CET 2008 Daniel Veillard <daniel@veillard.com> - - * dict.c: applied patch from Florent Guilian to remove an - useless mutex in the xmlDict structure. - -Wed Feb 6 17:00:20 CET 2008 Daniel Veillard <daniel@veillard.com> - - * SAX2.c: another leak reported by Ashwin - * xinclude.c: fixed the behaviour when XIncluding a fragment - of the current document, patch from Chris Ryan - -Wed Feb 6 12:10:08 HKT 2008 William Brack <wbrack@mmm.com.hk> - - * nanohttp.c: added space for port number (when not 80) in - xmlNanoHTTPMethodRedir, plus a few more comments. Should - fix #514521. - -Tue Feb 5 09:41:46 CET 2008 Daniel Veillard <daniel@veillard.com> - - * schemas.c: apply fix suggested by Ashwin correcting a cut-n-paste - error about the SAX callback in cdataBlockSplit when streaming - XSD validation - -Tue Feb 5 09:36:46 CET 2008 Daniel Veillard <daniel@veillard.com> - - * uri.c: applied a patch based on Petr Sumbera one to avoid a - problem with paths starting with // - -Mon Feb 4 17:48:30 CET 2008 Daniel Veillard <daniel@veillard.com> - - * doc/xml.html doc/xmlmem.html: added a small section on returning - memory to the kernel by compacting the heap provided by Wolfram Sang - -Fri Jan 25 20:01:42 CET 2007 Rob Richards <rrichards@ctindustries.net> - - * include/win32config.h win32/Makefile.msvc: fix build under VS 2008. - patch by David Wimsey - -Thu Jan 24 15:37:04 CET 2008 Daniel Veillard <daniel@veillard.com> - - * parser.c: fix a memory leak in internal subset parsing with - a fix from Ashwin - * test/errors/content1.xml result/errors/content1.xml*: - add test to regressions - -Fri Jan 11 09:00:09 CET 2008 Daniel Veillard <daniel@veillard.com> - - * configure.in doc/*: preparing release of 2.6.31 - -Fri Jan 11 08:58:49 CET 2008 Daniel Veillard <daniel@veillard.com> - - * parser.c: avoid a warning on 64bits introduced earlier - * parserInternals.c: make more checking on the UTF-8 input - -Fri Jan 11 15:37:05 CST 2008 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: avoid stopping parsing when encountering - out of range characters in an HTML file, report and - continue processing instead, should fix #472696 - -Fri Jan 11 15:13:35 CST 2008 Daniel Veillard <daniel@veillard.com> - - * check-relaxng-test-suite2.py check-relaxng-test-suite.py - Makefile.am python/tests/Makefile.am python/Makefile.am - check-xsddata-test-suite.py: patches from John Carr to - start cleaning up 'make diskcheck' problems c.f. #506228 - -Fri Jan 11 14:48:40 CST 2008 Daniel Veillard <daniel@veillard.com> - - * xmllint.c: apply fix from Stefan Kost to avoid a crash - in xmllint, fixes 504284 - -Fri Jan 11 14:39:03 CST 2008 Daniel Veillard <daniel@veillard.com> - - * xml2-config.in: apply patch from Fred Crozat to avoid - outputting -L/usr/lib from xml2-config, fixes #497012 - -Fri Jan 11 14:18:09 CST 2008 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: fix definition for <embed> to avoid error - when saving back, patch from Stefan Behnel fixing 495213 - -Fri Jan 11 14:06:09 CST 2008 Daniel Veillard <daniel@veillard.com> - - * parser.c: applied patch from Christian Schmidt fixing a - column counter update problem, fixes #472696 - -Fri Jan 11 13:22:14 CST 2008 Daniel Veillard <daniel@veillard.com> - - * parser.c: handle a erroneous parsing of attributes in - case said attribute has been redeclared in the DTD with a - different type - * hash.c: fix the hash scanner to not crash if a first element - from the hash list is been removed in the callback - -Wed Jan 9 10:15:50 CST 2008 Daniel Veillard <daniel@veillard.com> - - * xmlwriter.c: fix indentation in xmlTextWriterFullEndElement, - as raised by Felipe Pena, should fix #508156 - -Tue Dec 6 11:07:42 CET 2007 Rob Richards <rrichards@ctindustries.net> - - * pattern.c: fix crash from double free of name for bug #501760 - -Fri Nov 23 11:47:48 CET 2007 Daniel Veillard <daniel@veillard.com> - - * threads.c: remove unused variable in __xmlGlobalInitMutexLock - reported by Hannes Eder - -Mon Nov 19 18:39:26 CET 2007 Daniel Veillard <daniel@veillard.com> - - * xmlregexp.c: remove a cut-and-paste copy error - -Fri Nov 16 11:55:36 CET 2007 Rob Richards <rrichards@ctindustries.net> - - * globals.c threads.c include/libxml/threads.h: - __xmlGlobalInitMutexDestroy() will free global_init_lock on Win32. - Patch from Marc-Antoine Ruel. - -Tue Nov 13 21:26:27 CET 2007 Rob Richards <rrichards@ctindustries.net> - - * schematron.c: fix crash/leaks from xmlSchematronParse due to improper - schema document ownership for bug #495215 - -Tue Oct 30 21:24:55 CET 2007 Daniel Veillard <daniel@veillard.com> - - * xmlmemory.c: xmlFree(NULL) should not crash in debug mode - should fix #491651 - -Tue Oct 16 13:58:41 CEST 2007 Daniel Veillard <daniel@veillard.com> - - * testURI.c: add a debug option printing all the fields within - the parsed URI structure - -Wed Oct 10 10:25:52 CEST 2007 Daniel Veillard <daniel@veillard.com> - - * xmlsave.c: fix to avoid a crash when dumping an attribute from - an XHTML document, patch contributed to fix #485298 - -Tue Aug 28 19:32:28 CEST 2007 Daniel Veillard <daniel@veillard.com> - - * xmlregexp.c: another nasty regexp case fixed. - * test/regexp/ranges2 result/regexp/ranges2: added to regression - suite - -Fri Aug 24 10:58:58 HKT 2007 William Brack <wbrack@mmm.com.hk> - - * nanohttp.c: Enhanced to include port number (if not == 80) on the - "Header:" URL (bug #469681). - * xmlregexp.c: Fixed a typo causing a warning message. - -Thu Aug 23 22:48:20 CEST 2007 Daniel Veillard <daniel@veillard.com> - - * nanohttp.c: fix an open() call with creation without 3rd argument - hopefully that interface is never used. - -Thu Aug 23 17:00:49 CEST 2007 Daniel Veillard <daniel@veillard.com> - - * configure.in doc/*: preparing release of 2.6.30 - -Thu Aug 23 20:58:28 HKT 2007 William Brack <wbrack@mmm.com.hk> - - * xpath.c: fixed xmlXPathCompOpEvalPositionalPredicate problem - with object caching (bug #469410) - -Thu Aug 23 11:28:38 CEST 2007 Daniel Veillard <daniel@veillard.com> - - * xmlschemas.c test/schemas/*455953* result/schemas/bug455953*: - applied patch from Frank Gross fixing Schemas IDC import bug - #455953 and also add the test to the regression suite - -Wed Aug 22 18:29:42 CEST 2007 Daniel Veillard <daniel@veillard.com> - - * xmlregexp.c: try to fix for the nth time the automata generation - in case of complex ranges. I suppose that time it is actually okay - -Tue Aug 14 15:51:05 CEST 2007 Daniel Veillard <daniel@veillard.com> - - * parser.c: aligned xmlSAXUserParseMemory() to match - xmlSAXUserParseFile() logic based on Ashwin post, and ifdef - cleanup - -Tue Aug 14 11:42:27 CEST 2007 Rob Richards <rrichards@ctindustries.net> - - * xmlIO.c: fixed windows path determination (patch from - Roland Schwarz, bug #462877) - * win32/Makefile.mingw win32/configure.js: fixed mingw build - (patch from Roland Schwarz, bug #462877) - -Wed Aug 1 09:50:12 CEST 2007 Daniel Veillard <daniel@veillard.com> - - * parser.c: fixed a parser bug where invalid char in comment may - not be detected, reported by Ashwin Sinha - * test/errors/comment1.xml result/errors/comment1.xml*: added - the example to the regression suite - -Thu Jul 26 13:42:26 CEST 2007 Daniel Veillard <daniel@veillard.com> - - * xmlsave.c: fixed problem reported on bug #460415 - -Thu Jul 19 18:10:58 PDT 2007 William Brack <wbrack@mmm.com.hk> - - * uri.c: applied patch from from Patrik Fimml. Fixes bug #458268. - -Wed Jul 18 11:05:08 PDT 2007 William Brack <wbrack@mmm.com.hk> - - * xinclude.c: applied patch from bug #454608 from Patrik Fimml. - Fixes bug #454608. - -Wed Jul 11 19:57:59 CEST 2007 Daniel Veillard <daniel@veillard.com> - - * xmlschemas.c: applied patch for xsi:nil from Frank Gross, this - should fix bug #358125 - -Wed Jul 4 17:44:20 CEST 2007 Daniel Veillard <daniel@veillard.com> - - * xmlwriter.c: patch from Dodji Seketeli to avoid a leak on repeated - uses of xmlTextWriterStartDocument() - -Tue Jun 26 13:30:50 CEST 2007 Daniel Veillard <daniel@veillard.com> - - * xmlschemas.c: fix a crash on solaris when a printf %s with a NULL - argument occurs, should fix #450936 - -Wed Jun 13 13:33:38 PDT 2007 William Brack <wbrack@mmm.com.hk> - - * xpath.c: fixed problem in previous fix to xmlXPathNodeSetSort - -Tue Jun 12 18:17:28 CEST 2007 Daniel Veillard <daniel@veillard.com> - - * doc/* configure.in NEWS: release of libxml2 2.6.29 - * valid.c: patch from Dagfinn I. Mannsåker for idness of name - in HTML, c.f. bug #305885. - -Tue Jun 12 17:14:08 CEST 2007 Daniel Veillard <daniel@veillard.com> - - * SAX2.c: fixing bug #319964, parsing of HTML attribute really - should not have namespace processing. - -Tue Jun 12 16:42:14 CEST 2007 Daniel Veillard <daniel@veillard.com> - - * parser.c: fixed the push mode when a big comment occurs before - an internal subset, should close bug #438835 - * test/comment6.xml result//comment6.xml*: added a special - test in the regression suite - -Tue Jun 12 15:41:09 CEST 2007 Daniel Veillard <daniel@veillard.com> - - * parser.c: fix bug #414846 where invalid characters in attributes - would sometimes not be detected. - * test/errors/attr4.xml result/errors/attr4.xml*: added a specific - test case to the regression tests - -Tue Jun 12 14:23:24 CEST 2007 Daniel Veillard <daniel@veillard.com> - - * xstc/Makefile.am: apply patch from Ryan Hill to cope with changes - in GNU tar, should fix #396751 - -Tue Jun 12 12:03:36 CEST 2007 Daniel Veillard <daniel@veillard.com> - - * python/types.c: try to allow compilation on old python version - should fix #398125 - -Tue Jun 12 11:48:15 CEST 2007 Daniel Veillard <daniel@veillard.com> - - * HTMLtree.c: htmlNodeDumpFormatOutput didn't handle XML_ATTRIBUTE_NODe - fixes bug #438390 - -Tue Jun 12 11:37:55 CEST 2007 Daniel Veillard <daniel@veillard.com> - - * xmlIO.c: workaround misgenerated file: URIs c.f. #437385 - -Tue Jun 12 11:22:47 CEST 2007 Daniel Veillard <daniel@veillard.com> - - * relaxng.c: fixed bug #407436 a crash in a specific case of - Relax-NG validation - -Tue Jun 12 11:12:50 CEST 2007 Daniel Veillard <daniel@veillard.com> - - * catalog.c: fixed bug #383687, some case of recursion on next - were not caught in the catalog code. - -Tue Jun 12 10:37:42 CEST 2007 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: fixed bug #381877, avoid reading over the end - of stream when generating an UTF-8 encoding error. - -Tue Jun 12 10:16:48 CEST 2007 Daniel Veillard <daniel@veillard.com> - - * parser.c: fixed bug #366161, trivially added the check in - xmlCtxtReset() - -Fri Jun 8 21:48:21 CEST 2007 Rob Richards <rrichards@ctindustries.net> - - * win32/configure.js win32/Makefile.msvc: add --vcmanifest flag (yes/no) - for VC8 build support to embed manifest within files. Under MS VC, build - libxml2_a_dll.lib by default (LIBXML_STATIC_FOR_DLL flag). - -Fri Jun 8 21:37:46 CEST 2007 Rob Richards <rrichards@ctindustries.net> - - * threads.c include/libxml/threads.h: use specified calling convention - for xmlDllMain. Old SDKs (VC6) only support InterlockedCompareExchange. - add xmlDllMain to header for win32 when building for static dll - -Fri Jun 8 10:51:28 CEST 2007 Rob Richards <rrichards@ctindustries.net> - - * xmlwriter.c: fixed problem with namespace declaration being - written more than once per element start tag - -Wed Jun 6 10:18:28 PDT 2007 William Brack <wbrack@mmm.com.hk> - - * xpath.c: fixed problem with xmlXPathNodeSetSort; - fixed problem with xmlXPathNodeTrailingSorted (both bug#413451) - -Wed May 30 22:05:08 PDT 2007 William Brack <wbrack@mmm.com.hk> - - * xpath.c: fixed problem with string value for PI node - (bug #442275) - -Mon May 28 16:14:50 CEST 2007 Daniel Veillard <daniel@veillard.com> - - * uri.c: fix bug reported by François Delyon - -Tue May 22 08:59:48 PDT 2007 William Brack <wbrack@mmm.com.hk> - - * encoding.c: Fixed typo in xmlCharEncFirstLine pointed out - by Mark Rowe (bug #440159) - * include/libxml/xmlversion.h.in: Added check for definition of - _POSIX_C_SOURCE to avoid warnings on Apple OS/X (patch from - Wendy Doyle and Mark Rowe, bug #346675) - * schematron.c, testapi.c, tree.c, xmlIO.c, xmlsave.c: minor - changes to fix compilation warnings - no change to logic. - -Tue May 15 22:18:08 PDT 2007 William Brack <wbrack@mmm.com.hk> - - * nanohttp.c: small enhancement to last fix, pointed out - by Alex Cornejo - -Tue May 15 12:38:38 PDT 2007 William Brack <wbrack@mmm.com.hk> - - * nanohttp.c: fixed problem on gzip streams (bug #438045) - * xpath.c: fixed minor spot of redundant code - no logic change. - -Fri May 11 22:45:18 HKT 2007 William Brack <wbrack@mmm.com.hk> - - * xpath.c: enhanced the coding for xmlXPathCastNumberToString - in order to produce the required number of significant digits - (bug #437179) - -Thu May 10 01:52:42 CEST 2007 Daniel Veillard <daniel@veillard.com> - - * list.c: applied patch to fix xmlListAppend() from - Georges-André SILBER - * valid.c: also fix the place where it was called. - -Wed May 2 18:47:33 CEST 2007 Daniel Veillard <daniel@veillard.com> - - * parser.c: tried to fix an error problem on entity content failure - reported by Michael Day - -Wed May 2 18:23:35 CEST 2007 Daniel Veillard <daniel@veillard.com> - - * configure.in: typo patch from Bjorn Reese - -Wed May 2 18:12:58 CEST 2007 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: applied patch from Michael Day to add support for - <embed> - -Thu Apr 26 10:58:50 CEST 2007 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: Jean-Daniel Dupas pointed a couple of problems - in htmlCreateDocParserCtxt. - -Thu Apr 26 10:36:26 CEST 2007 Daniel Veillard <daniel@veillard.com> - - * uri.c include/libxml/uri.h: patch from Richard Jones to save - the query part in raw form. - * libxml2-python-api.xml: also added accessor for the python bindings - -Wed Apr 25 15:57:32 CEST 2007 Daniel Veillard <daniel@veillard.com> - - * xstc/Makefile.am doc/examples/Makefile.am Makefile.am: applied - patch from Richard Jones to for the silent flag on valgrind - when doing "make valgrind" - * xmlregexp.c: raise a regexp error when '\' is misused to escape - a standard character. - -Tue Apr 24 20:15:14 CEST 2007 Daniel Veillard <daniel@veillard.com> - - * tree.c: Richard Jones reported xmlBufferAdd (buf, "", -1), fixing it - -Tue Apr 24 10:59:28 CEST 2007 Daniel Veillard <daniel@veillard.com> - - * uri.c: fix xmlURIUnescapeString comments which was confusing - -Wed Apr 18 09:52:25 CEST 2007 Daniel Veillard <daniel@veillard.com> - - * include/win32config.h libxml.h: new patch from Andreas Stricke to - better integrate support for Windows CE - -Tue Apr 17 16:50:12 CEST 2007 Daniel Veillard <daniel@veillard.com> - - * doc/* configure.in NEWS: release of libxml2 2.6.28 - -Tue Apr 17 14:47:42 CEST 2007 Daniel Veillard <daniel@veillard.com> - - * catalog.c libxml.h win32/wince/wincecompat.h win32/wince/wincecompat.c - xmlIO.c nanohttp.c nanoftp.c trio.c triostr.c triostr.h: applied - patch from Andreas Stricke to ease the compilation on Windows CE - -Tue Apr 17 14:34:45 CEST 2007 Daniel Veillard <daniel@veillard.com> - - * xmllint.c catalog.c: "xmllint unusable on win32" so applied - a libxml2 patch from Christian Ehrlicher - -Mon Apr 16 09:05:01 CEST 2007 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: change the way script/style are parsed to - not try to detect comments, reported by Mike Day - * result/HTML/doc3.*: affects the result of that test - -Wed Apr 11 22:38:18 HKT 2007 William Brack <wbrack@mmm.com.hk> - - * xmlregexp.c: small enhancement for quantifier range with - min occurs of 0; fixes bug 425542. - -Fri Mar 30 14:41:57 CEST 2007 Daniel Veillard <daniel@veillard.com> - - * xmlIO.c: applied change from Michael Day to avoid a problem when - compiled without zlib support. - -Wed Mar 21 17:58:13 CET 2007 Daniel Veillard <daniel@veillard.com> - - * include/libxml/xpath.h: applied documentation patch from James Dennett - -Wed Mar 21 21:20:48 HKT 2007 William Brack <wbrack@mmm.com.hk> - - * xmlregexp.c: fixed problem with 0x2d in Char Range (bug #420596) - * test/regexp/bug420596, result/regexp/bug420596: added regression - test for this - -Wed Mar 21 14:23:08 HKT 2007 William Brack <wbrack@mmm.com.hk> - - * HTMLparser.c: fixed memory access error on parsing of meta data - which had errors (bug #382206). Also cleaned up a few warnings - by adding some additional DECL macros. - -Tue Mar 20 09:58:13 CET 2007 Daniel Veillard <daniel@veillard.com> - - * nanoftp.c: applied patch from Björn Wiberg to try to fix again - the silly __ss_family problem on various AIXes, should fix #420184 - -Wed Mar 14 20:30:38 HKT 2007 William Brack <wbrack@mmm.com.hk> - - * configure.in: corrected small error in last commit - * xmlreader.c: corrected small typo in last commit - -Wed Mar 14 19:35:28 HKT 2007 William Brack <wbrack@mmm.com.hk> - - * xmlschemas.c: fixed problem with referenced attribute groups - (bug #417621) - * configure.in: re-ordered some includes for types.h / socket.h - (bug #416001) - -Fri Mar 9 17:54:40 CET 2007 Daniel Veillard <daniel@veillard.com> - - * xmlreader.c: applied patch from Julien Reichel cleaning up mode - and state internal flags mixups - -Wed Mar 7 16:18:18 HKT 2007 William Brack <wbrack@mmm.com.hk> - - * xpath.c: fixed xmlXPathCmpNodes for incorrect result on certain - cases when comparing identical nodes (bug #415567) with patch - from Oleg Paraschenko - -Fri Feb 16 09:13:38 PST 2007 William Brack <wbrack@mmm.com.hk> - - * python/libxml.py: fixed tab problem with patch from - Andreas Hanke (bug #408626) - -Thu Feb 15 12:43:28 PST 2007 William Brack <wbrack@mmm.com.hk> - - * doc/xml.html: Changed all references to libxml2 CVS over to - the corresponding SVN. A few other spelling/grammar/links - also changed. - * doc/libxml2-api.xml, doc/*.html: Regenerated all docs. - -Tue Feb 13 18:15:58 PST 2007 William Brack <wbrack@mmm.com.hk> - - * xpath.c: Fixed memory bug with invalid function reported by - Francois Delyon on mailing list - -Mon Feb 12 16:40:48 PST 2007 William Brack <wbrack@mmm.com.hk> - - * xinclude.c: fixed problem with invalid char encountered - during text include (reported on xslt mailing list) - -Mon Feb 12 18:30:01 CET 2007 Daniel Veillard <daniel@veillard.com> - - * Makefile.am: small cleanup to avoid packaging .svn - * libxml.h threads.c parser.c: applied patch to avoid a problem - in concurrent threaded initialization fix from Ted Phelps - -Thu Feb 08 15:35:18 PST 2007 William Brack <wbrack@mmm.com.hk> - - * parser.c: added a GROW when parsing complex comments (bug #405666) - * gentest.py, testapi.c: added a hack to prevent destruction of any - param with 'destroy' in it's description (i.e. param destroyed by - the routine under test, so shouldn't be destroyed by testapi) - * xmlreader.c: added freeing of 'input' param even on error - (fixes leak detected by testapi) - -Wed Jan 31 10:25:38 PST 2007 William Brack <wbrack@mmm.com.hk> - - * testAutomata.c, testRegexp.c, testThreads.c, testThreadsWin32.c, - xmlwriter.c: repositioned #include for libxml.h to avoid - compilation error on some architectures (bug #398277) - * fixed screwed-up ChangeLog (deleted some duplicate entries) - -Fri Jan 26 00:05:18 PST 2007 William Brack <wbrack@mmm.com.hk> - - * implemented patch from Stéphane Bidoul for uri.c (bug #389767) - -Thu Jan 25 11:15:08 PST 2007 William Brack <wbrack@mmm.com.hk> - - * xpath.c: added checks for alloc fail on calls to - xmlXPathNewContext (libxslt bug #400242) - -Thu Jan 11 15:38:08 PST 2007 William Brack <wbrack@mmm.com.hk> - - * Re-generated the documentation (API chunks 27-29 were missing) - (also causes changes to testapi.c, elfgcchack.h and - win32/libxml2.def.src) - -Tue Jan 9 22:24:26 CET 2007 Daniel Veillard <daniel@veillard.com> - - * python/libxml.c: fix a memory leak in the python string handling - when SAX event are passed back to the python handlers - -Thu Jan 4 18:27:49 CET 2007 Daniel Veillard <daniel@veillard.com> - - * xmlreader.c: fix xmlTextReaderSetup() description - * test/relaxng/empty1.rng test/relaxng/comps_0.xml - test/relaxng/empty1_0.xml test/relaxng/comps.rng - test/relaxng/empty0.rng test/relaxng/empty0_0.xml - test/relaxng/empty1_1.xml: tests which were apparently - never committed to CVS - -Wed Jan 3 16:05:21 PST 2007 Aleksey Sanin <aleksey@aleksey.com> - - * xmlreader.c include/libxml/xmlreader.h win32/libxml2.def.src: - expose xmlTextReaderSetup() function - -Wed Jan 3 16:14:13 CET 2007 Daniel Veillard <daniel@veillard.com> - - * configure.in: adapt the extra versioning code to SVN - -Thu Dec 14 16:52:34 CET 2006 Daniel Veillard <daniel@veillard.com> - - * python/generator.py python/libxml.py: apparently id() sometimes - generate negative values and %X outputs -XXXX :-( - -Mon Dec 4 10:30:25 CET 2006 Daniel Veillard <daniel@veillard.com> - - * parser.c include/libxml/tree.h: patch from Michael Day on standalone - and XML declaration detection, and associated documentation change - -Mon Dec 4 10:27:01 CET 2006 Daniel Veillard <daniel@veillard.com> - - * xinclude.c: another XInclude user data propagation patch from - Michael Day - -Thu Nov 23 17:22:03 CET 2006 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: applied patch from Steven Rainwater to fix - UTF8ToHtml behaviour on code points which are not mappable to - predefined HTML entities, fixes #377544 - -Thu Nov 23 17:11:23 CET 2006 Daniel Veillard <daniel@veillard.com> - - * xpath.c: fixed a bug where the principal node type of an axis - wasn't tested on name check, fixes bug #377432 - -Wed Nov 8 10:19:27 CET 2006 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: change htmlCtxtReset() following Michael Day bug - report and suggestion. - -Mon Nov 6 09:56:41 CET 2006 Daniel Veillard <daniel@veillard.com> - - * uri.c: applied patch from Igor for path conversion on Windows - -Thu Nov 2 11:29:17 CET 2006 Daniel Veillard <daniel@veillard.com> - - * xmlregexp.c: another small change on the algorithm for the - elimination of epsilon transitions, should help on #362989 too - -Wed Nov 1 16:33:10 CET 2006 Daniel Veillard <daniel@veillard.com> - - * tree.c: applied documentation patches from Markus Keim - * xmlregexp.c: fixed one bug and added a couple of optimisations - while working on bug #362989 - -Fri Oct 27 14:54:07 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: applied a reworked version of Usamah Malik patch - to avoid growing the parser stack in some autoclose cases, should - fix #361221 - -Thu Oct 26 10:54:40 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * xpath.c: William spotted an obvious bug - -Wed Oct 25 18:04:50 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * NEWS configure.in testapi.c doc//*: preparing release of - libxml2-2.6.27 - * include/libxml/tree.h: fix a small problem with preproc flags - -Fri Oct 20 14:55:47 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * tree.c: fix comment for xmlDocSetRootElement c.f. #351981 - * xmllint.c: order XPath elements when using --shell - -Tue Oct 17 23:23:26 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * xmlregexp.c: applied fix from Christopher Boumenot for bug - #362714 on regexps missing ']' - -Tue Oct 17 22:32:42 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * parserInternals.c: applied patch from Marius Konitzer to avoid - leaking in xmlNewInputFromFile() in case of HTTP redirection - -Tue Oct 17 22:19:02 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: fix one problem found in htmlCtxtUseOptions() - and pointed in #340591 - -Tue Oct 17 22:04:31 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: fixed the 2 stupid bugs affecting htmlReadDoc() and - htmlReadIO() this should fix #340322 - -Tue Oct 17 21:39:23 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * xpath.c: applied patch from Olaf Walkowiak which should fix #334104 - -Tue Oct 17 18:12:34 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: fixing HTML minimized attribute values to be generated - internally if not present, fixes bug #332124 - * result/HTML/doc2.htm.sax result/HTML/doc3.htm.sax - result/HTML/wired.html.sax: this affects the SAX event stream for - a few test cases - -Tue Oct 17 17:56:31 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: fixing HTML entities in attributes parsing bug #362552 - * result/HTML/entities2.html* test/HTML/entities2.html: added to - the regression suite - -Tue Oct 17 01:21:37 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * xmllint.c: started to switch xmllint to use xmlSaveDoc to test - #342556 - * xmlsave.c: fixed #342556 easy and a whole set of problems with - encodings, BOM and xmlSaveDoc() - -Mon Oct 16 15:14:53 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: fix #348252 if the document clains to be in a - different encoding in the meta tag and it's obviously wrong, - don't screw up the end of the content. - -Mon Oct 16 11:32:09 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: fix a chunking and script bug #347708 - -Mon Oct 16 09:51:05 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: remove a warning - * encoding.c: check with uppercase for AIX iconv() should fix #352644 - * doc/examples/Makefile.am: partially handle one bug report - -Sun Oct 15 22:31:42 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * parser.c: fix the patch for unreproductable #343000 but - also fix a line/column keeping error - * result/errors/attr1.xml.err result/errors/attr2.xml.err - result/errors/name.xml.err result/errors/name2.xml.err - result/schemas/anyAttr-processContents-err1_0_0.err - result/schemas/bug312957_1_0.err: affected lines in error output - of the regression tests - -Sat Oct 14 10:46:46 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * tree.c: fixing bug #344390 with xmlReconciliateNs - -Sat Oct 14 00:31:49 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * xmllint.c: added --html --memory to test htmlReadMemory to - test #321632 - * HTMLparser.c: added various initialization calls which may help - #321632 but not conclusive - * testapi.c tree.c include/libxml/tree.h: fixed compilation with - --with-minimum --with-sax1 and --with-minimum --with-schemas - fixing #326442 - -Fri Oct 13 18:30:55 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * relaxng.c: fix a Relax-NG bug related to element content processing, - fixes bug #302836 - * test/relaxng/302836.rng test/relaxng/302836_0.xml - result/relaxng/302836*: added to regression tests - -Fri Oct 13 14:42:44 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * parser.c: fix a problem in xmlSplitQName resulting in bug #334669 - -Fri Oct 13 12:27:22 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * parser.c: fixed xmlIOParseDTD handling of @input in error case, - Should fix #335085 - * testapi.c: reset the http_proxy env variable to not waste time - on regression tests - -Thu Oct 12 23:07:43 CEST 2006 Rob Richards <rrichards@ctindustries.net> - - * xmlIO.c: fix Windows compile - missing xmlWrapOpen. - -Thu Oct 12 18:21:18 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * parser.c: fixed the heuristic used when trying to detect mixed-content - elememts if the parser wants to treat ignorable whitespaces - in a non-standard way, should fix bug #300263 - -Thu Oct 12 14:52:38 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * parser.c: fix a first arg error in SAX callback pointed out by - Mike Hommey, and another one still hanging around. Should fix #342737 - -Wed Oct 11 23:11:58 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * include/libxml/xmlversion.h.in: fix comment on versions - * xmlmemory.c: do not spend too much time digging in dumped memory - -Wed Oct 11 18:40:00 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * valid.c: fixed a weird error where validity context would not - show up if warnings were disabled pointed out by Bob Stayton - * xmlIO.c doc/generator.py: cleanup and fix to regenerate the docs - * doc//* testapi.c: rebuilt the docs - -Wed Oct 11 14:32:00 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * libxml-2.0.pc.in: applied patch from Mikhail Zabaluev to separate - library flags for shared and static builds, fixes #344594. If this - bites you, use xml2-config. - -Wed Oct 11 11:27:37 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * python/Makefile.am: remove the build path recorded in the python - shared module as Peter Breitenlohner pointed out, should fix #346022 - -Wed Oct 11 11:14:51 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * xmlIO.c: applied patch from Mikhail Zabaluev fixing the conditions - of unescaping from URL to filepath, should fix #344588. - -Wed Oct 11 10:24:58 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * configure.in xstc/Makefile.am: applied patch from Peter Breitenlohner - for wget detection and fix of a Python path problem, should fix - #340993 - -Tue Oct 10 22:02:29 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * include/libxml/entities.h entities.c SAX2.c parser.c: trying to - fix entities behaviour when using SAX, had to extend entities - content and hack on the entities processing code, but that should - fix the long standing bug #159219 - -Tue Oct 10 14:36:18 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * uri.c include/libxml/uri.h: add a new function xmlPathToUri() - to provide a clean conversion when setting up a base - * SAX2.c tree.c: use said function when setting up doc->URL - or using the xmlSetBase function. Should fix #346261 - -Tue Oct 10 11:05:59 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * xmlIO.c: applied a portability patch from Emelyanov Alexey - -Tue Oct 10 10:52:01 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * parser.c: applied and slightly modified a patch from Michael Day to - keep _private in the parser context when parsing external entities - -Tue Oct 10 10:33:43 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * python/libxml.py python/types.c: applied patch from Ross Reedstrom, - Brian West and Stefan Anca to add XPointer support to the Python bindings - -Fri Sep 29 11:13:59 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * xmlsave.c: fixed a comment - * xinclude.c include/libxml/xinclude.h: applied a patch from Michael Day - to add a new function providing the _private field for the generated - parser contexts xmlXIncludeProcessFlagsData() - -Thu Sep 21 10:36:11 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * xmlIO.c: applied patch from Michael Day doing some refactoring - for the catalog entity loaders. - -Thu Sep 21 08:53:06 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c include/libxml/HTMLparser.h: exports htmlNewParserCtxt() - as Michael Day pointed out this is needed to use htmlCtxtRead*() - -Tue Sep 19 14:42:59 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * parser.c: applied patch from Ben Darnell on #321545, I could not - reproduce the problem but 1/ this is safe 2/ it's better to be safe. - -Sat Sep 16 16:02:23 CEST 2006 Rob Richards <rrichards@ctindustries.net> - - * tree.c: xmlTextConcat works with comments and PI nodes (bug #355962). - * parser.c: fix resulting tree corruption when using XML namespace - with existing doc in xmlParseBalancedChunkMemoryRecover. - -Fri Sep 1 11:52:55 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * xmlIO.c: another patch from Emelyanov Alexey to clean up a few things - in the previous patch. - -Wed Aug 30 15:10:09 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * xmlIO.c: applied patch from Roland Schwingel to fix the problem - with file names in UTF-8 on Windows, and compat on older win9x - versions. - -Tue Aug 22 16:51:22 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * valid.c: fixed a bug #203125 in Red hat bugzilla, crashing PHP4 - on validation errors, the heuristic to guess is a vctxt user - pointer is the parsing context was insufficient. - -Mon Aug 21 10:40:10 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * doc/xmlcatalog.1 doc/xmlcatalog_man.xml doc/xmllint.1 doc/xmllint.xml: - applied patch to man pages from Daniel Leidert and regenerated - -Thu Aug 17 00:48:31 CEST 2006 Rob Richards <rrichards@ctindustries.net> - - * xmlwriter.c: Add a document to the xmlwriter structure and - pass document when writing attribute content for encoding support. - -Wed Aug 16 01:15:12 CEST 2006 Rob Richards <rrichards@ctindustries.net> - - * HTMLtree.c xmlsave.c: Add linefeeds to error messages allowing - for consistent handling. - -Tue Aug 15 15:02:18 CEST 2006 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xpath.c: Applied the proposed fix for the documentation - of xmlXPathCastToString(); see bug #346202. - -Tue Aug 15 14:49:18 CEST 2006 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: While investigating bug #350247, I noticed - that xmlSchemaIDCMatcher structs are massively recreated - although only a maximum of 3 structs is used at the same - time; added a cache for those structures to the - validation context. - -Sat Aug 12 16:12:53 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * xmlschemas.c: applied patch from Marton Illes to fix an allocation - bug in xmlSchemaXPathEvaluate should close #351032 - -Mon Aug 7 13:08:46 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * xmlschemas.c: applied patch from Bertrand Fritsch to fix a bug in - xmlSchemaClearValidCtxt - -Fri Aug 4 14:50:41 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * python/generator.py: fixed the conversion of long parameters - -Thu Jul 13 15:03:11 CEST 2006 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlsave.c: Removed the automatic generation of CDATA sections - for the content of the "script" and "style" elements when - serializing XHTML. The issue was reported by Vincent Lefevre, - bug #345147. - * result/xhtml1 result/noent/xhtml1: Adjusted regression test - results due to the serialization change described above. - -Thu Jul 13 08:32:21 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * configure.in parser.c xmllint.c include/libxml/parser.h - include/libxml/xmlversion.h.in: applied patch from Andrew W. Nosenko - to expose if zlib support was compiled in, in the header, in the - feature API and in the xmllint --version output. - -Thu Jul 13 08:24:14 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * SAX2.c: refactor to use normal warnings for entities problem - and not straight SAX callbacks. - -Wed Jul 12 17:13:03 CEST 2006 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: Fixed bug #347316, reported by David Belius: - The simple type, which was the content type definition - of a complex type, which in turn was the base type of a - extending complex type, was missed to be set on this - extending complex type in the derivation machinery. - -Mon Jul 3 13:36:43 CEST 2006 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xpath.c: Changed xmlXPathCollectAndTest() to use - xmlXPathNodeSetAddNs() when adding a ns-node in case of - NODE_TEST_TYPE (the ns-node was previously added plainly - to the list). Since for NODE_TEST_ALL and NODE_TEST_NAME - this specialized ns-addition function was already used, - I assume it was missed to be used with NODE_TEST_TYPE. - -Mon Jul 3 10:57:33 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: applied const'ification of strings patch from - Matthias Clasen - -Thu Jun 29 13:51:12 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * threads.c: patch from Andrew W. Nosenko, xmlFreeRMutex forgot to - destroy the condition associated to the mutex. - -Thu Jun 29 12:48:00 CEST 2006 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xpath.c: Fixed a double-free in xmlXPathCompOpEvalToBoolean(), - revealed by a Libxslt regression test. - -Thu Jun 29 12:28:07 CEST 2006 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xpath.c: Enhanced xmlXPathCompOpEvalToBoolean() to be also - usable outside predicate evaluation; the intention is to - use it via xmlXPathCompiledEvalToBoolean() for XSLT tests, - like in <xsl:if test="/foo">. - -Wed Jun 28 19:11:16 CEST 2006 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xpath.c: Fix a memory leak which occurred when using - xmlXPathCompiledEvalToBoolean(). - -Mon Jun 26 17:24:28 UTC 2006 William Brack <wbrack@mmm.com.hk> - - * python/libxml.c, python/libxml.py, python/tests/compareNodes.py, - python/tests/Makefile.am: - Added code submitted by Andreas Pakulat to provide node - equality, inequality and hash functions, plus a single - test program to check the functions (bugs 345779 + 345961). - -Mon Jun 26 18:38:51 CEST 2006 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xpath.c: Added xmlXPathCompiledEvalToBoolean() to the API and - adjusted/added xmlXPathRunEval(), xmlXPathRunStreamEval(), - xmlXPathCompOpEvalToBoolean(), xmlXPathNodeCollectAndTest() - to be aware of a boolean result request. The new function - is now used to evaluate predicates. - -Mon Jun 26 16:22:50 CEST 2006 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xpath.c: Fixed an bug in xmlXPathCompExprAdd(): the newly - introduced field @rewriteType on xmlXPathStepOp was not - initialized to zero here; this could lead to the activation - of the axis rewrite code in xmlXPathNodeCollectAndTest() when - @rewriteType is randomly set to the value 1. A test - (hardcoding the initial value to 1) revealed that the - resulting incorrect behaviour is similar to the behaviour - as described by Arnold Hendriks on the mailing list; so I - hope that will fix the issue. - -Fri Jun 23 18:26:08 CEST 2006 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xpath.c: Fixed an error in xmlXPathEvalExpr(), which - was introduced with the addition of the d-o-s rewrite - and made xpath.c unable to compile if XPATH_STREAMING - was not defined (reported by Kupriyanov Anatolij - - #345752). Fixed the check for d-o-s rewrite - to work on the correct XPath string, which is ctxt->base - and not comp->expr in this case. - -Mon Jun 19 12:23:41 CEST 2006 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xpath.c: Added optimization for positional predicates - (only short-hand form "[n]"), which have a preceding - predicate: "/foo[descendant::bar][3]". - -Sun Jun 18 20:59:02 EDT 2006 Daniel Veillard <daniel@veillard.com> - - * parser.c: try to fix the crash raised by the parser in - recover mode as pointed by Ryan Phillips - -Sun Jun 18 18:44:56 EDT 2006 Daniel Veillard <daniel@veillard.com> - - * python/types.c: patch from Nic Ferrier to provide a better type - mapping from XPath to python - -Sun Jun 18 18:35:50 EDT 2006 Daniel Veillard <daniel@veillard.com> - - * runtest.c: applied patch from Boz for VMS and reporting - Schemas errors. - -Sun Jun 18 18:22:25 EDT 2006 Daniel Veillard <daniel@veillard.com> - - * testapi.c: applied patch from Felipe Contreras when compiling - with --with-minimum - -Fri Jun 16 21:37:44 CEST 2006 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * tree.c include/libxml/tree.h: Fixed a bug in - xmlDOMWrapAdoptNode(); the tree traversal stopped if the - very first given node had an attribute node :-( This was due - to a missed check in the traversal mechanism. - Expanded the xmlDOMWrapCtxt: it now holds the namespace map - used in xmlDOMWrapAdoptNode() and xmlDOMWrapCloneNode() for - reusal; so the map-items don't need to be created for every - cloning/adoption. Added a callback function to it for - retrieval of xmlNsPtr to be set on node->ns; this is needed - for my custom handling of ns-references in my DOM wrapper. - Substituted code which created the XML namespace decl on - the doc for a call to xmlTreeEnsureXMLDecl(). Removed - those nasty "warnings" from the docs of the clone/adopt - functions; they work fine on my side. - -Mon Jun 12 13:23:11 CEST 2006 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * result/pattern/namespaces: Adjusted the result of a - regression test, since the fix of xmlGetNodePath() revealed a - bug in this test result. - -Mon Jun 12 13:06:03 CEST 2006 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * tree.c: Got rid of a compiler warning in xmlGetNodePath(). - -Mon Jun 12 12:54:25 CEST 2006 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * tree.c: Fixed xmlGetNodePath() to generate the node test "*" - for elements in the default namespace, rather than generating - an unprefixed named node test and losing the namespace - information. - -Fri Jun 9 21:45:02 CEST 2006 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * include/libxml/parser.h: Clarified in the docs that the tree - must not be tried to be modified if using the parser flag - XML_PARSE_COMPACT as suggested by Stefan Behnel - (#344390). - -Tue Jun 6 17:50:43 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * configure.ini NEWS doc//* libxml.spec.in : preparing release of 2.6.26 - -Tue Jun 6 17:25:23 CEST 2006 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xpath.c: Fixed self-invented a segfault in xmlXPathCtxtCompile(), - when the expression was not valid and @comp was NULL and I - tried to do the d-o-s rewrite. - -Tue Jun 6 15:19:57 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * configure.ini NEWS doc//* libxml.spec.in : preparing release of 2.6.25 - -Tue Jun 6 11:28:15 CEST 2006 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xpath.c: Enabled the compound traversal again; I added a - check to use this only if the have an expression starting - with the document node; so in the case of "//foo", we - already know at compilation-time, that there will be only - 1 initial context node. Added the rewrite also to - xmlXPathEvalExpr(). - -Tue Jun 6 10:23:10 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * xinclude.c: fix bug #343968, include='text' can't lead to a - recursion. - -Fri Jun 2 22:47:08 CEST 2006 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xpath.c: Disabled the compound traversal for the release; - I need first to assure that this is done only if we have - 1 initial node. - -Wed May 31 13:53:41 PST 2006 Aleksey Sanin <aleksey@aleksey.com> - - * xpath.c: fixed memory leak in xpath error reporting - -Wed May 31 15:30:16 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * libxml.h triodef.h: applied patch from Olli Savia for LynxOS - -Wed May 31 14:33:00 CEST 2006 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xpath.c include/libxml/xpath.h runsuite.c: - Changed the name of the recently added public function - xmlXPathContextSetObjectCache() to - xmlXPathContextSetCache(); so a more generic one, in - case we decide to cache more things than only XPath - objects. - -Tue May 30 21:36:16 CEST 2006 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xpath.c: Optimized xmlXPathNodeCollectAndTest() and - xmlXPathNodeCollectAndTestNth() to evaluate a compound - traversal of 2 axes when we have a "//foo" expression. - This is done with a rewrite of the XPath AST in - xmlXPathRewriteDOSExpression(); I added an additional field - to xmlXPathStepOp for this (but the field's name should be - changed). The mechanism: the embracing descendant-or-self - axis traversal (also optimized to return only nodes which - can hold elements), will produce context nodes for the - inner traversal of the child axis. This way we avoid a full - node-collecting traversal of the descendant-or-self axis. - Some tests indicate that this can reduce execution time of - "//foo" to 50%. Together with the XPath object cache this - all significantly speeds up libxslt. - -Tue May 30 11:38:47 CEST 2006 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: A warning will now be reported in the value of - the XSD attribute 'schemaLocation' does not consist of tuples - (namespace-name, document-URI). A warning will be reported - if a schema document could not be found at the specified - location (via 'schemaLocation' or - 'noNamespaceSchemaLocation'). - * include/libxml/xmlerror.h: Added XML_SCHEMAV_MISC to - xmlParserErrors. - -Tue May 30 11:21:34 CEST 2006 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xpath.c: Enhanced xmlXPathNodeCollectAndTest() to avoid - recreation (if possible) of the node-set which is used to - collect the nodes in the current axis for the current context - node. Especially for "//foo" this will decrease dramatically - the number of created node-sets, since for each node in the - result node-set of the evaluation of descendant-or-self::node() - a new temporary node-set was created. Added node iterator - xmlXPathNextChildElement() as a tiny optimization for - child::foo. - -Mon May 29 18:06:17 CEST 2006 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xpath.c include/libxml/xpath.h: Added an XPath object cache. - It sits on an xmlXPathContext and need to be explicitly - activated (or deactivated again) with - xmlXPathContextSetObjectCache(). The cache consists of 5 - lists for node-set, string, number, boolean and misc XPath - objects. Internally the xpath.c module will use object- - deposition and -acquisition functions which will try to reuse - as many XPath objects as possible, and fallback to normal - free/create behaviour if no cache is available or if the cache - is full. - * runsuite.c: Adjusted to deactivate the cache for XML Schema - tests if a cache-creation is turned on by default for the whole - library, e.g. for testing purposes of the cache. It is - deactivated here in order to avoid confusion of the memory leak - detection in runsuite.c. - -Wed May 24 10:54:25 CEST 2006 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xpath.c: Removed a memcpy if xmlXPathNodeSetMerge(); it - seems we really need to walk the whole list, since those - nasty namespace nodes need to be added with - xmlXPathNodeSetDupNs(); thus a pure memcpy is not possible. - A flag on the node-set indicating if namespace nodes are in - the set would help here; this is the 3rd flag which would - be useful with node-sets. The current flags I have in mind: - 1) Is a node-set already sorted? - This would allow for rebust and optimizable sorting - behaviour. - 2) Of what type are the nodes in the set (or of mixed type)? - This would allow for faster merging of node-sets. - 3) Are namespace nodes in the set? - This would allow to skip all the namespace node specific - special handling. Faster node-set merging if the first - set is empty; just memcpy the set. - -Mon May 22 17:14:00 CEST 2006 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xpath.c: Optimization of count(): eliminated sorting - (see bug #165547). Optimization of XPATH_OP_FILTER if the - predicate is a [1] (disable with XP_OPTIMIZED_FILTER_FIRST if - it produces trouble). Tiny opt in xmlXPathNodeSetMerge(). - -Mon May 22 13:33:12 CEST 2006 Rob Richards <rrichards@ctindustries.net> - - * tree.c: Revert behavior change in xmlSetProp to handle attributes - with colons in name and no namespace. - -Fri May 19 21:56:43 CEST 2006 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xpath.c: Substituted all remaining calls to xmlXPathCmpNodes() - for xmlXPathCmpNodesExt(). Tiny further enhancement of - xmlXPathCmpNodesExt(). Added additional checks in various code - parts to avoid calling sorting or merging functions if the - node-set(s) don't need them; i.e., if they are empty or contain - just one node. - -Fri May 19 13:16:58 CEST 2006 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xpath.c: Optimized the comparison for non-element nodes - in xmlXPathCmpNodesExt(); the comparison is used for sorting - of node-sets. This enhancement is related to bug #165547. - There are other places where the old comparison function - xmlXPathCmpNodes() is still called, but I currently don't - know exactly what those calls are for; thus if they can be - substituted (if it makes sense) for the new function. - -Tue May 16 16:55:13 CEST 2006 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xpath.c: Applied patch from Rob Richards, fixing a potential - memory leak in xmlXPathTryStreamCompile(), when a list of - namespaces was assigned to the XPath compilation context; - here a new namespace list was created and passed to - xmlPatterncompile(); but this list was not freed afterwards. - Additionally we avoid now in xmlXPathTryStreamCompile() to - compile the expression, if it has a colon - indicating - prefixed name tests - and no namespace list was given. The - streaming XPath mechanism needs a namespace list at - compilation time (unlike normal XPath, where we can bind - namespace names to prefixes at execution time). - * pattern.c: Enhanced to use a string dict for local-names, - ns-prefixes and namespace-names. - Fixed xmlStreamPushInternal() not to use string-pointer - comparison if a dict is available; this won't work, since - one does not know it the given strings originate from the - same dict - and they normally don't do, since e.g. - namespaces are hold on xmlNs->href. I think this would be - worth an investigation: if we can add a @doc field to xmlNs - and put the @href in to a additionan namespace dict hold - in xmlDoc. Daniel will surely not like this idea :-) But - evaluation of tons of elements/attributes in namespaces - with xmlStrEqual() isn't the way we should go forever. - -Thu May 11 18:03:49 CEST 2006 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: Fixed bug #341337, reported by David Grohmann. - The code expected a node (xmlNodePtr) on the info for a - non-existent default attribute, which clearly cannot be - expected, since the attribute does not exist. I can only - guess that this sneaked trying to eliminate the query - for the owner-element, which is unavoidable actually. - Note that creation of default attributes won't have an - effect if validating via SAX/XMLReader; i.e., the processor - won't fire additional start-attribute events (I'm not even - sure if Libxml2 has such a SAX-event; I think it hands them - all over in the start-element event). - -Tue May 9 21:47:58 CEST 2006 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: Fixed bug #341150, reported by Michael Romer. - In xmlSchemaBuildContentModelForSubstGroup(), - xmlAutomataNewOnceTrans2() was incorrectly used instead of - xmlAutomataNewTransition2() to mimic a xs:choice for - substitution-groups. - * test/schemas/subst-group-1_1.xsd - test/schemas/subst-group-1_0.xml - result/schemas/subst-group-1_0_1 - result/schemas/subst-group-1_0_1.err: Added regression test - supplied by Michael Romer for bug #341150. - -Sat May 6 11:05:24 HKT 2006 William M. Brack <wbrack@mmm.com.hk> - - * relaxng.c: Fixed compilation error with patch supplied by - Graham Bennett. - -Thu May 4 19:14:03 CEST 2006 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: We'll raise an internal error and stop - validation now when an entity is found in the instance - document, since we don't support automatic entity - substitution by the schema processor (yet?) - - see bug #340316, reported by Nick Wellnhofer. - -Wed May 3 15:16:00 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * configure.in: applied another Python detection patch from Joseph Sacco - * libxml.spec.in: cleanup the changelog section, asciifies the spec file - too - -Tue May 2 22:34:54 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * xmlIO.c: fix a mix of code and declarations showing up on Windows - patch from Kjartan Maraas, fixing #340404 - -Tue May 2 14:24:40 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * encoding.c: fixing bug #340398 xmlCharEncOutFunc writing to - input buffer - -Fri Apr 28 18:29:22 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * NEWS configure.in doc//*: preparing 2.6.24 release, fixed Python - paths at the last moment - * relaxng.c testapi.c tree.c: fix some comments - -Thu Apr 27 10:15:45 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * xmlIO.c: applied patch from Roland Schwingel to allow UTF-8 - file paths on Windows - -Thu Apr 27 10:10:58 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * xmlwriter.c: patch from Jason Viers for line breaks after EndPI - -Tue Apr 25 22:22:58 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * tree.c: fix compilation without tree - -Tue Apr 25 18:17:37 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * xmllint.c: applied patch from Gary Coady to really make sure - xmllint --nonet would not reach the network, should fix #337483. - -Tue Apr 25 14:52:15 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * configure.in: applied patch from Joseph Sacco changing slightly - the python detection scheme should fix bug #338526 - -Mon Apr 24 10:50:19 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * parser.c: fix the error message for invalid code point in content - c.f. bug #339311 - -Wed Apr 19 13:16:23 CEST 2006 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c test/schemas/restriction-enum-1* - result/schemas/restriction-enum-1*: Fixed incorrect - validation of restricted enumerations. Added related - regression tests. - -Thu Apr 13 09:47:25 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * xmlschemas.c: fixing a deallocation problem in xmlSchemaAddSchemaDoc() - in case of errors, should fix bug #338303 - -Thu Apr 13 09:31:45 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * relaxng.c: fixing a deallocation problem in xmlRelaxNGParse() - in case of errors, should fix bug #338306 - -Thu Apr 6 10:22:17 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * doc/xmlcatalog.1 doc/xmlcatalog_man.xml doc/xmllint.1 doc/xmllint.xml: - applied man page improvements from Daniel Leidert - -Mon Mar 27 11:44:07 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * xmlschemas.c: removed unused code or variables, from Stefan Kost - fixing #336163 and #336164 - -Mon Mar 27 11:38:21 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * xmlschemas.c: applied patch from Stefan Kost fixing #336160 - -Mon Mar 27 11:23:39 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * chvalid.c genChRanges.py genUnicode.py xmlunicode.c - include/libxml/chvalid.h include/libxml/xmlunicode.h: applied - patches from Aivars Kalvans to make unicode tables const, fixes - bug #336096, this also updates to Unicode 4.01 final with a couple - of character ranges fixes. - -Mon Mar 27 00:51:40 CEST 2006 Daniel Veillard <daniel@veillard.com> - - * chvalid.c genChRanges.py include/libxml/chvalid.h: fixed bug - #335603 and resync'ed genChRanges.py to the expected output. - -Wed Mar 22 00:14:34 CET 2006 Daniel Veillard <daniel@veillard.com> - - * xmlregexp.c: applied patch from Youri Golovanov fixing bug - #316338 and adding a couple of optimizations in the regexp - compilation engine. - * test/regexp/bug316338 result/regexp/bug316338: added regression - tests based on the examples provided in the bug report. - -Fri Mar 10 08:40:55 EST 2006 Daniel Veillard <daniel@veillard.com> - - * c14n.c encoding.c xmlschemas.c xpath.c xpointer.c: fix a few - warning raised by gcc-4.1 and latest changes - -Fri Mar 10 01:34:42 CET 2006 Daniel Veillard <daniel@veillard.com> - - * runtest.c schematron.c testAutomata.c tree.c valid.c xinclude.c - xmlcatalog.c xmlreader.c xmlregexp.c xpath.c: end of first - pass on coverity reports. - -Thu Mar 9 19:36:14 CET 2006 Daniel Veillard <daniel@veillard.com> - - * relaxng.c xmlschemas.c xmlschemastypes.c: more cleanups based - on coverity reports. - -Thu Mar 9 17:47:40 CET 2006 Daniel Veillard <daniel@veillard.com> - - * SAX2.c catalog.c encoding.c entities.c example/gjobread.c - python/libxml.c: more cleanups based on coverity reports. - -Thu Mar 9 15:12:19 CET 2006 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c parser.c parserInternals.c pattern.c uri.c: a bunch - of small cleanups based on coverity reports. - -Thu Mar 9 09:42:10 CET 2006 Daniel Veillard <daniel@veillard.com> - - * win32/Makefile.bcb: added schematron as pointed out by Eric Zurcher - -Tue Mar 7 09:50:09 CET 2006 Daniel Veillard <daniel@veillard.com> - - * xml2-config.in: fix Red Hat bug #184170 - -Mon Mar 6 14:21:08 CET 2006 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * tree.c: Simplified usage of the internal xmlNsMap. Added a - "strict" lookup for namespaces based on a prefix. Fixed a - namespace processing issue in the clone-node function, which - occurred if a @ctxt argument was given. - -Fri Mar 3 17:44:10 CET 2006 Rob Richards <rrichards@ctindustries.net> - - * valid.c: fix HTML attribute ID checking for input element. - Maintain current attribute "name" behavior for now. - -Thu Mar 2 18:59:50 CET 2006 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * tree.c: Bundled lookup of attr-nodes and retrieving their - values into the functions xmlGetPropNodeInternal() and - xmlGetPropNodeValueInternal(). Changed relevant code - to use those functions. - -Mon Feb 27 20:42:04 CET 2006 Daniel Veillard <daniel@veillard.com> - - * xpath.c: workaround HP-UX compiler bug by Rick Jones - -Mon Feb 27 10:57:05 CET 2006 Daniel Veillard <daniel@veillard.com> - - * python/libxml2.py: remove a tab, as pointed out on IRC - -Sat Feb 25 18:12:10 CET 2006 Rob Richards <rrichards@ctindustries.net> - - * tree.c: Fix the add sibling functions when passing attributes. - Modify testing for ID in xmlSetProp. - No longer remove IDness when unlinking or replacing an attribute. - -Fri Feb 24 21:20:33 CET 2006 Daniel Veillard <daniel@veillard.com> - - * catalog.c: Martin Cole pointed out a bug in xmlCatalogAdd() - if /etc/xml/catalog doesn't exist. - -Thu Feb 23 23:06:18 CET 2006 Daniel Veillard <daniel@veillard.com> - - * doc//*: updated the Ruby bindings links, and regenerated the - docs. - -Thu Feb 23 09:12:27 CET 2006 Daniel Veillard <daniel@veillard.com> - - * catalog.c: improve catalog debugging message patch from Rick Jones - -Wed Feb 22 16:09:10 CET 2006 Daniel Veillard <daniel@veillard.com> - - * python/types.c: Nic Ferrier found debug statement left in the - XPath conversion code - -Tue Feb 21 20:23:14 CET 2006 Daniel Veillard <daniel@veillard.com> - - * doc/xmllint.1 doc/xmllint.xml: small man page improvements from - Daniel Leidert - -Mon Feb 20 15:45:19 CET 2006 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: Fixed a side-effect of the previous XSI bugfix: - The constructor needs a bucket to be assigned during component - fixup. - -Mon Feb 20 14:32:36 CET 2006 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c xmlschemastypes.c: Fixed xs:boolean to reject - the empty string (reported by Bas Driessen on the mailing-list). - Fixed schema XSI-acquisition and construction: the schemata - (xmlSchema) didn't get the targetNamespace in some cases, thus - the component resolution mechanism failed to work. The XSI - stuff needs to be tested more intensively; think about how - to test this for regression. - -Mon Feb 20 09:57:41 CET 2006 Daniel Veillard <daniel@veillard.com> - - * doc/xmllint.1 doc/xmllint.xml: more man page improvements from - Daniel Leidert - -Sun Feb 19 22:31:33 CET 2006 Daniel Veillard <daniel@veillard.com> - - * doc/xmllint.1 doc/xmllint.xml: man page improvements from Daniel - Leidert, c.f. #331290 - -Sun Feb 19 17:54:04 CET 2006 Daniel Veillard <daniel@veillard.com> - - * xmllint.c: fix an error report when using --path and --valid - closes bug #331290 - -Sun Feb 19 16:20:43 CET 2006 Daniel Veillard <daniel@veillard.com> - - * relaxng.c: trying to fix #331062, this is again a problem - around interleave, there is no good fix unless reimplementing - but this works around some cases and allow to validate in that - case. - -Wed Feb 15 11:55:22 CET 2006 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * tree.c: Fixed bug #328896 reported by Liron. The path - for text- and CDATA-section-nodes was computed incorrectly - in xmlGetNodePath(). - -Sun Feb 12 20:12:22 CET 2006 Daniel Veillard <daniel@veillard.com> - - * xmlregexp.c: bug fixes for #327167 as well as some cleanups - and more thorough tests on atoms comparisons. - -Thu Feb 9 10:07:20 CET 2006 Daniel Veillard <daniel@veillard.com> - - * include/wsockcompat.h: patch from Eric Zurcher to compile with - Borland C++ 6 - -Sun Feb 5 04:03:59 CET 2006 Daniel Veillard <daniel@veillard.com> - - * parser.c: bill pointed out a missing block in xmlParseComment - trying to fill with a normal processing of the given character. - -Sun Feb 5 03:41:39 CET 2006 Daniel Veillard <daniel@veillard.com> - - * parser.c: fixed the comment streaming bug raised by Graham Bennett - * test/badcomment.xml result//badcomment.xml*: added to the regression - suite. - -Fri Feb 3 17:36:41 CET 2006 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * include/libxml/tree.h: Added the xmlDOMWrapCloneNode() to - the header file. - -Fri Feb 3 17:29:22 CET 2006 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * tree.c: Added an initial version of xmlDOMWrapCloneNode() to - the API. It will be used to reflect DOM's Node.cloneNode and - Document.importNode methods. - The pros: 1) non-recursive, 2) optimized ns-lookup - (mostly pointer comparison), 3) user defined ns-lookup, - 4) save ns-processing. The function is in an unfinished - and experimental state and should be only used to test it. - -Fri Feb 3 10:42:48 CET 2006 Daniel Veillard <daniel@veillard.com> - - * uri.c: applied patch from Rob Richards fixing the URI regressions - tests on Windows which seems to indicate bad escaping. - -Thu Feb 2 13:11:26 CET 2006 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * tree.c: Fixed some bugs xmlDOMWrapReconcileNamespaces() wrt - the previous addition of the removal of redundant ns-decls. - -Wed Feb 1 17:32:25 CET 2006 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * tree.c: Enhanced xmlDOMWrapReconcileNamespaces() to remove - redundant ns-decls if the option XML_DOM_RECONNS_REMOVEREDUND - was given. Note that I haven't moved this option to the - header file yet; so just call this function with an @option - of 1 to test the behaviour. - -Wed Feb 1 12:21:08 CET 2006 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * tapi.c win32/Makefile.*: Added changed as proposed on - the mailing list by venkat naidu in order to compile - testapi.c on windows. - -Thu Jan 19 09:57:28 CET 2006 Daniel Veillard <daniel@veillard.com> - - * configure.in xml2-config.in: trying to fix windows/configure - issues reported by Tim Van Holder - -Wed Jan 18 18:21:15 CET 2006 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c libxml.h parser.c: try to fix xmlParseInNodeContext - when operating on an HTML document. - -Mon Jan 9 17:27:15 CET 2006 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * relaxng.c include/libxml/relaxng.h: Added - xmlRelaxNGSetParserStructuredErrors() to the API. - -Mon Jan 9 15:33:16 CET 2006 Daniel Veillard <daniel@veillard.com> - - * parser.c: reverted first patches for #319279 which led to #326295 - and fixed the problem in xmlParseChunk() instead - * test/ent11 result//ent11*: added test for #326295 to the regression - suite - -Thu Jan 5 16:25:06 CET 2006 Daniel Veillard <daniel@veillard.com> - - * NEWS configure.in libxml.spec.in testapi.c doc/*: updated the news - regenerated the docs, preparing for release of 2.6.23 - * pattern.c xmlschemas.c: fixed some comments - -Thu Jan 5 15:48:27 CET 2006 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * test/XPath/docs/nodes test/XPath/tests/nodespat - result/XPath/tests/nodespat: Added regression tests for - the latest XPath/pattern fixes. - -Thu Jan 5 15:43:38 CET 2006 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * pattern.c: Another fix to handle "foo//.": "foo" was not - included in the resulting node-set. - -Thu Jan 5 13:22:29 CET 2006 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * pattern.c xpath.c include/libxml/pattern.h: - Fixed bug #322928, reported by Erich Schubert: The bug was - in pattern.c, which is used for a tiny subset of xpath - expression which can be evaluated in an optimized way. - The doc-node was never considered when evaluating "//" - expressions. Additionally, we fixed resolution - to nodes of any type in pattern.c; i.e. a "//." didn't work - yet, as it did select only element-nodes. Due to this - issue the pushing of nodes in xpath.c needed to be adjusted - as well. - -Wed Jan 4 18:07:47 CET 2006 Daniel Veillard <daniel@veillard.com> - - * parser.c: tiny refactoring patch from Bjorn Reese - -Wed Jan 4 15:00:51 CET 2006 Daniel Veillard <daniel@veillard.com> - - * SAX2.c: fix bug #324432 with <xml:foo/> - * test/ns7 result/ns7*: added to the regression tests - -Wed Jan 4 10:53:56 CET 2006 Daniel Veillard <daniel@veillard.com> - - * include/wsockcompat.h: applied patch from Mark Junker, fixing a - MinGW compilation problem, should close bug #324943 - -Tue Jan 3 11:49:54 CET 2006 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: Removed last dependency on the obsolete enum - xmlSchemaValidError. - -Mon Jan 2 11:20:00 CET 2006 Daniel Veillard <daniel@veillard.com> - - * xmlreader.c include/libxml/xmlreader.h xmlschemas.c: compilation - and doc build fixes from Michael Day - -Wed Dec 28 22:12:34 CET 2005 Daniel Veillard <daniel@veillard.com> - - * xmlregexp.c: bug in xmlRegExecPushString2() pointed out by - Sreeni Nair. - -Tue Dec 20 16:55:31 CET 2005 Rob Richards <rrichards@ctindustries.net> - - * tree.c: fix bug #322136 in xmlNodeBufGetContent when entity ref is - a child of an element (fix by Oleksandr Kononenko). - * HTMLtree.c include/libxml/HTMLtree.h: Add htmlDocDumpMemoryFormat. - -Tue Dec 20 11:43:06 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c xmlstring.c: Fixed a segfault during - text concatenation when validating a node tree: - xmlStrncat was called with a @len of -1; but unlike - xmlStrncatNew, it does not calculate the length - automatically in such a case (reported by Judy Hay - on the mailing list). - Updated the descriptions of the involved string - functions to note this. - -Thu Dec 15 12:11:07 CET 2005 Daniel Veillard <daniel@veillard.com> - - * nanohttp.c: applied patch from Gary Coady to accept gzipped - http resources. - -Wed Dec 14 18:41:26 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * win32/configure.js: Added enable/disable of runtime - debugging (LIBXML_DEBUG_RUNTIME). - -Wed Dec 14 18:11:50 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * include/libxml/xmlversion.h.in: Fixed to define - LIBXML_DEBUG_RUNTIME on the basis of @WITH_RUN_DEBUG@. - -Tue Dec 13 12:49:23 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * test/schemas/bug321475* result/schemas/bug321475*: - Added regression test for bug #321475 (reported by - Gabor Nagy). Fixing of bug #323510 seemed to have - fixed this bug as well. - -Mon Dec 12 16:19:16 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * test/schemas/bug323510* result/schemas/bug323510*: - Added regression test for bug #323510. - -Mon Dec 12 16:11:13 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: Workaround for bug #323510 (reported by - Jonathan Filiatrault): substituted the epsilon transition - for a labelled transition, in order to avoid a bug in - xmlregexp.c which eliminated the epsilon transition and - marked the initial state as final. - -Mon Dec 12 14:25:46 CET 2005 Daniel Veillard <daniel@veillard.com> - - * xmlreader.c: Gary Coady pointed a memory leak in - xmlTextReaderReadInnerXml() applied patch fixing #323864 - -Sat Dec 10 12:08:28 CET 2005 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c configure.in parserInternals.c runsuite.c runtest.c - testapi.c xmlschemas.c xmlschemastypes.c xmlstring.c: fixed a number - of warnings shown by HP-UX compiler and reported by Rick Jones - -Fri Dec 9 18:57:31 CET 2005 Rob Richards <rrichards@ctindustries.net> - - * xmlwriter.c: Insert space between pubid and sysid when both - passed to xmlTextWriterStartDTD and indenting not being used. - Remove no longer used Mem callbacks. - -Fri Dec 9 11:01:16 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * runsuite.c: Changed to instantly mark instance-tests as - failed if the corresponding schema was invalid. This - reflects the side of the Python code for the XML Schema test - suite. We now get the same number of failed tests on both - sides. - -Wed Dec 7 14:59:01 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlreader.c include/libxml/xmlreader.h: Added - xmlTextReaderSchemaValidateCtxt() to the API. - -Wed Dec 7 12:59:56 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: Fixed a segfault: the instance document was - still tried to be validated, if the schema, dynamically - acquired using XSI was invalid, thus mangled. The - validation will stop (or rather won't validate) now in - such a case. The schema parser error code will be set - on the validion context now; this is somehow not nice, - but it assures that the validation context indicates an - error in there was a parser error. - -Tue Dec 6 18:57:23 CET 2005 Daniel Veillard <daniel@veillard.com> - - * xmlreader.c: small doc patch from Aron Stansvik - * legacy.c: another doc patch for a deprecated API - -Mon Dec 5 16:23:49 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * Makefile.am: Tiny change for 'make tests': raised - the number of expected failures for James Clark's - XML Schema datatype tests from 10 to 11. The additional - reported error was agreed to be correct long time ago, - but we missed to adjust the message reported by - the testing script. - -Fri Dec 2 13:51:14 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * result/schemas/decimal* result/schemas/bug322411*: - Added missing regression test results for the latest IDC - and xs:decimal bugs. - -Wed Nov 30 12:22:23 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * test/schemas/decimal* test/schemas/bug322411*: Added - regression tests for the latest IDC and xs:decimal bugs. - -Wed Nov 30 11:57:35 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: Fixed bubbling of duplicate IDC nodes: the - parent's list of duplicates was filled with NULLs instead - of the nodes under certain conditions. This lead to a - segfault when the list's entries were accessed. - -Mon Nov 28 17:28:53 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemastypes.c: Fixed parsing of xs:decimal to - allow/deny special lexical forms. Fixed the totalDigits - for values in the range (x < 1) && (x > -1) && (x != 0); - E.g "0.123" has now a totalDigits of 3 (was 4 previously). - Adjusted the comparison function for decimals due to this - change. As a side effect comparison against zeroes was - optimized. - -Mon Nov 28 13:25:11 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: An assignment to a local variable, which was - used to access the IDC node list, was missing after the - reallocation of the list (reported by Fabrice GUY - bug #322411). Renamed the define ENABLE_IDC_NODE_TABLES - to ENABLE_IDC_NODE_TABLES_TEST and *disabled* it, since - it is used to force bubbling of IDC node tables even - if not necessary; this was intended to be used for test - purposes, but I obviously missed to disable it (although - it apparently helped finding the bug). - -Wed Nov 23 17:34:52 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: In xmlSchemaAssembleByXSI() the return value - of xmlSchemaGetMetaAttrInfo() was not assigned to anything; - this caused XSI-driven-dynamic schema acquisition to fail - with @noNamespaceSchemaLocation (reported by Julien Lamy - on the mailing list). - -Tue Nov 22 18:31:34 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: Fixed a bug in xmlSchemaFindRedefCompInGraph() - which caused the search for components to stop at the - first encountered attribute group component. - Fixed error report in xmlSchemaCheckSRCRedefineFirst(): the - designation of a not-found component was not reported. - -Mon Nov 21 12:23:28 CET 2005 Daniel Veillard <daniel@veillard.com> - - * xmlschemastypes.c: Albert Chin found another signed/unsigned problem - in the date and time code raised on IRIX 6.5 - -Fri Nov 18 18:13:38 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c include/libxml/xmlschemas.h: - Added xmlSchemaSetParserStructuredErrors() to the API. - Fixed channeling of error relevant information to - subsequent parser/validation contexts. - -Thu Nov 17 14:11:43 CET 2005 Daniel Veillard <daniel@veillard.com> - - * parserInternals.c: removed unreachable code pointed out by - Oleksandr Kononenko, fixes bug #321695 - -Thu Nov 17 08:24:31 CET 2005 Daniel Veillard <daniel@veillard.com> - - * parser.c: use ctxt->standalone = -2 to indicate that the - XMLDecl was parsed but no standalone attribute was found, - suggested by Michael Day to detect if an XMLDecl was found. - -Tue Nov 15 09:49:24 CET 2005 Daniel Veillard <daniel@veillard.com> - - * runtest.c: Hisashi Fujinaka pointed that errors in Schemas tests - were not properly reported. - -Sun Nov 13 13:42:41 CET 2005 Daniel Veillard <daniel@veillard.com> - - * xmlIO.c: applied patch from Geert Jansen to remove xmlBufferClose() - which is not needed. - -Fri Nov 11 13:48:52 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: Changed xmlSchemaFormatIDCKeySequence() - to use xmlSchemaGetCanonValueWhtspExt() in order to - correctly report values for xs:anySimpleType. - * test/schemas/idc-keyref-err1* - result/schemas/idc-keyref-err1*: Added a test for this change. - -Wed Nov 9 13:07:24 EST 2005 Rob Richards <rrichards@ctindustries.net> - - * xmlIO.c xmlwriter.c: function consolidation when writing to xmlBuffer. - Return error condition not len if xmlwriter fails writing to buffer. - -Wed Nov 9 09:54:54 CET 2005 Daniel Veillard <daniel@veillard.com> - - * xmlsave.c xmlIO.c include/libxml/xmlIO.h include/libxml/xmlsave.h: - applied patch from Geert Jansen to implement the save function to - a xmlBuffer, and a bit of cleanup. - -Mon Nov 7 14:58:39 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c xmlschemastypes.c: Fixed the type of the - totalDigits value to be positiveInteger. - Fixed crash in an error report function when we gave it - the document node; only element and attribute nodes are - processed now (reported by Rob Richards). - -Tue Nov 1 16:22:29 CET 2005 Daniel Veillard <daniel@veillard.com> - - * xmlregexp.c: fix bug #319897, problem with counted atoms - when the transition itself is counted too - * result/regexp/hard test/regexp/hard: augmented the regression - tests with the problem exposed. - -Tue Nov 1 11:54:39 CET 2005 Daniel Veillard <daniel@veillard.com> - - * win32/Makefile.mingw include/win32config.h: applied patch from - Mark Junker to fix compilation with MinGW - -Fri Oct 28 18:36:08 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * libxml.3: tiny fix from Albert Chin - * runsuite.c runtest.c testapi.c: portability cleanup for arch - needing trio for *printf - -Fri Oct 28 12:21:39 EDT 2005 Rob Richards <rrichards@ctindustries.net> - - * tree.c: add additional checks to prevent tree corruption. fix problem - copying attribute using xmlDocCopyNode from one document to another. - -Fri Oct 28 17:58:13 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * config.h.in configure.in vms/config.vms macos/src/config-mac.h: - cleanup from Albert Chin - * doc/Makefile.am: html/index.sgml doesn't exist anymore - -Fri Oct 28 16:53:51 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * xmlIO.c xmlmodule.c: more portability patches from Albert Chin for - HP-UX and AIX - -Fri Oct 28 10:36:10 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * xmlmodule.c configure.in: applied 2 patches from Albert Chin for - module portability - -Fri Oct 28 10:24:39 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * error.c: fixing a portability problem on some old Unices with - patch from Albert Chin - -2005-10-27 Aleksey Sanin <aleksey@aleksey.com> - - * c14n.c result/c14n/exc-without-comments/test-2 - test/c14n/exc-without-comments/test-2.xml - test/c14n/exc-without-comments/test-2.xpath: fixing - bug in exc-c14n namespace visibility + test case (bug #319367) - -Thu Oct 27 16:10:31 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * python/libxml.py: remove warnings to stdout patch from Nic Ferrier - -Thu Oct 27 13:54:52 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * valid.c xmlregexp.c include/libxml/valid.h - include/libxml/xmlregexp.h: avoid function parameters names 'list' - as this seems to give troubles with VC6 and stl as reported by - Samuel Diaz Garcia. - -Wed Oct 26 10:59:21 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * parserInternals.c: fix a problem in some error case on Solaris - when passed a NULL filename, pointed by Albert Chin. - -Tue Oct 25 14:34:58 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: script HTML parser error fix, corrects bug #319715 - * result/HTML/53867* test/HTML/53867.html: added test from Michael Day - to the regression suite - -Tue Oct 25 14:21:11 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: typo fix from Michael Day - -Mon Oct 24 20:16:23 EDT 2005 Rob Richards <rrichards@ctindustries.net> - - * tree.c: fix issue adding non-namespaced attributes in xmlAddChild(), - xmlAddNextSibling() and xmlAddPrevSibling() (bug #319108) - part 1. - -Sat Oct 22 10:00:41 HKT 2005 William Brack <wbrack@mmm.com.hk> - - * parser.c: fixed second spot where CRLF split between chunks - could cause trouble (bug #319279) - * gentest.py, testapi.c: fixed two problems involved with - --with-minimum compilation (compilation errors with schematron - and formal expressions tests) - -Fri Oct 21 10:50:14 EDT 2005 Rob Richards <rrichards@ctindustries.net> - - * xmlsave.c: prevent output of fragment tags when serializing XHTML. - -Wed Oct 19 16:53:47 BST 2005 Daniel Veillard <daniel@veillard.com> - - * xmlregexp.c: committing a some fixes and debug done yesterday in - the London airport. - -Thu Oct 20 12:54:23 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: Removed creation of a temporary parser context - during validation when processing xsi:type; this previously - added a string to the dict of the schema - to assure thread - safety, we don't want to modify a given schema during - validation. - -Thu Oct 20 17:05:29 HKT 2005 William Brack <wbrack@mmm.com.hk> - - * xmlwriter.c: fixed problem in xmlTextWriterVSprintf caused by - misuse of vsnprintf - * configure.in, config.h.in: added a configuration check for - va_copy and added a define for VA_COPY for xmlwriter.c fix - * parser.c: fixed problem with CRLF split between chunks (bug - #319279) (fix provided by Brion Vibber) - -Wed Oct 19 18:49:52 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: Fixed a potential memory leak in - xmlSchemaCheckCSelectorXPath() when an internal error occurs. - Fixed setting of ctxt->err to the given error code in - the parsing error functions. - * pattern.c: Added internal xmlCompileIDCXPathPath() as a - starting point for IDC XPath compilation; this and some other - tiny changes fixes issues regarding whitespace in the - expressions and IDC selector/field relevant restrictions of - the subset of XPath. Fixed a missing blocking of attributes - in xmlStreamPushInternal(). - -Mon Oct 17 15:06:05 EDT 2005 Daniel Veillard <daniel@veillard.com> - - * runtest.c: removed the error message - * relaxng.c xmlschemas.c: removed 2 instability warnings from function - documentation - * include/libxml/schemasInternals.h: changed warning about API stability - * xmlregexp.c: trying to improve runtime execution of non-deterministic - regexps and automata. Not fully finished but should be way better. - -Mon Oct 17 16:12:02 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: Fixed a memory leak in - xmlSchemaContentModelDump(). Added output of local types - in xmlSchemaElementDump(). Tiny cosmetical changes to the - dump output. - -Mon Oct 17 14:29:08 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * tree.c pattern.c: Silenced intel compiler warnings (reported - by Kjartan Maraas, bug #318517). - * xmlschemas.c: The above changes in pattern.c revealed an - inconsistency wrt IDCs: we now _only_ pop XPath states, if - we really pushed them beforehand; this was previously not - checked for the case when we discover an element node to be - invalid wrt the content model. - Fixed segfault in xmlSchemaGetEffectiveValueConstraint(). - -Fri Oct 14 16:40:18 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * result/schemas/*.err: Adapted regression test results. - -Fri Oct 14 16:21:22 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: Fixed some identity-constraint issues: - Restructured IDC node-tables - Allowed IDCs to resolve also to nodes of complex type with - simple content. - Added check for keyrefs with references to keyrefs. - IDC target-nodes were interfering with IDC node-tables, - since they used one list of entries only. I separated this - one big list into 3 lists: 1 for IDC node-table entries, - 1 for _duplicates_ of IDC node-table entries and 1 for - IDC target-nodes. More code, but cleaner and it works at last. - Keyrefs will fail to resolve to duplicate key/unique entries. - I thought this was already working this way, but it didn't. - The wording of the definition for [node table] in the spec - can lead to a scenario, where keyrefs resolve perfectly, even - if the relevant key-sequences of the referenced key/unique have - duplicates in the subtree. Currently only Saxon 8.5.1 is - dissallowing resolution to duplicate entries correctly - we - will follow Saxon here. - Removed some intel compiler warnings (reported by - Kjartan Maraas, bug #318517). - * pattern.c: Fixed an IDC-XPath problem when resolving to - attributes. - -Mon Oct 14 01:15:14 CEST 2005 Rob Richards <rrichards@ctindustries.net> - * nanohttp.c include/wsockcompat.h: applied patch from Kolja Nowak - to use getaddrinfo() if supported in Windows build (bug# 317431). - -Mon Oct 10 15:33:48 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * result/schemas/*: Adapted regression test results. - -Mon Oct 10 15:12:43 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c include/libxml/schemasInternals.h - include/libxml/xmlerror.h: Initial implementation for - redefinitions; this still misses checks for restrictions - of the content model of complex types. - Fixed default/fixed values for attributes (looks like they - did not work in the last releases). - Completed constraints for attribute uses. - Separated attribute derivation from attribute constraints. - Completed constraints for attribute group definitions. - Disallowing <import>s of schemas in no target namespace if the - importing schema is a chameleon schema. This contradicts - the way Saxon, Xerces-J, XSV and IBM's SQC works, but the - W3C XML Schema WG, thinks it is correct to disallow such - imports. - Added cos-all-limited constraints. - Restructured reference resolution to model groups and element - declarations. - Misc cleanup. - -Fri Oct 7 04:34:12 CEST 2005 Rob Richards <rrichards@ctindustries.net> - - * schematron.c xmlregexp.c: remove warnings under Windows. - -Wed Sep 28 23:42:14 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * parser.c: applied patch from Massimo Morara fixing bug #317447 - about risk of invalid write in xmlStringLenDecodeEntities - -Tue Sep 27 11:20:57 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * error.c: Adrian Mouat pointed out redundancies in xmlReportError() - -Mon Sep 26 19:18:24 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * xmlregexp.c: seems a test to avoid duplicate transition is - really needed at all times. Luka Por gave an example hitting - this. Changed back the internal API. - -Thu Sep 22 13:14:07 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * xmlreader.c: fixing leak in xmlTextReaderReadString() #316924 - -Thu Sep 15 16:12:44 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * uri.c: more fixes to the behaviour of xmlBuildRelativeURI - -Thu Sep 15 15:08:21 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * xmlregexp.c: detect combinatory explosion and return with - a runtime error in those case, c.f. #316338 though maybe we - should not see such an explosion with that specific regexp, - more checking needs to be done. - -Wed Sep 14 19:52:18 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * include/libxml/schemasInternals.h: Added some comments for the - struct fields. - -Wed Sep 14 13:24:27 HKT 2005 William Brack <wbrack@mmm.com.hk> - - * uri.c: fixed problem when xmlBuildRelativeURI was given a - blank path (bug 316224) - -Mon Sep 12 23:41:40 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * NEWS configure.in doc//*: release of 2.6.22 updated doc and - rebuild. - * xmlsave.c include/libxml/xmlsave.h: added XML_SAVE_NO_XHTML - xmlSaveOption - * xmlschemas.c: minor cleanups - -Mon Sep 12 21:42:47 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * test/schemas/import1_0.xsd: And adapting another one. - -Mon Sep 12 21:29:35 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * result/schemas/derivation-ok-extension_0_0: Adapted result. - -Mon Sep 12 21:20:41 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * result/schemas/allsg_0_3.err result/schemas/allsg_0_4.err - result/schemas/changelog093_1_0.err - result/schemas/derivation-ok-extension_0_0.err - result/schemas/import1_0_0.err - result/schemas/derivation-ok-restriction-2-1-1_0_0.err: - Adapted regression results. - -Mon Sep 12 21:00:53 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c include/libxml/schemasInternals.h - include/libxml/xmlerror.h: Completion of the schema graph. - Centralisation, more robustness of the schema document - acquisition story. Centralised and restructured component fixup. - Fixed attribute derivation when 'prohibiting' attribute uses. - Added warnings: when schema documents cannot be localized - during imports; when we get duplicate and pointless attribute - prohibitions. Changed error reports for IDCs to report - the relevant IDC designation as well (requested by GUY Fabrice). - Misc code-cleanup. - -Mon Sep 12 16:02:12 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * xmlsave.c: applied second patch from David Madore to be less intrusive - when handling scripts and style elements in XHTML1 should fix #316041 - * test/xhtml1 result//xhtml1\*: updated the test accordingly - -Mon Sep 12 15:09:09 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * libxml.spec.in doc/devhelp/*: finished the integration with - devhelp, completing the index and inserted into the gtk-doc - database at "make install" stage - -Mon Sep 12 14:14:12 CEST 2005 Rob Richards <rrichards@ctindustries.net> - - * include/libxml/xmlsave.h xmlsave.c: add XML_SAVE_NO_EMPTY save option - and use option from xmlSaveCtxtPtr rather than global during output. - * xmlsave.c: fix some output formatting for meta element under XHTML. - -Mon Sep 12 11:12:03 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * include/libxml/parser.h parser.c xmllint.c: damn XML_FEATURE_UNICODE - clashes with Expat headers rename to XML_WITH_ to fix bug #316053. - * doc/Makefile.am: build devhelp before the examples. - * doc/*: regenerated the API - -Mon Sep 12 02:03:12 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * xmlsave.c: fix bug #316034, where xmlElemDump() can crash if - given a document pointer instead of an element - -Mon Sep 12 01:26:16 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * doc/devhelp/devhelp.xsl: improvements on the html generation, - should be complete with navigation, what is left done is glueing - -Mon Sep 12 00:03:27 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * configure.in doc/Makefile.am doc/apibuild.py doc/libxml2-api.xml - doc/devhelp/*: started work needed to generate devhelp content, - not too hard based on the existing format and extractor. - -Fri Sep 9 12:56:19 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * parser.c: fixes bug #315617 when using push CDATA in some cases. - -Thu Sep 8 23:39:41 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * xmllint.c: patch from Stéphane Bidoul to compile without schematron - -Wed Sep 7 00:16:27 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * debugXML.c: patch from Oleg Paraschenko to fix xmlDebugDumpNode() - when handled a namespace node. - -Sun Sep 4 23:36:45 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * NEWS elfgcchack.h testapi.c doc/*: updated the docs and rebuild - releasing 2.6.21 - * include/libxml/threads.h threads.c: removed xmlIsThreadsEnabled() - * threads.c include/libxml/threads.h xmllint.c: added the more - generic xmlHasFeature() as suggested by Bjorn Reese, xmllint uses it. - -Sun Sep 4 22:45:49 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * configure.in doc/* configure.in: prepare for release - * xpath.c: work for #303289, fix a formatting bug for MIN_INT - -Sun Sep 4 15:48:57 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * relaxng.c: real fix for #314881 and #314759 is was a bit more complex - than initially expected as ctxt->error == NULL had behaviour side - effects at the compilation level itself. - -Sun Sep 4 14:01:00 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * pattern.c xpath.c include/libxml/pattern.h: fixing yet another - pattern induced XPath bug #314282 - * relaxng.c: reverted back last change it was seriously broken - -Sat Sep 3 16:51:55 CEST 2005 Rob Richards <rrichards@ctindustries.net> - - * xmlsave.c: check for NULL to prevent crash with meta elements - -Sat Sep 3 16:26:55 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * relaxng.c: structured error reporting problem with Relax-NG - should fix #314881 and #314759 - -Sat Sep 3 15:42:29 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * pattern.c: fixes a portability problem raised by C370 on Z/OS - -Sat Sep 3 15:26:31 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * SAX2.c tree.c valid.c: fixing a number of issues raised by xml:id - but more generally related to attributes and ID handling, fixes - #314358 among other things - -Fri Sep 2 14:26:43 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * encoding.c parserInternals.c: avoid passing a char[] as snprintf - first argument. - * threads.c include/libxml/threads.h: implemented xmlIsThreadsEnabled() - based on Andrew W. Nosenko idea. - * doc/* elfgcchack.h: regenerated the API - -Thu Sep 1 14:44:42 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * configure.in: the use of AM_PATH_PYTHON is not portable enough - reverting back to AM_PATH_PROG - -Thu Sep 1 11:42:39 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: Applied the last patch from Gary Coady for #304637 - changing the behaviour when text nodes are found in body - * result/HTML/*: this changes the output of some tests - -Thu Sep 1 11:22:37 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * doc/downloads.html doc/xml.html: adding reference to Bull AIX rpms - c.f. #160598 - -Wed Aug 31 11:39:02 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * xml2-config.in: removed the obsolete --libtool-libs option, c.f. - bug #314853 - -Fri Aug 26 17:33:26 CEST 2005 Rob Richards <rrichards@ctindustries.net> - - * xmlsave.c: move handling of meta element for http-equiv in XHTML docs - to serialization and no longer modify internal tree. - -Fri Aug 26 00:51:58 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * libxml.spec.in: the profiling usually don't work, disabled - * doc/*: rebuilt - -Thu Aug 25 23:47:55 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * configure.in: trying to fix the first part of #310033 by - detecting gcc <= 3.2 - -Thu Aug 25 22:13:37 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * error.c: fixed bug #310033, the URI extraction code given a - node is a bit twisted and broke in the last months. - -Thu Aug 25 16:18:15 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * debugXML.c result/XPath/xptr/strrange2: uninitialized field and - fix on test. - -Thu Aug 25 16:03:05 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * debugXML.c: change verbosity depending on API - * result/XPath/tests/* result/XPath/xptr/* result/xmlid/*: get back - to previous outputs - -Thu Aug 25 15:14:56 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c parser.c SAX2.c debugXML.c tree.c valid.c xmlreader.c - xmllint.c include/libxml/HTMLparser.h include/libxml/parser.h: - added a parser XML_PARSE_COMPACT option to allocate small - text nodes (less than 8 bytes on 32bits, less than 16bytes on 64bits) - directly within the node, various changes to cope with this. - * result/XPath/tests/* result/XPath/xptr/* result/xmlid/*: this - slightly change the output - -Thu Aug 25 12:16:26 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * configure.in: patch from Andrew W. Nosenko, use se $GCC = 'yes' - instead of $CC = 'gcc' because GCC may have a different name - -Thu Aug 25 00:18:20 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * configure.in: changes the way the python binary is found, should - also fix bug #308004 - -Wed Aug 24 16:44:41 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * parser.c: found another bug while looking at #309616 on missing - entities. - * result/ent2.sax* result/ent7.sax* result/xml2.sax*: this changed the - SAX stream in missing conditions for a few tests - -Wed Aug 24 16:19:00 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * encoding.c: applied the patch suggested #309565 which can avoid - looping in error conditions. - -Wed Aug 24 16:04:17 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * SAX2.c tree.c: line numbers are now carried by most nodes, fixing - xmlGetLineNo() c.f. bug #309205 - -Wed Aug 24 14:43:34 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * encoding.c error.c include/libxml/xmlerror.h: finally converted - the encoding module to the common error reporting mechanism - * doc/* doc/html/libxml-xmlerror.html: rebuilt - -Wed Aug 24 11:35:26 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * xpath.c: removed a potentially uninitialized variable error - * python/generator.py: fixed a deprecation warning - * python/tests/tstLastError.py: silent the damn test when Okay ! - -Wed Aug 24 00:11:16 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * SAX2.c globals.c runtest.c testC14N.c testapi.c tree.c - include/libxml/SAX2.h include/libxml/xmlregexp.h: fixed compilation - when configured --without-sax1 and other cleanups fixes bug #172683 - * doc/* elfgcchack.h: regenerated - -Tue Aug 23 20:05:05 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * parser.c: fixed bug #170489 reported by Jirka Kosek - * test/valid/objednavka.xml test/valid/dtds/objednavka.dtd - result/valid/objednavka*: added the test to the regression suite. - -Tue Aug 23 18:04:08 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c include/libxml/HTMLparser.h: added a recovery mode - for the HTML parser based on the suggestions of bug #169834 by - Paul Loberg - -Tue Aug 23 15:38:46 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * elfgcchack.h testapi.c doc/*: regenerated - * schematron.c: fixed a compilation problem - * xmlregexp.c include/libxml/xmlregexp.h: some cleanups and one bug fix - * result/expr/base: slightly changes the number of Cons. - -Mon Aug 22 23:19:50 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * elfgcchack.h testapi.c doc/*: rescanned code and rebuilt - * xmlregexp.c: small cleanup - * include/libxml/schematron.h include/libxml/xmlexports.h - include/libxml/xmlversion.h.in: cleanup problems from code scanner - -Mon Aug 22 18:00:18 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * xmlschemastypes.c: applied patch from Kuba Nowakowski fixing bug - #313982 - * result/schemas/bug313982* test/schemas/bug313982*: also added - the test case to the regression suite. - -Mon Aug 22 17:50:20 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * testRegexp.c: printed the wrong string - -Mon Aug 22 16:42:07 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * testRegexp.c xmlregexp.c include/libxml/xmlregexp.h: exported - xmlExpExpDerive(), added it to the testRegexp command line - tool when providing multiple expressions. - -Mon Aug 22 14:57:13 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * Makefile.am result/expr/base test/expr/base: added the first - regression test suite set for the new expression support - -Mon Aug 22 13:49:18 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * valid.c: fixed an uninitialized variable - * xmlregexp.c include/libxml/xmlregexp.h: extended the API to - add the parser, serializer and some debugging - * include/libxml/xmlversion.h.in: made the new support compiled - by default if Schemas is included - * testRegexp.c: cleanup and integration of the first part of the - new code with a special switch - * xmllint.c: show up Expr in --version if compiled in - * include/libxml/tree.h: moved the xmlBuffer definition up - -Mon Aug 22 12:11:10 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: Some preparation for the creation of a graph - of imported/included/redefined schemas; this is needed for - at least the redefinitions. - Centralized the creation of the parser context in one function. - -Mon Aug 22 02:19:33 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * xmlregexp.c include/libxml/xmlregexp.h: pushing the formal expression - handling code to have it in CVs from now. Not plugged, and misses - APIs it's not compiled in yet. - -Sat Aug 20 23:13:27 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * xmlreader.c: applied another patch from Rob Richards to fix - xmlTextReaderGetAttributeNs and xmlTextReaderMoveToAttributeNs - -Wed Aug 17 09:06:33 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * xmlreader.c: applied patch from Rob Richards to fix - xmlTextReaderGetAttribute behaviour with namespace declarations - -Fri Aug 12 14:12:56 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c include/libxml/xmlerror.h: - Changed output for keyref-match errors; the target-node will - be now reported rather than the scope-node of the keyref - definition - allowing easier chasing of instance errors. - This was reported by Guy Fabrice to the mailing list. - Some initial parsing code for schema redefinitions. - * result/schemas/bug303566_1_1.err - result/schemas/bug312957_1_0.err: Adapted test results due - to the keyref changes. - -Fri Aug 12 12:17:52 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * valid.c: applied patch from Derek Poon fixing bug #310692 - -Wed Aug 10 23:39:02 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * xmlschemas.c: fix for bug #312945 as pointed by Dean Hill, the - context type was not always properly initialized. - -Wed Aug 10 18:21:41 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * relaxng.c: fixed bug #307377 about validation of choices in - list values. - * test/relaxng/307377* result/relaxng/307377* Makefile.am runtest.c: - added examples to the regression tests, problem is that streaming - version gives slightly more information. - -Wed Aug 10 15:25:53 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * xinclude.c: fixed bug #302302, nasty but the fix is rather simple. - -Wed Aug 10 11:59:46 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * result/schemas/any6_1_0*: Added missing test results. - -Tue Aug 9 23:37:22 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * xmlregexp.c: fixed a determinism detection problem exposed by - ##other tests committed by Kasimier, also added a small speedup - of determinism detection. - * test/results/any6_2_0* any8_1_0* any7_1_2* any7_2_2*: added - the results to the regression tests now - -Tue Aug 9 15:54:09 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * test/schemas/any7_2.xml test/schemas/any6_2.xsd - test/schemas/any8_1.xsd test/schemas/any8_0.xml: - Added some more tests for element wildcards. - -Tue Aug 9 14:22:47 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: Fixed #312957 reported by Carol Hunter: - streaming XPath states were not popped in every case, - thus failed to resolve correctly for subsequent input. - * test/schemas/bug312957* result/schemas/bug312957*: - Added the test submitted by Carol Hunter. - -Tue Aug 9 13:07:27 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * xmlregexp.c xmlschemas.c: trying to nail down the remaining - ##other issues - * result/schemas/any7* test/schemas/any7: completed the tests - and added the results - * result/schemas/any3_0_0.err result/schemas/any5_0_0.err - result/schemas/any5_1_0.err: this slightly changes the output - from 3 existing tests - -Mon Aug 8 22:33:08 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * nanoftp.c nanohttp.c xmlschemastypes.c: applied patch from - Marcus Boerger to remove warnings on Windows. - -Mon Aug 8 16:43:04 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * xmlsave.c include/libxml/xmlsave.h: fixed #145092 by adding - an xmlSaveOption to omit XML declaration - -Mon Aug 8 15:44:54 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * HTMLtree.c: fixed bug #310333 with a patch close to the provided - patch for HTML UTF-8 serialization - * result/HTML/script2.html: this changed the output of that test - -Mon Aug 8 15:01:51 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * xmlregexp.c: fixed bug #310264, basically it's about reentrancy - of count based transition, when going though the counter must - be reset to 0 - * test/schemas/bug310264* result/schemas/bug310264*: added the - regression test. - -Mon Aug 8 14:40:52 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: Fixed a memory leak: xmlSchemaFreeAnnot() was - only freeing the first annotation in the list. - -Mon Aug 8 09:44:34 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * xmlreader.c: applied patch from Rob Richards fixing - xmlTextReaderGetAttribute - -Mon Aug 8 01:41:53 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: fixed an uninitialized memory access spotted by - valgrind - -Sun Aug 7 12:39:35 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * test/relaxng/docbook_0.xml: get rid of the dependency on a locally - installed DTD - * uri.c include/libxml/uri.h xmlIO.c nanoftp.c nanohttp.c: try to - cleanup the Path/URI conversion mess, needed fixing in various - layers and a new API to the uri module which also fixes #306861 - * runtest.c: integrated a regression test specific to check the - URI conversions done before calling the I/O handlers. - -Sat Aug 6 11:06:24 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * doc/XSLT.html doc/xml.html: small doc fix for #312647 - -Tue Aug 2 13:26:42 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * win32/configure.js: applied patch from Rob Richards to allow - disabling modules in win32, fixes #304071 - -Mon Aug 1 07:18:53 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * python/libxml.c: applied fix from Jakub Piotr Clapa for - xmlAttr.parent(), closing #312181 - -Sun Jul 31 18:48:55 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * schematron.c: report improvement - * test/schematron/zvon* result/schematron/zvon*: more tests - -Sun Jul 31 16:02:59 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * win32/Makefile.msvc win32/configure.js: applied patch from Rob - Richards to add schematron to the build on Windows - * test/schematron/zvon3* result/schematron/zvon3*: second test - * test/schematron/zvon10* result/schematron/zvon10*: this is the - real second test 10 and 2 are swapped. - -Sun Jul 31 15:42:31 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * schematron.c: more bug fixes, improve the error reporting. - * test/schematron/zvon2* result/schematron/zvon2*: second test - -Sun Jul 31 14:15:31 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * schematron.c xmllint.c: fixing the loop bug, fixing schematron - text error rendering - * Makefile.am result/schematron/* test/schematron/zvon1*.sct: - started integrating within "make tests" - -Sat Jul 30 17:26:58 EDT 2005 Daniel Veillard <daniel@veillard.com> - - * test/schematron/*: a few first tests from Zvon unfortunately - with the old syntax - -Sat Jul 30 17:08:07 EDT 2005 Daniel Veillard <daniel@veillard.com> - - * schematron.c xmllint.c include/libxml/schematron.h: committing - work done on the plane last week-end - -Sat Jul 30 15:16:29 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * runtest.c: allows an extra argument to subset the tests - * xmlregexp.c: big speedup for validation, basically avoided - transition creation explosion when removing epsilon transition - -Sat Jul 30 00:00:46 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * Makefile.am globals.c parserInternals.c xmlreader.c xmlunicode.c - xmlwriter.c: more cleanups based on sparse reports, added - "make sparse" - -Fri Jul 29 12:11:25 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * python/libxml.c: don't output any message on failed resolver lookups, - better done by the python user provided resolver layer. - -Fri Jul 29 01:48:02 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c SAX2.c encoding.c globals.c parser.c relaxng.c - runsuite.c runtest.c schematron.c testHTML.c testReader.c - testRegexp.c testSAX.c testThreads.c valid.c xinclude.c xmlIO.c - xmllint.c xmlmodule.c xmlschemas.c xpath.c xpointer.c: a lot of - small cleanups based on Linus' sparse check output. - -Thu Jul 28 21:28:33 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * include/libxml/Makefile.am: added schematron.h, oops ... - -Thu Jul 28 02:38:21 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemastypes.c: Added creation of the content type of - xs:anyType. This is needed when trying to extend xs:anyType - (although it makes no sense to extend it; IMHO the schema - people should have ruled this out). This was reported - by Yong Chen to the mailing list. - * xmlschemas.c: Fixed handling of xs:anyType in - xmlSchemaCheckCOSCTExtends() (reported by Young Chen). Tiny - adjustment to an error report output. - * test/schemas/extension2* result/schemas/extension2*: - Added a test case provided by Young Chen. - -Mon Jul 25 11:41:18 PDT 2005 William Brack <wbrack@mmm.com.hk> - - * uri.c: enhanced xmlBuildRelativeURI to allow the URI and the - base to be in "relative" form - -Sun Jul 24 10:25:41 EDT 2005 Daniel Veillard <daniel@veillard.com> - - * schematron.c xmllint.c: started adding schematron to the xmllint - tool, the report infrastructure is gonna be fun. - -Sat Jul 23 23:23:51 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * test/schemas/any6* test/schemas/any7*: Added regression tests - (they fail currently), but did not added results yet. - -Sat Jul 23 23:07:05 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: Removed the workaround code in - xmlSchemaValidateElemWildcard() for the <any> wildcard - with namespace == ##other. Support for such wildcards was - implemented by Daniel at the automaton level recently, and - the workaround code iterfered with it. - -Sat Jul 23 10:55:50 EDT 2005 Daniel Veillard <daniel@veillard.com> - - * pattern.c include/libxml/pattern.h: changed xmlPatterncompile - signature to pass an int and not an enum since it can generate - ABI compat troubles. - * include/libxml/schematron.h schematron.c: adding the new - schematron code, work in progress lots to be left and needing - testing - * include/libxml/xmlversion.h.in include/libxml/xmlwin32version.h.in - Makefile.am configure.in: integration of schematron into the - build - * xpath.c include/libxml/xpath.h: adding flags to control compilation - options right now just XML_XPATH_CHECKNS. - -Sat Jul 23 16:39:35 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: Removed an "internal error" message from - xmlSchemaBuildAContentModel() when an empty model group - definition is hit. - -Sat Jul 23 00:34:07 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * pattern.c: Changed xmlCompileStepPattern() and - xmlCompileAttributeTest() to handle the "xml" prefix without - caring if the XML namespace was supplied by the user. - -Fri Jul 22 00:08:43 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: Fixed xmlSchemaPSimpleTypeErr(), which did not - output the given string arguments correctly. - -Thu Jul 21 09:21:00 EDT 2005 Daniel Veillard <daniel@veillard.com> - - * error.c globals.c parser.c runtest.c testHTML.c testSAX.c - threads.c valid.c xmllint.c xmlreader.c xmlschemas.c xmlstring.c - xmlwriter.c include/libxml/parser.h include/libxml/relaxng.h - include/libxml/valid.h include/libxml/xmlIO.h - include/libxml/xmlerror.h include/libxml/xmlexports.h - include/libxml/xmlschemas.h: applied a patch from Marcus Boerger - to fix problems with calling conventions on Windows this should - fix #309757 - -Wed Jul 20 14:45:39 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * parser.c: an optimization of the char data inner loop, - can gain up to 10% in pure SAX2 parsing speed - * xmlschemas.c: applied patch from Kupriyanov Anatolij fixing - a bug in XML Schemas facet comparison #310893 - -Tue Jul 19 17:27:26 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * xmlregexp.c xmlschemas.c: fixed the error reporting for - not transitions - * result/schemas/any5_0_0* result/schemas/any5_0_2* - result/schemas/any5_1_0*: fixed output - -Tue Jul 19 15:34:12 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * xmlregexp.c xmlschemas.c include/libxml/xmlautomata.h: fixing - bug #172215 about foreign namespaces by adding support for - negated string transitions. Error messages still need to be - improved. - * test/schemas/any5* result/schemas/any5*: adding regression - tests for this. - -Tue Jul 19 12:33:31 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * tree.c: applied patch from Alexander Pohoyda fixing xmlGetNodePath - on namespaced attributes #310417. - -Mon Jul 18 23:01:15 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * doc/xmllint.1 doc/xmllint.html doc/xmllint.xml: --nonet was - ducplicated - -Mon Jul 18 20:49:28 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * xmlschemas.c: fixed xsd:all when used in conjunction with - substitution groups - * test/schemas/allsg_* result/schemas/allsg_*: adding specific - regression tests, strangely missing from NIST/Sun/Microsoft - testsuites - -Sun Jul 17 07:11:27 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * xmlschemas.c: fixed bug #307508, a bad automata was built but - this showed as an indeterminist result - -Thu Jul 14 17:53:02 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * xmlschemastypes.c: found the last bug raised by NIST tests in - comparing base64 strings, result from runsuite: - ## NIST test suite for Schemas version NIST2004-01-14 - Ran 23170 tests (3953 schemata), no errors - -Thu Jul 14 14:57:36 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * testRegexp.c: fixed where xmlMemoryDump() should be called. - * xmlregexp.c: fixed handling of {0}, \n, \r and \t, two bugs - affecting NIST regression tests - -Thu Jul 14 11:30:24 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * configure.in: applied a patch from Gerrit P. Haase to add - module support on cygwin - -Thu Jul 14 10:56:42 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: fixed a potential buffer overrun error introduced - on last commit to htmlParseScript() c.f. #310229 - -Thu Jul 14 23:48:17 PDT 2005 William Brack <wbrack@mmm.com.hk> - - * xpath.c: Changed the behaviour of xmlXPathEqualNodeSetFloat to - return TRUE if a nodeset with a numeric value of NaN is compared - for inequality with any numeric value (bug 309914). - -Thu Jul 14 01:03:03 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * error.c relaxng.c xmlreader.c xmlschemas.c include/libxml/relaxng.h - include/libxml/xmlschemas.h: applied patch from Marcus Boerger - to route relaxng and schemas error messages when using the reader - through the structured interface if activated. - * elfgcchack.h doc/* testapi.c: rebuilt since this add new APIs - to test. - -Wed Jul 13 18:35:47 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: applied UTF-8 script parsing bug #310229 fix from - Jiri Netolicky - * result/HTML/script2.html* test/HTML/script2.html: added the test - case from the regression suite - -Tue Jul 12 17:08:11 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * nanohttp.c: fixed bug #310105 with http_proxy environments with - patch provided by Peter Breitenlohner - -Mon Jul 11 00:28:10 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * Makefile.am NEWS configure.in doc/*: preparing release 2.6.20 - * xmllint.c: removed a compilation problem - -Sun Jul 10 23:33:41 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * xstc/Makefile.am README README.tests Makefile.tests Makefile.am: - preparing to make testsuite releases along with code source releases - * gentest.py testapi.c: fixed a couple of problem introduced by - the new Schemas support for Readers - * xpath.c: fixed the XPath attribute:: bug #309580, #309864 in a crude - but simple way. - * xmlschemas.c include/libxml/tree.h: fixed a couple of problems - raised by the doc builder. - * doc/*: made rebuild - -Sun Jul 10 21:51:16 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * xmlschemas.c: fixed a bug introduced on last commit - -Sun Jul 10 21:00:54 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * doc/xmllint.1 doc/xmllint.html doc/xmllint.xml: fixed a typo - pointed by Jeroen Ruigrok - * include/libxml/xmlreader.h include/libxml/xmlschemas.h: increased - the APIs for xmlReader schemas validation support - * xmllint.c xmlreader.c xmlschemas.c: xmlReader schemas validation - implementation and testing as xmllint --stream --schema ... - -Sun Jul 10 16:11:26 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * include/libxml/xmlwin32version.h.in: try to avoid conflicts. - -Sat Jul 9 19:29:10 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * parser.c: fix for #309761 from Dylan Shell - * xmlschemas.c include/libxml/xmlschemas.h: added xmlSchemaSAXPlug - and xmlSchemaSAXUnplug generic APIs for SAX Schemas validation. - * xmllint.c: couple of fixes plus added descriptions for --sax and - --sax1 - -Fri Jul 8 23:35:00 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: Added c-props-correct constraint to check - for equal cardinality of keyref/key. - * include/libxml/xmlerror.h: Added an error code. - -Fri Jul 8 21:56:04 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * pattern.c: Fixed evaluation of attributes. Actually only - attribute at the first level were evaluated (e.g. "@attr"); - expression like "foo/@attr" always failed. - -Fri Jul 8 20:04:29 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: tiny fix in xmlSchemaValidateStream() if a - user-provided SAX handler is given. - -Fri Jul 8 19:25:26 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * parser.c: fix some potential leaks in error cases. - * xmllint.c: added --sax, to allow testing of --schemas --sax and - various other combinations. - * xmlschemas.c: fix a couple of tiny problems in - xmlSchemaValidateStream() - -Fri Jul 8 18:34:22 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: Changed xmlSchemaValidateFile() to use - xmlSchemaValidateStream() internally. - -Fri Jul 8 17:02:14 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * test/relaxng/docbook_0.xml: added the missing entity to the - document internal subset to avoid errors if the DocBook catalogs - are not there - * xmlschemas.c: first cut at implementing xmlSchemaValidateStream() - untested yet - -Wed Jul 6 15:45:48 PDT 2005 William Brack <wbrack@mmm.com.hk> - - * parser.c: fixed problem with free on dupl attribute in - dtd (bug309637). - * test/errors/attr3.xml, result/errors/attr3.*: added - regression test for this - -Wed Jul 6 13:11:35 PDT 2005 William Brack <wbrack@mmm.com.hk> - - * win32/Makefile.msvc: try again to fix file format for Windows - -Wed Jul 6 12:20:13 PDT 2005 William Brack <wbrack@mmm.com.hk> - - * win32/Makefile.msvc: removed spurious ^M - * runtest.c: added check for option O_BINARY - * test/schemas/bug309338*, result/schemas/bug309338*: changed - sticky tag to 'binary' - -Wed Jul 6 10:38:02 PDT 2005 William Brack <wbrack@mmm.com.hk> - - * debugXML.c: excluded content string check for XML_ELEMENT_DECL - in xmlCtxtGenericNodeCheck - * runtest.c: changed "open" calls to include O_BINARY for Windows - -Wed Jul 6 17:14:03 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * parser.c: fixing bug #166777 (and #169838), it was an heuristic - in areBlanks which failed. - * result/winblanks.xml* result/noent/winblanks.xml test/winblanks.xml: - added the input file to the regression tests - -Wed Jul 6 13:40:22 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemastypes.c: Fixed bug #309338, reported by Kupriyanov - Anotolij. - * test/schemas/bug309338* result/schemas/bug309338*: - Added a regression test for the above bug. - -Tue Jul 5 16:03:05 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * Makefile.am: first steps toward a testsuite dist - * SAX2.c include/libxml/xmlerror.h: fixed bug #307870 - -Tue Jul 5 12:38:36 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * runsuite.c runtest.c: Tiny portability adjustment for win. - * win32/Makefile.*: Added runtest.exe and runsuite.exe to - be created. - -Mon Jul 4 17:44:26 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * runsuite.c: first stb at unimplemnted detection - * runtest.c: fixing Windows code - -Mon Jul 4 17:19:31 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * runsuite.c: fix on schemas error - * runtest.c: portability glob() on Windows - -Mon Jul 4 16:23:54 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * runsuite.c runtest.c: cleanups, logfile and portability - * xmllint.c: fixed a memory leak - -Mon Jul 4 13:11:12 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * parser.c: fixed a bug failing to detect UTF-8 violations in - CData in push mode. - * result/errors/cdata.xml* test/errors/cdata.xml: added the test - to the regressions - -Mon Jul 4 11:26:57 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * debugXML.c: added enhancement for #309057 in xmllint shell - -Mon Jul 4 00:58:44 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: applied patch from James Bursa fixing an html parsing - bug in push mode - * result/HTML/repeat.html* test/HTML/repeat.html: added the test to the - regression suite - -Sun Jul 3 23:42:31 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * testapi.c tree.c: fixing a leak detected by testapi in - xmlDOMWrapAdoptNode, and fixing another side effect in testapi - seems to pass tests fine now. - * include/libxml/parser.h parser.c: xmlStopParser() is no more limited - to push mode - * error.c: remove a warning - * runtest.c xmllint.c: avoid compilation errors if only some parts - of the library are compiled in. - -Mon Jul 4 00:39:35 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * gentest.py testapi.c: fix a problem with previous patch to - testapi.c - -Sun Jul 3 22:59:28 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * runsuite.c runtest.c tree.c: fixing compilations when - disabling parts of the library at configure time. - -Sun Jul 3 18:17:58 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * parserInternals.c: fix bug raised by zamez on IRC - * testapi.c: regenerated, seems to pop-up leaks in new tree functions - * tree.c: added comments missing. - * doc/*: regenerated - -Sun Jul 3 18:06:55 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * testapi.c runsuite.c runtest.c: fixing #307823 and a couple of - assorted bugs - * python/generator.py python/libxml2-python-api.xml: fixed - conditionals in generator too - * doc/apibuild.py doc/libxml2-api.xml doc/* elfgcchack.h: some - cleanups too and rebuilt - -Sun Jul 3 16:42:00 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * xmlIO.c: fixed bug #307503 misplaced #ifdef - -Sun Jul 3 16:34:47 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * runsuite.c: expanded test - * xmlregexp.c: found and fixed the leak exposed by Microsoft regtests - -Sat Jul 2 23:38:24 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * runsuite.c: a bit of progresses on xstc - -Sat Jul 2 09:30:13 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * runsuite.c: completed the simple checks for Relax-NG suites - back to the same 11 errors as in the Python runs. - -Thu Jun 30 15:01:52 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * runtest.c: complete, checking on other platforms is needed - * README: updated - * debugXML.c: fix a bug raised by bill on IRC - * relaxng.c: fix a leak in weird circumstances - * runsuite.c Makefile.am: standalone test tool against - the regression suites, work in progress - -Tue Jun 28 08:30:26 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * runtest.c: adding URI tests - -Mon Jun 27 23:55:56 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * runtest.c: adding xml:id - -Mon Jun 27 23:29:36 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * runtest.c: finishing XPath, adding XPointer - -Mon Jun 27 17:39:27 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * runtest.c: adding more coverage, XInclude and starting XPath - -Mon Jun 27 17:02:14 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * tree.c include/libxml/tree.h: Added allocation/deallocation - functions for the DOM-wrapper context. - -Mon Jun 27 15:41:30 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * tree.c: Commented the new functions to be experimental. - -Mon Jun 27 14:41:14 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * error.c valid.c: working some weird error reporting problem for - DTD validation. - * runtest.c: augmented with DTD validation tests - * result/VC/OneID*: slight change in validation output. - -Mon Jun 27 13:44:41 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * runtest.c: added most HTML tests - -Mon Jun 27 14:06:10 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * test/namespaces/reconcile/tests.xml - test/namespaces/reconcile/tests-to-c.xsl: Added initial tests - for some new DOM-wrapper helping functions. - -Mon Jun 27 14:01:06 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xstc/xstc-to-python.xsl: Cleanup. - * xstc/sun-test-def.xml xstc/nist-test-def.xml xstc/ms-test-def.xml: - Removed, those are not needed anymore due to the new test suite. - -Mon Jun 27 11:39:50 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * result/*.sax2 MAkefile.am: added SAXv2 regression tests apparently - missing. - * runtest.c: added SAX1/SAX2 checks. - -Mon Jun 27 12:24:54 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * tree.c include/libxml/tree.h: Added - xmlDOMWrapReconcileNamespaces(), xmlDOMWrapAdoptNode() and - xmlDOMWrapRemoveNode() to the API. These are functions intended - to be used with DOM-wrappers. - -Mon Jun 27 10:14:57 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * runtest.c: continue to increase the tests - -Mon Jun 27 09:21:49 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * runtest.c: continue to increase the tests - -Mon Jun 27 01:01:32 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * runtest.c: continue to increase the tests - -Sun Jun 26 20:08:24 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * include/libxml/valid.h valid.c: avoid name glob in arguments as - it matches the glob() routine. - * runtest.c Makefile.am: first steps toward a C regression test - framework. - -Sat Jun 25 01:37:22 PDT 2005 William Brack <wbrack@mmm.com.hk> - - * configure.in: fixed a problem with the detection of - ss_family for ipV6, as reported on the mailing list by - Doug Orleans. - -Tue Jun 21 10:44:34 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * test/schemas/empty-value* result/schemas/empty-value*: - Added regression tests (from Dhyanesh). - -Tue Jun 21 10:35:43 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: Fixed NULL values to be validated as empty - string values (reported by Dhyanesh to the mailing list). - Adjusted text concatenation of mixed content. - -Mon Jun 20 18:11:32 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * tree.c valid.c: applied patch from Rob Richards for removal - of ID (and xml:id) - * xmlreader.c: applied patch from James Wert implementing - xmlTextReaderReadInnerXml and xmlTextReaderReadOuterXml - -Thu Jun 16 14:38:22 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: Fixed SAX2 validation: grow of internal - namespace list, appending of element character content. - * xstc/xstc.py: Added "--sax" option for SAX2 validation. - -Wed Jun 15 15:34:52 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemastypes.c: Added missing function descriptions. - -Wed Jun 15 15:26:14 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * xmllint.c: if sax1 is used and input is a file use the old - API xmlParseFile() - * xmlschemas.c: cleanups - * doc/* testapi.c elfgcchack.h: rebuilt to add python bindings - for the new functions in Schemas. - -Wed Jun 15 14:50:48 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c include/libxml/xmlschemas.h: Added - xmlSchemaValidateFile() to the public API. This will use - SAX2-driven validation. - -Wed Jun 15 11:11:38 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * result/schemas/bug306806_1_0 result/schemas/bug306806_1_0.err: - Added schema test results (Tom Browder, bug #306806). - -Wed Jun 15 11:08:34 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * test/schemas/bug306806_1.xsd test/schemas/bug306806_0.xml: - Added schema tests submitted by Tom Browder (bug #306806). - -Tue Jun 14 15:03:22 PDT 2005 William Brack <wbrack@mmm.com.hk> - - * pattern.c: adjusted last change to xmlCompilePathPattern, - fixed one compilation warning - -Tue Jun 14 21:19:16 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * pattern.c: Some changes/fixes to the streaming evaluation. - * xmlschemas.c: A bit of support for parsing the schema for - schema. Fixed attribute derivation when the use is - "prohibited" and was "optional". Fixed an attribute construction - bug, a left-over from the time, where <complexContent>, - <extension>, etc. where created as structs. - -Tue Jun 14 12:35:12 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * libxml-2.0.pc.in: removed a redundant include path - -Mon Jun 13 14:58:33 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xstc/Makefile.am: Some more adjustments. - -Mon Jun 13 14:35:59 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xstc/Makefile.am: Changed test extraction process, since some - boxes don't know about "tar --strip-path". - -Mon Jun 13 13:39:43 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * relaxng.c: fixed a bug exposed by Rob Richards in the mailing-list - * result//compare0* test//compare0*: added the regression test in - the suite as this went unnoticed ! - -Wed Jun 9 11:07:42 PDT 2005 William Brack <wbrack@mmm.com.hk> - - * pattern.c, xpath.c, include/libxml/pattern.h: Further - enhancement for XPath streaming, consolidated with - schemas usage of pattern.c. Added a new enum - xmlPatternFlags. - * doc/*, testapi.c, elfgcchack.h: updated to reflect new - enum. - * test/XPath/tests/mixedpat, test/XPath/docs/mixed, - result/XPath/mixedpat: added regression test for problems - reported in bug306348 - -Thu Jun 9 16:51:31 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemastypes.c: Changed non-prefixed QNames to be bound to a - default namespace if existent. - -Thu Jun 9 15:11:38 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemastypes.c: Fixed a bug which I invented: hexBinary's string - values were not duplicated corrently when creating a computed value - in xmlSchemaValAtomicType. - -Thu Jun 9 13:20:57 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c result/schemas/include1_0_0.err: - Fixed an attribute fixed/default value constraint error. - -Thu Jun 9 12:51:23 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * result/schemas/*: Adapted regression test results. - -Thu Jun 9 12:22:45 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c xmlschemastypes.c include/libxml/schemasInternals.h - include/libxml/xmlschemastypes.h: Changed the validation process - to be able to work in streaming mode. Some datatype fixes, - especially for list and union types. Due to the changes the - error report output has changed in most cases. Initial migration to - functions usable by both, the parser and the validator. This should - ease a yet-to-come XS construction API in the long term as well. - -Thu Jun 9 10:16:11 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * parser.c: applied patch from Malcolm Rowe to avoid namespace - troubles on rollback parsing of elements start #304761 - * test/nsclean.xml result/noent/nsclean.xml result/nsclean.xml*: - added it to the regression tests. - -Thu Jun 9 00:33:50 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * parser.c include/libxml/xmlerror.h: applied patch from Rob Richards - for xml:space and xml:lang handling with SAX2 api. - -Wed Jun 8 19:41:38 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * globals.c: applied patch from Morten Welinder, closing bug #306901 - on compiling subsets of the library - -Wed Jun 8 19:11:42 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xstc/Makefile.am xstc.py xstc-to-python.xsl: Adapted the - XS tests to use the new release of tests and test-definitions. - -2005-06-07 Aleksey Sanin <aleksey@aleksey.com> - - * c14n.c: fix rendering of attributes when parent node - is not in the node set - -2005-06-06 Aleksey Sanin <aleksey@aleksey.com> - - * c14n.c: fixed xml attributes processing bug in exc c14n - * xmllint.c: added --exc-c14n command line option - -Mon Jun 6 06:43:33 PDT 2005 William Brack <wbrack@mmm.com.hk> - - * xpath.c, pattern.c: Enhanced xmlXPathRunStreamEval, fixed - handling of depth/level for cases like union operator - (bug #306348 reported by Bob Stayton). Also enhanced - several comments throughout pattern.c. - * doc/apibuild.py: fixed problem in handling of - 'signed' declaration. Rebuilt the docs. - -Tue May 31 20:35:27 PDT 2005 William Brack <wbrack@mmm.com.hk> - - * xinclude.c: Enhanced handling of xml:base for included - elements, fixing bugs 169209 and 302353. - -Wed May 25 18:59:53 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: Fixed facet errors to be channelled back for - union type members; facet-validation will stop now on the - first error. Reported by GUY Fabrice to the mailing-list. - * xmlschemastypes.c: Changed to ignore lengh-related facet - validation for QNames and NOTATIONs as proposed by the - schema people. - * test/schemas/union2* result/schemas/union2*: Added - regression tests for union types (by GUY Fabrice). - -Fri May 20 20:48:08 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * xmlsave.c: applied patch from Mark Vakoc fixing saving of - CDATA with NULL content. - -Thu May 12 15:14:26 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemastypes.c: Changed the VALID_TZO macro to restrict - the timezone to -840 to 840. - -Thu May 12 15:05:11 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemastypes.c: Applied patch from Steve Nairn (bug #303670) - for "signed int" of the date-time timezone field. Silenced - a warning. - -Wed May 11 20:04:09 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * tree.c: applied patch for replaceNode from Brent Hendricks - -Tue May 10 17:27:52 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * tree.c: fixed bug #303682 of a leak reported by Malcolm Rowe - -Tue May 10 11:50:16 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * testapi.c: applied patch from Steve Nairn tof fix the compilation - problem exposed in bug #303640 - -Tue May 10 11:11:26 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * test/schemas/bug303566_1* result/schemas/bug303566_1_1*: - Added regression a test provided by Heiko Oberdiek (bug #303566). - -Mon May 9 17:56:58 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * pattern.c: Changed the XPath "." to resolve only on the first - level for XML Schema IDCs (bug #303566 reported by Heiko Oberdiek). - This should not affect pattern-like resolution on every level. - -Sun May 8 13:35:39 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * xmlmemory.c: fixed #169630 segfault in xmlMemDisplay - -Fri May 6 13:40:03 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * nanoftp.c: fixing bug #303068 increasing the nanoftp buffer. - * doc/apibuild.py: fixed __attribute() parsing problem - * doc/* testapi.c: regenerated the descriptions and docs. - -Wed May 4 11:16:00 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * Makefile.am configure.in threads.c: on linux/gcc use weak definitions - to avoid linking with pthread library on non-threaded environments. - * xpath.c: applied patch from Mark Vakoc w.r.t. a buggy namespace - list allocation. - -Fri Apr 29 11:27:37 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * parser.c: Fixed a test for duplicate attributes: Non-prefixed - attributes were treated as being bound to the default namespace. - -Tue Apr 19 17:51:32 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemastypes.c: Fixed date-time related validation - (reported by David Crossley, bug #300576). - -Tue Apr 19 16:55:40 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c xmlregexp.c: Removed 5 unnecessary - dereferences (reported by Andriy, bug #301074). - -Tue Apr 19 22:33:18 HKT 2005 William Brack <wbrack@mmm.com.hk> - - * xpath.c: Added some code to avoid integer overflow for - ceil, floor and round functions (bug 301162) - -Tue Apr 19 13:21:54 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: Removed workaround for bug #172215, since it - does more harm in some scenarios. Added some of the - "Particle Restriction OK" constraints - not yet enabled. - -Mon Apr 18 13:02:55 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * result/schemas/changelog093*: Added test results. - -Mon Apr 18 12:42:14 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: Added output of canonical values in - identity-constraint error messages. - * xmlschemastypes.c include/libxml/xmlschemastypes.h: - Added xmlSchemaGetCanonValueWhtsp() to the API. - Further enhancement of the canonical value - conversion. - * test/schemas/changelog093_0.*: Added test with an XSD - submitted by Randy J. Ray. - -Fri Apr 15 09:33:21 HKT 2005 William Brack <wbrack@mmm.com.hk> - - * valid.c: Applied Daniel's fix for memory leak in dtd - prefix (bug 300550). - * xpath.c: minor change to comment only - -Thu Apr 14 20:52:41 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * xmlmemory.c: added the call to the breakpoint routine - when a monitored block is reallocated or freed - -Wed Apr 13 05:55:51 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * nanohttp.c: applied patch from Aron Stansvik for bug #172525 - about HTTP query string parameter being lost - -Tue Apr 12 04:03:32 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * python/libxml.c python/libxml.py: applied patch from Brent Hendricks - adding namespace removal at the python level #300209 - * python/tests/Makefile.am python/tests/nsdel.py: added the regression - test - -Sun Apr 10 09:03:22 HKT 2005 William Brack <wbrack@mmm.com.hk> - - * xpath.c: fixed several places where memory cleanup was not - properly done after an error was detected (problem was - reported on the mailing list by Pawel Palucha) - -Fri Apr 8 21:58:04 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: Added substitution group constraints; changed - the build of the pre-computed substitution groups. Channeled - errors during xsi assembling of schemas to the validation - context. Fixed a big memory leak, which occurred when using - IDCs: the precomputed value of attributes was not freed if - the attribute did not resolve to an IDC field (discovered - with the help of Randy J. Ray's schema, posted to the - xmlschema-dev maling list). - -Fri Apr 8 13:22:01 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: Added "Particle correct 2" to parsing of model groups. - Added handling substitution groups inside <choice> and <sequence>; - for <all> this is not supported yet. Changed circular checks for - model groups definitions. "memberTypes" are processed at different - levels now: component resolution first, construction later; this - goes hand in hand with a global change to handle component - resolution in a distinct phase. Fixed invalid default values for - elements to mark the schema as invalid; this just resulted in an - error report previously, but the schema was handled as valid. - Separated the assignment of the model groups to referencing - model group definition references (i.e. particles); this was - needed to perform the circularity check for model group definitions. - Added "Element Declaration Properties Correct (e-props-correct)" - constraints. Separated component resolution for simple/complex - types. - * include/libxml/schemasInternals.h: Added a flag for substitution - group heads. - -Wed Apr 6 23:14:03 CEST 2005 Igor Zlatkovic <igor@zlatkovic.com> - - * win32/Makefile.*: make install cleanup - -Wed Apr 6 22:42:23 CEST 2005 Igor Zlatkovic <igor@zlatkovic.com> - - * win32/Makefile.mingw: fixed mingw compilation - * testModule.c: removed mingw warnings - -Wed Apr 6 21:59:11 CEST 2005 Igor Zlatkovic <igor@zlatkovic.com> - - * .cvsignore: added Eclipse project files to ignore list - -Wed Apr 6 16:08:10 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * xpath.c: fixed the bug in lang() as raised by Elliotte Rusty Harold - * result/XPath/tests/langsimple test/XPath/tests/langsimple - test/XPath/docs/lang: added a regression test - -Tue Apr 5 23:48:35 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * nanoftp.c: applied fix from Rob Richards to compile on Windows. - -Tue Apr 5 17:02:58 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: Added "Type Derivation OK (Complex)" constraints - and anchored them in the "Element Locally Valid (Element)" - constraints. This restricts the type substitution via "xsi:type". - -Tue Apr 5 13:10:06 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * xmlschemas.c: patch from Matthew Burgess to improve some schemas - facets validation messages. - -Sat Apr 2 12:48:41 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * doc/* configure.in NEWS: preparing release 2.6.19, updated docs and - rebuilding. - -Sat Apr 2 13:27:32 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * xstc/Makefile.am: integrated fixup-tests.py - -Fri Apr 1 19:14:18 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * xmlschemastypes.c: fixed a lack of comment and missing test for - a pointer in the API. - -Fri Apr 1 17:54:22 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xstc/fixup-tests.py: A tiny script to fixup some of the schema - files used for the tests. - -Fri Apr 1 17:33:50 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c include/libxml/schemasInternals.h - result/schemas/src-element2-*.err result/schemas/element-*.err: - Committing again, since the CVS server aborted. - -Fri Apr 1 15:29:27 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemastypes.c: Corrected 'length' facet validation for - QNames and notations. Corrected xmlSchemaGetCanonValue: some - data types did not return a value if already in normalized - form. - * xmlschemas.c include/libxml/schemasInternals.h: - Eliminated creation of structs for <restriction>, <extension>, - <simpleContent>, <complexContent>, <list> and <union>: the - information is now set directly on the corresponding simple/ - complex type. Added some more complex type constraints. - Added facet derivation constraints. Introduced "particle" - components, which seem to be really needed if applying - constraints. Corrected/change some of the parsing functions. - This is all a bit scary, since a significant change to the code. - * result/schemas/src-element2-*.err result/schemas/element-*.err: - Adapted regression test results. - -Fri Apr 1 16:07:59 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * doc/apibuild.py doc/elfgcchack.xsl: revamped the elfgcchack.h - format to cope with gcc4 change of aliasing allowed scopes, had - to add extra information to doc/libxml2-api.xml to separate - the header from the c module source. - * *.c: updated all c library files to add a #define bottom_xxx - and reimport elfgcchack.h thereafter, and a bit of cleanups. - * doc//* testapi.c: regenerated when rebuilding the API - -Thu Mar 31 17:20:32 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * xmlsave.c: fixed bug reported by Petr Pajas, in the absence of - encoding UTF-8 should really be assumed. This may break if - the HTTP headers indicates for example ISO-8859-1 since this - then becomes a well formedness error. - -Thu Mar 31 16:57:18 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * SAX.c: fixed #172260 redundant assignment. - * parser.c include/libxml/parser.h: fixed xmlSAXParseDoc() and - xmlParseDoc() signatures #172257. - -Thu Mar 31 16:11:10 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * parser.c: fix potential crash if ctxt->sax->ignorableWhitespace - is NULL as reported by bug #172255 - -Thu Mar 31 15:36:52 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * relaxng.c: fixed a problem in Relax-NG validation #159968 - * test/relaxng/list.* result/relaxng/list_*: added the test - to the regression suite - -Thu Mar 31 13:06:02 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * python/libxml.c: fixed bug #168504 - -Thu Mar 31 12:22:54 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * config.h.in configure.in nanoftp.c nanohttp.c xmllint.c - macos/src/config-mac.h: use XML_SOCKLEN_T instead of SOCKLEN_T - since apparently IBM can't avoid breaking common defines #166922 - -Thu Mar 31 10:41:45 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * encoding.c: fix unitinialized variable in not frequently used - code bug #172182 - -Thu Mar 31 00:45:18 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * python/generator.py python/libxml.py: another patch from Brent - Hendricks to add new handlers with the various validity contexts - * python/tests/Makefile.am python/tests/validDTD.py - python/tests/validRNG.py python/tests/validSchemas.py: also - added the regression tests he provided - -Wed Mar 30 09:39:27 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * python/generator.py python/libxml.c: applied patch from Brent - Hendricks to avoid leak in python bindings when using schemas - error handlers. - -Tue Mar 29 22:29:28 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * HTMLtree.c: fixing bug 168196, <a name=""> must be URI escaped too - -Sun Mar 27 13:24:24 CEST 2005 Daniel Veillard <daniel@veillard.com> - - * tree.c: cleanup of the Prop related functions and xmlNewNodeEatName - by Rob Richards - -Thu Mar 24 19:01:22 PST 2005 William Brack <wbrack@mmm.com.hk> - - * gentest.py, testapi.c: fixed problem with 'minimal library' - compilation (LIBXML_PATTERN_ENABLED not properly checked) reported - by Greg Morgan - -Thu Mar 24 12:01:30 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: Fixed call to a facet error report: the type of - the error was wrong, resulting in a segfault (bug #171220, reported - by GUY Fabrice). - -Mon Mar 21 22:58:37 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: Removed a stupid bug in xmlSchemaValidateAttributes, - failing to build a linked list correctly (bug #169898, reported - by bing song, hmm...). - -Mon Mar 21 21:09:07 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: Fixed a segfault, which occurred during bubbling - of IDC nodes (bug #170779 and #170778, reported by GUY Fabrice): - a variable was missed to be reset in a loop. Deactivated bubbling, - if not referenced by a keyref. - -Sun Mar 20 11:13:02 PST 2005 Aleksey Sanin <aleksey@aleksey.com> - - * c14n.c include/libxml/xmlerror.h: special case "DAV:" namespace - in c14n relative namespaces check and add structured error messages - to c14n code - -Thu Mar 17 12:55:23 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: Removed inheritance of "mixed" content type for - short-hand restrictions of "anyType" (reported by Guy Fabrice - to the mailing list). Added the namespace conversion (chameleon - includes) for the base type reference of <restriction> and - <extension>. - * test/schemas/bug152470_1.xsd: Adapted due to the above change - of "mixed" inheritance. - -Thu Mar 17 11:03:59 CET 2005 Daniel Veillard <daniel@veillard.com> - - * xmlschemas.c: fixed a = -> == error pointed by GUY Fabrice - -Wed Mar 16 22:53:53 CET 2005 Daniel Veillard <daniel@veillard.com> - - * xmlschemas.c: more debug messages from Matthew Burgess - * xmlschemastypes.c: xmlSchemaValidateLengthFacet API missing check. - -Wed Mar 16 17:37:04 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemastypes.c: Aaaannnd putting back the previous changes done - by Daniel, which I overwrote with the previous commit. - -Wed Mar 16 17:20:25 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c xmlschemastypes.c include/libxml/xmlschemastypes.h: - Hopefully finished validation against facets to use the normalized - value of both, the facets and instance values. Added - xmlSchemaValidateLengthFacetWhtsp(), xmlSchemaValidateFacetWhtsp() - and xmlSchemaGetValType() to the schema API. - -Wed Mar 16 13:55:31 CET 2005 Daniel Veillard <daniel@veillard.com> - - * libxml.spec.in: do not package .la files - * xmllint.c: applied patch from Gerry Murphy for xmllint return code - * xmlschemastypes.c: fixed a couple of missing tests of parameters - at public API entry points. - -Tue Mar 15 23:31:14 HKT 2005 William Brack <wbrack@mmm.com.hk> - - * xmlschemastypes.c: a couple of more changes to various - decimal-handling routines. Fixes python some problems - turned up by the python tests. - * Makefile.am: change SchemasPythonTests message to warn - that there are 10 'expected' errors (rather than 6) since - we now reject a '+' sign on an unsigned. - -Tue Mar 15 15:43:27 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemastypes.c xmlschemastypes.h: In preparation to use - normalized values of facets during validation: changed the - arguments of some string comparison functions; added a static - xmlSchemaValidateFacetInternal() with more arguments to be - more flexible. Prepared XML_SCHEMA_FACET_ENUMERATION validation - to use the comparison functions. Fixed some assignments in - xmlSchemaValAtomicType(): total digit count, lo, mi, hi. - -Sun Mar 13 19:32:03 CET 2005 Daniel Veillard <daniel@veillard.com> - - * NEWS configure.in testapi.c doc/*: preparing release of 2.6.18 - updated docs and rebuilt - * libxml.spec.in: reactivated gcc profiling for gcc >= 4.0.0 - -Sat Mar 12 19:50:22 CET 2005 Daniel Veillard <daniel@veillard.com> - - * encoding.c: removed a static buffer in xmlByteConsumed(), - as pointed by Ben Maurer, fixes #170086 - * xmlschemas.c: remove a potentially uninitialized pointer warning - -Fri Mar 11 23:53:13 HKT 2005 William Brack <wbrack@mmm.com.hk> - - * xmlschemastypes.c: enhanced the parsing of XML_SCHEMAS_DECIMAL - and much of the routine xmlSchemaCompareDecimals. The - changes were necessary to fix a problem reported on the - mailing list by John Hockaday. - -Fri Mar 11 13:22:52 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: The schema parser will stop if components could - not be resolved. This is not conforming to the spec but for now - will avoid internal errors during type fixup and content model - creation. Restructured inclusion/import of schemata: this avoids - duplicate, self and circular inclusion. Chameleon includes are - still workarounded. Added restriction to disallow references to - non-imported namespaces. Corrected parsing of <group>. - * result/schemas/bug167754_0_0*: Added a missing test result. - -Thu Mar 10 16:02:17 CET 2005 Daniel Veillard <daniel@veillard.com> - - * doc/xml.html doc/encoding.html: Enriched encoding.html with more - link and foreword warning to avoid problem with ignorant - programmers, c.f #169721 - -Thu Mar 10 15:01:34 CET 2005 Daniel Veillard <daniel@veillard.com> - - * python/tests/Makefile.am python/tests/readernext.py: added - a regression test from Rob Richards for the previous bug - -Thu Mar 10 13:22:36 CET 2005 Daniel Veillard <daniel@veillard.com> - - * xmlreader.c: applied fix for xmlTextReaderNext() bug from - Rob Richards - -Thu Mar 10 11:35:57 CET 2005 Daniel Veillard <daniel@veillard.com> - - * xmlmodule.c: second patch from Rick Jones, portability fix for - HP-UX - * doc/examples/xpath1.c doc/examples/xpath2.c: first fix from Rick Jones - to avoid warnings. - -Thu Mar 10 10:20:23 CET 2005 Daniel Veillard <daniel@veillard.com> - - * include/libxml/hash.h libxml.h libxml.spec.in: some gcc4 portability - patches, including a serious aliasing bug exposed in s390 - when trying to convert data pointer to code pointer. - -Mon Mar 7 18:34:00 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: Tiny restructuring of the validation start-up - functions. Added cleanup of the validation context at the - end of validation. This takes care of the validation context - being reused. - -Mon Mar 7 12:12:01 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemastypes.c: Tiny changes in the comparison functions - I forgot to commit last time. - -Fri Mar 4 22:51:42 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: Added IDC validation of anySimpleType attribute - values; anyway the IDC key comparison is restricted to - anySimpleType <--> string based types. For other types we - would possibly need the canonical lexical representation of - them; this sounds not performant, since we would need to - build such a representation each time we want to compare against - anySimpleType. TODO: think about buffering the canonical values - somewhere. Fixed error reports for default attributes to work - without a node being specified. This all and the enabling of IDC - validation fixes bug #165346 (reported by Benoit Gr?goire - could - not read his last name correctly from bugzilla). - -Fri Mar 4 18:57:44 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: Enabled IDC parsing and validation. - * xmlschemastypes.c include/libxml/xmlschemastypes.h: - Added xmlSchemaCopyValue to the API; this was done due to - validation of default attributes against IDCs: since IDC keys - consume the precomputed value, one needs a copy. - * pattern.c: Enabled IDC support; this is currently done - via calling xmlPatterncompile with a flag arg of 1. - -Wed Mar 2 11:45:18 CET 2005 Daniel Veillard <daniel@veillard.com> - - * Makefile.am doc/examples/Makefile.am python/tests/Makefile.am - xstc/Makefile.am: try to fix a problem with valgrind. - * python/generator.py python/libxml.c python/tests/Makefile.am - python/tests/tstmem.py: applied memory leak fix from Brent Hendricks - c.f. bug #165349 - -Mon Feb 28 11:18:24 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * tree.c: Changed xmlSearchNsByHref to call xmlNsInScope with - the prefix instead of the namespace name. - * test/schemas/annot-err_0.xsd test/schemas/element-err_0.xsd: - Adapted invalid values of the "id" attribute, since they are - validated now. - -Fri Feb 25 08:31:16 CET 2005 Daniel Veillard <daniel@veillard.com> - - * threads.c: new version with fixes from Rob Richards - -Thu Feb 24 16:37:51 CET 2005 Daniel Veillard <daniel@veillard.com> - - * threads.c: applied patch from Rich Salz for multithreading on - Windows. - -Wed Feb 23 15:04:46 CET 2005 Daniel Veillard <daniel@veillard.com> - - * xmlwriter.c: applied a patch from Rob Richards fixing a couple - of bugs in the writer - -Mon Feb 21 21:51:03 HKT 2005 William Brack <wbrack@mmm.com.hk> - - * xmlsave.c: fixed problem when XMLLINT_INDENT was empty (bug 168033). - * xpath.c: fixed compilation warning, no change to logic. - * xmlschemastypes.c: fixed compilation warning, no change to logic. - -Mon Feb 21 14:48:27 CET 2005 Daniel Veillard <daniel@veillard.com> - - * xmlwriter.c: applied patch from Rob Richards to fix a problem with - xmlTextWriterStartAttributeNS - -Mon Feb 21 11:41:41 CET 2005 Daniel Veillard <daniel@veillard.com> - - * pattern.c xpath.c: fixed remaining known bugs in the XPath streaming, - and switched XPath to use it by default when possible - -Sat Feb 19 19:25:14 CET 2005 Daniel Veillard <daniel@veillard.com> - - * xmlschemastypes.c: a bit of cleanup - * elfgcchack.h testapi.c doc/*: rebuilt the API the tests and - the documentation as a result. - -Fri Feb 18 20:34:03 CET 2005 Daniel Veillard <daniel@veillard.com> - - * xmlreader.c include/libxml/xmlreader.h: applied patch from - Aron Stansvik to add xmlTextReaderByteConsumed() - * testReader.c: added a test option - * xmlschemastypes.c: fix a lack of pointer checking in APIs - -Fri Feb 18 12:41:10 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * test/schemas/bug167754_0*: Added the regression test of Frans - Englich for bug #167754. - -Fri Feb 18 12:31:49 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: Started support for IDC resolution to default - attributes. If building the content model for <all>: ensured - to put element declarations and not the particles into the - content model automaton (this was bug #167754, reported by - Frans Englich). - -Thu Feb 17 22:31:58 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * pattern.c pattern.h: Some experimental addition for parsing - of expressions and streamable validation. - Added xmlStreamPushAttr to the API. - -Thu Feb 17 19:57:35 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: Added validation for the attribute "id" in the - schemata; doing this needed error report fixes for notations, - facets and group. Changed NOTATION validation to work with the - declared NOTATIONs in the schema; this does have no impact on - the validation via the relaxng module. - * xmlschemastypes.c include/libxml/xmlschemastypes.h: - Added xmlSchemaNewNOTATIONValue to the API to be able to do - the NOTATION validation described above. - * test/schemas/element-err_0.xsd test/schemas/annot-err_0.xsd: - Fixed the values of the "id" attributes, which were not validated - previously. - -Thu Feb 17 12:03:46 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: Fixed comparison for default/fixed attribute - values, if the type was 'xsd:string'. Changed the comparison - for IDCs to use the whitespace aware comparison function. - * xmlschemastypes.c include/libxml/xmlschemastypes.h: - Added xmlSchemaGetCanonValue, xmlSchemaNewStringValue and - xmlSchemaCompareValuesWhtsp to the API. Added functions - to compare strings with whitespace combinations of "preserve", - "replace" and "collapse". - -Wed Feb 16 13:24:35 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: Further work on IDCs, especially evaluation for - attribute nodes. - -Wed Feb 16 01:19:27 CET 2005 Daniel Veillard <daniel@veillard.com> - - * encoding.c: fix the comment to describe the real return values - * pattern.c xpath.c include/libxml/pattern.h: lot of work on - the patterns, pluggin in the XPath default evaluation, but - disabled right now because it's not yet good enough for XSLT. - pattern.h streaming API are likely to be changed to handle - relative and absolute paths in the same expression. - -Tue Feb 15 15:33:32 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: Added IDC evaluation for attribute nodes. - Made 'nil'ed elements work. Added a specific error message - for 'strict' attribute wildcards. - * include/libxml/xmlerror.h: Added an error code for - wildcards. - * result/schemas/anyAttr-processContents-err1_0_0.err: Adapted. - -Sun Feb 13 16:15:03 HKT 2005 William Brack <wbrack@mmm.com.hk> - - This change started out as a simple desire to speed up the - execution time of testapi.c, which was being delayed by - nameserver requests for non-existent URL's. From there it - just sort of grew, and grew.... - * nanohttp.c, nanoftp.c: changed the processing of URL's - to use the uri.c routines instead of custom code. - * include/libxml/xmlerror.h: added code XML_FTP_URL_SYNTAX - * uri.c: added accepting ipV6 addresses, in accordance with - RFC's 2732 and 2373 (TODO: allow ipV4 within ipV6) - * gentest.py, testapi.c: fixed a few problems with the - testing of the nanoftp and nanohttp routines. - * include/libxml/xmlversion.h: minor change to fix a - warning on the docs generation - * regenerated the docs - -Sat Feb 12 09:07:11 HKT 2005 William Brack <wbrack@mmm.com.hk> - - * xinclude.c: fixed xmlXIncludeParseFile to prevent - overwriting XML_COMPLETE_ATTRS when setting pctxt->loadsubset - (bug 166199) - * Makefile.am, python/tests/Makefile.am, xstc/Makefile.am: added - code to add $(top_builddir)/.libs to LD_LIBRARY_PATH whenever - PYTHONPATH is set, to assure new libxml2 routines are used. - -Fri Feb 11 22:20:41 HKT 2005 William Brack <wbrack@mmm.com.hk> - - * parser.c: fixed problem when no initial "chunk" was - given to xmlCreatePushParser (bug 162613) - -Fri Feb 11 18:37:22 HKT 2005 William Brack <wbrack@mmm.com.hk> - - * dict.c: fixed compilation warning - * parser.c: changed xmlWarningMsg so ctxt->errNo is not set - * xmllint.c: changed to return non-zero status if error - on xinclude processing - * xmlsave.c: minor deletion of a redundant condition statement - -Wed Feb 9 17:47:40 CET 2005 Daniel Veillard <daniel@veillard.com> - - * tree.c: applied patch to xmlSetNsProp from Mike Hommey - -Sun Feb 6 00:17:57 CET 2005 Daniel Veillard <daniel@veillard.com> - - * pattern.c xmllint.c: fixed implementation for | - * test/pattern/conj.* result/pattern/conj: added a specific regression - test - -Sat Feb 5 18:36:56 CET 2005 Daniel Veillard <daniel@veillard.com> - - * pattern.c: first implementation for | support - -Sat Feb 5 14:58:46 CET 2005 Daniel Veillard <daniel@veillard.com> - - * pattern.c: fixed the namespaces support - * tree.c: fixed xmlGetNodePath when namespaces are used - * result/pattern/multiple result/pattern/namespaces - test/pattern/multiple.* test/pattern/namespaces.*: added - more regression tests - -Fri Feb 4 18:26:43 CET 2005 Daniel Veillard <daniel@veillard.com> - - * xmlschemas.c: fixed one internal function - * doc/Makefile.am doc/wiki.xsl: applied patch from Joel Reed - * testapi.c doc/libxml2-api.xml doc/libxml2-refs.xml: regenerated - -Fri Feb 4 00:25:43 CET 2005 Daniel Veillard <daniel@veillard.com> - - * Makefile.am: use the walker to test the patterns instead of - the normal reader - * pattern.c xmllint.c: bug fixes in the train including fixing the - stupid build break. - -Tue Feb 1 18:15:52 CET 2005 Daniel Veillard <daniel@veillard.com> - - * pattern.c: more bug fixes for the XPath streaming code. - -Mon Jan 31 17:59:24 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: Integrated the streaming pattern from the - pattern module. Fixed some IDC code bugs. Changed - fallback for attribute declaration addition to work like for - element declarations. - -Mon Jan 31 01:27:22 CET 2005 Daniel Veillard <daniel@veillard.com> - - * pattern.c xmllint.c: bugfixes around the streaming patterns - -Sun Jan 30 23:35:19 CET 2005 Daniel Veillard <daniel@veillard.com> - - * Makefile.am configure.in result/pattern/simple - test/pattern/simple.*: added first test for the patterns - * pattern.c xmllint.c: a few fixes - -Sun Jan 30 19:27:23 CET 2005 Daniel Veillard <daniel@veillard.com> - - * pattern.c include/libxml/pattern.h xmllint.c: added a - streaming pattern detector for a subset of XPath, should - help Kasimier for identity constraints - * python/generator.py: applied Stéphane Bidoul patch to find - paths without breaking. - -Fri Jan 28 18:53:40 CET 2005 Daniel Veillard <daniel@veillard.com> - - * xmlschemas.c: fixed an untested pointer dereference and a & vs && - -Fri Jan 28 18:37:18 CET 2005 Daniel Veillard <daniel@veillard.com> - - * xmlreader.c: implementation of xmlTextReaderReadString by - Bjorn Reese - -Fri Jan 28 16:51:47 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: Corrected an ambiguous symbol-space for - local attribute declarations. IFDEFed more IDC code to - suppress compiler warnings. - -Fri Jan 28 00:57:04 CET 2005 Daniel Veillard <daniel@veillard.com> - - * bakefile/Readme.txt bakefile/Bakefiles.bkgen bakefile/libxml2.bkl: - files for the Bakefile generator for Makefiles from Francesco - Montorsi - * win32/configure.js: fixes for Windows compilation with non-default - flags by Joel Reed - -Thu Jan 27 18:23:50 CET 2005 Daniel Veillard <daniel@veillard.com> - - * tree.c: fixed xmlCopyDoc to also copy the doc->URL as pointed - by Martijn Faassen - -Thu Jan 27 13:39:04 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c include/libxml/schemasInternals.h: - Added an initial skeleton for indentity-constraints. This is all - defined out, since not complete, plus it needs support from other - modules. - Added mechanism to store element information for the - ancestor-or-self axis; this is needed for identity-constraints - and should be helpful for a future streamable validation. - * include/libxml/xmlerror.h: Added an error code for - identity-constraints. - -Wed Jan 26 01:03:37 CET 2005 Daniel Veillard <daniel@veillard.com> - - * gentest.py testapi.c: had to fix generation and rebuild. - * valid.c: the testapi found a bug in the last code of course ! - -Wed Jan 26 00:43:05 CET 2005 Daniel Veillard <daniel@veillard.com> - - * Makefile.am testapi.c doc/Makefile.am: fixing the way testapi.c - is generated, fixes bug #161386 - * dict.c: fix a comment typo - * elfgcchack.h doc/*: regenerated - -Tue Jan 25 22:39:33 CET 2005 Daniel Veillard <daniel@veillard.com> - - * parser.c: found and fixed 2 problems in the internal subset scanning - code affecting the push parser (and the reader), fixes #165126 - * test/intsubset2.xml result//intsubset2.xml*: added the test case - to the regression tests. - -Tue Jan 25 01:20:11 CET 2005 Daniel Veillard <daniel@veillard.com> - - * testdso.c xmlregexp.c: warning patches from Peter Breitenlohner - * include/libxml/valid.h valid.c parser.c: serious DTD parsing - speedups, start to deprecate 3 ElementDef related entry point - and replace them with better ones. - -Mon Jan 24 00:47:41 CET 2005 Daniel Veillard <daniel@veillard.com> - - * xmlschemas.c: more hash dictionary interning changes - -Sun Jan 23 23:54:39 CET 2005 Daniel Veillard <daniel@veillard.com> - - * hash.c include/libxml/hash.h: added xmlHashCreateDict where - the hash reuses the dictionary for internal strings - * entities.c valid.c parser.c: reuse that new API, leads to a decent - speedup when parsing for example DocBook documents. - -Sun Jan 23 21:14:20 CET 2005 Daniel Veillard <daniel@veillard.com> - - * parser.c: small speedup in skipping blanks characters - * entities.c: interning the entities strings - -Sun Jan 23 18:35:00 CET 2005 Daniel Veillard <daniel@veillard.com> - - * parser.c: boosting common comment parsing code, it was really - slow. - * test/comment[3-5].xml result//comment[3-5].xml*: added sprecific - regression tests - -Sun Jan 23 01:00:09 CET 2005 Daniel Veillard <daniel@veillard.com> - - * parser.c: small optimization back. - -Sat Jan 22 00:40:31 CET 2005 Daniel Veillard <daniel@veillard.com> - - * dict.c parser.c include/libxml/dict.h: a single lock version - mostly avoid the cost penalty of the lock in case of low - parallelism, so applying that version instead. - -Fri Jan 21 17:54:06 CET 2005 Daniel Veillard <daniel@veillard.com> - - * dict.c: patch from Gary Coady to fix a race in dict reference - counting in multithreaded apps. - -Fri Jan 21 16:08:21 CET 2005 Daniel Veillard <daniel@veillard.com> - - * parser.c: fixed bug #164556 where non-fatal errors stopped - push parsing and xmlreader. - * Makefile.am: fixup - * test/errors/webdav.xml result/errors/webdav*: adding regression - test for this problem. - -Wed Jan 19 17:24:34 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: Corrected targetNamespace in - xmlSchemaElementDump. Cosmetic changes to the dump output. - -Sun Jan 16 21:00:53 CET 2005 Daniel Veillard <daniel@veillard.com> - - * configure.in NEWS doc/*: preparing release of 2.6.17, - updated and rebuilt the docs - -Sun Jan 16 19:58:36 CET 2005 Daniel Veillard <daniel@veillard.com> - - * parser.c: better fix for #151694 not killing c14n regression tests - * xmlschemastypes.c: fixing bug #157653 - -Sun Jan 16 19:01:06 CET 2005 Daniel Veillard <daniel@veillard.com> - - * parser.c: fixing bug #151694, line should always be set in the - elements. - -Sun Jan 16 01:04:18 CET 2005 Daniel Veillard <daniel@veillard.com> - - * xmlschemastypes.c: trying to fix at least the message from - bug #158628 - * include/libxml/xmlsave.h xmlsave.c: added first xmlsave option - for format, c.f. bug #159997 - -Sat Jan 15 18:44:30 CET 2005 Daniel Veillard <daniel@veillard.com> - - * python/libxml.py: make __str__ call serialize() on nodes, c.f. - bug #157872 - -Sat Jan 15 18:18:07 CET 2005 Daniel Veillard <daniel@veillard.com> - - * nanoftp.c: applied patch from Dan McNichol for compilation on AIX - -Sat Jan 15 13:35:19 CET 2005 Daniel Veillard <daniel@veillard.com> - - * relaxng.c: fixed bug #157633 in relaxng choice optimization - * result/relaxng/choice0* test/relaxng/choice0*: added regression - tests about it. - * doc/*: rebuilt - * testdso.c: removed a warning due to a missing void in signature. - -Thu Jan 13 17:42:55 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * include/libxml/schemasInternals.h xmlschemas.c: - Exposed targetNamespace for simple/complex types, model groups, - attribute groups and notations (reported by Michael Hewarth - to the mailing list). Added targetNamespace to xmlSchemaType, - xmlSchemaAttributeGroup and xmlSchemaNotation. - Tiny cosmetic change to the content model error report output. - * result//all_*.err result//any3_0_0.err result//choice_*.err - result//list0_0_1.err result//list0_1_1.err: Adapted output - of regression tests. - -Thu Jan 13 13:20:51 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: Put the fix of Daniel (from Tue Jan 11 14:41:47 CET) - back in, since I missed to update xmlschemas.c before doing - the previous commit. - -Thu Jan 13 12:59:25 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: Integrated xmlRegExecErrInfo and xmlRegExecNextValues - from xmlregexp.c to report expected elements on content model errors. - * all_*.err any3_0_0.err choice_*.err list0_0_1.err list0_1_1.err: - Adapted output of regression tests. - -Thu Jan 13 12:24:09 CET 2005 Daniel Veillard <daniel@veillard.com> - - * config.h.in configure.in xmlmodule.c: trying to work around - the compilation problem on HP-UX - -Wed Jan 12 22:03:33 CET 2005 Daniel Veillard <daniel@veillard.com> - - * pattern.c: fixed the fixed size array structure problem reported by - Patrick Streule - -Wed Jan 12 15:15:02 CET 2005 Daniel Veillard <daniel@veillard.com> - - * elfgcchack.h testapi.c doc/libxml2-api.xml doc/*: regenerated - the API description, rebuilt, improved navigation in documentation - a bit. - -Wed Jan 12 14:17:14 CET 2005 Daniel Veillard <daniel@veillard.com> - - * include/libxml/xmlregexp.h xmlregexp.c: extended xmlRegExecErrInfo() - and xmlRegExecNextValues() to return error transition strings too, - and sink state detection and handling. - -Tue Jan 11 14:41:47 CET 2005 Daniel Veillard <daniel@veillard.com> - - * xmlschemas.c: fixed bug #163641 when the value passed for - an atomic list type is NULL. - -Tue Jan 11 10:14:33 HKT 2005 William Brack <wbrack@mmm.com.hk> - - * Makefile.am configure.in: fixed dependency on python 2.3, - also small improvement for cygwin (bug 163273) - -Sun Jan 9 18:46:32 CET 2005 Daniel Veillard <daniel@veillard.com> - - * gentest.py testapi.c: William noticed I forgot to add special - support for xmlmodules.c define - * xmlregexp.c include/libxml/xmlregexp.h: added terminal to - xmlRegExecErrInfo() API, adding new xmlRegExecNextValues() - entry point and refactored to use both code. - -Mon Jan 10 01:02:41 HKT 2006 William Brack <wbrack@mmm.com.hk> - - * doc/xml.html, doc/FAQ.html: added an FAQ under Developer for - setting up a "private" library (after some list posts about - people having trouble doing it) - -Sat Jan 8 23:04:10 CET 2005 Daniel Veillard <daniel@veillard.com> - - * xmlregexp.c: fixing behaviour for xmlRegExecErrInfo in case of - rollback - -Fri Jan 7 14:54:51 CET 2005 Daniel Veillard <daniel@veillard.com> - - * TODO: small update - * xmlregexp.c: trying to add an API to get useful error information - back from a failing regexp context. - -Thu Jan 6 17:35:41 HKT 2005 William Brack <wbrack@mmm.com.hk> - - * xpath.c: fixed problem with xmlXPathErr when error number - subscript was out of range (bug 163055) - -Thu Jan 6 09:57:03 HKT 2005 William Brack <wbrack@mmm.com.hk> - - * uri.c: fixed problem with xmlURIEscape when query part was - empty (actually fixed xmlURIEscapeStr to return an empty - string rather than NULL for empty string input) (bug 163079) - -Tue Jan 4 17:08:45 PST 2005 Aleksey Sanin <aleksey@aleksey.com> - - * parser.c, parserInternal.c: fixed "col" calculation for - struct _xmlParserInput (based on patch from Rob Richards) - * include/libxml/xmlerror.h, error.c: propagated error column - number in the xmlError structure - -Tue Jan 4 22:47:22 CET 2005 Daniel Veillard <daniel@veillard.com> - - * parser.c: fixed namespace bug in push mode reported by - Rob Richards - * test/ns6 result//ns6*: added it to the regression tests - * xmlmodule.c testModule.c include/libxml/xmlmodule.h: - added an extra option argument to module opening and defined - a couple of flags to the API. - -Tue Jan 4 21:16:05 CET 2005 Daniel Veillard <daniel@veillard.com> - - * xmlmodule.c include/libxml/xmlmodule.h: applied patch from - Bjorn Reese, plus some cleanups - * elfgcchack.h doc/elfgcchack.xsl: fixed the stylesheet to - add the new header - * doc/* testapi.c: regenerated the API - -Tue Jan 4 18:47:19 CET 2005 Daniel Veillard <daniel@veillard.com> - - * configure.in: making DSO support an option - * xmlmodule.c xmlreader.c include/libxml/xmlmodule.h: code - and documentation cleanups - * elfgcchack.h testapi.c doc/*: regenerated the docs and - checks for new module - * test/valid/REC-xml-19980210.xml: fix a small change introduced - previously - -Tue Jan 4 16:07:52 CET 2005 Daniel Veillard <daniel@veillard.com> - - * Makefile.am config.h.in configure.in error.c libxml-2.0.pc.in - testModule.c testdso.c xml2-config.in xmllint.c xmlmodule.c - include/libxml/Makefile.am include/libxml/xmlerror.h - include/libxml/xmlmodule.h include/libxml/xmlversion.h.in - include/libxml/xmlwin32version.h.in: applied DSO support - patch 2 from Joel Reed - -Tue Jan 4 15:30:15 CET 2005 Daniel Veillard <daniel@veillard.com> - - * configure.in: applied patch from Marcin Konicki for BeOS - -Mon Jan 3 13:57:21 PST 2005 Aleksey Sanin <aleksey@aleksey.com> - - * parser.c: added GetLineNumber and GetColumnNumber functions for xmlReader - -Sun Jan 2 17:51:18 HKT 2005 William Brack <wbrack@mmm.com.hk> - - Re-examined the problems of configuring a "minimal" library. - Synchronized the header files with the library code in order - to assure that all the various conditionals (LIBXML_xxxx_ENABLED) - were the same in both. Modified the API database content to more - accurately reflect the conditionals. Enhanced the generation - of that database. Although there was no substantial change to - any of the library code's logic, a large number of files were - modified to achieve the above, and the configuration script - was enhanced to do some automatic enabling of features (e.g. - --with-xinclude forces --with-xpath). Additionally, all the format - errors discovered by apibuild.py were corrected. - * configure.in: enhanced cross-checking of options - * doc/apibuild.py, doc/elfgcchack.xsl, doc/libxml2-refs.xml, - doc/libxml2-api.xml, gentest.py: changed the usage of the - <cond> element in module descriptions - * elfgcchack.h, testapi.c: regenerated with proper conditionals - * HTMLparser.c, SAX.c, globals.c, tree.c, xmlschemas.c, xpath.c, - testSAX.c: cleaned up conditionals - * include/libxml/[SAX.h, SAX2.h, debugXML.h, encoding.h, entities.h, - hash.h, parser.h, parserInternals.h, schemasInternals.h, tree.h, - valid.h, xlink.h, xmlIO.h, xmlautomata.h, xmlreader.h, xpath.h]: - synchronized the conditionals with the corresponding module code - * doc/examples/tree2.c, doc/examples/xpath1.c, doc/examples/xpath2.c: - added additional conditions required for compilation - * doc/*.html, doc/html/*.html: rebuilt the docs - -Sat Dec 25 18:10:02 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * parserInternals.c: fixed to skip (if necessary) the BOM for - encoding 'utf-16'. Completes the fix for bug #152286. - * tree.c, parser.c: minor warning cleanup, no change to logic - -Fri Dec 24 16:31:22 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * python/generator.py: added most required entries to - foreign encoding table, plus some additional logic to - assure only the 1st param uses the 't#' format. Fixes - bug #152286, but may still have some other UTF-16 problems. - -Thu Dec 23 23:44:08 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * Makefile.am, gentest.py: enhanced for enabling build in - a different directory. Added (optional) param to gentest.py - to specify the source directory (bug #155468) - * doc/Makefile.am: changed destination of NEWS from (top_srcdir) - to (top_builddir) (bug #155468) - * python/Makefile.am, python/generator.py: enhanced for enabling - build in a different directory(bug #155468). Added (optional) - param to generator.py to specify the source directory. Added - a new table of functions which have possible "foreign" encodings - (e.g. UTF16), and code to use python 't' format instead of - 'z' format (mostly solving bug #152286, but still need to - populate the table). - -Tue Dec 21 08:10:44 MST 2004 John Fleck <jfleck@inkstain.net> - - * doc/site.xsl, doc/xml.html, plus rebuilt all the html pages - Change reference to new site for Solaris binaries, fixing bug - 160598 - - -Mon Dec 20 08:02:57 PST 2004 William Brack <wbrack@mmm.com.hk> - - * parser.c: reset input->base within xmlStopParser - * xmlstring.c: removed call to xmlUTF8Strlen from within - xmlUTF8Strpos (Bill Moseley pointed out it was not - useful) - -Fri Dec 17 16:03:41 PST 2004 William Brack <wbrack@mmm.com.hk> - - * valid.c: changed xmlErrValidWarning to use ctxt->warning - instead of ctxt->error for its reports (bug #160662) - -Fri Dec 17 14:52:17 PST 2004 William Brack <wbrack@mmm.com.hk> - - * python/generator.py: modified to allow the ns and nsDefs - accessors to return None instead of error when no namespace - is present (bug #) - -Fri Dec 17 11:40:21 PST 2004 William Brack <wbrack@mmm.com.hk> - - * doc/Makefile.am: changed maintainer-clean dependency with - suggestion from Crispin Flowerday (bug #157634) - * debugXML.c: fixed crash when ATTRIBUTE or DOCUMENT nodes - were specified with debugDumpNode (bug #160621) - -Fri Dec 10 11:24:41 CET 2004 Daniel Veillard <daniel@veillard.com> - - * valid.c: fixed ID deallocation problem based on patch from - Steve Shepard fixes bug #160893 - * xmlmemory.c: improving comment. - * testapi.c: new test for xmlDictExists() is generated. - -Wed Dec 1 22:35:37 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * dict.c, xpath.c, include/libxml/hash.h: fixed up some gcc warnings, - no change to logic. New macro XML_CAST_FPTR to circumvent gcc - warnings on function pointer <-> object pointer (a hack). - -Mon Nov 29 14:07:18 CET 2004 Daniel Veillard <daniel@veillard.com> - - * xpath.c: fixed a memory leak on errors in some circumstances #159812 - -Fri Nov 26 23:20:48 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * xmlIO.c: added a check within xmlOutputBufferWriteEscape to prevent - a dead loop on bad data (bug 159550) - -Fri Nov 26 13:09:04 CET 2004 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: Fixed strict/lax element wildcards: the children - of elements for which a declaration existed were still processed - by the wildcard mechanism (reported by philippe ventrillon to the - mailing list). - Changed the import and include mechanism to share dictionaries. - -Fri Nov 26 11:44:36 CET 2004 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c parser.c: make sure xmlCtxtReadFile and htmlCtxtReadFile - go through the catalog resolution. - * gentest.py testapi.c: fix a side effect wrning of the change - -Wed Nov 24 13:41:52 CET 2004 Daniel Veillard <daniel@veillard.com> - - * dict.c include/libxml/dict.h: added xmlDictExists() to the - dictionary interface. - * xmlreader.c: applying xmlTextReaderHasAttributes fix for namespaces - from Rob Richards - -Wed Nov 17 13:54:37 CET 2004 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: tiny enhancement for content model error reports - (#157190, #143948). Removed abbreviations: CT, ST and WC - (#157190, reported by Frans Englich). - Initial: no report of local components. - * result/schemas/all* result/schemas/any3_0_0.err - result/schemas/choice* - result/schemas/cos-st-restricts-1-2-err_0_0.err - result/schemas/derivation-ok-extension-err_0_0.err - result/schemas/derivation-ok-extension_0_0.err - result/schemas/derivation-ok-restriction-2-1-1_0_0.err - result/schemas/derivation-ok-restriction-4-1-err_0_0.err - result/schemas/deter0_0_0.err result/schemas/extension1_0_2.err - result/schemas/facet-unionST-err1_0_0.err - result/schemas/hexbinary_0_1.err - result/schemas/list* result/schemas/restriction-attr1_0_0.err - result/schemas/vdv-first4_0_1.err result/schemas/vdv-first4_0_2.err: - Adapted output. - -Mon Nov 15 13:04:28 CET 2004 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: Moved execution of xmlSchemaCheckDefaults to - xmlSchemaTypeFixup; this ensures facets of inherited types to be - checked prior to facets of derived types - which caused a seg - fault otherwise (bug #158216, reported by Frans Englich). - -Sun Nov 14 22:23:18 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * gentest.py, testapi.c: further enhancement, now all - compilation warnings have been fixed. - * xmlschemastypes.c: added NULL check for one function - -Fri Nov 12 23:58:14 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * xpath.c: trivial change (changed CHECK_CONTEXT to CHECK_CTXT - on a couple of lines) - * gentest.py, testapi.c: enhanced to reduce compilation warnings - -Fri Nov 12 16:12:48 CET 2004 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: Un-commented a TODO in xmlSchemaParseElement. - -Fri Nov 12 14:55:36 CET 2004 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: Correct symbol space for 'all' and 'choice'. - * xmlschemastypes.c include/xmlschemastypes.h: Added 'replace' - normalization for 'normalizedString'. - Added xmlSchemaWhiteSpaceReplace to the API. - -Thu Nov 11 21:43:02 CET 2004 Daniel Veillard <daniel@veillard.com> - - * Makefile.am: forgot a $(srcdir) - * encoding.c: stupid error wrong name #157976 - -Wed Nov 10 15:35:25 CET 2004 Daniel Veillard <daniel@veillard.com> - - * NEWS configure.in doc/*: preparing release of libxml2-2.6.16 - -Wed Nov 10 12:55:18 CET 2004 Daniel Veillard <daniel@veillard.com> - - * python/generator.py python/libxml.c python/libxml2class.txt - python/libxml_wrap.h python/types.c: Applied patch from Brent - Hendricks adding support for late DTD validation. - * python/tests/Makefile.am python/tests/dtdvalid.py - python/tests/test.dtd: integrated the provided regression test - -Tue nov 9 19:24:31 CET 2004 Dodji Seketeli <dodji@seketeli.org> - - * configure.in: detect when struct sockaddr_storage - has the __ss_family member instead of ss_family and - behave accordingly. We now can use ipv6 on aix. - -Tue Nov 9 17:15:46 CET 2004 Daniel Veillard <daniel@veillard.com> - - * Makefile.am gentest.py testapi.c: integrated in "make tests" - added -q option, and more conditional features fixes - * catalog.c debugXML.c parser.c testThreads.c xmllint.c - xmlschemastypes.c xmlwriter.cinclude/libxml/catalog.h - include/libxml/debugXML.h: various compilation and conditional - cleanups. - * doc/*: regenerated - -Tue Nov 9 15:59:50 CET 2004 Daniel Veillard <daniel@veillard.com> - - * gentest.py testapi.c: better handling of conditional features - * HTMLparser.c SAX2.c parserInternals.c xmlwriter.c: more testing - on parser contexts closed leaks, error messages - -Tue Nov 9 10:21:37 GMT 2004 William Brack <wbrack@mmm.com.hk> - - * xpath.c: fixed problem concerning XPath context corruption - during function argument evaluation (bug 157652) - -Mon Nov 8 18:54:52 CET 2004 Daniel Veillard <daniel@veillard.com> - - * testapi.c: more types. - * parserInternals.c xpath.c: more fixes - -Mon Nov 8 18:16:43 CET 2004 Daniel Veillard <daniel@veillard.com> - - * gentest.py testapi.c: better parser options coverage - * SAX2.c xpath.c: more cleanups. - -Tue Nov 9 01:50:08 CET 2004 Daniel Veillard <daniel@veillard.com> - - * testapi.c: trying to fix some optional support brokenness - -Mon Nov 8 17:25:27 CET 2004 Daniel Veillard <daniel@veillard.com> - - * gentest.py testapi.c: more coverage - * debugXML.c parser.c xmlregexp.c xpath.c: more fixes - -Mon Nov 8 15:02:39 CET 2004 Daniel Veillard <daniel@veillard.com> - - * gentest.py testapi.c: more coverage - * SAX2.c parser.c parserInternals.c: more fixes - -Mon Nov 8 12:55:16 CET 2004 Daniel Veillard <daniel@veillard.com> - - * parser.c testapi.c xmlIO.c xmlstring.c: more fixes. - -Mon Nov 8 11:24:57 CET 2004 Daniel Veillard <daniel@veillard.com> - - * gentest.py testapi.c: more types, more coverage - * parser.c parserInternals.c relaxng.c valid.c xmlIO.c - xmlschemastypes.c: more problems fixed - -Mon Nov 8 10:24:28 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * gentest.py: fixed test file corruption problem - -Sun Nov 7 13:18:05 CET 2004 Daniel Veillard <daniel@veillard.com> - - * gentest.py testapi.c: fixed typos and avoid Catalogs verbosity - -Sat Nov 6 23:25:16 CET 2004 Daniel Veillard <daniel@veillard.com> - - * testapi.c: augmented the number of types - -Sat Nov 6 20:24:07 CET 2004 Daniel Veillard <daniel@veillard.com> - - * HTMLtree.c tree.c xmlreader.c xmlwriter.c: a number of new - bug fixes and documentation updates. - -Sat Nov 6 15:50:11 CET 2004 Daniel Veillard <daniel@veillard.com> - - * gentest.py testapi.c: augmented type autogeneration for enums - * xpath.c include/libxml/xpath.h: removed direct error reporting. - -Sat Nov 6 14:27:18 CET 2004 Daniel Veillard <daniel@veillard.com> - - * encoding.c: fixed a regression in iconv support. - -Fri Nov 5 18:19:23 CET 2004 Daniel Veillard <daniel@veillard.com> - - * gentest.py testapi.c: autogenerate a minimal NULL value sequence - for unknown pointer types - * HTMLparser.c SAX2.c chvalid.c encoding.c entities.c parser.c - parserInternals.c relaxng.c valid.c xmlIO.c xmlreader.c - xmlsave.c xmlschemas.c xmlschemastypes.c xmlstring.c xpath.c - xpointer.c: This uncovered an impressive amount of entry points - not checking for NULL pointers when they ought to, closing all - the open gaps. - -Fri Nov 5 16:26:28 UTC 2004 William Brack <wbrack@mmm.com.hk> - - * catalog.c: fixed problem with NULL entry (bug 157407) - * xpath.c: fixed a couple of warnings (no change to logic) - -Fri Nov 5 15:30:43 CET 2004 Daniel Veillard <daniel@veillard.com> - - * gentest.py testapi.c: more coverage - * xmlunicode.c: one fix - -Fri Nov 5 23:15:51 CET 2004 Daniel Veillard <daniel@veillard.com> - - * entities.c: fixed a compilation problem on a recent change - -Fri Nov 5 12:50:09 CET 2004 Daniel Veillard <daniel@veillard.com> - - * gentest.py testapi.c: more coverage - * nanoftp.c tree.c: more fixes - -Fri Nov 5 11:02:28 CET 2004 Daniel Veillard <daniel@veillard.com> - - * gentest.py testapi.c: fixed the way the generator works, - extended the testing, especially with more real trees and nodes. - * HTMLtree.c tree.c valid.c xinclude.c xmlIO.c xmlsave.c: a bunch - of real problems found and fixed. - * entities.c: fix error reporting to go through the new handlers - -Thu Nov 4 18:44:56 CET 2004 Daniel Veillard <daniel@veillard.com> - - * parser.c: dohh ... stupid change killing xmlParseDoc() - -Thu Nov 4 18:32:22 CET 2004 Daniel Veillard <daniel@veillard.com> - - * gentest.py testapi.c: changing the way the .c is generated, - extending the tests coverage - * include/libxml/nanoftp.h nanoftp.c elfgcchack.h doc/*: fixing some - function signatures, regenerating stuff - * SAX2.c parser.c xmlIO.c: another set of bug fixes and API hardening - -Thu Nov 4 13:32:19 CET 2004 Daniel Veillard <daniel@veillard.com> - - * gentest.py testapi.c: extending the tests coverage - -Thu Nov 4 11:52:28 CET 2004 Daniel Veillard <daniel@veillard.com> - - * Makefile.am: gentest.py was missing from the EXTRA_DIST - -Thu Nov 4 11:48:47 CET 2004 Daniel Veillard <daniel@veillard.com> - - * gentest.py testapi.c: extending the tests coverage - * HTMLtree.c tree.c xmlsave.c xpointer.c: more fixes and cleanups - -Thu Nov 4 00:25:36 CET 2004 Daniel Veillard <daniel@veillard.com> - - * gentest.py testapi.c: more fixes and extending the tests coverage - * nanoftp.c xmlIO.c: more fixes and hardening - -Wed Nov 3 20:16:24 CET 2004 Daniel Veillard <daniel@veillard.com> - - * gentest.py testapi.c: more fixes and extending the tests coverage - * valid.c: bunch of cleanups and 2 leaks removed - -Wed Nov 3 18:06:44 CET 2004 Daniel Veillard <daniel@veillard.com> - - * gentest.py testapi.c: more fixes and extending the tests coverage - * list.c tree.c: more fixes and hardening - -Wed Nov 3 15:19:22 CET 2004 Daniel Veillard <daniel@veillard.com> - - * gentest.py testapi.c: more fixes and extending the tests coverage - * relaxng.c include/libxml/relaxng.h: adding a type init interface - * include/libxml/xmlerror.h parser.c xmlreader.c xmlwriter.c: more - cleanups and bug fixes raised by the regression tests - -Wed Nov 3 12:49:30 CET 2004 Daniel Veillard <daniel@veillard.com> - - * gentest.py testapi.c: more fixes and extending the tests coverage - * xmlwriter.c list.c: more hardeing of APIs - * doc/apibuild.py: skip testapi.c when scanning the C files. - -Tue Nov 2 23:09:06 CET 2004 Daniel Veillard <daniel@veillard.com> - - * gentest.py testapi.c: more testing and coverage - * elfgcchack.h xmlstring.c include/libxml/xmlstring.h: more cleanups - * doc/*: rebuilt - -Tue Nov 2 19:44:32 CET 2004 Daniel Veillard <daniel@veillard.com> - - * gentest.py testapi.c: more developments on the API testing - * HTMLparser.c tree.c: more cleanups - * doc/*: rebuilt - -Tue Nov 2 15:49:34 CET 2004 Daniel Veillard <daniel@veillard.com> - - * xmlmemory.c include/libxml/xmlmemory.h: adding xmlMemBlocks() - * Makefile.am gentest.py testapi.c: work on generator of an - automatic API regression test tool. - * SAX2.c nanoftp.c parser.c parserInternals.c tree.c xmlIO.c - xmlstring.c: various API hardeing changes as a result of running - the first set of automatic API regression tests. - * test/slashdot16.xml: apparently missing from CVS, committed it - -Mon Nov 1 15:54:18 CET 2004 Daniel Veillard <daniel@veillard.com> - - * xpath.c: fixed an UTF-8 parsing bug reported by Markus Bertheau - on #fedora-devel - -Sun Oct 31 22:03:38 CET 2004 Daniel Veillard <daniel@veillard.com> - - * parser.c: fixed a bug reported by Petr Pajas on the list and - affecting XML::Libxml - -Sun Oct 31 16:33:54 CET 2004 Daniel Veillard <daniel@veillard.com> - - * encoding.c doc/examples/testWriter.c: Fixed bug #153937, making - sure the conversion functions return the number of byte written. - Had to fix one of the examples. - -Fri Oct 29 14:16:56 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * doc/xmllint.1 doc/xmllint.xml: indicate - means stdin closing #156626 - -Fri Oct 29 14:03:36 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * python/libxml.c: register xmlSchemaSetValidErrors, patch from - Brent Hendricks in the mailing-list - * include/libxml/valid.h HTMLparser.c SAX2.c valid.c - parserInternals.c: fix #156626 and more generally how to find out - if a validation contect is part of a parsing context or not. This - can probably be improved to make 100% sure that vctxt->userData - is the parser context too. It's a bit hairy because we can't - change the xmlValidCtxt structure without breaking the ABI since - this change xmlParserCtxt information indexes. - -Wed Oct 27 19:26:20 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * ChangeLog NEWS configure.in doc/*: preparing release 2.6.15 - * debugXML.c nanoftp.c xmlschemas.c xmlschemastypes.c: cleanups - -Wed Oct 27 09:31:24 PDT 2004 William Brack <wbrack@mmm.com.hk> - - * uri.c: fixed a stupid mistake in xmlBuildRelativeURI - (bug 156527) - -Wed Oct 27 11:44:35 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * nanoftp.c nanohttp.c: second part of the security fix for - xmlNanoFTPConnect() and xmlNanoHTTPConnectHost(). - -Tue Oct 26 23:57:02 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * nanoftp.c: applied fixes for a couple of potential security problems - * tree.c valid.c xmllint.c: more fixes on the string interning checks - -Tue Oct 26 18:09:59 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * debugXML.c include/libxml/xmlerror.h: added checking for names - values and dictionaries generates a tons of errors - * SAX2.ccatalog.c parser.c relaxng.c tree.c xinclude.c xmlwriter.c - include/libxml/tree.h: fixing the errors in the regression tests - -Mon Oct 25 16:04:22 PDT 2004 William Brack <wbrack@mmm.com.hk> - - * parser.c: modified the handling of _private for entity - expansion (bug 155816) - -Mon Oct 25 17:11:37 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * parser.c: fixed the leak reported by Volker Roth on the list - * test/ent10 result//ent10*: added a specific test for the problem - -Sat Oct 23 11:07:41 PDT 2004 William Brack <wbrack@mmm.com.hk> - - * valid.c: unlinked the internal subset within xmlValidateDtd - (bug 141827) - * configure.in: added -Wall to developer's flags - * doc/examples/reader4.res: added to CVS - -Fri Oct 22 16:36:50 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: added support for HTML PIs #156087 - * test/HTML/python.html result/HTML/python.html*: added specific tests - -Fri Oct 22 15:20:23 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * threads.c: fixed nasty bug #156087 - -Fri Oct 22 21:04:20 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * python/libxml.c: fixed a problem occurring only in x86_64 when - very large error messages are raised to the Python handlers. - -Thu Oct 21 18:03:21 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * xmlschemas.c: fixed a memory bug - * doc/examples/reader4.c doc/examples/*: added test from Graham Bennett - and regenerated the directory - -Tue Oct 19 11:06:39 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * include/libxml/xmlreader.h xmlreader.c: applied patch from - Graham Bennett adding 4 convenience functions to the reader API. - -Fri Oct 15 11:22:48 PDT 2004 William Brack <wbrack@mmm.com.hk> - - * debugXML.c: excluded a few nodes (with no content) from the - string check routine. - -Fri Oct 15 10:48:30 EDT 2004 Daniel Veillard <daniel@veillard.com> - - * debugXML.c include/libxml/xmlerror.h: added UTF-8 string checking, - raise a problem, need debug - -Wed Oct 13 02:17:36 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * python/Makefile.am: applied patch from Thomas Fitzsimmons fixing - #155240 building outside the source tree. but make tests fails. - -Mon Oct 11 16:26:51 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * debugXML.c include/libxml/xmlerror.h: added namespace checking - -Sat Oct 9 22:36:21 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * debugXML.c: some framework preparation to add namespace checkings - -Thu Oct 7 15:12:58 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * debugXML.c include/libxml/debugXML.h include/libxml/xmlerror.h: - adding the tree debug mode - * parser.c relaxng.c tree.c xpath.c: fixing various problems reported - by the debug mode. - * SAX2.c: another tree fix from Rob Richards - -Wed Oct 6 10:50:03 PDT 2004 William Brack <wbrack@mmm.com.hk> - - * catalog.c: small change to last fix, to get xml:base right - -Wed Oct 6 09:33:51 PDT 2004 William Brack <wbrack@mmm.com.hk> - - * catalog.c: added code to handle <group>, including dumping - to output (bug 151924). - * xmlcatalog.c, xmlstring.c, parser.c: minor compiler warning - cleanup (no change to logic) - -Mon Oct 4 16:09:07 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * configure.in debugXML.c include/libxml/xmlversion.h.in - include/libxml/xmlwin32version.h.in: revamped the XML debugging - module and prepare for a new checking mode - -Mon Oct 4 13:53:24 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * parser.c: applied patch from Malcolm Tredinnick fixing bug #152426 - -Mon Oct 4 12:26:28 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * python/generator.py python/libxml.c python/tests/outbuf.py: - applied patch from Malcolm Tredinnick fixing bug #154294 - related to saving to python file objects. - -Sat Oct 2 21:08:51 PDT 2004 William Brack <wbrack@mmm.com.hk> - - * tree.c: changed xmlHasNsProp to properly handle a request for - the default namespace (bug 153557) - -Sat Oct 2 18:18:27 PDT 2004 William Brack <wbrack@mmm.com.hk> - - * parser.c: fixed problem with dictionary handling within - xmlParseInNodeContext (bug 153175) - -Sat Oct 2 15:46:37 PDT 2004 William Brack <wbrack@mmm.com.hk> - - * check-relaxng-test-suite.py, check-relaxng-test-suite2.py, - check-xinclude-test-suite.py, check-xml-test-suite.py, - check-xsddata-test-suite.py, doc/examples/index.py: changed - changed sys.path setting from 'append' to 'insert' (patch - supplied by Malcolm Tredinnick) (bug 153716) - -Sat Oct 2 15:03:14 PDT 2004 William Brack <wbrack@mmm.com.hk> - - * include/libxml/parserInternals.h: added two new macros - IS_ASCII_LETTER and IS_ASCII_DIGIT used with (html) - parsing and xpath for testing data not necessarily - unicode. - * HTMLparser.c, xpath.c: changed use of IS_LETTER_CH and - IS_DIGIT_CH macros to ascii versions (bug 153936). - -Fri Oct 1 20:37:25 PDT 2004 William Brack <wbrack@mmm.com.hk> - - * error.c: added some coding to attempt to display which file - contains an error when using XInclude (bug 152623) - -Thu Sep 30 11:19:17 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * configure.in: stupid cut'n paste bug in xmllint detection - -Wed Sep 29 17:47:56 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * configure.in doc/*: releasing 2.6.14, rebuilding the docs - -Wed Sep 29 15:00:11 CEST 2004 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c include/libxml/xmlerror.h include/libxml/xmlschemas.h - include/libxml/schemasInternals.h: Parsing of <complexContent> - - handle attribute 'mixed', catch illegal attributes. - Parsing of <complexType> - handle attributes 'abstract', - 'final' and 'block', catch illegal attributes. - Validation of complex types - handle abstract types. - Added handling of default/fixed attributes and element values. - Per validation option attribute nodes/text nodes are created - on the instance. - Added the corresponding constraints for fixed/default. - Added xmlSchemaSetValidOptions, xmlSchemaGetValidOptions - to the external API. - Extended element declaration constraints. - Got rid of perseverative creation of temporery validation/parser - contexts. - Added handling of xsi:schemaLocation and - xsi:noNamespaceSchemaLocation. - Fixed xsi:type component resolution if using non-prefixed - QNames. - * xmlregexp.c xmlschemas.c include/libxml/xmlautomata.h: - Enabled namespace awareness of the content model if using the - model group "all". - * test/schemas/bug152470_1.xsd: Removed an "abstract" attribute, - which broke the test. - * xstc/xstc.py: Workaround to accommodate case insensitive - test definitions in ms-test.def.xml (was missing in a previous - commit). - -Wed Sep 29 11:03:10 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * python/drv_libxml2.py: another patch from Malcolm Tredinnick - adding option not to load dtd from the drv_libxml2.py module - #134633 - -Tue Sep 28 14:30:22 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * acconfig.h config.h.in configure.in xmlIO.c xmlregexp.c xmlschemas.c - xmlschemastypes.c: another patch from Malcolm Tredinnick fixing - warning generated by the Nonstop Kernel Open System Services - compiler #151710 - -Tue Sep 28 13:07:37 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * python/libxml.py: applied patch from Malcolm Tredinnick fixing - python exception hierarchy #139824 - -Sun Sep 26 16:40:24 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * valid.c TODO: applied patch from Malcolm Tredinnick fixing errata - E20 concerning NMTOKENS and co. validation #153722 - * result/VC/AttributeNmtokens test/VC/AttributeNmtokens - test/VCM/AttributeNmtokens.xml: also added tests from Malcolm - -Sun Sep 26 16:24:44 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * xstc/xstc.py: applied patch from Malcolm Tredinnick fixing space/tabs - #153713 - * xpath.c: fixed a realloc potential problem - -Fri Sep 24 16:14:12 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * Makefile.am: fixed make valgrind xstc - -Thu Sep 23 18:23:46 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * xmlschemastypes.c: fixing an out of bound addressing issue - -Thu Sep 23 15:14:12 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c parser.c relaxng.c xmlschemas.c: more memory related - code cleanups. - -Thu Sep 23 01:04:30 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * parser.c: fixed a bunch of errors when realloc failed. - -Wed Sep 22 23:56:05 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * threads.c uri.c: couple of memory fixes from Mark Vakoc reported - by Purify on Windows. - -Mon Sep 20 22:01:47 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * xmllint.c: added --timing --copy timing for the copy - * vms/build_libxml.com: applied patch from Craig Berry - to build with recent releases - -Fri Sep 17 21:25:33 PDT 2004 William Brack <wbrack@mmm.com.hk> - - * nanohttp.c, include/libxml/nanohttp.h: added the routine - xmlNanoHTTPContentLength to the external API (bug151968). - * parser.c: fixed unnecessary internal error message (bug152060); - also changed call to strncmp over to xmlStrncmp. - * encoding.c: fixed compilation warning (bug152307). - * tree.c: fixed segfault in xmlCopyPropList (bug152368); fixed - a couple of compilation warnings. - * HTMLtree.c, debugXML.c, xmlmemory.c: fixed a few compilation - warnings; no change to logic. - -Fri Sep 17 10:40:23 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * parser.c: removed some extern before function code reported by - Kjartan Maraas on IRC - * legacy.c: fixed compiling when configuring out the HTML parser - * Makefile.am: added a declaration for CVS_EXTRA_DIST - * HTMLparser.c: beginning of an attempt at cleaning up the construction - of the HTML parser data structures, current data generate a huge - amount of ELF relocations at loading time. - -Fri Sep 17 10:36:23 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * ChangeLog: applied fix from Stepan Kasal to fix duplication - in the change log and cleanup of space/tabs issues. - -Thu Sep 16 13:24:27 CEST 2004 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c include/libxml/schemasInternals.h - test/schemas/bug152470_1.* result/schemas/bug152470_1_1*: - Simplified attribute wildcard creation and assignment to get rid - of memory leaks. - Restructured the validation process. - Restructured and expanded parsing of <attributeGroup>. - Added initial handing of xsi:type. - Advanced handling of xsi:nil (should work now for simple types). - Added construction of schemata using xsi:schemaLocation and - xsi:noNamespaceSchemaLocation; this is not enabled, since - no corresponding API exists yet. - Moved the content model to complex type components. - Resolution of types for attributes will look for simple types - only (incl. all the built-in simple types). - Extended parsing of 'anyAttribute'. - Fixed content-type type for complex types if derived from - 'anyType' using the short-hand form (see bug # 152470, - submitted by Thilo Jeremias). - * include/libxml/xmlschematypes.h: Cleaned up some comments. - * xstc/xstc.py: Workaround to accommodate case insensitive - test definitions in ms-test.def.xml. - * result/schemas/deter0_0_0.err result/schemas/ns0_0_2.err - result/schemas/ns0_1_2.err: Adapted. - -Sat Sep 11 09:04:22 PDT 2004 William Brack <wbrack@mmm.com.hk> - - * xmlwriter.c: changed char array initialisation to avoid a - complaint from some compiler(s) (bug 152308) - -Thu Sep 9 07:22:11 PDT 2004 William Brack <wbrack@mmm.com.hk> - - * encoding.c: applied fixes for the UTF8ToISO8859x transcoding - routine suggested by Mark Itzcovitz - -Wed Sep 8 22:50:27 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * valid.c xmlsave.c: fixed 2 problems raised by #152140, one - which is that notation not in the internal subset should - not be saved, and the second more nasty on an error saving - NOTATIONs, if there is a proof that nobody uses notations ! - -Wed Sep 8 11:04:27 CEST 2004 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c include/libxml/xmlschemas.h: Added the function - xmlSchemaValidateOneElement to the XML Schema validation API, - as proposed by Jeffrey Fink - see bug # 152073. - -Tue Sep 7 11:10:36 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * configure.in doc/Makefile.am xstc/Makefile.am: some cleanup - checking for xmllint and xsltproc in configure.in, fixed - make dist w.r.t. the new xstc subdir. - * doc/*: rebuilt - -Mon Sep 6 16:42:59 CEST 2004 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xstc/xstc.py: Changed to finally validate instance documents. - -Mon Sep 6 16:04:01 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * xstc/Makefile.am Makefile.am: integrated to "make valgrind", - heavy ... weight 250MB of VM ! - -Mon Sep 6 14:54:39 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * xstc/Makefile.am xstc/xstc-to-python.xsl xstc/xstc.py Makefile.am: - more cleanup in integrating the xstc testsuite - -Mon Sep 6 13:56:28 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * Makefile.am configure.in xstc/.cvsignore xstc/Makefile.am: - starting to integrate the xstc suite in the normal regression - tests - -Mon Sep 6 13:14:11 CEST 2004 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xstc/sun-test-def.xml: The "tsDir" attribute was not - set correctly. - -Mon Sep 6 11:52:50 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * check-xinclude-test-suite.py: when output and expected do not match - exactly run diff to put the differences in the log c.f. #148691 - -Mon Sep 6 11:17:35 CEST 2004 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xstc/xstc-to-python.xslt xstc/ms-test-def.xml xstc/nist-test-def.xml - xstc/sun-test-def.xml: Initial release of generation files to - create python test scripts, which will run the W3C XML Schema Test - Collection. The ms-test-def.xml and sun-test-def.xml files - were extracted from the online HTML XSTC results [1], since they did - not exist for the SUN tests, and only partially did exist for the - MS tests. The NIST definition file was created by concatenation - of the existing definition files for each single datatype. - The stylesheet "xstc-to-python.xslt" should be run against the - definition files to produce the python scripts. - [1] "http://www.w3.org/XML/2001/05/xmlschema-test-collection/ - results-master.html" - -Fri Sep 3 20:29:59 CEST 2004 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c include/libxml/schemasInternals.h - include/libxml/xmlerror.h: Fixed a seg fault in xmlGetQNameProp: - a format argument was missing. - Fixed wrong assignment of the owner of a wildcard in - xmlSchemaBuildAttributeValidation (in the shorthandform of - <complexType>; this caused a seg fault, due to a double-free - of the wildcard. - Added a check for circular attribute group references. - Added a check for circular model group definition references. - Fixed a duplicate xmlParserErrors enum value - see bug #151738. - -Fri Sep 3 10:08:13 PDT 2004 William Brack <wbrack@mmmm.com.hk> - - * xmlstring.c: modified comments on xmlGetUTF8Char in - response to bug 151760 (no change to logic) - -Tue Aug 31 09:46:18 PDT 2004 William Brack <wbrack@mmm.com.hk> - - * xmlstring.c: fixed error reported on the list caused by - my last change - -Tue Aug 31 15:41:52 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * NEWS configure.in doc/*: release of libxml2-2.6.13 - -Tue Aug 31 14:14:30 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * xmlIO.c: fixing #151456, an encoding error could generate - a serialization loop. - -Tue Aug 31 11:34:04 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * Makefile.am: also produce a tar ball with just the sources - * xmllint.c: added --path option and --load-trace options to - xmllint, RFE #147740 based on xsltproc versions - * doc/xmllint.* doc/*: updated the man page and rebuilt - -Tue Aug 31 10:37:23 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * xmlschemastypes.c: "" is a valid hexbinary string dixit xmlschema-dev - * result/schemas/hexbinary_0_1.err test/schemas/hexbinary_1.xml: - update the test. - * test/ns5 result//ns5*: added a test for the namespace bug fixed - in previous commit. - * Makefile.am: added a message in the regression tests - -Mon Aug 30 23:36:21 PDT 2004 William Brack <wbrack@mmm.com.hk> - - * SAX2.c: fixed bug introduced during OOM fixup causing problems - with default namespace when a named prefix with the same href - was present (reported on the mailing list by Karl Eichwalder. - * xmlstring.c: modified xmlCheckUTF8 with suggested code from - Julius Mittenzwei. - * dict.c: added a typecast to try to avoid problem reported by - Pascal Rodes. - -Mon Aug 30 12:45:46 CEST 2004 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: Fixed a bug in xmlSchemasCheckFacet, which did - not create a computed value on a facet and thus crashed during - validation of instances. - Expanded validity checks for min/maxOccurs attributes. - Expanded validity checks for the value of the attribute "form". - -Fri Aug 27 18:32:24 PST 2004 William Brack <wbrack@mmm.com.hk> - - * xmlstring.c: fixed a problem with xmlCheckUTF8 reported on the - mailing list by Julius Mittenzwei - -Fri Aug 27 00:13:39 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * libxml.spec.in: added BuildRequires: zlib-devel, fixes - Red Hat bug #124942 - -Thu Aug 26 12:27:23 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * parser.c: remove a warning on Solaris - * xmlschemastype.c: fix a crashing bug #151111 - -Wed Aug 25 22:20:18 CEST 2004 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * test/schemas/import-bad-1_0.imp: Added missing test file. - * xmlschemas.c include/libxml/xmlerror.h include/libxml/xmlschemas.h: - Substituted the obsolete xmlSchemaValidError(s) for xmlParserErrors - - see #150840. - Changed the import of schemas to allow failure of location - of a resource to be imported. - * result/schemas/all_* result/schemas/any3_0_0.err - result/schemas/choice_* result/schemas/import1_0_0.err - result/schemas/list0_0_1.err result/schemas/list0_1_0.err - result/schemas/list0_1_1.err result/schemas/ns0_0_2.err - result/schemas/ns0_1_2.err: Adapted regression test results. - -Tue Aug 24 20:49:15 MDT 2004 John Fleck <jfleck@inkstain.net> - - * doc/tutorial/xmltutorial.xml, xmltutorial.pdf, *.html - fix Xpath memory leak (thanks to sKaBoy and William Brack) - -Tue Aug 24 21:10:59 CEST 2004 Igor Zlatkovic <igor@zlatkovic.com> - - * parser.c: fixed path problem in DTD loading reported by - Sameer Abhinkar - -Tue Aug 24 16:40:51 CEST 2004 Igor Zlatkovic <igor@zlatkovic.com> - - * win32/configure.js: added support for version extra - * win32/Makefile.*: upgraded to zlib 1.2.1 - -Mon Aug 23 14:33:54 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * configure.in: removing -O -g from default gcc flags #150828 - -Sun Aug 22 16:26:46 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * configure.in doc/* NEWS: preparing 2.6.12 release, updated and - and rebuilt the docs. - -Sun Aug 22 16:07:20 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * python/libxml.c: fix a problem on last commit - -Sun Aug 22 15:16:53 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * xmllint.c xpath.c include/libxml/xpath.h - include/libxml/xpathInternals.h python/libxml.c - python/libxml_wrap.h: trying to remove some warning when compiling - on Fedora Core 3 and 64bits - -Sat Aug 21 0:035:10 CET 2004 Kasimier Buchcik <libxml2-cvs@cazic.net> - - * xmlschemas.c: modified parsing of <list>, <union>, <restriction>, - <sequence>, <choice>, <include>, <import>. - Fixed schema defaults (elementFormDefault, etc.) for included - schemas. - Fixed a bug which reported attributes as invalid on - elements declarations with the built-in type 'anyType'. - Added "lax" validation of the content of elements of type - 'anyType'. - Fixed: element declarations with the same name were treated - as duplicate if located in the subtree of <choice> -> <sequence>. - (This was bug 150623, submitted by Roland Lezuo) - Fixed cleanup of error codes in xmlSchemaValidateDoc as proposed - by Igor Kapitanker. (This was bug 150647, submitted by Igor - Kapitanker) - * xmlschemastypes.c: Changed the type of anyType to - XML_SCHEMAS_ANYTYPE. - * include/libxml/xmlerror.h: Added schema parser errors. - * result/schemas/bug145246_0_0* - result/schemas/extension1_0_2.err: Changed test results. - * result/schemas/ct-sc-nobase_0_0* - result/schemas/facet-whiteSpace_0_0* - result/schemas/import1_0_0* result/schemas/import2_0_0* - result/schemas/include2_0_0* result/schemas/include3_0_0* - result/schemas/restriction-attr1_0_0* - result/schemas/seq-dubl-elem1_0_0* - result/schemas/xsd-list-itemType_0_0*: Added new rest results. - test/schemas/bug145246.xsd.imp test/schemas/ct-sc-nobase_0* - test/schemas/facet-whiteSpace_0* test/schemas/import1_0* - test/schemas/import2_0* test/schemas/include2_0* - test/schemas/include3_0* test/schemas/restriction-attr1_0* - test/schemas/seq-dubl-elem1_0* test/schemas/xml.xsd - test/schemas/xsd-list-itemType_0*: Added new tests and missing - files. - -Fri Aug 20 18:51:36 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * Makefile.am configure.in: a bit of cleanup and a extra variable for - CVS dist - -Thu Aug 19 07:44:07 MDT 2004 John Fleck <jfleck@inkstain.net> - - * doc/xmllint.xml, xmllint.1, xmllint.html: - Edit and rebuild the man pages with Daniel's C14 update - -Wed Aug 18 19:15:27 PDT 2004 William Brack <wbrack@mmm.com.hk> - - * parser.c: fixed missing line numbers on entity as reported - on the list by Steve Cheng - -Wed Aug 18 14:04:31 PDT 2004 William Brack <wbrack@mmm.com.hk> - - * configure.in globals.c include/libxml/xmlversion.h.in - include/libxml/xmlwin32version.h.in: added some code to - include the CVS ChangeLog version in the xmlParserVersion - string (printed by xmllint with --version) - -Wed Aug 18 11:14:06 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * xmlschemas.c include/libxml/xmlschemas.h python/generator.py - python/libxml.c python/libxml_wrap.h python/types.c - python/tests/schema.py python/tests/Makefile.am: Applied patch - from Torkel Lyng to add Schemas support to the Python bindings - and extend the schemas error API, registered a new test. - * doc/* elfgcchack.h: rebuilt to regenerate the bindings - -Mon Aug 16 14:36:25 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * debugXML.c: added help for new set shell command - * xinclude.c xmllint.c xmlreader.c include/libxml/parser.h: - added parser option to not generate XInclude start/end nodes, - added a specific option to xmllint to test it fixes #130769 - * Makefile.am: regression test the new feature - * doc/xmllint.1 doc/xmllint.xml: updated man page to document option. - -Mon Aug 16 02:42:30 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * xmlIO.c: small typo pointed out by Mike Hommey - * doc/xmllint.xml, xmllint.html, xmllint.1: slightly improved - the --c14n description, c.f. #144675 . - * nanohttp.c nanoftp.c: applied a first simple patch from - Mike Hommey for $no_proxy, c.f. #133470 - * parserInternals.c include/libxml/parserInternals.h - include/libxml/xmlerror.h: cleanup to avoid 'error' identifier - in includes #137414 - * parser.c SAX2.c debugXML.c include/libxml/parser.h: - first version of the implementation of parsing within - the context of a node in the tree #142359, new function - xmlParseInNodeContext(), added support at the xmllint --shell - level as the "set" function - * test/scripts/set* result/scripts/* Makefile.am: extended - the script based regression tests to instrument the new function. - -Sat Aug 14 18:53:08 MDT 2004 John Fleck <jfleck@inkstain.net> - - * doc/xmllint.xml, xmllint.html, xmllint.1: - add c14n to man page (man, it's hard to keep up with - Daniel!) - -Sat Aug 14 18:45:38 MDT 2004 John Fleck <jfleck@inkstain.net> - - * doc/xmllint.xml, xmllint.html, xmllint.1: - add pattern, walker, maxmem, output and xmlout to man page - fixes #144675 - -Sun Aug 15 00:41:12 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * xmllint.c: added a --c14n option to canonicalize the output - should close the RFE #143226 - -Sat Aug 14 23:50:10 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * tree.c: Dodji pointed out a bug in xmlGetNodePath() - * xmlcatalog.c: applied patch from Albert Chin to add a - --no-super-update option to xmlcatalog see #145461 - and another patch also from Albert Chin to not crash - on -sgml --del without args see #145462 - * Makefile.am: applied another patch from Albert Chin to - fix a problem with diff on Solaris #145511 - * xmlstring.c: fix xmlCheckUTF8() according to the suggestion - in bug #148115 - * python/libxml.py: apply fix from Marc-Antoine Parent about - the errors in libxml(2).py on the node wrapper #135547 - -Sat Aug 14 13:18:57 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * Makefile.am: added a dumb rule to able to compile tst.c - when people submit a sample test program - * xmlschemas.c: applied small patch from Eric Haszlakiewicz - to document xmlSchemasSetValidErrors() limitations, #141827 - * error.c: Add information in generic and structured error - setter functions that this need to be done per thread #144308 - * xmlsave.c: fixed bug with missing NOTATION(s) serialization - bug #144162 - * doc/xmllint.xml: typo fix #144840 - -Tue Aug 10 07:19:31 PDT 2004 Daniel Veillard <daniel@veillard.com> - - * configure.in xmlregexp.c xmlschemas.c xmlschemastypes.c - include/libxml/schemasInternals.h include/libxml/xmlerror.h - include/libxml/xmlschemastypes.h: applied Schemas patches - from Kasimier Buchcik - * test/ result/ bug141333* annot-err* any[1-4]* bug145246* - element-err* element-minmax-err* include1* restrict-CT-attr-ref*: - lot of new tests for things fixed by the patch - -Fri Aug 6 09:22:34 PDT 2004 William Brack <wbrack@mmm.com.hk> - - * valid.c: fixed my mis-handling of External ID on last - change. - -Wed Aug 4 23:40:21 PDT 2004 William Brack <wbrack@mmm.com.hk> - - * valid.c: changed the parsing of a document's DTD to use - the proper base path (bug 144366) - -Wed Aug 4 16:58:08 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * Makefile.am config.h.in configure.in python/Makefile.am: - applied a patch from Gerrit P. Haase to get python bindings - on Cygwin - -Tue Aug 3 15:08:22 PDT 2004 William Brack <wbrack@mmm.com.hk> - - * include/libxml/valid.h: elaborated on description of - xmlValidityWarningFunc and xmlValidityErrorFunc (bug - 144760) - * xmlIO.c, xmlschemastypes.c, include/libxml/schemasinternals.h: - minor fixes to comments for doc rebuilding errors. - * doc/*.html: rebuilt the docs - -Tue Aug 3 23:59:23 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * doc/ChangeLog.xsl doc/downloads.html doc/xml.html doc/*: - fixes documentation glitches raised by Oliver Stoeneberg - -Tue Aug 3 09:42:31 PDT 2004 William Brack <wbrack@mmm.com.hk> - - * tree.c: fixed problem with memory leak on text nodes in DTD - (bug 148965) with patch provided by Darrell Kindred - -Tue Aug 3 08:14:44 PDT 2004 William Brack <wbrack@mmm.com.hk> - - * HTMLparser.c: fixed initialisation problem for htmlReadMemory - (bug 149041) - -Sat Jul 31 11:01:33 PDT 2004 William Brack <wbrack@mmm.com.hk> - - * doc/buildDocBookCatalog: enhanced per bug 119876. Further - info posted to the mailing list. - -Sat Jul 31 09:12:44 PDT 2004 William Brack <wbrack@mmm.com.hk> - - * SAX2.c, encoding.c, error.c, parser.c, tree.c, uri.c, xmlIO.c, - xmlreader.c, include/libxml/tree.h: many further little changes - for OOM problems. Now seems to be getting closer to "ok". - * testOOM.c: added code to intercept more errors, found more - problems with library. Changed method of flagging / counting - errors intercepted. - -Fri Jul 30 13:57:55 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * tree.c: applied a couple of patch one from Oliver Stoeneberg - and another one from Rob Richards fixing #148448 - -Thu Jul 29 13:20:28 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: 1 line patch, apparently htmlNewDoc() was not - setting doc->charset. - -Thu Jul 29 00:05:58 PDT 2004 William Brack <wbrack@mmm.com.hk> - - * SAX2.c, tree.c, uri.c, xmlIO.c, xmlreader.c: further - fixes for out of memory condition, mostly from Olivier - Andrieu. - * testOOM.c: some further improvement by Olivier, with - a further small enhancement for easier debugging. - -Tue Jul 27 00:34:07 PDT 2004 William Brack <wbrack@mmm.com.hk> - - * SAX2.c, error.c, parser.c, tree.c, xmlreader.c: - implemented patches supplied by Olivier Andrieu - (bug 148588), plus made some further enhancements, to - correct some problems with out of memory conditions. - * testOOM.c: improved with patches from Olivier Andrieu - -Mon Jul 26 11:03:18 PDT 2004 William Brack <wbrack@mmm.com.hk> - - * tree.c: put in patch for Windows buffer re-allocation - submitted by Steve Hay (bug 146697) - -Sun Jul 25 17:18:39 PDT 2004 William Brack <wbrack@mmm.com.hk> - - * xinclude.c: added some code to check, when an include is - done, whether the requested URL gets mapped to some other - location (e.g. with a catalog entry) and, if so, take care - of the xml:base properly (bug 146988) - -Sun Jul 25 14:02:24 PDT 2004 William Brack <wbrack@mmm.com.hk> - - * error.c: fixed to assure user data param is set correctly - when user structured error handler is called (bug 144823) - -Thu Jul 22 10:14:48 PDT 2004 William Brack <wbrack@mmm.com.hk> - - * xmlreader.c: fixed problem with reader state after - processing attributes (bug 147993) - -Wed Jul 21 17:04:27 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * configure.in, Makefile.am: put in an auto* check for the - path to perl (if it exists), and modified make Timingtests - to use that path instead of just executing the dbgenattr.pl - script (bug 148056) - -Fri Jul 16 18:36:33 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * python/generator.py: added a check on the argument for some - classes (e.g. xmlDoc and xmlNode) to prevent a segfault (as - reported on the list). Further enhancement should be done - to auto-create the appropriate object. - * python/libxml.c: minor fix for a warning message; added a - routine, currently not used, to report the description of a - PyCObject. - * python/libxml2class.txt: regenerated - -Fri Jul 16 11:01:40 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * catalog.c test/catalogs/white* result/catalogs/white*: - applied patches from Peter Breitenlohner to fix handling - of white space normalization in public ids and add tests - -Tue Jul 13 17:24:13 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * xmlmemory.c: applied a small fix from Steve Hay - -Tue Jul 13 23:02:19 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * xpath.c: Added code to in PREDICATE/FILTER handling to reset - the xpath context document pointer (part of fix to libxslt - bug 147445) - -Tue Jul 13 00:14:08 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * python/libxml.py: ran 'expand' on the file to get rid of mixture - of tabs and spaces (bug 147424) - -Sun Jul 11 22:38:29 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * python/drv_libxml.py: added an encoding "special comment" to avoid - warning message in python2.3 (bug 146889) - * Makefile.am, python/Makefile.am, python/tests/Makefile.am: small - change to make "make tests" a little quieter (MAKEFLAGS+=--silent) - * xpath.c: enhanced to take advantage of current libxslt handling - of tmpRVT. Fixes bug 145547. - -Fri Jul 9 14:02:54 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * libxml.h uri.c: fixed a couple of problems in the new - elfgcchack.h trick pointed by Peter Breitenlohner - -Wed Jul 7 00:45:48 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * elfgcchack.h doc/apibuild.py doc/libxml2-api.xml: fixed a bug - which prevented building with --with-minimum - -Mon Jul 5 19:43:51 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * configure.in doc/*: releasing 2.6.11, updated and regenerated the - docs - -Mon Jul 5 18:43:47 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * parser.c: make the push interfaces synchronous - * python/tests/sync.py: added a specific test - * python/tests/Makefile.am doc/examples/Makefile.am - doc/examples/index.py: added the new test, cleaning up - "make tests" output - -Mon Jul 5 15:09:17 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * xmlschemas.c: applied patch from Kasimier to fix some Relax-NG - datatype facet problem with recent changes. - -Sat Jul 3 11:31:02 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * python/libxml.c: Changed the number of XPath extension functions - allowed to be variable-length (patch supplied by Marc-Antoine - Parent, bug 143805). Added code to "unregister" the functions - when the parser cleanup takes place. - -Fri Jul 2 14:22:14 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * xmlmemory.c python/libxml.c python/libxml2-python-api.xml: - some updates with memory debugging facilities while messing - with libxslt python bindings - -Thu Jul 1 14:53:36 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * python/libxml.c python/generator.py python/libxml.py - python/libxml2-python-api.xml python/libxml2class.txt: - applied patch from Stéphane Bidoul to fix some Python bindings - initialization, then had to change the parserCleanup() - to handle memory released there. - * xmlmemory.c: added more debugging comments. - -Thu Jul 1 13:18:02 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * xmlreader.c: seems the reader buffer could be used while not - allocated, fixes bug #145218 - -Thu Jul 1 11:34:10 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * python/generator.py: do not provide functions used as destructor - of classes as public methods to avoid double-free problem like - in bug #145185 - -Wed Jun 30 19:45:23 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * xmlschemas.c, xmlschemastypes.c: warning message cleanup. - Now compiles warning-free, all tests passed. - * SAX2.c: small change to comments for documentation. - No change to logic. - -Tue Jun 29 15:00:13 PDT 2004 Daniel Veillard <daniel@veillard.com> - - * xmlschemas.c: more fixes with Kasimier, looks far cleaner :-) - -Tue Jun 29 23:00:05 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * xmlschemas.c: Kasimier Buchcik fixed the memory access and - allocation problem - -Tue Jun 29 19:00:32 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * xmlschemas.c xmlschemastypes.c include/libxml/xmlerror.h - include/libxml/schemasInternals.h include/libxml/xmlschemastypes.h: - applied Schemas patches from Kasimier Buchcik, there is still - one open issue about referencing freed memory. - * test/schemas/* result/schemas/*: updated with new tests from - Kasimier - -Tue Jun 29 14:52:18 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * include/libxml/globals.h include/libxml/xmlIO.h - doc/libxml2-api.xml doc/libxml2-refs.xml: moved some definitions - to globals.h to avoid some troubles pointed out by Rob Richards - -Mon Jun 28 11:25:31 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * libxml.m4: applied changes suggested by Mike Hommey, remove - libxml1 support and use CPPFLAGS instead of CFLAGS - -Sun Jun 27 14:17:15 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * libxml.spec.in: another, more 'experimental' feature to - get compiler optimization based on gcc runtime profiling - -Sun Jun 27 14:02:36 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * elfgcchack.h doc/elfgcchack.xsl libxml.h: hack based on Arjan van de - Ven suggestion to reduce ELF footprint and generated code. Based on - aliasing of libraries function to generate direct call instead of - indirect ones - * doc/libxml2-api.xml doc/Makefile.am doc/apibuild.py: added automatic - generation of elfgcchack.h based on the API description, extended - the API description to show the conditionals configuration flags - required for symbols. - * nanohttp.c parser.c xmlsave.c include/libxml/*.h: lot of cleanup - * doc/*: regenerated the docs. - -Sun Jun 27 10:02:28 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * regressions.py, regressions.xml: new files for running - regression tests under Python. Not yet complete, but - should provide good testing under both Linux and Windows. - * testHTML.c, testSAX.c, xmllint.c: changed the 'fopen' used - for --push testing to include the 'rb' param when compiled - under Windows. - -Fri Jun 25 13:38:57 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * uri.c: fixed a problem when base path was "./xxx" - * result/XInclude/*: 5 test results changed by above. - * Makefile.am: fixed a couple of spots where a new - result file used different flags that the testing one. - -Thu Jun 24 16:27:44 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * valid.c: suppressed warnings from within xmlValidGetValidElements - (bug 144644) - * doc/examples/testWriter.c: corrected typo in comment for ISO-8859-1 - (bug 144245) - -Thu Jun 24 10:17:31 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * valid.c: implemented bugfix from Massimo Morara for DTD - dumping problem. - * test/valid/t10.xml, result/valid/t10.*: added regression - for above - * configure.in: small change for my profile settings - -Wed Jun 23 20:18:19 MDT 2004 John Fleck <jfleck@inkstain.net> - - * doc/xmlcatalog_man.xml, xmlcatalog.1 - Docs patch from Ville Skytta, bugzilla #144841 - -Sat Jun 19 18:34:11 MDT 2004 John Fleck <jfleck@inkstain.net> - - * doc/xmllint.xml, xmllint.html, xmllint.1 - update man page to reflect William's newly disciplined return - code mojo - -Thu Jun 17 00:51:55 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * doc/examples/io2.c doc/examples/parse4.c: fixing a couple of - compilation errors when configured with --with-minimum - -Wed Jun 16 16:07:10 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * debugXML.c: applied patch from Stefano Debenedetti to register - namespaces in the debug shell - -Mon Jun 14 21:56:31 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * xmlreader.c: fix from Steve Ball and update of the comment. - * Makefile.am result/errors/*.str: William pointed out that - the streaming error checking part wasn't streaming, fixing - -Mon Jun 14 14:11:52 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * catalog.c: patch from Igor for the default catalog path on Windows - -Sat Jun 12 09:03:57 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * configure.in: apparently wasn't updated last time - -Thu Jun 10 20:57:48 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * configure.in, xmlmemory.c, globals.c: fixed problem when - configuring using --with-thread-alloc - -Wed Jun 9 16:31:24 CEST 2004 Igor Zlatkovic <igor@zlatkovic.com> - - * win32/configure.js win32/Makefile.* minor changes for the new - layout of the Windows binary package - -Tue Jun 8 19:50:25 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * xmlschemas.c include/libxml/xmlerror.h: applied another patch - from Kasimier Buchcik for Schema Component Constraints - * test/schemas/* result/schemas/*: added the regression tests - -Tue Jun 8 21:27:03 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * xmllint.c: fixed missing error return code for schema - validation (bug 143880), also changed over to an enum for - defining the error return codes for all conditions. - -Tue Jun 8 14:01:14 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * parser.c xmlreader.c include/libxml/parser.h: fixed a serious - problem when substituting entities using the Reader, the entities - content might be freed and if rereferenced would crash - * Makefile.am test/* result/*: added a new test case and a new - test operation for the reader with substitution of entities. - -Tue Jun 8 12:14:16 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * globals.c xmlIO.c include/libxml/globals.h include/libxml/xmlIO.h: - applied patch from Rob Richards for the per thread I/O mappings - -Tue Jun 8 09:58:31 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * xinclude.c: some further enhancement to take care of - xml:base for XPointer elements (bug 143886). Also fixed - a problem when xml:base was already specified on an - XInclude'd element. - -Mon Jun 7 22:14:58 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * relaxng.c: fixed a problem with internal cleanup of <DIV> element - (bug 143738). - -Mon Jun 7 16:57:43 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * uri.c, include/libxml/uri.h: added a new routine - xmlBuildRelativeURI needed for enhancement of xinclude.c - * xinclude.c: changed handling of xml:base (bug 135864) - * result/XInclude/*: results of 5 tests changed as a result - of the above change - -Fri Jun 4 11:27:37 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * test/schemas/* result/schemas/*: added a bunch of tests from - Kasimier Buchcik posted on May 11 - -Thu Jun 3 17:58:25 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * xmlschemas.c: new patch from Kasimier Buchcik for processContents - of wildcards attribute handling - * test/schemas/anyAttr-* result/schemas/anyAttr-*: added specific - regression tests - -Thu Jun 3 13:20:36 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * parser.c: fixed a bug where invalid charrefs may not be detected - sometimes as pointed by Morus Walter. - * test/errors/charref1.xm result/errors/charref1.xml*: added the - test in the regression suite. - -Thu Jun 3 18:38:27 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * xmlschemas.c: small change to xmlSchemaValidateAttributes, - also corrected typo on error code enum. - * include/libxml/xmlerror.h: corrected typo on schema error - code enum - -Thu Jun 3 10:12:38 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * xmlschemas.c: minor cosmetic changes, no change to logic. - * result/schemas/attruse_0_[12].err: regenerated - * globals.c: added a newline at end to make gcc happy - -Wed Jun 2 21:16:26 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * xmlschemas.c include/libxml/schemasInternals.h - include/libxml/xmlerror.h: applied a patch from Kasimier Buchcik - implementing attribute uses and wildcards. - * test/schemas/* result/schemas/*: added/fixed a bunch of tests - -Wed Jun 2 18:15:51 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * globals.c xmlIO.c include/libxml/globals.h: applied patch from - Rob Richards for custom I/O BufferCreateFilenane fixes bug - #143366 - -Wed Jun 02 16:25:32 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * xpath.c: fixed problem with predicate evaluation on an - empty nodeset (bug 143409) - -Wed Jun 02 11:26:41 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * testSAX.c: fixed problem with attribute listing (bug 142674) - and added macro LIBXML_TEST_VERSION to assure xmlInitParser - gets called (bug 142686) - -Sat May 29 21:35:52 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * test/schemas/date_0.xml xmlschemastypes.c: applied a patch from - Charles Bozeman fixing a side effect in date handling - -Thu May 27 19:47:48 MDT 2004 John Fleck <jfleck@inkstain.net> - - * doc/tutorial/xmltutorial.xml fix lack of cast in Xpath example - * doc/tutorial/*.html, xmltutorial.pdf rebuild html, pdf - -2004-05-25 Aleksey Sanin <aleksey@aleksey.com> - - * c14n.c: fixed c14n bug with serializing attribute namespaces - -Mon May 24 08:22:48 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * xpath.c: fixed to allow '+' in exponent of number - (bug 143005) - * SAX2.c: fixed typo in last commit - -Sat May 22 09:08:24 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * SAX2.c: skipped call to xmlValidateNCName when compiling - --with-minimum (bug 142917) - -Tue May 18 06:48:00 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * catalog.c: reverted the broken change. - -Mon May 17 23:07:15 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * NEWS doc/*: updated the docs for 2.6.10 - -Mon May 17 05:52:03 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * configure.in : releasing 2.6.10 - -Sun May 16 23:12:35 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * tree.c: avoid returning default namespace when searching - from an attribute - * entities.c xmlwriter.c: reverse xmlEncodeSpecialChars() behaviour - back to escaping " since the normal serialization routines do not - use it anymore, should close bug #134477 . Tried to make - the writer avoid it too but it didn't work. - -Sun May 16 01:07:16 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * doc/ChangeLog.awk doc/ChangeLog.xsl: fixed escaping - handling and added direct links to bugzilla report for - bug numbers. - -Sun May 16 11:11:13 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * error.c: modified to assure proper user data is sent to - structured error routine (bug 142598) - -Sun May 16 03:18:52 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * catalog.c: a couple of large static variable which should really - not be declared as such cluttered the .bss section. - -Sun May 16 03:06:31 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * doc/ChangeLog.awk: fixed a couple of problems when parsing - libxslt ChangeLog - -Sat May 15 20:14:21 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * doc/ChangeLog.awk doc/ChangeLog.xsl: first steps of a good - ChangeLog page generation. The awk should escape characters - not okay in XML and the xslt should make links to functions - or variables or bug reported in the entries. - -Sat May 15 14:57:40 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * xmlsave.c include/libxml/xmlsave.h: start adding API for - escaping customization. - -Sat May 15 12:38:17 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * xmlsave.c: more xmlSave cleanup, optimization and refactoring - -Fri May 14 17:51:48 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * xmlIO.c xmlsave.c: third pass at the escaping refactoring. - -Fri May 14 12:37:24 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * parser.c: enhanced the enhancement, fixed another couple of - special cases. - -Fri May 14 11:48:33 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * parser.c: small enhancement to dtd handling of (a?)+ (bug 142487) - -Thu May 13 23:19:00 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * xmlIO.c xmlsave.c include/libxml/xmlIO.h: second pass on escaping - handling, start to looks better, need to be completed and added - directly at the saving context level. - -Thu May 13 10:31:28 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * xmlIO.c xmlsave.c include/libxml/xmlIO.h: first pass at refactoring - the escape on save routines for better performances (less malloc) - and more flexibility using the new saving context. Preliminary - work, interface will change. - -Wed May 12 22:34:03 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * xmlschemas.c: added code in xmlSchemaBuildAContentModel to handle - element reference within the xs:all construct (bug 139897) - -Wed May 12 17:27:18 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * xinclude.c: a little further fixing of fallback processing, this - time for fallback with children (bug 139520). - -Wed May 12 08:21:33 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * xmlschemas.c: added code in xmlSchemaBuildContentModel to - allow ref in group definition (bug 134411). Also fixed - misc compilation warning messages. - * result/schema/group0_0_0, result/schema/group0_0_0.err: - regenerated (now no error reported). - -Tue May 11 11:55:59 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * xmlIO.c: fix to the fix for #141864 from Paul Elseth - * HTMLparser.c result/HTML/doc3.htm: apply fix from David Gatwood for - #141195 about text between comments. - -Tue May 11 23:04:47 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * xmlschemas.c, include/libxml/schemasInternals.h, - include/libxml/xmlerror.h: Applied patches supplied by - Kasimier Buchcik. - * test/schemas/po1_0.xml, test/schemas/po1_0.xsd: - changed test to account for above patch. - -Tue May 11 09:06:53 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * python/tests/tstLastError.py: better portability fix for f(*args), - use apply(f, args) as Stéphane Bidoul suggested - -Mon May 10 15:49:22 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * xmlregexp.c: enhanced xmlRegStateAddTrans to check if transition - is already present and, if so, to ignore the request to add it. - This has a very dramatic effect on memory requirements as well - as efficiency. It also fixes bug 141762. - -Sun May 9 20:40:59 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * Makefile.am python/tests/Makefile.am python/tests/tstLastError.py: - applied patch from Ed Davis to allow "make tests" to work - with Python 1.5 - -Sun May 9 19:46:13 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * xmlsave.c: apply fix for XHTML1 formatting from Nick Wellnhofer - fixes bug #141266 - * test/xhtmlcomp result//xhtmlcomp*: added the specific regression - test - -Sun May 9 14:07:21 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * Makefile.am: fix for a pedantic make check without make all request - -Sat May 8 22:56:22 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * uri.c xmlIO.c: fixing some problems in URI unescaping - and output buffer opening, this should fix #141864 - -Fri May 7 22:31:54 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * valid.c include/libxml/valid.h: fixes the use of 'list' as a parameter - * xmlIO.c include/libxml/xmlIO.h: added xmlPopInputCallback for - Matt Sergeant - -Thu May 6 21:14:38 PDT 2004 William Brack <wbrack@mmm.com.hk> - - * xmlregexp.c: enhanced the handling of subexpression ranges - which have a minOccurs of 0 (bug 140478 again); cleaned up - comments throughout the module. - -Tue May 4 00:52:16 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * xmllint.c: adding a --maxmem option to check memory used. - -Sat May 1 01:08:44 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * xmllint.c xmlsave.c python/generator.py python/libxml.c: Fixed - bug #141529 i.e. various problems when building with --without-html - -Fri Apr 30 18:12:31 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * xmllint.c xmlreader.c: fixing bug #141384 where the reader didn't - call the deregistering functions. Also added the check to - xmllint --stream --chkregister . - -Fri Apr 30 08:57:47 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * win32/Makefile.msvc: applied a second patch from Mark Vakoc for - regression tests on Windows - -Thu Apr 29 21:47:23 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * xmlreader.c: never commit without running make tests first ! - -Thu Apr 29 20:15:20 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * xmlreader.c: fix a nasty problem with reading over the end - * xmlsave.c: fix a reported memory leak apparently - -Thu Apr 29 17:05:00 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * win32/Makefile.msvc: patch from Mark Vakoc for regression tests - on Windows. - * xpath.c: the NaN problem also shows up on Borland - -Mon Apr 26 23:37:12 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * xmlregexp.c: enhanced xmlFARegExec range evaluation for min - occurs 0 problems - fixes bug 140478. - -Thu Apr 22 09:12:47 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * rngparser.c: tiny path fixes the "xmlConvertCRNGFile" function name - from Kasimier Buchcik - * xmlschemas.c: recursive xs:extension fix from taihei goi - -Wed Apr 21 00:19:29 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * tree.c: small buffer resizing improvement from Morten Welinder - closes #140629 - -Tue Apr 20 23:40:14 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * xpath.c: last version of the fix for MSC version 1200 - -Tue Apr 20 19:40:37 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * parser.c: killing the strncmp vs. memcmp controversy and #140593 - -Tue Apr 20 13:27:06 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * include/libxml/SAX2.h: Kasimier Buchcik pointed out some - inexistent functions, cleaned them out. - -Tue Apr 20 11:42:50 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * error.c: Johnson Cameron pointed out that - initGenericErrorDefaultFunc() was really wrong. - * xmlreader.c include/libxml/xmlreader.h: xmlTextReaderMode enum - must be made public, added some missing comments on the XMLReader - header. - * c14n.c: Alexsey fixed C14N bug with processing namespaces - from attributes - -Mon Apr 19 23:27:46 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * xpath.c: fixed a stupid () error + Mark name. - -Sun Apr 18 23:45:46 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * configure.in: preparing 2.6.9 release - * doc/* News: updated and rebuilt the docs - -Sun Apr 18 22:51:43 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * xpath.c: relaxed id() to not check that the name(s) passed - are actually NCName, decided this in agreement with Aleksey Sanin - since existing specs like Visa3D broke that conformance checking - and other tools seems to not implement it sigh... - * SAX2.c: check attribute decls for xml:id and the value is an - NCName. - * test/xmlid/id_err* result/xmlid/id_err*: added error testing - -Sun Apr 18 21:46:17 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * xpath.c: work around Microsoft compiler NaN bug raise reported - by Mark Vakoc - * xmlschemas.c include/libxml/schemasInternals.h - include/libxml/xmlerror.h: fixed a recursive extension schemas - compilation error raised by taihei goi - -Sun Apr 18 16:57:02 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * libxml.spec.in: keep the ChangeLog compressed - * xmlreader.c: fix a segfault when using Close() - * python/tests/Makefile.am python/tests/reader8.py: test for - the Close() reader API. - -Sat Apr 17 22:42:13 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * xmlschemas.c, xmlwriter.c, doc/examples/parse4.c, - doc/examples/io2.c: minor warning cleanup (no change to logic) - * xinclude: fixed return value for internal function - xmlXIncludeLoadFallback (now always 0 or -1) - -Sat Apr 17 21:32:32 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * valid.c: small enhancement to fix bug 139791 - -Fri Apr 16 18:44:47 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * xmlschemas.c include/libxml/schemasInternals.h - include/libxml/xmlerror.h: applied patches from Kasimier Buchcik - for the attribute use support - * test/schemas/attruse* result/schemas/attruse*: added the - tests to the regression suite. - -Fri Apr 16 18:22:25 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * xmlsave.c: move the TODO as comments as the function while not - finished are usable as-is - * xmlschemas.c include/libxml/xmlerror.h: patch from Kasimier Buchcik - implementing union - * test/schemas/union_0_0.x* result/schemas/union_0_0*: added example - * python/Makefile.am: applied fix from Mike Hommey - -Fri Apr 16 23:58:42 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * parser.c: fixed problem with detecting external dtd - encoding (bug 135229). - * Makefile.am: minor change to test label - -Fri Apr 16 16:09:31 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * xinclude.c: fixed problem causing duplicate fallback - execution (bug 139520) - * test/XInclude/docs/fallback2.xml result/XInclude/fallback2.*: - added testcase - -Fri Apr 9 23:49:37 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * SAX2.c include/libxml/tree.h: adding xml:id draft support - * Makefile.am test/xmlid/id_tst* result/xmlid/id_tst*: adding - 4 first regression tests - -Fri Apr 9 11:56:08 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * libxml.spec.in: fixing Red Hat bug #120482 , libxml2-python - should depend on the version of python used to compile it. - -Mon Apr 5 09:07:24 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: applied patch from James Bursa, frameset should - close head. - -Fri Apr 2 22:02:24 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * relaxng.c: fixed problem in xmlRelaxNGCompareNameClasses - which was causing check-relaxng-test-suite.py test 351 to fail. - -Fri Apr 2 17:03:48 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * nanohttp.c: implemented fix for M$ IIS redirect provided - by Ian Hummel - * relaxng.c: fixed problem with notAllowed compilation - (bug 138793) - -Thu Apr 1 22:07:52 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * uri.c: fix for xmlUriEscape on "http://user@somewhere.com" - from Mark Vakoc. - -2004-04-01 Johan Dahlin <johan@gnome.org> - - * python/.cvsignore: Add generated files, to make cvs silent. - -Thu Apr 1 12:41:36 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * xmlschemas.c: small signed-ness patch from Steve Little - -Wed Mar 31 17:47:28 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * xmlregexp.c: patched a bug in parsing production 1 and 2 of - xmlschemas regexp that William pointed out while working on - #134120 - * test/regexp/branch result/regexp/branch: added a specific - regression test - -Wed Mar 31 09:50:32 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * Makefile.am: added PYTHONPATH to python tests for Schemas - and RelaxNG - * test/xsdtest/xsdtestsuite.xml: added testfile for - SchemasPythonTests - -Mon Mar 29 16:56:49 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * doc/examples/examples.xsl doc/examples/index.html: added - information about compiling on Unix - -Mon Mar 29 14:18:12 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * catalog.c: fixes the comments for xmlCatalogDump and xmlDumpACatalog - * doc/*: rebuilt to update - -Sun Mar 28 18:11:41 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * xmlsave.c: optimize indentation based on the new context - -Sun Mar 28 14:17:10 CEST 2004 Daniel Veillard <daniel@veillard.com> - - * doc/examples/xpath2.c doc/examples/xpath2.res: handle and explain - a very tricky problem when modifying the tree based on an XPath - result query. - -Sat Mar 27 09:56:14 PST 2004 William Brack <wbrack@mmm.com.hk> - - * relaxng.c: fixed problem with IS_COMPILABLE flag - (bug 130216) - -Fri Mar 26 18:28:32 CET 2004 Daniel Veillard <daniel@veillard.com> - - * parser.c: applied patch from Dave Beckett to correct line number - errors when using push with CDATA - -Fri Mar 26 14:53:58 CET 2004 Daniel Veillard <daniel@veillard.com> - - * doc/examples/xpath1.c: added a test template - * doc/examples/xpath2.c doc/examples/xpath2.res doc/examples/*: - added a new example, and make valgrind target - -Fri Mar 26 11:47:29 CET 2004 Daniel Veillard <daniel@veillard.com> - - * parser.c: apply fix for #136693 - -Thu Mar 25 20:21:01 MST 2004 John Fleck <jfleck@inkstain.net> - - * doc/examples/io2.c - * doc/examples/io2.res - add xmlDocDumpMemory example in response to mailing list FAQ - (rebuilt xml and html also) - -Thu Mar 25 10:33:05 CET 2004 Daniel Veillard <daniel@veillard.com> - - * debugXML.c testXPath.c xmllint.c xmlschemastypes.c: applied - patch from Mark Vakoc avoiding using xmlParse* option and use - xmlRead* instead - * win32/Makefile.bcb: patch to Borland C++ builder from Eric Zurcher - to avoid problems with some pathnames. - -Tue Mar 23 12:35:08 CET 2004 Daniel Veillard <daniel@veillard.com> - - * configure.in doc/* News: preparing 2.6.8 release, updated and rebuilt - the docs. - * Makefile.am: use valgring for the new Python based regression tests - -Mon Mar 22 20:07:27 CET 2004 Daniel Veillard <daniel@veillard.com> - - * relaxng.c: remove a memory leak on schemas type facets. - * check-relaxng-test-suite.py check-relaxng-test-suite2.py - check-xsddata-test-suite.py: reduce verbosity - * configure.in Makefile.am: incorporated the Python regressions - tests for Relax-NG and Schemas Datatype to "make tests" - -Mon Mar 22 16:16:18 CET 2004 Daniel Veillard <daniel@veillard.com> - - * xmlwriter.c include/libxml/xmlwriter.h doc/* : applied patch from - Alfred Mickautsch for better DTD support. - * SAX2.c HTMLparser.c parser.c xinclude.c xmllint.c xmlreader.c - xmlschemas.c: fixed bug #137867 i.e. fixed properly the way - reference counting is handled in the XML parser which had the - side effect of removing a lot of hazardous cruft added to try - to fix the problems associated as they popped up. - * xmlIO.c: FILE * close fixup for stderr/stdout - -Sun Mar 21 19:19:41 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * relaxng.c: added an error message when an element is not - found within a <choice> (bug 126093) - -Sat Mar 20 22:25:18 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * xmlregexp.c: enhanced the logic of parsing char groups to - better handle initial or ending '-' (bug 135972) - -Sat Mar 20 19:26:03 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * relaxng.c: added check for external reference in - xmlRelaxNGGetElements (bug 137718) - * test/relaxng/rngbug-001.*, result/relaxng/rngbug-001*: added - regression test for above - -Wed Mar 17 16:37:22 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * nanohttp.c: added a close for the local file descriptor - (bug 137474) - -Mon Mar 15 15:46:59 CET 2004 Daniel Veillard <daniel@veillard.com> - - * xmlsave.c: switched the output routines to use the new context. - -Mon Mar 15 10:37:18 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * relaxng.c: enhanced to ignore XML_XINCLUDE_START and XML_XINCLUDE_END - nodes (bug 137153) - -Sun Mar 14 13:19:20 CET 2004 Daniel Veillard <daniel@veillard.com> - - * xmlschemastypes.c: applied patch from John Belmonte for anyURI. - -Wed Mar 10 17:22:48 CET 2004 Daniel Veillard <daniel@veillard.com> - - * parser.c: fix bug reported by Holger Rauch - * test/att8 result/noent/att8 result/att8 result/att8.rdr - result/att8.sax: added the test to th regression suite - -Wed Mar 10 19:42:22 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * doc/search.php: Minor change for later version of php requiring - $HTTP_GET_VARS. - -Wed Mar 10 00:12:31 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * tree.c: Changed the flag to xmlDocCopyNode (and similar routines), - previously used only for recursion, to use a value of '2' to - indicate copy properties & namespaces, but not children. - * xinclude.c: changed the handling of ranges to use the above new - facility. Fixes Bug 134268. - -Tue Mar 9 18:48:51 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * win32/Makefile.bcb, win32/Makefile.mingw, win32/Makefile.msvc: - added new module xmlsave with patch supplied by Eric Zurcher - (second attempt - don't know what happened to the first one!) - -Tue Mar 9 09:59:25 CET 2004 Daniel Veillard <daniel@veillard.com> - - * python/libxml.c python/libxml.py: applied patch from Anthony Carrico - providing Python bindings for the Canonicalization C14N support. - -Mon Mar 8 11:12:23 CET 2004 Hagen Moebius <hagen.moebius@starschiffchen.de> - - * .cvsignore and python/.cvsignore patched - -Mon Mar 8 22:33:14 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * xinclude.c: enhanced to assure that if xpointer is called - for a document, the XML_PARSE_NOENT flag is set before parsing - the included document so that entities will automatically get - taken care of. - * xpointer.c: corrected code so that, if an XML_ENTITY_REF node - is encountered, it will log it and not crash (bug 135713) - -Sun Mar 7 19:03:48 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * xinclude.c: modified to make sub-includes inherit the - parse flags from the parent document (bug 132597) - -Fri Mar 5 01:13:22 CET 2004 Daniel Veillard <daniel@veillard.com> - - * xmlschemas.c: QName handling fixes for the XML Schemas - support from Adam Dickmeiss - * test/schemas/po1_0.xsd: also fix the schemas - * test/schemas/ns[12]* result/schemas/ns[12]*: added the specific - regression tests - -Thu Mar 4 23:03:02 CET 2004 Daniel Veillard <daniel@veillard.com> - - * configure.in doc/Makefile.am include/libxml/Makefile.am: - paalied patch from Julio M. Merino Vidal fixing bug #134751 - to fix --with-html-dir option. - * doc/*: rebuilt fully the docs - * doc/html/libxml-xmlsave.html: new file from new header. - -Thu Mar 4 16:57:50 CET 2004 Daniel Veillard <daniel@veillard.com> - - * debugXML.c testHTML.c tree.c doc/examples/*.c - include/libxml/xmlsave.h: fixing compilation bug with some options - disabled as well as --with-minimum should fix #134695 - -Thu Mar 4 15:00:45 CET 2004 Daniel Veillard <daniel@veillard.com> - - * xmlcatalog.c: allow fallback to URI lookup when SYSTEM fails, - should close #134092 - -Thu Mar 4 14:39:38 CET 2004 Daniel Veillard <daniel@veillard.com> - - * Makefile.am tree.c xmlsave.c include/libxml/xmlsave.h: committing - the new xmlsave module before the actual big code change. - -Thu Mar 4 12:38:53 CET 2004 Daniel Veillard <daniel@veillard.com> - - * xmlschemas.c: applied patch from Adam Dickmeiss for mixed content - * test/schemas/mixed* result/schemas/mixed*: added his regression - tests too. - -Mon Mar 1 15:22:06 CET 2004 Daniel Veillard <daniel@veillard.com> - - * testSAX.c: fix a compilation problem about a missing timb include - -Sat Feb 28 22:35:32 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * testSAX.c: small enhancement to prevent trying to print - strings with null pointers (caused "make tests" errors on - HP-UX) - -Thu Feb 26 20:19:40 MST 2004 John Fleck <jfleck@inkstain.net> - - * doc/xmllint.xml - * doc/xmllint.1 - * doc/xmllint.html - * doc/xmlcatalog_man.xml - * doc/xmlcatalog.1 - * doc/xmlcatalog_man.html - applying patch from Mike Hommey to clarify XML_CATALOG_FILES - use - -Thu Feb 26 23:47:43 CET 2004 Daniel Veillard <daniel@veillard.com> - - * Makefile.am: patch for cross-compilation to Windows from - Christophe de VIENNE. - -Thu Feb 26 18:52:11 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * doc/*.html, doc/html/*.html: regenerated docs using older - version of xsltproc pending resolution of AVT problem - -Thu Feb 26 10:56:29 CET 2004 Daniel Veillard <daniel@veillard.com> - - * Makefile.am: applied patch from Charles Bozeman to not use - the system xmllint. - -Wed Feb 25 18:07:05 CET 2004 Daniel Veillard <daniel@veillard.com> - - * include/libxml/xmlexports.h: applied patch from Roland Schwingel - for MingW - -Wed Feb 25 13:57:25 CET 2004 Daniel Veillard <daniel@veillard.com> - - * Makefile.am catalog.c configure.in: applied a cleanup patch - from Peter Breitenlohner - * tree.c: removed a doc build warning by fixing a param comment - * doc/* : rebuilt the docs - -Wed Feb 25 13:33:07 CET 2004 Daniel Veillard <daniel@veillard.com> - - * valid.c HTMLparser.c: avoid ID error message if using - HTML_PARSE_NOERROR should fix #130762 - -Wed Feb 25 12:50:53 CET 2004 Daniel Veillard <daniel@veillard.com> - - * debugXML.c relaxng.c valid.c xinclude.c xmllint.c xmlreader.c: - fixing compilation and link option when configuring with - --without-valid should fix #135309 - -Wed Feb 25 11:36:06 CET 2004 Daniel Veillard <daniel@veillard.com> - - * catalog.c: fixed the main issues reported by Peter Breitenlohner - * parser.c: cleanup - * valid.c: speedup patch from Petr Pajas - -Wed Feb 25 16:07:14 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * xpath.c: fixed a memory leak (xmlXPathLangFunction) reported - on the list by Mike Hommey - -Mon Feb 23 17:28:34 CET 2004 Daniel Veillard <daniel@veillard.com> - - * doc/* NEWS configure.in: preparing 2.6.7 release, updated and - rebuilt the documentation. - -Mon Feb 23 11:52:12 CET 2004 Daniel Veillard <daniel@veillard.com> - - * python/tests/*.py: applied patch from Malcolm Tredinnick - to avoid tabs in python sources, should fix #135095 - -Sun Feb 22 23:16:23 CET 2004 Daniel Veillard <daniel@veillard.com> - - * testSAX.c: add --timing option - * relaxng.c: use the psvi field of the nodes instead of _private - which may be used for other purposes. - -Sat Feb 21 16:57:48 CET 2004 Daniel Veillard <daniel@veillard.com> - - * encoding.c: small patch to try to fix a warning with Sun One compiler - -Sat Feb 21 16:22:35 CET 2004 Daniel Veillard <daniel@veillard.com> - - * encoding.c: small patch removing a warning with MS compiler. - -Sat Feb 21 13:52:30 CET 2004 Daniel Veillard <daniel@veillard.com> - - * debugXML.c: added "relaxng" option to the debugging shell - * Makefile.am test/errors/* result/errors/*: some regression tests - for some error tests cases. - -Fri Feb 20 09:56:47 CET 2004 Daniel Veillard <daniel@veillard.com> - - * tree.c: xmlAttrSerializeTxtContent don't segfault if NULL - is passed. - * test/att7 result//att7*: adding an old regression test - laying around on my laptop - -Thu Feb 19 17:33:36 CET 2004 Daniel Veillard <daniel@veillard.com> - - * xmlreader.c: fixed xmllint --memory --stream memory consumption - on large file by using xmlParserInputBufferCreateStatic() with - the mmap'ed file - -Thu Feb 19 13:56:53 CET 2004 Daniel Veillard <daniel@veillard.com> - - * tree.c: some clarification in xmlDocDumpMemory() documentation - * xmllint.c: fixed xmllint --stream --timing to get timings back - -Wed Feb 18 15:20:42 CET 2004 Daniel Veillard <daniel@veillard.com> - - * parser.c: fixed a problem in push mode when attribute contains - unescaped '>' characters, fixes bug #134566 - * test/att6 result//att6*: added the test to the regression suite - -Tue Feb 17 17:26:31 CET 2004 Daniel Veillard <daniel@veillard.com> - - * valid.c: removing a non-linear behaviour from ID/IDREF raised - by Petr Pajas. Call xmlListAppend instead of xmlListInsert in - xmlAddRef - -Tue Feb 17 13:27:27 CET 2004 Daniel Veillard <daniel@veillard.com> - - * python/tests/indexes.py python/tests/reader.py: indicated - encoding of the test file, needed for python 2.3 - -Tue Feb 17 21:08:11 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * xpath.c: fixed problem with numbers having > 19 - fractional places (bug 133921) - -Tue Feb 17 12:47:20 CET 2004 Daniel Veillard <daniel@veillard.com> - - * xpath.c: applied optimization patch from Petr Pajas - -Tue Feb 17 12:39:08 CET 2004 Daniel Veillard <daniel@veillard.com> - - * xmlwriter.c include/libxml/xmlwriter.h: applied update - from Alfred Mickautsch and the added patch from Lucas Brasilino - -Sun Feb 15 12:01:30 CET 2004 Daniel Veillard <daniel@veillard.com> - - * benchmark.png index.html xml.html: updating the benchmark - graph and using a PNG instead of a GIF - * xmlreader.c: updated the TODO - -Sat Feb 14 18:55:40 MST 2004 John Fleck <jfleck@inkstain.net> - - * doc/tutorial/xmltutorial.xml - * doc/tutorial/xmltutorial.pdf - * doc/tutorial/*.html - Fix bug in XPath example in the tutorial, thanks to Carlos, whose - last name I don't know, for pointing this out - -Thu Feb 12 16:28:12 CET 2004 Daniel Veillard <daniel@veillard.com> - - * NEWS configure.in: preparing release of 2.6.6 - * doc/*: updated the docs and rebuilt them - -Thu Feb 12 13:41:16 CET 2004 Daniel Veillard <daniel@veillard.com> - - * xmlregexp.c: fixing bug #132930 with the provided patch, a bit - suspicious about it but this is fairly contained and regression - tests still passes. - * test/schemas/all1* result/schemas/all1*: added the test to - the regression suite. - -Thu Feb 12 12:54:26 CET 2004 Daniel Veillard <daniel@veillard.com> - - * parser.c: fixed bug #132575 about finding the end of the - internal subset in push mode. - * test/intsubset.xml result/intsubset.xml* result/noent/intsubset.xml: - added the test to the regression suite - -Wed Feb 11 14:19:31 CET 2004 Daniel Veillard <daniel@veillard.com> - - * parserInternals.c xmlIO.c encoding.c include/libxml/parser.h - include/libxml/xmlIO.h: added xmlByteConsumed() interface - * doc/*: updated the benchmark rebuilt the docs - * python/tests/Makefile.am python/tests/indexes.py: added a - specific regression test for xmlByteConsumed() - * include/libxml/encoding.h rngparser.c tree.c: small cleanups - -Wed Feb 11 08:13:58 HKT 2004 William Brack <wbrack@mmm.com.hk - - * tree.c: fixed missing output of internal DTD param entities when - nothing else present in DTD (bug 134052) - -Tue Feb 10 19:24:38 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * encoding.c: applied patch supplied by Christophe Dubach - to fix problem with --with-minimum configuration - (bug 133773) - * nanoftp.c: fixed potential buffer overflow problem, - similar to fix just applied to nanohttp.c. - -Mon Feb 9 18:40:21 CET 2004 Igor Zlatkovic <igor@zlatkovic.com> - - * nanohttp.c: fixed the fix for the buffer overflow, thanx - William :-) - -Mon Feb 9 22:37:14 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * acinclude.m4, configure.in: fixed problem concerning - determining SOCKLEN_T as pointed out by Daniel Richard G. - on the mailing list - -Mon Feb 9 15:31:24 CET 2004 Igor Zlatkovic <igor@zlatkovic.com> - - * nanohttp.c: fixed buffer overflow reported by Yuuichi Teranishi - -Mon Feb 9 13:45:59 CET 2004 Daniel Veillard <daniel@veillard.com> - - * xpath.c: small patch from Philip Ludlam to avoid warnings. - -Mon Feb 9 13:41:47 CET 2004 Daniel Veillard <daniel@veillard.com> - - * encoding.c: applied a small patch from Alfred Mickautsch - to avoid an out of bound error in isolat1ToUTF8() - -Mon Feb 9 13:35:50 CET 2004 Daniel Veillard <daniel@veillard.com> - - * xinclude.c: remove the warning on the 2001 namespace - * parser.c parserInternals.c xpath.c: remove some warnings - when compiling with MSVC6 - * nanohttp.c: applied a patch when using _WINSOCKAPI_ - -Sun Feb 8 12:09:55 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * xinclude.c: added a small hack to fix interference between - my fixes for bugs 132585 and 132588. - * python/libxml.c: fixed problem with serialization of namespace - reported on the mailing list by Anthony Carrico - -Sat Feb 7 16:53:11 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * xinclude.c: fixed problem with function xmlXIncludeCopyRange - (bug 133686). - -Fri Feb 6 21:03:41 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * xmlwriter.c: fixed problem with return value of - xmlTextWriterWriteIndent() (bug 133297) - -Fri Feb 6 19:07:04 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * xinclude.c: changed coding to output good XIncludes when - one or more bad ones are present (bug 132588) - -Fri Feb 6 17:34:21 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * xinclude.c: corrected handling of empty fallback condition - (bug 132585) - -Fri Feb 6 15:28:36 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * HTMLparser.c: added initialisation for ctxt->vctxt - in HTMLInitParser (bug 133127) - * valid.c: minor cosmetic change (removed ATTRIBUTE_UNUSED - from several function params) - -Tue Feb 3 16:48:57 PST 2004 William Brack <wbrack@mmm.com.hk> - - * xinclude.c: fixed problem regarding freeing of dictionary - when there are errors within an XInclude file (bug 133106). - Thanks to Oleg Paraschenko for the assistance. - -Tue Feb 3 09:53:18 PST 2004 William Brack <wbrack@mmm.com.hk> - - * xmlschemastypes.c: fixed validation of maxLength with no - content using patch submitted by Eric Haszlakiewicz - (bug 133259) - -Tue Feb 3 09:21:09 CET 2004 Igor Zlatkovic <igor@zlatkovic.com> - - * include/libxml/xmlreader.h include/libxml/xmlmemory.h: added - calling convention to the public function prototypes (rep by - Cameron Johnson) - * include/libxml/xmlexports.h: fixed mingw+msys compilation - (rep by Mikhail Grushinskiy) - -Mon Feb 2 20:22:18 PST 2004 William Brack <wbrack@mmm.com.hk> - - * xmlwriter.c: enhanced output indenting (bug 133264) - -Mon Feb 2 16:13:33 PST 2004 William Brack <wbrack@mmm.com.hk> - - * xmlreader.c, include/libxml/xmlreader.h: applied patch from - Steve Ball to provide structured error reports. - -Sun Feb 1 01:48:14 PST 2004 William Brack <wbrack@mmm.com.hk> - - * tree.c, include/libxml/tree.h: moved serialization of - attribute text data (xmlSerializeContent) into a separate - routine (xmlSerializeTxtContent) so it can be used by xmlwriter.c - * xmlwriter.c: changed handling of attribute string to use the - routine above (fixed bug 131548) - -Sat Jan 31 08:22:02 MST 2004 John Fleck <jfleck@inkstain.net - - * doc/examples/reader1.c, reader2.c, reader3.c - * doc/examples/examples.xml - * doc/examples/*.html - add note that reader examples need libmxl2 > 2.6, rebuild - html - this time doing it correctly :-) - -Fri Jan 30 20:45:36 MST 2004 John Fleck <jfleck@inkstain.net> - - * doc/examples/examples.xml - * doc/examples/*.html - add note that reader examples need libmxl2 > 2.6, rebuild - html - -Thu Jan 29 23:51:48 PST 2004 William Brack <wbrack@mmm.com.hk> - - * xpath.c: added (void *) type override to prevent - warning on Solaris (Bug 132671) - -Wed Jan 28 07:20:37 MST 2004 John Fleck <jfleck@inkstain.net> - - * doc/examples/Makefile.am - per Jan. 15 email to the list from oliverst, the index.html - file from this directory wasn't making it into the tarball - -Mon Jan 26 18:01:00 CET 2004 Daniel Veillard <daniel@veillard.com> - - * acinclude.m4: applied fix from Alexander Winston for a problem - related to automake-1.8 , c.f. #132513 and #129861 - -Mon Jan 26 12:53:11 CET 2004 Daniel Veillard <daniel@veillard.com> - - * doc/examples/index.py: don't rely on . being on the path for - make tests, should keep Mr. Crozat quiet until next time... - -Sun Jan 25 21:45:03 CET 2004 Daniel Veillard <daniel@veillard.com> - - * configure.in NEWS doc/*: preparing release 2.6.5, rebuilt the - docs, checked rngparser stuff does not end up in the tarball - -Sun Jan 25 20:59:20 CET 2004 Daniel Veillard <daniel@veillard.com> - - * python/libxml.c: applied patch from Frederic Peters - fixing the wrong arg order in xpath callback in bug #130980 - -Sun Jan 25 20:52:09 CET 2004 Daniel Veillard <daniel@veillard.com> - - * xinclude.c: fixing #130453 XInclude element with no href attribute - * relaxng.c rngparser.c include/libxml2/relaxng.h: fully integrating - the compact syntax will require more work, postponed for the - 2.6.5 release. - -Sat Jan 24 09:30:22 CET 2004 Daniel Veillard <daniel@veillard.com> - - * include/libxml/schemasInternals.h xmlschemas.c: applied patch from - Steve Ball to avoid a double-free. - -Fri Jan 23 14:03:21 CET 2004 Daniel Veillard <daniel@veillard.com> - - * doc/examples/*: added io1.c an example ox xmlIO usage and io1.res - test result, fixed a awful lot of memory leaks showing up in - testWriter.c, changed the examples and the Makefiles to test - memory leaks. - * xmlwriter.c: fixed a memory leak - * Makefile.am: run the doc/examples regression tests as part of - make tests - * xpath.c include/libxml/xpath.h: added xmlXPathCtxtCompile() to - compile an XPath expression within a context, currently the goal - is to be able to reuse the XSLT stylesheet dictionary, but this - opens the door to others possible optimizations. - * dict.c include/libxml/dict.h: added xmlDictCreateSub() which allows - to build a new dictionary based on another read-only dictionary. - This is needed for XSLT to keep the stylesheet dictionary read-only - while being able to reuse the strings for the transformation - dictionary. - * xinclude.c: fixed a dictionary reference counting problem occurring - when document parsing failed. - * testSAX.c: adding option --repeat for timing 100times the parsing - * doc/* : rebuilt all the docs - -Thu Jan 22 14:17:05 2004 Aleksey Sanin <aleksey@aleksey.com> - - * xmlmemory.c: make xmlReallocLoc() accept NULL pointer - -Thu Jan 22 08:26:20 CET 2004 Daniel Veillard <daniel@veillard.com> - - * xmlschemastypes.c: applied patch from John Belmonte for - normalizedString datatype support. - -Thu Jan 22 10:43:22 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * xpath.c: fixed problem with union when last() is used - in predicate (bug #131971) - * xpointer.c: minor change to comment for doc generation - -Wed Jan 21 17:03:17 CET 2004 Daniel Veillard <daniel@veillard.com> - - * parser.c: fixed bug #131745 raised by Shaun McCance with the - suggested patch - -Wed Jan 21 10:59:55 CET 2004 Daniel Veillard <daniel@veillard.com> - - * xmlwriter.c: applied patch from Alfred Mickautsch fixing a memory - leak reported on the list. - -Thu Jan 15 00:48:46 CET 2004 Daniel Veillard <daniel@veillard.com> - - * python/generator.py python/tests/tstLastError.py: applied - patch from Stéphane Bidoul to add enums to the Python bindings. - -Tue Jan 13 21:50:05 CET 2004 Daniel Veillard <daniel@veillard.com> - - * testHTML.c: another small patch from Mark Vakoc - -Tue Jan 13 21:39:58 CET 2004 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c relaxng.c testRelax.c testSchemas.c: applied - patch from Mark Vakoc to not use SAX1 unless necessary. - -Mon Jan 12 17:22:57 CET 2004 Daniel Veillard <daniel@veillard.com> - - * dict.c parser.c xmlstring.c: some parser optimizations, - xmllint --memory --timing --repeat --stream ./db10000.xml - went down from 16.5 secs to 15.5 secs. - -Thu Jan 8 17:57:50 CET 2004 Daniel Veillard <daniel@veillard.com> - - * xmlschemas.c: removed a memory leak remaining from the switch - to a dictionary for string allocations c.f. #130891 - -Thu Jan 8 17:48:46 CET 2004 Daniel Veillard <daniel@veillard.com> - - * xmlreader.c: fixing some problem if configured --without-xinclude - c.f. #130902 - -Thu Jan 8 17:42:48 CET 2004 Daniel Veillard <daniel@veillard.com> - - * configure.in: changed AC_OUTPUT() macro to avoid a cygwin problem - c.f. #130896 - -Thu Jan 8 00:36:00 CET 2004 Daniel Veillard <daniel@veillard.com> - - * win32/Makefile.bcb win32/Makefile.mingw win32/Makefile.msvc: - applying patch from Mark Vakoc for Windows - * doc/catalog.html doc/encoding.html doc/xml.html: applied doc - fixes from Sven Zimmerman - -Tue Jan 6 23:51:46 CET 2004 Daniel Veillard <daniel@veillard.com> - - * python/libxml2-python-api.xml python/libxml_wrap.h python/types.c - python/tests/Makefile.am python/tests/tstLastError.py: applied - patch from Stéphane Bidoul for structured error handling from - python, and the associated test - -Tue Jan 6 23:18:11 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * configure.in: fixed Bug130593 - * xmlwriter.c: fixed compilation warning - -Tue Jan 6 15:15:23 CET 2004 Daniel Veillard <daniel@veillard.com> - - * include/libxml/xmlstring.h: fixed the comment in the header - * doc/*: rebuilt the docs - -Tue Jan 6 19:40:04 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * encoding.c, parser.c, xmlstring.c, Makefile.am, - include/libxml/Makefile.am, include/libxml/catalog.c, - include/libxml/chvalid.h, include/libxml/encoding.h, - include/libxml/parser.h, include/libxml/relaxng.h, - include/libxml/tree.h, include/libxml/xmlwriter.h, - include/libxml/xmlstring.h: - moved string and UTF8 routines out of parser.c and encoding.c - into a new module xmlstring.c with include file - include/libxml/xmlstring.h mostly using patches from Reid - Spencer. Since xmlChar now defined in xmlstring.h, several - include files needed to have a #include added for safety. - * doc/apibuild.py: added some additional sorting for various - references displayed in the APIxxx.html files. Rebuilt the - docs, and also added new file for xmlstring module. - * configure.in: small addition to help my testing; no effect on - normal usage. - * doc/search.php: added $_GET[query] so that persistent globals - can be disabled (for recent versions of PHP) - -Mon Jan 5 20:47:07 MST 2004 John Fleck <jfleck@inkstain.net> - - * doc/tutorial/customfo.xsl - * doc/tutorial/customhtml.xsl - update custom tutorial-building stylesheets in preparation - for tutorial update - -Tue Jan 6 00:10:33 CET 2004 Daniel Veillard <daniel@veillard.com> - - * rngparser.c: committing the compact relax ng parser. It's not - completely finished, it's not integrated but I want to save the - current state - -Mon Jan 5 22:22:48 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * doc/apibuild.py, doc/APIconstructors.html, doc/libxml2-refs.xml, - win32/libxml2.def.src: fixed apibuild.py's generation of - "constructors" to be in alphabetical order (instead of previous - random sequence); regenerated resulting files. - -Mon Jan 5 14:03:59 CET 2004 Daniel Veillard <daniel@veillard.com> - - * xmlwriter.c: applied patch from Lucas Brasilino fixing an indent - problem. - -Sun Jan 4 18:54:29 MST 2004 John Fleck <jfleck@inkstain.net> - - * doc/newapi.xsl: change background color of function - declaration to improve readability - * doc/*: rebuild docs with new stylesheet - -Sun Jan 4 22:45:14 HKT 2004 William Brack <wbarck@mmm.com.hk> - - * parser.c, include/libxml/parser.h: added a routine - xmlStrncatNew to create a new string from 2 frags. - * tree.c: added code to check if node content is from - dictionary before trying to change or concatenate. - -Sun Jan 4 08:57:51 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * xmlmemory.c: applied suggestion from Miloslav Trmac (see - Bug 130419) and eliminated xmlInitMemoryDone. More - improvement needed. - * xml2-config.in: added an additional flag (--exec-prefix) to - allow library directory to be different from include directory - (Bug 129558). - -Fri Jan 2 21:22:18 CET 2004 Daniel Veillard <daniel@veillard.com> - - * error.c: applied patch from Stéphane Bidoul for structured error - reporting. - -Fri Jan 2 21:03:17 CET 2004 Daniel Veillard <daniel@veillard.com> - - * include/libxml/xmlwriter.h xmlwriter.c: applied the patch from - Lucas Brasilino to add indentation support to xmlWriter - -Fri Jan 2 22:58:29 HKT 2004 William Brack <wbrack@mmm.com.hk> - - * xinclude.c: fixed problem with "recursive" include (fallback - contains another include - Bug 129969) - -Fri Jan 2 11:40:06 CET 2004 Daniel Veillard <daniel@veillard.com> - - * SAX2.c: found and fixed a bug misallocating some non - blank text node strings from the dictionary. - * xmlmemory.c: fixed a problem with the memory debug mutex - release. - -Wed Dec 31 22:02:37 HKT 2003 William Brack <wbrack@mmm.com.hk> - - * xinclude.c: fixed problem caused by wrong dictionary - reference count, reported on the list by Christopher - Grayce. - -Wed Dec 31 15:55:55 HKT 2003 William Brack <wbrack@mmm.com.hk> - - * python/generator.py, python/libxml2class.txt: fixed problem - pointed out by Stéphane Bidoul on the list. - * xinclude.c, xpointer.c, xpath.c, include/libxml/xpointer.h: - completed modifications required to fix Bug 129967 (at last!). - Now wait to see how long before further trouble... - -Tue Dec 30 16:26:13 HKT 2003 William Brack <wbrack@mmm.com.hk> - - * parser.c, xmlmemory.c, include/libxml/xmlmemory.h: Fixed - memory leak reported by Dave Beckett - * xmlschemas.c: Removed spurious comment reported on the mailing - list - * xinclude.c, xpath.c, xpointer.c, libxml/include/xpointer.h: - Further work on Bug 129967 concerning xpointer range handling - and range-to function; much better, but still not complete - -Mon Dec 29 18:08:05 CET 2003 Daniel Veillard <daniel@veillard.com> - - * valid.c: xmlValidateElement could crash for element holding a - namespace declaration but not in a namespace. Oliver Fischer - provided the example. - -Mon Dec 29 11:29:31 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xmllint.c: issue validation status on stderr, not stdout as suggested - by Pawel Palucha - * result/relaxng/*: this change slightly all the output from RNG - regressions. - -Mon Dec 28 10:47:32 HKT 2003 William Brack <wbrack@mmm.com.hk> - - * xmlschemas.c: edited a couple of comments in accordance with - posting on the mailing list (no logic change) - * xpointer.c: working on Bug 129967, added check for NULL - nodeset to prevent crash. Further work required. - * xpath.c: working on Bug 129967, added code to handle - XPATH_LOCATIONSET in RANGETO code, also added code to - handle it in xmlXPathEvaluatePredicateResult. Further - work required. - -Sat Dec 27 12:32:58 HKT 2003 William Brack <wbrack@mmm.com.hk> - - * xmlschemas.c: added tests for xs:all to assure minOccurs - and maxOccurs <= 1 (Bug 130020) - -Sat Dec 27 09:53:06 HKT 2003 William Brack <wbrack@mmm.com.hk> - - * xmlregexp.c: fixed xmlFAParseCharRange for Unicode ranges - with patch from Charles Bozeman. - -Fri Dec 26 14:03:41 HKT 2003 William Brack <wbrack@mmm.com.hk> - - * xmlregexp.c: fixed problem causing segfault on validation error - condition (reported on mailing list) - -Thu Dec 25 21:16:22 HKT 2003 William Brack <wbrack@mmm.com.hk> - - * xmlschemas.c: fixed missing dictionaries for Memory and Doc - parser contexts (problem reported on mailing list) - * doc/apibuild.py: small change to prevent duplicate lines - on API functions list. It will take effect the next time - the docs are rebuilt. - -Wed Dec 24 12:54:25 CET 2003 Daniel Veillard <daniel@veillard.com> - - * configure.in NEWS doc/*: updated the docs and prepared a new - release 2.6.4 - -Wed Dec 24 12:07:52 CET 2003 Daniel Veillard <daniel@veillard.com> - - * legacy.c: remove deprecated warning on startElement() - -Wed Dec 24 12:04:35 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xinclude.c result/XInclude/nodes2.*: XInclude xpointer support - was broken with the new namespace. Fixes #129932 - -Wed Dec 24 00:29:30 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xmlschemas.c include/libxml/schemasInternals.h: types might be - redefined in includes, quick fix to allow this but lacks the - equality of the redefinition test. - -Tue Dec 23 15:14:37 HKT 2003 William Brack <wbrack@mmm.com.hk> - - * valid.c: fixed bug concerning validation using external - dtd of element with multiple namespace declarations - (Bug 129821) - -Tue Dec 23 11:41:42 HKT 2003 William Brack <wbrack@mmm.com.hk> - - * tree.c: inhibited production of "(null):" in xmlGetNodePath - when node has default namespace (Bug 129710) - -Tue Dec 23 09:29:14 HKT 2003 William Brack <wbrack@mmm.com.hk> - - * xpath.c: small enhancement to xmlXPathCmpNodes to assure - document order for attributes is retained (Bug 129331) - -Mon Dec 22 19:06:16 CET 2003 Daniel Veillard <daniel@veillard.com> - - * parser.c xmlreader.c: change xmlReadFd() xmlCtxtReadFd() - xmlReaderNewFd() xmlReaderForFd(), change those to not close - the file descriptor. Updated the comment, should close #129683 - -Mon Dec 22 00:34:09 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xinclude.c: fixed a serious problem in XInclude #129021 - -Sun Dec 21 13:59:54 CET 2003 Daniel Veillard <daniel@veillard.com> - - * parser.c: fixed bug #129489, propagation of parsing flags - in entities. - * parser.c xmlreader.c: improved the comments of parsing options - -Sun Dec 21 18:14:04 HKT 2003 William Brack <wbrack@mmm.com.hk> - - * python/Makefile.am, python/tests/Makefile.am, - doc/Makefile.am: applied fixes to allow build from - 'outside' directory (Bug 129172) - -Sat Dec 20 16:42:07 MST 2003 John Fleck <jfleck@inkstain.net> - - * tree.c - add explanation of namespace inheritance when - ns is NULL to xmlNewChild and xmlNewTextChild API doc - -Sat Dec 20 18:17:28 HKT 2003 William Brack <wbrack@mmm.com.hk> - - * include/libxml/xpathInternals.h: undid last change (my - bad). Put necessary fix in libxslt/libexslt instead. - * include/libxml/DOCBparser.h: put test for __GCC__ on - warning directive (Bug 129105) - -Sat Dec 20 10:48:37 HKT 2003 William Brack <wbrack@mmm.com.hk> - - * include/libxml/xpathInternals.h: fixed xmlXPathReturnString - to cater for NULL pointer (bug 129561) - * globals.c: added comment to suppress documentation warning - * doc/apibuild.py: fixed problem which caused last APIchunkxx.html - to be lost. Rebuilt doc/* (including adding APIchunk26.html) - -Fri Dec 19 18:24:02 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xmlreader.c: trying to fix #129692 xmlTextReaderExpand() when - using an xmlReaderWalker() - -Thu Dec 18 20:10:34 MST 2003 John Fleck <jfleck@inkstain.net> - - * tree.c: fix misc. typos in doc comments - * include/libxml/tree.h: elaborate on macro define doc comments - * doc/*: rebuild docs - -Wed Dec 17 16:07:33 CET 2003 Daniel Veillard <daniel@veillard.com> - - * doc/examples/*: don't call the result files .out but .res as - the Makefiles tend to try generating binaries for .out targets... - -Tue Dec 16 20:53:54 MST 2003 John Fleck <jfleck@inkstain.net> - - * doc/html/libxml-pattern.html: - cvs add API docs for new - pattern stuff - -Tue Dec 16 20:40:40 MST 2003 John Fleck <jfleck@inkstain.net> - - * tree.c - * doc/*: - Elaborate in documentation discussion of xmlNewChild - and xmlNewTextChild. Thanks to Steve Lenti for pointing - out the usefulness of a more explicit explanation of the - reserved character escaping issue. - -Fri Dec 12 15:55:15 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xmlcatalog.c: applied patch from Stefan Kost - -Thu Dec 11 15:15:31 CET 2003 Daniel Veillard <daniel@veillard.com> - - * doc/examples/testWriter.c: applied small fix from Lucas Brasilino - -Thu Dec 11 14:55:22 CET 2003 Igor Zlatkovic <igor@zlatkovic.com> - - * win32/Makefile.* win32/configure.js: Added pattern support - -Wed Dec 10 14:11:20 CET 2003 Daniel Veillard <daniel@veillard.com> - - * configure.in doc/* libxml.spec.in: preparing release of - libxml2-2.6.3, updated and regenerated the docs. - -Wed Dec 10 11:43:33 CET 2003 Daniel Veillard <daniel@veillard.com> - - * SAX2.c pattern.c: removed some compilation warnings - -Wed Dec 10 11:16:29 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xmllint.c: fixing bug #119264 xmllint failing to report - serialization errors in some cases. - -Tue Dec 9 23:50:23 CET 2003 Daniel Veillard <daniel@veillard.com> - - * entities.c: fixed an XML entities content serialization - potentially triggered by XInclude, see #126817 - -Tue Dec 9 16:12:50 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xmlwriter.c: applied the patch to xmlTextWriterStartPI() - suggested by Daniel Schulman in #128313 - -Tue Dec 9 15:18:32 CET 2003 Daniel Veillard <daniel@veillard.com> - - * configure.in Makefile.am: another patch from Kenneth Haley - for Mingw, c.f. #128787 - -Tue Dec 9 15:07:09 CET 2003 Daniel Veillard <daniel@veillard.com> - - * include/libxml/xmlexports.h: applied patch from Kenneth Haley - for compiling on Mingw see #128786 - -Tue Dec 9 14:52:59 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xmllint.c: some flags were not passed down correctly as - parsing options. Fixes #126806 - -Tue Dec 9 12:29:26 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xinclude.c xmllint.c xmlreader.c include/libxml/xinclude.h - include/libxml/xmlerror.h: augmented the XInclude API - to be able to pass XML parser flags down to the Inclusion - process. Also resynchronized with the Last Call W3C Working - Draft 10 November 2003 for the xpointer attribute. - * Makefile.am test/XInclude/docs/nodes[23].xml - result/XInclude/*: augmented the tests for the new namespace and - testing the xpointer attribute, changed the way error messages - are tested - * doc/*: regenerated the documentation - -Mon Dec 8 18:38:26 CET 2003 Daniel Veillard <daniel@veillard.com> - - * error.c: filter warning messages if the global setting blocks them - * xinclude.c xmlreader.c include/libxml/xinclude.h - include/libxml/xmlerror.h: updated the change of namespace at - the XInclude level, raise a warning if the old one is found, - and some cleanup - -Mon Dec 8 13:09:39 CET 2003 Daniel Veillard <daniel@veillard.com> - - * tree.c: tentative fix for #126117 character reference in - attributes output problem in some cornercase. - -Mon Dec 8 11:08:45 CET 2003 Daniel Veillard <daniel@veillard.com> - - * python/libxml.py: tried to fix the problems reported in - bug #126735 - * xpath.c SAX2.c error.c parser.c valid.c include/libxml/xmlerror.h: - fixed again some problem trying to use the structured error - handlers, c.f. bug #126735 - * result/VC/ElementValid: tiny change due to the fix - -Sun Dec 7 22:27:31 CET 2003 Daniel Veillard <daniel@veillard.com> - - * error.c: fixed __xmlRaiseError to use structured error handlers - defined by xmlSetStructuredErrorFunc(), fixes bug #126211 - -Sun Dec 7 20:30:53 CET 2003 Daniel Veillard <daniel@veillard.com> - - * parser.c: attempt to fix #126211 ... - -Fri Dec 5 17:07:29 CET 2003 Daniel Veillard <daniel@veillard.com> - - * pattern.c xmlreader.c xmllint.c include/libxml/pattern.h - include/libxml/xmlreader.h: fixed the pattern interfaces - but not yet the parser to handle the namespaces. - * doc/examples/reader3.c doc/*: fixed the example, rebuilt the docs. - -Fri Dec 5 15:49:44 CET 2003 Daniel Veillard <daniel@veillard.com> - - * globals.c xmlwriter.c doc/apibuild.py include/libxml/globals.h - include/libxml/pattern.h include/libxml/schemasInternals.h - include/libxml/xmlexports.h include/libxml/xmlwriter.h: cleanup - the make rebuild in doc, this include new directive to stop - documentation warnings - * doc/* doc/html/*: rebuilt the docs - * pattern.c xmlreader.c include/libxml/pattern.h - include/libxml/xmlreader.h: adding xmlTextReaderPreservePattern() - to save nodes while scanning the tree with the reader, cleanup - the way element were freed, and xmlTextReaderPreserve() - implementation, the API might change for namespace binding support - when compiling patterns. - * doc/examples/*: added reader3.c exposing the xmlTextReaderPreserve() - -Thu Dec 4 15:10:57 CET 2003 Daniel Veillard <daniel@veillard.com> - - * python/libxml.py: oops forgot to modify/commit the new code. - -Thu Dec 4 13:29:19 CET 2003 Daniel Veillard <daniel@veillard.com> - - * python/generator.py python/libxml.c python/libxml_wrap.h: - cleanup the output buffer support to at least get the basic - to work - * python/tests/outbuf.py python/tests/serialize.py: fixes and - cleanup. - * include/libxml/xmlwriter.h: cleanup - -Wed Dec 3 21:38:56 MST 2003 John Fleck <jfleck@inkstain.net> - - * include/libxml/xmlversion.h.in - * doc/*: add WITH_TRIO comment so it shows up in the docs, rebuild - docs - -Wed Dec 3 13:10:08 CET 2003 Daniel Veillard <daniel@veillard.com> - - * config.h.in configure.in xmlregexp.c: fix bug #128401 affecting - regexp quantifiers - -Tue Dec 2 23:29:56 CET 2003 Daniel Veillard <daniel@veillard.com> - - * pattern.c include/libxml/pattern.h: adding the pattern node - selection code. Inheried in part from libxslt but smaller. - * Makefile.am configure.in include/libxml/xmlversion.h.in: - integrated the pattern module, made it a configure time option - * xmllint.c: added --pattern to test when doing --stream - -Tue Dec 2 11:25:25 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xmlreader.c: fixed a problem in xmlreader validation when - streaming exposed by reader2 example. - -Mon Dec 1 20:40:51 MST 2003 John Fleck <jfleck@inkstain.net> - - * doc/xml.html - * doc/docs.html: - add reference to the Code Examples page to docs.html list - of resources - -Mon Dec 1 12:30:28 CET 2003 Igor Zlatkovic <igor@zlatkovic.com> - - * win32/Makefile.bcb win32/configure.js: Applied the BCB patch - from Eric - -Sun Nov 30 21:33:37 MST 2003 John Fleck <jfleck@inkstain.net> - - * include/libxml/xinclude.h - * doc/*: Add comments for macro definitions in xinclude.h and - rebuild the docs - -Sun Nov 30 21:06:29 MST 2003 John Fleck <jfleck@inkstain.net> - - * doc/docdescr.doc - Updating William's explanation of how to build docs, - reflecting Daniel's new docs build system - -Sat Nov 29 18:38:22 HKT 2003 William Brack <wbrack@mmm.com.hk> - - * xmlmemory.c: enhanced by adding mutex to protect global - structures in a multi-threading environment. This fixed - some random errors on the Threads regression tests. - -Fri Nov 28 21:39:49 MST 2003 John Fleck <jfleck@inkstain.net> - - * doc/xml.html doc/python.html: fix tst.py text, which didn't - import sys - -Fri Nov 28 17:28:47 HKT 2003 William Brack <wbrack@mmm.com.hk> - - * encoding.c, include/libxml/encoding.h: Enhanced the handling of - UTF-16, UTF-16LE and UTF-16BE encodings. Now UTF-16 output is - handled internally by default, with proper BOM and UTF-16LE - encoding. Native UTF-16LE and UTF-16BE encoding will not generate - BOM on output, and will be automatically recognized on input. - * test/utf16lebom.xml, test/utf16bebom.xml, result/utf16?ebom*: - added regression tests for above. - -Thu Nov 27 19:25:10 CET 2003 Igor Zlatkovic <igor@zlatkovic.com> - - * win32/Makefile.* win32/configure.js: Modified to allow coexistent - build with all compilers. Added C-Runtime option for MSVC. Included - xmlWriter. - * xmlwriter.c: Added IN_LIBXML macro - -Wed Nov 26 21:54:01 CET 2003 Igor Zlatkovic <igor@zlatkovic.com> - - * win32/Makefile.bcb: applied patch from Eric - -Wed Nov 26 21:33:14 CET 2003 Daniel Veillard <daniel@veillard.com> - - * include/libxml/tree.h: stefan on IRC pointed out that XML_GET_LINE - is broken on 2.6.x - -Tue Nov 25 18:39:44 CET 2003 Daniel Veillard <daniel@veillard.com> - - * entities.c: fixed #127877, never output " in element content - * result/isolat3 result/slashdot16.xml result/noent/isolat3 - result/noent/slashdot16.xml result/valid/REC-xml-19980210.xml - result/valid/index.xml result/valid/xlink.xml: this changes the - output of a few tests - -Tue Nov 25 16:36:21 CET 2003 Daniel Veillard <daniel@veillard.com> - - * include/libxml/schemasInternals.h include/libxml/xmlerror.h - testSchemas.c xmlschemas.c: added xsd:include support, fixed - testSchemas behaviour when a schemas failed to parse. - * test/schemas/vdv-* result/schemas/vdv-first5_0_0*: added one - test for xsd:include from Eric Van der Vlist - -Tue Nov 25 08:18:12 CET 2003 Daniel Veillard <daniel@veillard.com> - - * parser.c: swapped the attribute defaulting and attribute checking - parts of parsing a new element start, fixes bug #127772 - * result/valid/127772.* test/valid/127772.xml - test/valid/dtds/127772.dtd: added the example in the regression tests - -Tue Nov 25 08:00:15 CET 2003 Daniel Veillard <daniel@veillard.com> - - * parser.c: moved xmlCleanupThreads() to the end of xmlCleanupParser() - to avoid bug #127851 - -Mon Nov 24 15:26:21 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xmlregexp.c: fixing some Negative Character Group and - Character Class Subtraction handling. - -Mon Nov 24 14:01:57 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xmlregexp.c xmlschemas.c: more XML Schemas fixes based - on Eric van der Vlist examples - * result/schemas/vdv-first4* test/schemas/vdv-first4*: - added regression tests - * doc/examples/Makefile.am doc/examples/index.py: do not - regenerate the index on make all target, but only on - make rebuild to avoid troubles. - -Sat Nov 22 21:35:42 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xmlschemas.c xmlschemastypes.c include/libxml/xmlerror.h - include/libxml/schemasInternals.h: lot of bug fixes, cleanup, - starting to add proper namespace support too. - * test/schemas/* result/schemas/*: added a number of tests - fixed the result from some regression tests too. - -Fri Nov 21 20:50:59 MST 2003 John Fleck <jfleck@inkstain.net> - - * doc/xml.html, docs.html: remove reference to gtk-doc now that - Daniel has removed it, fix link to George's IBM article, other - minor edits - -Fri Nov 21 01:26:00 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xmlschemas.c: applied patch from Robert Stepanek to start - import os schemas support, cleaned up stuff and the patch. - * test/schemas/import0_0.* result/schemas/import0_0_0*: added test - to regression, fixed a few regressions too. - -Thu Nov 20 22:58:00 CET 2003 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: applied two parsing fixes from James Bursa - -Thu Nov 20 19:20:46 CET 2003 Daniel Veillard <daniel@veillard.com> - - * doc/examples/*: added two xmlReader examples - * xmlreader.c: cleaned up some bugs in the process - -Thu Nov 20 12:54:30 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xmlwriter.c include/libxml/xmlwriter.h: applied patch from - Alfred Mickautsch, bugfixes and comments - * doc/examples/*: added his test as the xmlWriter example - * doc/html/ doc/*.html: this resulted in some improvements - * include/libxml/hash.h: fixed an inclusion problem when - <libxml/hash.h> wasn't preceded by <xml/parser.h> - -Wed Nov 19 17:19:35 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xinclude.c: fix an error message - * doc/examples/*: added tree2 example from Lucas Brasilino - -Wed Nov 19 17:50:47 HKT 2003 William Brack <wbrack@mmm.com.hk> - - * doc/newapi.xsl: improve the sort sequence for page content - * doc/html/*.html: regenerate the web pages - -Wed Nov 19 00:48:56 CET 2003 Daniel Veillard <daniel@veillard.com> - - * Makefile.am: do not package cvs versioning temp files. - * doc/apibuild.py doc/libxml2-api.xml doc/newapi.xsl: more cleanup, - slightly improved the API xml format, fixed a lot of small - rendering problems - * doc/html/libxml*.html: rebuilt - -Tue Nov 18 21:51:15 CET 2003 Daniel Veillard <daniel@veillard.com> - - * include/libxml/*.h include/libxml/*.h.in: modified the file - header to add more information, painful... - * genChRanges.py genUnicode.py: updated to generate said changes - in headers - * doc/apibuild.py: extract headers, add them to libxml2-api.xml - * *.html *.xsl *.xml: updated the stylesheets to flag geprecated - APIs modules. Updated the stylesheets, some cleanups, regenerated - * doc/html/*.html: regenerated added back book1 and libxml-lib.html - -Tue Nov 18 14:43:16 CET 2003 Daniel Veillard <daniel@veillard.com> - - * doc/Makefile.am doc/*.xsl doc/*.html doc/apibuild.py: cleaned up - the build process to remove all remains from the old gtk-doc - inherited, libxml2-refs.xml is now generated by apibuild.py, the - stylesheets have been improved, and the API*html now generated - are XHTML1 valid too - -Tue Nov 18 14:28:32 HKT 2003 William Brack <mmm.com.hk> - - * genChRanges.py, chvalid.c, include/libxml/chvalid.h: minor - enhancement to prevent comment with unreferenced variable. - * threads.c xmlreader.c xmlwriter.c: edited some comments to - improve auto-generation of documentation - * apibuild.py: minor change to an error message - -Mon Nov 17 17:55:51 CET 2003 Daniel Veillard <daniel@veillard.com> - - * doc/apibuild.py doc/libxml2-api.xml doc/newapi.xsl: more cleanup, - improving navigation - * doc/html/*.html: updated the result - -Mon Nov 17 14:54:38 CET 2003 Daniel Veillard <daniel@veillard.com> - - * doc/Makefile.am doc/apibuild.py doc/libxml2-api.xml doc/newapi.xsl: - improvement of the stylesheets, fixed a API generation problem, - switched the stylesheet and Makefile to build the HTML output. - * doc/html/*.html: complete update, ditched some old files, might - introduce some breakage... - -Mon Nov 17 12:50:28 CET 2003 Daniel Veillard <daniel@veillard.com> - - * doc/newapi.xsl: lot of improvements, this starts looking good - enough to be usable. - -Mon Nov 17 00:58:09 CET 2003 Daniel Veillard <daniel@veillard.com> - - * doc/newapi.xsl: stylesheet to build HTML pages from the - API XML description, Work in Progress - -Sun Nov 16 16:03:24 HKT 2003 William Brack <wbrack@mmm.com.hk> - - * xpath.c: fixed bug 126976 (string != empty nodeset - should be false) - -Sun Nov 16 14:00:08 HKT 2003 William Brack <wbrack@mmm.com.hk> - - * doc/html/*.html: Finally - found the problem with the - page generation (XMLPUBFUN not recognized by gtkdoc). - Re-created the pages using a temporary version of - include/libxml/*.h. - * testOOMlib.c,include/libxml/encoding.h, - include/libxml/schemasInternals.h,include/libxml/valid.h, - include/libxml/xlink.h,include/libxml/xmlwin32version.h, - include/libxml/xmlwin32version.h.in, - include/libxml/xpathInternals.h: minor edit of comments - to help automatic documentation generation - * doc/docdescr.doc: small elaboration - * doc/examples/test1.c,doc/examples/Makefile.am: re-commit - (messed up on last try) - * xmlreader.c: minor change to clear warning. - -Sat Nov 15 19:20:32 CET 2003 Daniel Veillard <daniel@veillard.com> - - * Copyright: fixed some wording - * libxml.spec.in: make sure doc/examples is packaged - * include/libxml/tree.h valid.c xmlreader.c: fixed the really - annoying problem about xmlRemoveID and xmlReader streaming. - Thing looks fixed now, had to add a doc reference to the - xmlID structure though... - -Sat Nov 15 09:53:36 MST 2003 John Fleck <jfleck@inkstain.net> - - * doc/docdescr.doc: added description of man page building - -Sat Nov 15 19:08:22 HKT 2003 William Brack <wbrack@mmm.com.hk> - - * doc/html/libxml-chvalid.html, doc/html/libxml-dict.html, - doc/html/libxml-list.html, doc/html/libxml-testOOMlib.html, - doc/html/libxml-wincecompat, doc/html/winsockcompat.html, - doc/html/libxml-xmlexports.html, doc/html/libxml-xmlversion.html, - doc/html/libxml-xmlwin32version.html, doc/html/libxml-xmlwriter.html: - added missing pages for the website. - -Sat Nov 15 18:23:48 HKT 2003 William Brack <wbrack@mmm.com.hk> - - * doc/Makefile.am doc/*.html doc/html/*.html: rebuilt the - generated pages (again), manually restored doc/html/index.html - and manually edited generated file doc/gnome-xml.xml to put - in appropriate headings. - * doc/docdescr.doc: new file to describe details of the - document generation (helps my memory for the next time) - * genChRanges.py,chvalid.c,include/libxml/chvalid.h: minor - enhancement to please the automatic documentation generation. - -Fri Nov 14 23:47:31 HKT 2003 William Brack <wbrack@mmm.com.hk> - - * catalog.c,relaxng.c,testAutomata.c,xpointer.c,genChRanges.py, - chvalid.c,include/libxml/chvalid.h,doc/examples/test1.c: - minor error cleanup for gcc-3.3.[12] compilation warnings. - -Fri Nov 14 15:08:13 HKT 2003 William Brack <wbrack@mmm.com.hk> - - * tree.c: minor changes to some comments - * doc/*.html: rebuilt the generated HTML pages for changes - from jfleck (bug 126945) - -Thu Nov 13 12:44:14 CET 2003 Daniel Veillard <daniel@veillard.com> - - * doc/examples/*: added Dodji's example, added output handling - -Thu Nov 13 11:35:35 CET 2003 Daniel Veillard <daniel@veillard.com> - - * doc/examples/*: added Aleksey XPath example, fixed bugs - in the indexer - -Wed Nov 12 23:48:26 CET 2003 Daniel Veillard <daniel@veillard.com> - - * doc/*: integrating the examples in the navigation menus - * doc/examples/*: added make tests, updated the navigation, - added a new test, cleanups, updates. - -Wed Nov 12 17:50:36 CET 2003 Daniel Veillard <daniel@veillard.com> - - * doc/*.html: rebuilt the generated HTML pages - * doc/examples/*: updated the stylesheets, added a synopsis, - Makefile.am is now generated by index.py - -Wed Nov 12 01:38:16 CET 2003 Daniel Veillard <daniel@veillard.com> - - * doc/site.xsl doc/examples/Makefile.am doc/examples/index.html: - added autogeneration of a web page for the examples - * doc/examples/example1.c doc/examples/.cvsignore - doc/examples/examples.xml doc/examples/index.py: updated the - information extracted, improved the format and indexing. - -Tue Nov 11 22:08:59 CET 2003 Daniel Veillard <daniel@veillard.com> - - * check-xinclude-test-suite.py: less verbose on difference - * libxml.spec.in: cleanup - * parser.c: fixed xmlCleanupParser() doc - * doc/Makefile.am doc/apibuild.py doc/libxml2-api.xml - doc/examples/Makefile.am doc/examples/example1.c - doc/examples/examples.xml doc/examples/index.py - doc/examples/test1.xml: work on adding C examples and - generating automated information about those. examples.xml - is autogenerated describing the examples. - * example/Makefile.am: cleanup - -Mon Nov 10 23:47:03 HKT 2003 William Brack <wbrack@mmm.com.hk> - - * genUnicode.py, xmlunicode.c, include/libxml/xmlunicode.h: - fixed missing '-' in block names, enhanced the hack for - ABI aliasing. - -Sun Nov 9 20:28:21 HKT 2003 William Brack <wbrack@mmm.com.hk> - - * genUnicode.py, xmlunicode.c, include/libxml/xmlunicode.h, - python/libxml2class.txt: enhanced for range checking, - updated to Unicode version 4.0.1 (API docs also updated) - * python/generator.py: minor change to fix a warning - -Wed Nov 5 23:46:36 CET 2003 Daniel Veillard <daniel@veillard.com> - - * Makefile.am: apply fix from Karl Eichwalder for script path - -Wed Nov 5 10:49:20 CET 2003 Daniel Veillard <daniel@veillard.com> - - * win32/configure.js: applied patch from Mark Vakoc to simplify - his work from CVS checkouts. - -Tue Nov 4 21:16:47 MST 2003 John Fleck <jfleck@inkstain.net> - - * doc/xmlreader.html: minor cleanups - -Tue Nov 4 15:52:28 PST 2003 William Brack <wbrack@mmm.com.hk> - - * include/libxml/xmlversion.h.in: changed macro ATTRIBUTE_UNUSED - for gcc so that, if undefined, it's defined as - __attribute__((unused)) - -Tue Nov 4 15:28:07 PST 2003 William Brack <wbrack@mmm.com.hk> - - * python/generator.py: small enhancement to assure ATTRIBUTE_UNUSED - appears after the variable declaration. - * valid.c: trivial change to eliminate a warning message - -Tue Nov 4 11:24:04 CET 2003 Daniel Veillard <daniel@veillard.com> - - * configure.in NEWS doc/*: preparing release 2.6.2, updated and - rebuilt the docs - -Tue Nov 4 09:38:46 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xmllint.c: change --html to make sure we use the HTML serialization - rule by default when HTML parser is used, add --xmlout to allow to - force the XML serializer on HTML. - * HTMLtree.c: ugly tweak to fix the output on <p> element and - solve #125093 - * result/HTML/*: this changes the output of some tests - -Mon Nov 3 17:51:28 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xinclude.c: fixed bug #125812, about XPointer in XInclude - failing but not returning an error. - -Mon Nov 3 17:18:22 CET 2003 Daniel Veillard <daniel@veillard.com> - - * valid.c: fixed bug #125811 related to DTD post validation - where the DTD doesn't pertain to a document. - -Mon Nov 3 15:25:58 CET 2003 Daniel Veillard <daniel@veillard.com> - - * parser.c xmlIO.c include/libxml/parserInternals.h: implemented - the XML_PARSE_NONET parser option. - * xmllint.c: converted xmllint.c to use the option instead of - relying on the global resolver variable. - -Mon Nov 3 13:26:32 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xinclude.c xmlreader.c include/libxml/xinclude.h: adding XInclude - support to the reader interface. Lot of testing of the walker, - various bug fixes. - * xmllint.c: added --walker and made sure --xinclude --stream --debug - works as expected - * Makefile.am result/dtd11.rdr result/ent6.rdr test/dtd11 test/ent6 - result/XInclude/*.rdr: added regression tests for the walker and - XInclude xmlReader support, had to slightly change a couple of tests - because the walker can't distinguish <foo/> from <foo></foo> - -Sat Nov 1 17:42:27 CET 2003 Daniel Veillard <daniel@veillard.com> - - * tree.c nanohttp.c threads.c: second BeOS patch from - Marcin 'Shard' Konicki - -Fri Oct 31 15:35:20 CET 2003 Daniel Veillard <daniel@veillard.com> - - * parser.c: always generate line numbers - -Fri Oct 31 11:53:46 CET 2003 Daniel Veillard <daniel@veillard.com> - - * parser.c: fixed another regression introduced in fixing #125823 - -Fri Oct 31 11:33:18 CET 2003 Daniel Veillard <daniel@veillard.com> - - * python/libxml.c: previous fix for #124044 was broken, correct - fix provided. - * HTMLparser.c parser.c parserInternals.c xmlIO.c: fix xmlStopParser() - and the error handlers to address #125877 - -Thu Oct 30 23:10:46 CET 2003 Daniel Veillard <daniel@veillard.com> - - * parser.c: side effect of #123105 patch, namespace resolution - would fail when defined in internal entities, fixes #125823 - -Thu Oct 30 14:10:42 CET 2003 Daniel Veillard <daniel@veillard.com> - - * python/libxml.c: be more defensive in the xmlReader python bindings - fixing bug #124044 - -Thu Oct 30 11:14:31 CET 2003 Daniel Veillard <daniel@veillard.com> - - * valid.c: the a-posteriori DTD validation code was not validating - the namespace declarations, this fixes #124110 - -Wed Oct 29 14:13:03 PDT 2003 William Brack <wbrack@mmm.com.hk> - - * xmlIO.c: enhanced to bypass compression detection code - when input file is stdin (bug 125801) - -Wed Oct 29 18:21:00 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xmlIO.c: fix needed when HTTP is not compiled in by Mark Vakoc - -Wed Oct 29 18:05:53 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xpath.c: more fixes about unregistering objects - * include/libxml/relaxng.h: applied patch from Mark Vakoc - missing _cplusplus processing clause - -Wed Oct 29 07:49:52 2003 Aleksey Sanin <aleksey@aleksey.com> - - * include/libxml/parser.h parser.c: added xmlStrVPrintf function - -Wed Oct 29 14:37:40 CET 2003 Daniel Veillard <daniel@veillard.com> - - * nanoftp.c nanohttp.c testThreads.c threads.c: applied patch from - Marcin 'Shard' Konicki to provide BeOS thread support. - -Wed Oct 29 14:20:14 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xmlschemas.c include/libxml/xmlschemas.h: applied patch - from Steve Ball to make a schema parser from a preparsed document. - -Wed Oct 29 13:52:25 CET 2003 Daniel Veillard <daniel@veillard.com> - - * tree.c: applied a couple of patches from Mark Lilback about text - nodes coalescing - -Wed Oct 29 12:16:52 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xpath.c: change suggested by Anthony Carrico when unregistering - a namespace prefix to a context - * hash.c: be more careful about calling callbacks with NULL payloads. - -Wed Oct 29 00:04:26 CET 2003 Daniel Veillard <daniel@veillard.com> - - * configure.in NEWS doc/*: preparing release 2.6.1, updated and - regenerated docs and APIs - * parser.c: cleanup and last change to fix #123105 - -Tue Oct 28 23:02:29 CET 2003 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: Fix #124907 by simply backporting the same - fix as for the XML parser - * result/HTML/doc3.htm.err: change to ID detecting modified one - test result. - -Tue Oct 28 22:28:50 CET 2003 Daniel Veillard <daniel@veillard.com> - - * parser.c include/libxml/parser.h: included a new function - to reuse a Push parser context, based on Graham Bennett original - code - * valid.c: in HTML, a name in an input is not an ID - * TODO: bug list update - -Tue Oct 28 19:54:37 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xpath.c: applied patch from nico@xtradyne.com for #125030 - -Tue Oct 28 16:42:16 CET 2003 Daniel Veillard <daniel@veillard.com> - - * Makefile.am: cleanup - * error.c valid.c include/libxml/xmlerror.h: fixing bug #125653 - sometimes the error handlers can get a parser context on DTD - errors, and sometime they don't. So be very careful when trying - to grab those information. - -Tue Oct 28 15:26:18 CET 2003 Daniel Veillard <daniel@veillard.com> - - * tree.c: applied patch from Kasimier Buchcik which fixes a - problem in xmlSearchNs introduced in 2.6.0 - -Tue Oct 28 14:57:03 CET 2003 Daniel Veillard <daniel@veillard.com> - - * parser.c: fixed #123263, the encoding is mandatory in a textdecl. - -Tue Oct 28 13:48:52 CET 2003 Daniel Veillard <daniel@veillard.com> - - * tree.c: fix bug #125047 about serializing when finding a - document fragment node. - -Mon Oct 27 11:11:29 EST 2003 Daniel Veillard <daniel@veillard.com> - - * testSAX.c: fix bug #125592 need a NULL check - * include/libxml/chvalid.h: rename a parameter - -Mon Oct 27 09:43:48 EST 2003 Daniel Veillard <daniel@veillard.com> - - * parser.c: applied patch from #123105 about defaulted attributes - from element coming from an entity - -Mon Oct 27 21:12:27 HKT 2003 William Brack <wbrack@mmm.com.hk> - - * xmllint.c: fixed warning message from IRIX (bug 125182) - * python/libxml.py: removed tabs, replaced with spaces - (bug 125572) - -Mon Oct 27 06:17:30 EST 2003 Daniel Veillard <daniel@veillard.com> - - * libxml.h parserInternals.c xmlIO.c: make sure we report errors - if xmlNewInputFromFile() fails. - * xmlreader.c: avoid using _private for the node or document - elements. - -Sat Oct 25 17:33:59 CEST 2003 Igor Zlatkovic <igor@zlatkovic.com> - - * win32/configure.js: added declaration for verMicroSuffix - -Fri Oct 24 23:08:17 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * libxml.m4: applied patch from Patrick Welche provided in - bug #125432 , future proofing the .m4 file. - * parser.c: resetting the context should also reset the error - * TODO: problem of conformance w.r.t. E20 was raised in the - XML Core telconf and libxml2 isn't conformant there. - -Wed Oct 22 14:33:05 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * xmlwriter.c: applied patch from Alfred Mickautsch fixing #125180 - -Wed Oct 22 10:50:31 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * chvalid.c genChRanges.py: Stéphane Bidoul pointed out another - small glitch missing a const - -Wed Oct 22 10:43:21 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * chvalid.c genChRanges.py: Stéphane Bidoul pointed out that - it doesn't define IN_LIBXML - -Tue Oct 21 21:14:55 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * win32/Makefile.mingw: typo pointed out by Stéphane Bidoul - -Tue Oct 21 11:26:36 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * win32/Makefile.bcb win32/Makefile.mingw win32/Makefile.msvc - win32/configure.js: set of Win32 patches for 2.6.0 by Joachim Bauch - -Tue Oct 21 02:07:22 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * tree.c: last minute patch from Eric Zurcher making it into 2.6.0 - -Tue Oct 21 02:03:03 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * configure.in NEWS doc/libxml2.xsa: preparing libxml2-2.6.0 - * doc/*: updated and regenerated the docs and API - -Tue Oct 21 01:01:55 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * SAX2.c error.c tree.c: moved the line number to their proper - field in elements now. - -Tue Oct 21 00:28:20 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * configure.in xmlwriter.c Makefile.am include/libxml/xmlwriter.h - include/libxml/Makefile.am include/libxml/xmlversion.h.in: - added the xmlWriter module contributed by Alfred Mickautsch - * include/libxml/tree.h: added room for line and extra information - * xmlreader.c python/tests/reader6.py: bugfixing some problem some - of them introduced in September - * win32/libxml2.def.src doc/libxml2-api.xml: regenerated the API - -Mon Oct 20 19:02:53 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * Makefile.am configure.in xmldwalk.c xmlreader.c - include/libxml/Makefile.am include/libxml/xmldwalk.h - include/libxml/xmlversion.h.in: removing xmldwalk module - since it got merged with the xmlreader. - * parser.c: cleanup - * win32/libxml2.def.src python/libxml2class.txt doc/libxml2-api.xml: - rebuilt the API - * python/tests/Makefile.am python/tests/reader7.py - python/tests/walker.py: adding regression testing for the - new xmlreader APIs, new APIs for reader creation, including - making reader "walker" operating on preparsed document trees. - -Sun Oct 20 22:37:03 HKT 2003 William Brack <wbrack@mmm.com.hk> - - * entities.c, valid.c: fixed problem reported on the mailing - list by Melvyn Sopacua - wrong argument order on functions - called through xmlHashScan. - -Sun Oct 19 23:57:45 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * valid.c xmlIO.c: fixes for compiling using --with-minimum - -Sun Oct 19 23:46:04 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * tree.c: cleanup xmlNodeGetContent() reusing xmlNodeBufGetContent(), - tested it through the xslt regression suite. - -Sun Oct 19 22:42:16 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * tree.c include/libxml/tree.h: adding xmlNodeBufGetContent() - allowing to grab the content without forcing allocations. - * python/libxml2class.txt doc/libxml2-api.xml: rebuilt the API - * xpath.c xmldwalk.c: removed a couple of comment errors. - -Sun Oct 19 16:39:36 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * parser.c: applied patch from Chris Anderson to change back - memcmp with CMPx() - -Sun Oct 19 16:24:19 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: fixed to not send NULL to %s printing - * python/tests/error.py result/HTML/doc3.htm.err - result/HTML/test3.html.err result/HTML/wired.html.err - result/valid/t8.xml.err result/valid/t8a.xml.err: cleaning - up some of the regression tests error - -Sun Oct 19 15:31:43 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * include/libxml/nanohttp.h include/libxml/parserInternals.h - include/libxml/xmlIO.h nanohttp.c parserInternals.c xmlIO.c: - Fixed the HTTP<->parser interraction, which should fix 2 long - standing bugs #104790 and #124054 , this also fix the fact that - HTTP error code (> 400) should not generate data, we usually - don't want to parse the HTML error information instead of the - resource looked at. - -Sun Oct 19 19:20:48 HKT 2003 William Brack <wbrack@mmm.com.hk> - - * doc/Makefile.am: enhanced the installation of tutorial files - to avoid installing CVS subdirectories (bug 122943) - -Sun Oct 19 17:33:27 HKT 2003 William Brack <wbrack@mmm.com.hk> - - * xmlIO.c: fixed segfault when input file not present - * tree.c: changed output formatting of XML_CDATA_SECTION - (bug 120917) - -Sun Oct 19 00:15:38 HKT 2003 William Brack <wbrack@mmm.com.hk> - - * include/libxml/parserInternals.h HTMLparser.c HTMLtree.c - SAX2.c catalog.c debugXML.c entities.c parser.c relaxng.c - testSAX.c tree.c valid.c xmlschemas.c xmlschemastypes.c - xpath.c: Changed all (?) occurrences where validation macros - (IS_xxx) had single-byte arguments to use IS_xxx_CH instead - (e.g. IS_BLANK changed to IS_BLANK_CH). This gets rid of - many warning messages on certain platforms, and also high- - lights places in the library which may need to be enhanced - for proper UTF8 handling. - -Sat Oct 18 20:34:18 HKT 2003 William Brack <wbrack@mmm.com.hk> - - * genChRanges.py, chvalid.c, include/libxml/chvalid.h, - doc/apibuild.py: enhanced to include enough comments to - make the api doc generation happy. - -Sat Oct 18 07:28:25 EDT 2003 Daniel Veillard <daniel@veillard.com> - - * nanohttp.c xmlIO.c include/libxml/nanohttp.h: starting work - to fix the HTTP/XML parser integration. - -Sat Oct 18 11:04:32 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * xmlreader.c include/libxml/xmlreader.h: added new APIs - for creating reader from sources or reusing a reader with - a new source, like the xmlReadxx and xmlCtxtReadxxx - * win32/libxml2.def.src doc/libxml2-api.xml doc/apibuild.py - doc/Makefile.am: regenerated the APIs - * doc/xml.html: applied a patch from Stefan Kost for namespace docs - -Sat Oct 18 12:46:02 HKT 2003 William Brack <wbrack@mmm.com.hk> - - * genChRanges.py, chvalid.c, include/libxml/chvalid.h, - include/libxml/parserInternals.h: enhanced macros to avoid - breaking ABI from previous versions. - * catalog.c, parser.c, tree.c: modified to use IS_* macros - defined in parserInternals.h. Makes maintenance much easier. - * testHTML.c, testSAX.c, python/libxml.c: minor fixes to avoid - compilation warnings - * configuration.in: fixed pushHTML test error; enhanced for - better devel (me) testing - -Fri Oct 17 14:38:54 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * legacy.c: remove the warning for startDocument(), as it is used by - glade (or glade-python) - * parser.c relaxng.c xmlschemastypes.c: fixed an assorted set of - invalid accesses found by running some Python based regression - tests under valgrind. There is still a few leaks reported by the - relaxng regressions which need some attention. - * doc/Makefile.am: fixed a make install problem c.f. #124539 - * include/libxml/parserInternals.h: addition of xmlParserMaxDepth - patch from crutcher - -Wed Oct 15 12:47:33 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * parser.c: Marc Liyanage pointed out that xmlCleanupParser() - was missing xmlCleanupInputCallbacks and xmlCleanupOutputCallbacks - calls. - -Wed Oct 15 10:16:47 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * vms/build_libxml.com trionan.c: VMS patch from Craig A. Berry - -Mon Oct 13 21:46:25 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * Makefile.am: small fix from Bjorn Reese - -Mon Oct 13 15:59:25 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * valid.c: fix a call missing arguments - -Sun Oct 12 18:42:18 HKT 2003 William Brack <wbrack@mmm.com.hk> - - * genChRanges.py, chvalid.c, include/libxml/chvalid.h: fixed - a bug in the range search; enhanced range generation (inline code - if a small number of intervals); enhanced the readability of the - output files. - -Sun Oct 12 00:52:14 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * chvalid.def chvalid.c include/libxml/chvalid.h: rebuilt - chvalid.def from scratch based on XML 2nd edition REC - and regenerated the code. - -Sat Oct 11 22:54:13 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * check-xml-test-suite.py: removed some annoying warnings - * chvalid.def chvalid.c include/libxml/chvalid.h: fixed a bug - in the PubidChars definition, regenerated, there is still - a bug left somewhere - * genChRanges.py: save the header directly in include/libxml/ - * configure.in: I generated a 2.6.0beta6 earlier today - -Sat Oct 11 23:32:47 HKT 2003 William Brack <wbrack@mmm.com.hk> - - * fixed small error on previous commit (chvalid.h in - base dir instead of include directory) - -Sat Oct 11 23:11:22 HKT 2003 William Brack <wbrack@mmm.com.hk> - - * genChRange.py, chvalid.def, chvalid.c, include/libxml/chvalid.h: - new files for a different method for doing range validation - of character data. - * Makefile.am, parserInternals.c, include/libxml/Makefile.am, - include/libxml/parserInternals.h: modified for new range method. - * catalog.c: small enhance for warning message (using one - of the new range routines) - -Sat Oct 11 13:24:57 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * valid.c include/libxml/valid.h: adding an serror field to - the validation context breaks the ABI for the xmlParserCtxt - structure since it's embedded by content and not by reference - -Sat Oct 11 12:46:49 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * configure.in: patch from Mike Hommey - * threads.c: applied Windows patch from Jesse Pelton and Stephane - Bidoul - * parser.c: fix the potentially nasty access to ctxt->serror - without checking first that the SAX block is version 2 - -Fri Oct 10 21:34:01 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * SAX2.c: fixed a nasty bug with interning some text strings - * configure.in: prepare for beta5 of 2.6.0 - * libxml.h nanoftp.c nanohttp.c xmlIO.c include/libxml/xmlerror.h: - better error handling for I/O and converted FTP and HTTP - * parser.c: fixed another bug - -Fri Oct 10 16:45:20 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * SAX2.c: fixed uninitialized new field. - * result/VC/OneID2 result/relaxng/*.err: fixed a typo updating - all messages - -Fri Oct 10 16:19:17 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * include/libxml/tree.h: make room in Doc, Element, Attributes - for PSVI type information. - -Fri Oct 10 16:08:02 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c c14n.c catalog.c error.c globals.c parser.c - parserInternals.c relaxng.c valid.c xinclude.c xmlIO.c xmlregexp.c - xmlschemas.c xpath.c xpointer.c include/libxml/globals.h - include/libxml/parser.h include/libxml/valid.h - include/libxml/xmlerror.h: Setting up the framework for structured - error reporting, touches a lot of modules, but little code now - the error handling trail has been cleaned up. - -Fri Oct 10 14:29:42 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * c14n.c include/libxml/xmlerror.h: converted the C14N module too - -Fri Oct 10 13:40:51 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * xpath.c: cleanup - * xpointer.c include/libxml/xmlerror.h: migrated XPointer module - to the new error mechanism - -Fri Oct 10 12:49:53 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * error.c xmlschemas.c: a bit of cleanup - * result/schemas/*.err: updated with the new result strings - -Fri Oct 10 03:58:39 PDT 2003 William Brack <wbrack@mmm.com.hk> - - * xpath.c: fixed bug 124061 - -Fri Oct 10 02:47:22 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * Makefile.am: cleanup - * encoding.c: fix a funny typo - * error.c xmlschemas.c xmlschemastypes.c include/libxml/xmlerror.h: - converted the Schemas code to the new error handling. PITA, - still need to check output from regression tests. - -Thu Oct 9 15:13:53 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * HTMLtree.c include/libxml/xmlerror.h: converted too - * tree.c: small cleanup - -Thu Oct 9 13:44:57 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * xinclude.c: comment fix - * catalog.c include/libxml/xmlerror.h: migrating the catalog code - to the new infrastructure - -Thu Oct 9 00:36:03 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * xmlIO.c: final error handling cleanup - * xinclude.c error.c: converted XInclude to the new error handling - * include/libxml/xmlerror.h: added XInclude errors - -Wed Oct 8 23:31:23 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * parser.c: bug in compression saving was crashing galeon - reported by teuf - -Wed Oct 8 21:18:12 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * error.c tree.c xmlIO.c xmllint.c: more cleanup through the - I/O error path - -Wed Oct 8 20:57:27 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * xmlIO.c: better handling of error cases - -Wed Oct 8 13:51:14 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * xmlIO.c xmllint.c include/libxml/xmlerror.h: first pass at - cleaning up error handling in the I/O module. - -Wed Oct 8 10:52:05 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * xmlregexp.c include/libxml/xmlerror.h: error handling - cleanup of the Regexp module. - -Wed Oct 8 01:09:05 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * tree.c: converting the tree module too - * error.c include/libxml/xmlerror.h: created a simpler internal - error reporting function. - -Tue Oct 7 23:19:39 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * error.c include/libxml/xmlerror.h include/libxml/xpath.h - include/libxml/xpathInternals.h xpath.c: cleaning up XPath - error reporting that time. - * threads.c: applied the two patches for TLS threads - on Windows from Jesse Pelton - * parser.c: tiny safety patch for xmlStrPrintf() make sure the - return is always zero terminated. Should also help detecting - passing wrong buffer size easily. - * result/VC/* result/valid/rss.xml.err result/valid/xlink.xml.err: - updated the results to follow the errors string generated by - last commit. - -Tue Oct 7 14:16:45 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng.c include/libxml/xmlerror.h: last cleanup of error - handling in the Relax-NG module. - -Tue Oct 7 13:30:39 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * error.c relaxng.c include/libxml/xmlerror.h: switched Relax-NG - module to the new error reporting. Better default report, adds - the element associated if found, context and node are included - in the xmlError - * python/tests/reader2.py: the error messages changed. - * result/relaxng/*: error message changed too. - -Mon Oct 6 10:46:35 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * win32/Makefile.bcb win32/Makefile.mingw win32/Makefile.msvc - win32/configure.js: applied patch from Stéphane Bidoul to - fix the compilation of 2.6.0 code on Win32 - -Mon Oct 6 10:16:30 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * check-xml-test-suite.py: fixing the script - * parser.c: replace sequences of RAW && NXT(.) == '.' with - memcmp calls, seems to not break conformance, slightly inflate - the size of the gcc generated code though. - -Sun Oct 5 23:30:48 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * parserInternals.c parser.c valid.c include/libxml/parserInternals.h: - more cleanup of error handling in parserInternals, sharing the - routine for memory errors. - -Sun Oct 5 15:49:14 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c Makefile.am legacy.c parser.c parserInternals.c - include/libxml/xmlerror.h: more code cleanup, especially around - error messages, the HTML parser has now been upgraded to the new - handling. - * result/HTML/*: a few changes in the resulting error messages - -Sat Oct 4 23:06:41 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * parser.c include/libxml/xmlerror.h: more error/warning - handling cleanups, the XML parser module should be okay now. - -Sat Oct 4 01:58:27 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * Makefile.am configure.in xmldwalk.c include/libxml/Makefile.am - include/libxml/xmldwalk.h include/libxml/xmlversion.h.in: - integrated the xmlDocWalker API given by Alfred Mickautsch, - and providing an xmlReader like API but working on a xmlDocPtr. - -Sat Oct 4 00:18:29 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * Makefile.am: more cleanup in make tests - * error.c valid.c parser.c include/libxml/xmlerror.h: more work - in the transition to the new error reporting strategy. - * python/tests/reader2.py result/VC/* result/valid/*: - few changes in the strings generated by the validation output - -Fri Oct 3 00:19:02 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * Makefile.am: changed 'make tests' to use a concise output, - scrolling to see where thing broke wasn't pleasant - * configure.in: some beta4 preparation, but not ready yet - * error.c globals.c include/libxml/globals.h include/libxml/xmlerror.h: - new error handling code, last error information are stored - in the parsing context or a global variable, new APIs to - handle the xmlErrorPtr type. - * parser.c parserInternals.c valid.c : started migrating to the - new error handling code, it's a royal pain. - * include/libxml/parser.h include/libxml/parserInternals.h: - moved the definition of xmlNewParserCtxt() - * parser.c: small potential buffer access problem in push code - provided by Justin Fletcher - * result/*.sax result/VC/PENesting* result/namespaces/* - result/valid/*.err: some error messages were slightly changed. - -Thu Oct 2 13:01:13 2003 Aleksey Sanin <aleksey@aleksey.com> - - * include/libxml/parser.h parser.c: introduced xmlStrPrintf - function (wrapper around snprintf) - -Wed Oct 1 21:12:06 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * entities.c: Fix error on output of high codepoint charref like -  , reported by Eric Hanchrow - -Wed Oct 1 14:20:10 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * DOCBparser.c include/libxml/DOCBparser.h: let's see how much - of a pain murrayc is really gonna be. - -Wed Oct 1 11:03:40 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * xmlreader.c: Applied fix for bug #123481 reported by Peter Derr - -Tue Sep 30 15:34:31 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * entities.c legacy.c parser.c: made the predefined entities - static predefined structures to avoid the work, memory and - hazards associated to initialization/cleanup. - -Tue Sep 30 14:30:47 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c Makefile.am configure.in legacy.c parser.c - parserInternals.c testHTML.c xmllint.c include/libxml/HTMLparser.h - include/libxml/parser.h include/libxml/parserInternals.h - include/libxml/xmlversion.h.in: added a new configure - option --with-push, some cleanups, chased code size anomalies. - Now a library configured --with-minimum is around 150KB, - sounds good enough. - -Tue Sep 30 12:31:00 AEST 2003 Malcolm Tredinnick <malcolm@commsecure.com.au> - - * libxml-2.0-uninstalled.pc.in: New file for building against - uninstalled libxml2 builds. - * configure.in, Makefile.am: Support the *-uninstalled.pc file. - * .cvsignore: Ignore the new generated *.pc file. - -Tue Sep 30 02:38:16 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * Makefile.am SAX.c SAX2.c configure.in globals.c parser.c - parserInternals.c testReader.c testSAX.c xmlIO.c xmllint.c - xmlreader.c example/gjobread.c include/libxml/xmlversion.h.in: - added 2 new configure option: --with-reader --with-sax1 - to allow removing the reader or non-xmlReadxxx() interfaces. - -Mon Sep 29 19:58:26 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * configure.in entities.c tree.c valid.c xmllint.c - include/libxml/tree.h include/libxml/xmlversion.h.in: - Adding a configure option to remove tree manipulation - code which is not strictly needed by the parser. - -Mon Sep 29 15:23:41 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * nanoftp.c nanohttp.c: last finishing touch to the BeOS - patch from Marcin 'Shard' Konicki - -Mon Sep 29 15:15:08 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * HTMLtree.c SAX2.c c14n.c catalog.c configure.in debugXML.c - encoding.c entities.c nanoftp.c nanohttp.c parser.c relaxng.c - testAutomata.c testC14N.c testHTML.c testRegexp.c testRelax.c - testSchemas.c testXPath.c threads.c tree.c valid.c xmlIO.c - xmlcatalog.c xmllint.c xmlmemory.c xmlreader.c xmlschemas.c - example/gjobread.c include/libxml/HTMLtree.h include/libxml/c14n.h - include/libxml/catalog.h include/libxml/debugXML.h - include/libxml/entities.h include/libxml/nanohttp.h - include/libxml/relaxng.h include/libxml/tree.h - include/libxml/valid.h include/libxml/xmlIO.h - include/libxml/xmlschemas.h include/libxml/xmlversion.h.in - include/libxml/xpathInternals.h python/libxml.c: - Okay this is scary but it is just adding a configure option - to disable output, this touches most of the files. - -Mon Sep 29 12:53:56 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * xmlmemory.c: better fix, avoids breaking the python bindings - -Mon Sep 29 11:21:33 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * xmlmemory.c: fix a compilation problem when configuring - with debug but without mem-debug - -Sun Sep 28 20:53:17 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * Makefile.am: cleanup, creating a new legacy.c module, - made sure make tests ran in reduced conditions - * SAX.c SAX2.c configure.in entities.c globals.c parser.c - parserInternals.c tree.c valid.c xlink.c xmlIO.c xmlcatalog.c - xmlmemory.c xpath.c xmlmemory.c include/libxml/xmlversion.h.in: - increased the modularization, allow to configure out - validation code and legacy code, added a configuration - option --with-minimum compiling only the mandatory code - which then shrink to 200KB. - -Sun Sep 28 02:15:07 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * parser.c: fix a bug raised by the Mips compiler. - * include/libxml/SAX.h include/libxml/parser.h: move the - SAXv1 block definitions to parser.h fixes bug #123380 - * xmlreader.c include/libxml/xmlreader.h: reinstanciate - the attribute and element pool broken 2 commits ago. - Start playing with an entry point to preserve a subtree. - * entities.c: remove a warning. - -Sat Sep 27 12:19:38 PDT 2003 William Brack <wbrack@mmm.com.hk> - - * encoding.c, parser.c, relaxng.c: further (final?) minor - changes for compilation warnings. No change to logic. - -Fri Sep 26 18:03:42 PDT 2003 William Brack <wbrack@mmm.com.hk> - - * parser.c: fixed small problem with missing entities (test/ent2) - -Sat Sep 27 01:25:39 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * parser.c: William's change allowed to spot a nasty bug in xmlDoRead - if the result is not well formed that ctxt->myDoc is not NULL - and uses the context dictionary. - -Fri Sep 26 21:09:34 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * parser.c: other patches from William Brack to avoid - compilation warnings on AIX. - -Fri Sep 26 11:03:08 PDT 2003 William Brack <wbrack@mmm.com.hk> - - * HTMLparser.c, entities.c, xmlreader.c: minor change to - avoid compilation warnings on some (e.g. AIX) systems - -Fri Sep 26 16:49:25 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * parserInternals.c: fixed a backward compatibility problem - when formatting "deprecated SAXv1 function ignorableWhitespace" - could be reproduced by xmllint --format - -Fri Sep 26 15:50:44 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * doc/libxml2-api.xml: rebuilt the API - * xmllint.c doc/xmllint.1 doc/xmllint.xml: added the new options - --nocdata and --nsclean to remove CDATA section and surperfluous - namespace declarations - * parser.c SAX2.c: implementation of the 2 new options - -Fri Sep 26 14:41:53 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c testHTML.c xmllint.c include/libxml/HTMLparser.h: - added the same htmlRead APIs than their XML counterparts - * include/libxml/parser.h: new parser options, not yet implemented, - added an options field to the context. - * tree.c: patch from Shaun McCance to fix bug #123238 when ]]> - is found within a cdata section. - * result/noent/cdata2 result/cdata2 result/cdata2.rdr - result/cdata2.sax test/cdata2: add one more cdata test - -Thu Sep 25 23:03:23 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * parser.c xmllint.c doc/libxml2-api.xml include/libxml/parser.h: - Changed the new xmlRead/xmlCtxtRead APIs to have an extra - base URL parameter when not loading from a file or URL. - -Thu Sep 25 16:23:58 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * configure.in: preparing a beta3 solving the ABI problems - * globals.c parser.c parserInternals.c testHTML.c HTMLparser.c SAX.c - include/libxml/globals.h include/libxml/SAX.h: make sure the - global variables for the default SAX handler are V1 ones to - avoid ABI compat problems. - * xmlreader.c: cleanup of unneeded code - * hash.c: fix a comment - -Thu Sep 25 14:16:51 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * SAX2.c hash.c parser.c include/libxml/xmlexports.h - include/libxml/xmlmemory.h include/libxml/xmlversion.h.in: - fixing some comments to avoid warnings from apibuild.py - -Wed Sep 24 23:42:08 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * win32/configure.js: patch from Stéphane Bidoul for configuring - the beta2 version #123104 - -Wed Sep 24 23:17:59 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * Makefile.am: adding repeated parsing and validating tests - * SAX2.c parser.c tree.c include/libxml/parser.h: make the new - DOM tree building interfaces use the dictionary from the - parsing context to build the element and attributes names - as well as formatting spaces and short text nodes - * include/libxml/dict.h dict.c: added some reference counting - for xmlDictPtr because they can be shared by documents and - a parser context. - * xmlreader.c: a bit of cleanup, remove the specific tree freeing - functions and use the standard ones now. - * xmllint.c: add --nodict - * python/libxml.c: fix a stupid bug so that ns() works on - attribute nodes. - -Tue Sep 23 23:07:45 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * parser.c include/libxml/parser.h: adding a new set of - API for parsing xmlReadDoc() xmlReadFile() ... xmlReadIO() - and xmlCtxtReadDoc() ... xmlCtxtReadIO(). That with - a clear define of xmlParserOption, xmlCtxtUseOptions() - should simplify custom parsing without being tempted to - use global variables, and xmlCtxtReset() should allow reuse - of a context for multiple parsing. - * xmllint.c: switched to use xmlReadXXX, allow options to - be used simultaneously with less troubles. - * tree.c: simple warning removal - * doc/apibuild.py: small fix - * doc/libxml2-api.xml win32/libxml2.def.src: updated - -Tue Sep 23 11:15:23 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * parser.c: revert xmlCreateDocParserCtxt() since this break - the parseDoc() python bindings - -Tue Sep 23 11:00:18 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * parser.c: make sure xmlDetectSAX2() is called only at - parsing time to avoid breaking apps changing the SAX - callbacks after context allocation, change xmlCreateDocParserCtxt() - to use an immutable buffer instead of a copy - -Tue Sep 23 09:40:33 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * xmlIO.c: applied patch from Markus Keim fixing a problem - with I/O callback registration. - * include/libxml/xmlerror.h: fixed #122994 comment numbering - for xmlParserErrors - -Mon Sep 22 12:21:11 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * tree.c include/libxml/tree.h: the uri arg to xmlNodeSetBase is - really a const xmlChar* - * xmlreader.c include/libxml/xmlreader.h: addin the - xmlTextReaderConstString() to get an interned string from - the reader - -Sun Sep 20 17:22:20 PDT 2003 William Brack <wbrack@mmm.com.hk> - - * error.c: fixed a warning message (trivial) - * doc/search.php: removed incorrect warning message when word - search not found in last of multiple tables (bug 119535) - -Fri Sep 19 14:26:28 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * configure.in: preparing a 2.6.0-beta2 release - * xmlIO.c: avoid a warning - * tree.c: avoid duplicate code in xmlReplaceNode as pointed out - by Chris Ryland - * include/libxml/dict.h: add a QName access lookup to the - dictionary. - * xmlreader.c include/libxml/xmlreader.h: adding const access - based on the dictionary interface for string read from the - reader, the node content access is still TODO, it's too different - -Fri Sep 19 00:01:08 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * SAX2.c: fixing namespace DTD validations - * result/valid/ns2.xml result/valid/ns.xml: the output of defaulted - namespaces is slightly different now. - * Makefile.am: report the memory used in Timingtests (as well as time) - -Thu Sep 18 15:29:46 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * Makefile.am: add streaming on memory regression tests, found - bad bugs in the reader interface - * xmlreader.c: fixing bugs w.r.t. very large names, and special - condition in end of file. - * xmlIO.c tree.c include/libxml/tree.h include/libxml/xmlIO.h: - adding immutable buffers, and parser input based on those, - but this should not be used (yet) for general parsing - * parser.c: added a comment about using immutable buffers for - general parsing. - * result/bigname.xml.rdr result/bigname2.xml.rdr: fixing the - output of the regression tests - * xmllint.c: using the immutable buffers when streaming on - mmaped file (--stream --memory) - -Thu Sep 18 12:04:50 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * dict.c: the last patch broke unicity of returned strings, removed - -Thu Sep 18 00:31:02 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * Makefile.am: add a Timingtests target to check bad behaviour - from the streaming engine - * dbgen.pl dbgenattr.pl: perl script to generate big instances - * xmlreader.c: fix a bad behaviour on large buffer inputs - -Wed Sep 17 23:25:47 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * dict.c xmlreader.c: two small improvements - -Wed Sep 17 22:53:32 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * parserInternals.c: avoid a leak with previous patch - -Wed Sep 17 22:06:11 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * python/libxml.c: use stderr and not stdout for default errors - in python environment bug #122552 - -Wed Sep 17 21:33:57 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * parserInternals.c: small fix from Rob Richards for input filename - * xmllint.c: fixes for --repeat and --memory/--stream for speed tests - * xmlIO: adding a guard in one function - -Wed Sep 17 15:57:44 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * SAX2.c xmlreader.c include/libxml/parser.h: more performance hunting - reducing memory allocation and free and avoiding expensive routines - -Wed Sep 17 12:23:41 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * SAX2.c parser.c parserInternals.c xmlreader.c: started messing - seriously with per-document dict and element and attribute nodes - reuse in the xmlReader. This seems to lead to an interesting - speedup of the xmlReader already. - -Wed Sep 17 01:07:56 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * dict.c include/libxml/dict.h: do string allocations in large - pools, allowing to find if a string pertain to a dict quickly - * xmllint.c: fix --stream --repeat --timing - * Makefile.am: the testThreads run output should be seen. - -Mon Sep 15 16:46:28 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * SAX2.c include/libxml/parser.h: starting work on reusing the - parser dictionary for the element and attribute tag names. - Add pools for Element and Attributes in the parser context, - which should help speeding up the reader. - * Makefile.am result/*.rdr : adding non-python reader regression - tests. - -Mon Sep 15 14:54:42 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * SAX2.c parser.c valid.c: starting to cleanup some of the - problems exposed by the W3C/NIST regression suite. - * result/ent7.sax result/xml2.sax: small fixes. - -Mon Sep 15 11:46:47 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * parser.c: more parser error factoring - -Sun Sep 14 21:53:39 PDT 2003 William Brack <wbrack@mmm.com.hk> - - * HTMLtree.c: Fixed bug 121394 - missing ns on attributes - -Sun Sep 14 21:43:32 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * parser.c include/libxml/xmlerror.h: factoring of more - error handling code, serious size reduction and more lisibility - of the resulting code. - * parserInternals.c parser.c include/libxml/parserInternals.h - include/libxml/parser.h: changing the way VC:Proper Group/PE Nesting - checks are done, use a counter for entities. Entities where freed and - reallocated at the same address failing the check. - * tree.c: avoid a warning - * result/valid/* result/VC/*: this slightly changes some validation - error messages. - -Sun Sep 14 11:03:27 PDT 2003 William Brack <wbrack@mmm.com.hk> - - * valid.c: fixed bug 121759 - early declaration of - attribute-list in external DTD - -Sat Sep 13 14:42:11 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * parser.c include/libxml/xmlerror.h: starting cleaning up - error handling, factorize error processing - * doc/xmllint.html: update of the page, remove --sgml - -Sat Sep 13 02:13:50 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * Makefile.am DOCBparser.c parserInternals.c testDocbook.c - xmllint.c doc/xmllint.xml doc/xmllint.1: removing the - broken pseudo SGML DocBook parser code. - -Fri Sep 12 17:24:11 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * xpath.c: fix a problem with strcpy() in xmlXPathFormatNumber() - valgrind pointed out the strings overlapped. cleanup . - -Fri Sep 12 11:43:12 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * tree.c: applied speedup to xmlSearchNs() as suggested by - Luca Padovani. Cleaned up xmlSearchNsByHref() in the process - applying the same trick. - -Fri Sep 12 01:36:20 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * parser.c parserInternals.c tree.c include/libxml/parser.h - include/libxml/xmlerror.h: adding namespace checkings - while making sure they still parse as wellformed documents. - Add an nsWellFormed status report to the context, and - provide new appropriate error codes. - * Makefile.am result/namespaces/* test/namespaces/*: add - specific regression testing for the new namespace support - * test/att5 result/noent/att5 result/att5 result/att5.sax: - add more coverage for the attribute parsing and normalization - code. - -Fri Sep 12 01:34:19 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * threads.c: backport of a thread bugfix from 2_5_X branch - -Thu Sep 11 18:29:18 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * parser.c: fixed a bug in one corner case of attribute parsing. - -Thu Sep 11 16:21:53 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * configure.in doc/* : 2.6.0beta1 changes - * SAX2.c hash.c parser.c parserInternals.c: Fixing attribute - normalization, might not be totally fixed but this should - make sure SAX event provide the right strings for attributes - except entities for which libxml2 is different by default - This should fix #109564 - * result/attrib.xml.sax result/ent3.sax result/p3p.sax: minor changes - in attribute callback values - * result/c14n/with-comments/example-4 - result/c14n/without-comments/example-4: this also fixes a subtle - bug in the canonicalization tests. - -Wed Sep 10 12:38:44 CEST 2003 Daniel Veillard <daniel@veillard.com> - - Time to commit 3 days of work rewriting the parser internal, - fixing bugs and migrating to SAX2 interface by default. There - is some work letf TODO, like namespace validation and attributes - normalization (this break C14N right now) - * Makefile.am: fixed the test rules - * include/libxml/SAX2.h include/libxml/parser.h - include/libxml/parserInternals.h SAX2.c parser.c - parserInternals.c: changing the parser, migrating to SAX2, - adding new interface to switch back to SAX1 or initialize a - SAX block for v1 or v2. Most of the namespace work is done - below SAX, as well as attribute defaulting - * globals.c: changed initialization of the default SAX handlers - * hash.c tree.c include/libxml/hash.h: added QName specific handling - * xmlIO.c: small fix - * xmllint.c testSAX.c: provide a --sax1 switch to test the old - version code path - * result/p3p result/p3p.sax result/noent/p3p test/p3p: the new code - pointed out a typo in a very old test namespace - -Sun Sep 7 19:58:33 PTD 2003 William Brack <wbrack@mmm.com.hk> - - * xmlIO.c include/libxml/xmlIO.h parser.c: Implemented detection - of compressed files, setting doc->compressed appropriately - (bug #120503). - -Sun Sep 7 22:53:06 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * parser.c: try to cope with the fact that apps may still - have allocated smaller SAX callbak block - -Sun Sep 7 11:11:45 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * dict.c: allow to give -1 for undefined length in lookups - * include/libxml/parser.h parser.c parserInternals.c testSAX.c: - first round of work on the new SAX2 interfaces, the API - will change but committing before changing for historical - reference. - -Sat Sep 6 10:55:01 PTD 2003 William Brack <wbrack@mmm.com.hk> - - * SAX2.c, xmlIO.c: fixed bug #121210 (callback to sax->error, - sax->warning with wrong params). - -Fri Sep 5 10:33:42 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * include/libxml/globals.h: patch from Stéphane Bidoul to export - globals entry points to the python bindings - -Wed Sep 3 15:24:41 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: when creating a DOCTYPE use "html" lowercase - by default instead of "HTML" - * parser.c xmlreader.c: optimization, gain a few % parsing speed by - avoiding calls to "areBlanks" when not needed. - * include/libxml/parser.h include/libxml/tree.h: some structure - extensions for future work on using per-document dictionaries. - -Wed Sep 3 15:08:06 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * Makefile.am results/*.sax SAXResult/*: removing the SAXresults - tree, keeping result in the same tree, added SAXtests to the - default "make tests" - -Tue Sep 2 15:59:04 CEST 2003 Igor Zlatkovic <igor@zlatkovic.com> - - * include/libxml/xmlexports.h: defined additional macros which - affect exports and added mingw section - -Mon Sep 1 15:15:18 PDT 2003 William Brack <wbrack@mmm.com.hk> - - * doc/index.py: fixed problem parsing xhtml docs - * doc/xmlreader.html,doc/guidelines.html: small modification - to avoid problem in python parsing. - * doc/search.php: fixed upper case filename problem for XSLT docs - -Mon Sep 1 22:55:09 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * xinclude.c: patch from Mark Vakoc that allows compiling - with XInclude but without XPointer support. - -Mon Sep 1 22:31:38 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * configure.in xml2-config.in: Applied a patch from Kevin P. Fleming - to add --libtool-libs option to xml2-config script. - -Sun Aug 31 21:52:12 PDT 2003 William Brack <wbrack@mmm.com.hk> - - * doc/README.docs, doc/Makefile.am: new file added, - giving some description of the documentation generation process - * doc/search.php: fixed problem with upper case on filenames - -Fri Aug 29 12:25:01 CEST 2003 Igor Zlatkovic <igor@zlatkovic.com> - - * win32/Makefile.bcb: updates by Eric Zurcher - -Thu Aug 28 22:58:38 PDT 2003 William Brack <wbrack@mmm.com.hk> - - * doc/apibuild.py, doc/libxml2-api.xml: enhanced code - to compensate for pollution from Igor's header taint - (quick before Daniel notices) - -Thu Aug 28 23:01:36 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * SAX2.c: fixed a namespace error on attribute reporting bug - pointed out by Tobias Reif - * test/p3p result/p3p result/noent/p3p: this test case was wrong - using xmlsn instead of xmlns... - -Thu Aug 28 18:25:07 CEST 2003 Igor Zlatkovic <igor@zlatkovic.com> - - * include/libxml/globals.h include/libxml/xmlexports.h: fixed - typos reported by Mark Vakoc - -Thu Aug 28 08:59:51 MDT 2003 John Fleck <jfleck@inkstain.net> - - add: - * doc/tutorial/api.html - * doc/tutorial/ar01s09.html - * doc/tutorial/includexpath.c - updated - * doc/tutorial/*.html - fix my bad - forgot to check in new files when I last - updated - -Thu Aug 28 14:31:13 CEST 2003 Igor Zlatkovic <igor@zlatkovic.com> - - * win32/Makefile.bcb: new file, support for Borland C++ - * xmllint.c: fixed time inclusion for various compilers - -Thu Aug 28 12:32:59 CEST 2003 Igor Zlatkovic <igor@zlatkovic.com> - - * parser.c parserInternals.c DOCBparser.c HTMLparser.c: added - few casts to shut the compiler warnings - -Thu Aug 28 12:23:51 CEST 2003 Igor Zlatkovic <igor@zlatkovic.com> - - * win32/Makefile.* win32/configure.js: fixed for mingw - -Thu Aug 28 10:01:44 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * globals.c threads.c: fixing bug #120870 try to avoid problem - with uninitialized mutexes - -Wed Aug 27 16:12:41 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng.c: fixed an error reporting bug in Relax-NG when we end - up with multiple states, select the "best" one. Fix #120682 - * result/relaxng/tutor11_2_3.err: small change resulting - -Wed Aug 27 11:25:25 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * xmlschemastypes.c: applied base64 support patch from Anthony Carrico - -Wed Aug 27 10:58:51 CEST 2003 Igor Zlatkovic <igor@zlatkovic.com> - - * include/libxml/[threads-xpointer].h: realigned parameters - after taint - -Wed Aug 27 09:59:54 CEST 2003 Igor Zlatkovic <igor@zlatkovic.com> - - * include/libxml/xmlexports.h: fixed defs for Borland compiler, - as reported by Eric Zurcher - -Tue Aug 26 15:54:04 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng.c: fixed bug #120386 again a problem introduced when - trying to reuse automata for content validation. Fix a bug report - problem on zeroOrMore - * result/relaxng/tutor3_7_err: change slightly error reporting. - -Mon Aug 25 13:24:57 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * include/libxml/Makefile.am: make sure the new header will - be included when generating a new distribution. - -Mon Aug 25 12:37:05 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng.c: fixed a couple of stupid bugs in the state allocation - routines which led to bug #120040 and the ones reported by - Martijn Faassen - -Mon Aug 25 12:37:23 CEST 2003 Igor Zlatkovic <igor@zlatkovic.com> - - * include/libxml/parserInternals.h include/libxml/relaxng.h - include/libxml/SAX.h include/libxml/SAX2.h: realigned the - parameters after taint. - -Mon Aug 25 11:16:01 CEST 2003 Igor Zlatkovic <igor@zlatkovic.com> - - * include/libxml/xmlversion.h.in: moved export defs to a separate - file for consistency. - * include/libxml/xmlexports.h: new file, contains export defs. - -Mon Aug 25 11:01:49 CEST 2003 Igor Zlatkovic <igor@zlatkovic.com> - - * include/libxml/*.h genUnicode.py: exportability taint - of the headers. - -Thu Aug 21 12:37:46 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * SAX.c: make the deprecated interfaces log an error message - to be sure it won't get used. - -Thu Aug 21 00:50:32 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * Makefile.am SAX2.c include/libxml/Makefile.am include/libxml/SAX2.h: - Adding new version of the SAX interface, it's not there yet, - currently just preparing the work - * globals.c parser.c SAX.c include/libxml/SAX.h - include/libxml/globals.h include/libxml/parser.h: doing some - refactoring of the SAXv1 interfaces, obsoleting a bunch of them - while keeping functionalities, preparing SAX2 integration. - * dict.c: small cleanup. - -Wed Aug 20 00:20:01 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * tree.c: fixes a small bug introduced in last commit and detected - by valgrind. - -Tue Aug 19 16:54:18 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * dict.c hash.c: optimization when freeing hash tables. - * parser.c xmlIO.c include/libxml/tree.h: some tuning of buffer - allocations - * parser.c parserInternals.c include/libxml/parser.h: keep a - single allocated block for all the attributes callbacks, - avoid useless malloc()/free() - * tree.c: do not realloc() when growing a buffer if the buffer - ain't full, malloc/memcpy/free avoid copying memory. - -Mon Aug 18 18:37:01 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * xmllint.c doc/xmllint.xml doc/xmllint.1: added option - --dtdvalidfpi for Tobias Reif - -Mon Aug 18 14:03:03 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * dict.c include/libxml/dict.h Makefile.am include/libxml/Makefile.am: - new dictionary module to keep a single instance of the names used - by the parser - * DOCBparser.c HTMLparser.c parser.c parserInternals.c valid.c: - switched all parsers to use the dictionary internally - * include/libxml/HTMLparser.h include/libxml/parser.h - include/libxml/parserInternals.h include/libxml/valid.h: - Some of the interfaces changed as a result to receive or return - "const xmlChar *" instead of "xmlChar *", this is either - insignificant from an user point of view or when the returning - value changed, those function are really parser internal methods - that no user code should really change - * doc/libxml2-api.xml doc/html/*: the API interface changed and - the docs were regenerated - -Sun Aug 17 23:05:38 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * parser.c: applied patch to xmlCleanupParser from Dave Beckett - -Sat Aug 16 22:53:42 HKT 2003 William Brack <wbrack@mmm.com.hk> - - * doc/parsedecl.py, doc/libxml2-refs.xml, doc/API*.html: - fixed part (2) of bug 119535 (wrong alpha case on filenames) - -Sat Aug 16 20:35:28 HKT 2003 William Brack <wbrack@mmm.com.hk> - - * doc/API*.html, doc/html/*: regenerated API documentation - for xmlsoft.org (part of Bug 119535) - -Fri Aug 15 14:58:37 HKT 2003 William Brack <wbrack@mmm.com.hk> - - * encoding.c, threads.c, include/libxml/HTMLparser.h, - doc/libxml2-api.xml: Minor changes to comments, etc. for - improving documentation generation - * doc/Makefile.am: further adjustment to auto-generation of - win32/libxml2.def.src - -Fri Aug 15 02:24:20 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * News configure.in: preparing libxml2-2.5.10 release - * doc/* : updated the doc and rebuilt - -Fri Aug 15 01:55:53 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * parser.c: fixing the xmlSAXParseDTD bug #119536 raised by - Malcolm Tredinnick with the patch he suggested. - -Fri Aug 15 01:37:10 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: allocation error #119784 raised by Oliver Stoeneberg - -Fri Aug 15 00:41:58 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * uri.c: fixing an use of strcpy() where both strings overlap - pointed out by valgrind. - -Thu Aug 14 17:10:39 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * DOCBparser.c globals.c include/libxml/xmlmemory.h: get rid of - some compilation warnings. - * xinclude.c: fix the performance problem reported by Kevin Ruscoe - plus some cleanup and better error reporting. - -Thu Aug 14 14:13:43 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * encoding.c: applied UTF-16 encoding handling patch provided by - Mark Itzcovitz - * encoding.c parser.c: more cleanup and fixes for UTF-16 when - not having iconv support. - -Thu Aug 14 03:19:08 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * Makefile.am configure.in example/Makefile.am libxml.h nanoftp.c - nanohttp.c xmllint.c: Applied patch from Mikhail Grushinskiy for - mingw compiler on Windows. - -Thu Aug 14 02:28:36 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * parser.c: fixed the serious CPU usage problem reported by - Grant Goodale - * HTMLparser.c: applied patch from Oliver Stoeneberg about a free - missing in htmlSAXParseDoc - -Tue Aug 12 22:48:10 HKT 2003 William Brack <wbrack@mmm.com.hk> - - * doc/Makefile.am: Removed dependency from libxml2.def.src - -Tue Aug 12 18:55:08 HKT 2003 William Brack <wbrack@mmm.com.hk> - - * autogen.sh: took away the requirement for automake-1.4, - changed the messages for getting auto* tools to current - gnu pages. - * configure.in: added check for Linux Dec alpha requiring - -ieee flag, fixed test for ipv6 - * trionan.c: fixed problem for compiling on Linux Dec alpha - using native compiler - * doc/Makefile.am: implemented regeneration of win32/libxml2.def.src - whenever libxml2-api.xml is changed. - -Mon Aug 11 17:02:23 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * parser.c: cleaning up a problem when parsing UTF-16 and libiconv - is not used. - -Sun Aug 10 08:13:22 HKT 2003 William Brack <wbrack@mmm.com.hk> - - * win32/libxml2.def.src: renerated with fixed libxml2-api.xml - -Sun Aug 10 00:22:55 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * News configure.in: preparing libxml2-2.5.9 release - * doc/* : updated the doc and rebuilt - -Sat Aug 9 20:00:13 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * include/libxml/xmlreader.h doc/libxml2-api.xml: changing an enum - definition to get a correct API XML description. This was apparently - breaking Windows build. - -Sat Aug 9 13:41:21 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: fixed a nasty bug #119387, bad heuristic from - the progressive HTML parser front-end on large character data - island leading to an erroneous end of data detection by the - parser. Some cleanup too to get closer from the XML progressive - parser. - -Sat Aug 9 00:42:47 HKT 2003 William Brack <wbrack@mmm.com.hk> - - * win32/configure.js: Added in support for the ISO8859X - module (patch provided by Jesse Pelton) - -Fri Aug 8 15:56:32 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * HTMLtree.c tree.c threads.c: hum try to avoid some troubles - when the library is not initialized and one try to save, the - locks in threaded env might not been initialized, playing safe - * xmlschemastypes.c: apply patch for hexBinary from Charles Bozeman - * test/schemas/hexbinary_* result/schemas/hexbinary_*: also added - his tests to the regression suite. - -Fri Aug 8 18:47:38 HKT 2003 William Brack <wbrack@mmm.com.hk> - - * win32/defgen.xsl, win32/libxml2.def.src: Bug 119343 - (with apologies to Igor) - Enhanced handling of docb and - nanohttp. - -Thu Aug 7 21:13:22 HKT 2003 William Brack <wbrack@mmm.com.hk> - - * encoding.c: further small changes for warnings when - configured with --with-iconv=no - -Wed Aug 6 12:32:11 HKT 2003 William Brack <wbrack@mmm.com.hk> - - * error.c trionan.[ch] testThreads.c python/generator.py: - further small changes to eliminate most of the remaining - warnings. - -Tue Aug 5 23:51:21 HKT 2003 William Brack <wbrack@mmm.com.hk> - - * error.c HTMLparser.c testC14N.c testHTML.c testURI.c - xmlcatalog.c xmlmemory.c xmlreader.c xmlschemastypes.c - python/libxml.c include/libxml/xmlmemory.h: small changes - to syntax to get rid of compiler warnings. No changes - to logic. - -Mon Aug 4 22:40:54 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * doc/libxml2-api.xml doc/html/*: rebuilt the API and docs. - -Mon Aug 4 21:40:34 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * tree.c: fixed a small problem in the patch for #118763 - * result/HTML/doc3.htm*: this reverts back to the previous result - -Sun Aug 3 21:41:49 EDT 2003 Daniel Veillard <daniel@veillard.com> - - * doc/FAQ.html doc/xml.html: applied doc patch to xml.html - and rebuilt, apparently some C++ wrappers are not available, - c.f. bug #118943 - -Sun Aug 3 21:30:31 EDT 2003 Daniel Veillard <daniel@veillard.com> - - * tree.c: fixing HTML attribute serialization bug #118763 - applying a modified version of the patch from Bacek - * result/HTML/doc3.htm*: this modifies the output from one test - -Sun Aug 3 21:02:30 EDT 2003 Daniel Veillard <daniel@veillard.com> - - * tree.c include/libxml/tree.h: added a new API to split a - QName without generating any memory allocation - * valid.c: fixed another problem with namespaces on element - in mixed content case - * python/tests/reader2.py: updated the testcase with - Bjorn Reese fix to reader for insignificant white space - * parser.c HTMLparser.c: cleanup. - -Sun Aug 3 20:55:40 EDT 2003 Daniel Veillard <daniel@veillard.com> - - * catalog.c: trying to fix #118754 of possible recursion in the - catalogs. Not fantastically happy about the current fix since - it's likely to break under very thread intensive concurrent - access to the catalog. Better solution might to keep the depth - an extra argument to the resolution functions. - -Sun Aug 3 18:56:54 EDT 2003 Daniel Veillard <daniel@veillard.com> - - * valid.c: fixed bug #118712 about mixed content, and namespaced - element names. - * test/valid/mixed_ns.xml result/valid/mixed_ns*: added a check - in the regression tests - -Fri Aug 1 23:55:23 HKT 2003 William Brack <wbrack@mmm.com.hk> - - Coninuing work on bug 118559 - * DOCBparser.c: removed 2 unused vars - * xmlregexp.c: changed some numeric const to their enum symbols - * xmlreader.c: changed one var define from int to enum - (a little more to be done, awaiting co-ordination) - * relaxng.c: deleted one unused var - * xmllint.c: deleted some unused vars, changed one arg - val from int to enum - * testHTML.c, testDocbook.c: changed some arg vals to enum const - * xmlIO.c: fixed typo from last night (small warning msg) - -Thu Jul 31 22:44:33 HKT 2003 William Brack <wbrack@mmm.com.hk> - - Working on bug 118559 - * error.c: deleted unused variable - * parserInternals.c: deleted unneeded 'const' qualifier - * parser.c: changed variable type for enum temp storage - * xmlIO.c: changed debugging var to be inside #ifdef - * valid.c: removed unused variable - * HTMLparser.c: removed some unneeded 'const' qualifiers - * xpath.c: added some type casts, removed some unused vars - * xinclude.c: added one type cast - * nanohttp.c: repositioned some #ifdef to avoid unused var - * nanoftp.c: removed unused var - -Wed Jul 30 14:57:55 EDT 2003 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: applied a patch from William Brack about - the problem of parsing very large HTML instance with comments - as raised by Nick Kew - -Wed Jul 30 12:29:38 EDT 2003 Daniel Veillard <daniel@veillard.com> - - * xmlreader.c include/libxml/xmlreader.h: applying cleanup - patch from Bjorn Reese for xmlTextReaderNodeType() and - significant whitespace. There is an enum for node type - values now. - -Wed Jul 30 11:08:21 EDT 2003 Daniel Veillard <daniel@veillard.com> - - * encoding.c: applying patch from Peter Jacobi to added - ISO-8859-x encoding support when iconv is not available - * configure.in include/libxml/xmlversion.h.in - include/libxml/xmlwin32version.h.in: added the glue needed - at the configure level and made it the default for Windows - -Tue Jul 29 16:43:48 EDT 2003 Daniel Veillard <daniel@veillard.com> - - * python/generator.py python/libxml.c python/libxml2class.txt: - patch from Joachim Bauch + cleanup for Relax NG error callbacks - in python - -Tue Jul 29 12:46:08 EDT 2003 Daniel Veillard <daniel@veillard.com> - - * parser.c parserInternals.c tree.c: applied Peter Jacobi encoding - cleanup patch, and also avoided a possible memory leak - -Tue Jul 29 09:28:09 EDT 2003 Daniel Veillard <daniel@veillard.com> - - * encoding.c: fix the previous commit - -Tue Jul 29 12:28:17 HKT 2003 William Brack <wbrack@mmm.com.hk> - - * HTMLparser.c: fixed problem with comments reported by Nick Kew - * encoding.c: added routines xmlUTF8Size and xmlUTF8Charcmp for - some future cleanup of UTF8 handling - -Mon Jul 28 16:39:14 EDT 2003 Daniel Veillard <daniel@veillard.com> - - * xpath.c: applied a change suggested by Sean Griffin in bug - #118494 about a memory leak in EXSLT - -Sun Jul 27 14:30:56 EDT 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng.c: fixed a Relax-NG compilation/streaming bug introduced - when fixing the previous Relax-NG bugs - * result/relaxng/*: This slightly changes the output messages of - some regression tests. - * configure.in: added support of -with-fexceptions for nested C++ - support. - -Thu Jul 24 15:46:02 MDT 2003 John Fleck <jfleck@inkstain.net> - - * doc/tutorial/apa.html - * doc/tutorial/apb.html - * doc/tutorial/apc.html - * doc/tutorial/apd.html - * doc/tutorial/ape.html - * doc/tutorial/apf.html - * doc/tutorial/apg.html - * doc/tutorial/aph.html - * doc/tutorial/ar01s02.html - * doc/tutorial/ar01s03.html - * doc/tutorial/ar01s04.html - * doc/tutorial/ar01s05.html - * doc/tutorial/ar01s06.html - * doc/tutorial/ar01s07.html - * doc/tutorial/ar01s08.html - * doc/tutorial/index.html - * doc/tutorial/ix01.html - * doc/tutorial/xmltutorial.pdf - * doc/tutorial/xmltutorial.xml - update tutorial with XPath example - -Thu Jul 24 17:07:06 IST 2003 Daniel Veillard <daniel@veillard.com> - - * SAX.c parser.c: fixing a bug about a special case of namespace - handling, this closes bug #116841 - -Wed Jul 23 20:52:36 IST 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng.c result/relaxng/*: checked and fixed the compilation - of RNG schemas, fixes a couple of bugs #117097 and #117001 . - This slightly changes the output messages of some regression tests. - -Wed Jul 23 15:15:08 IST 2003 Daniel Veillard <daniel@veillard.com> - - * xmlreader.c: fixed an out of bound error #118052 , the good - part if that base64 code was not in use yet ... - -Tue Jul 22 19:42:15 MDT 2003 John Fleck <jfleck@inkstain.net> - - * doc/xmllint.html - include html version of the xmllint man page, so an - up-to-date version is visible on the Web - -Mon Jul 21 21:53:43 IST 2003 Daniel Veillard <daniel@veillard.com> - - * xinclude.c include/libxml/xinclude.h: added a new API - xmlXIncludeProcessTree() to process XInclude only on a subtree - this should fix bug #115385 - -Fri Jul 18 17:11:42 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng.c include/libxml/relaxng.h: adding Get interface for - the error callback and parameters of parsing and validation - contexts - * xmlreader.c: patch to fix bug #117702 about incomplete Read() - on text nodes. - -Wed Jul 16 23:15:53 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * parserInternals.c: patch from Dodji Seketeli about UTF16 BOM - when using the push XML parser. - * result/utf16bom.xml result/noent/utf16bom.xml test/utf16bom.xml: - added the test to the regression suite. - -Tue Jul 15 22:03:13 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * globals.c: add xmlThrDefMutex = NULL in xmlCleanupGlobals() - as suggested by Rob Richards - -Tue Jul 15 15:30:55 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * DOCBparser.c HTMLparser.c entities.c parser.c relaxng.c - xmlschemas.c xpath.c: removed some warnings by casting xmlChar - to unsigned int and a couple of others. - -Fri Jul 11 16:44:22 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * xmlschemastypes.c: fixes a segfault on empty hexBinary strings - -Thu Jul 10 16:02:47 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * nanoftp.c nanohttp.c: cleanup patches from Peter Breitenlohner - -Tue Jul 8 16:02:19 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * globals.c threads.c: fixes some problem when freeing uninitialized - mutexes - -Tue Jul 8 14:15:07 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * nanoftp.c nanohttp.c: the modules should not import <config.h> - directly, some cleanups - * xmlschemas.c: Peter Sobisch found a nasty bug in the Schemas - validation code. - -Mon Jul 7 18:00:51 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * win32/configure.js: Jesse Pelton pointed out a problem in the - javascript code. - -Mon Jul 7 16:39:31 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * NEWS doc/*: regenerated - * nanoftp.c nanohttp.c: might fix includes problems with the - Ipv6 support on solaris - * tree.c: patch from Markus Keim about xmlHasNsProp() on attributes - defined as #IMPLIED - -Sun Jul 6 23:09:13 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * configure.in doc/*: preparing release 2.5.8 - * nanohttp.c: changed some preprocessor block - * xmlschemastypes.c: applied patch from Charles Bozeman adding - hexBinary schema datatype and adding support for totalDigits and - fractionDigits facets. - -Sun Jul 6 19:56:18 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * debugXML.c xpath.c: fixed 2 bugs pointed in #116448 - -Sun Jul 6 19:34:17 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * xinclude.c: fixed bug #116095 removing the error message when - reapplying XInclude to a document. - -Sat Jul 5 22:40:23 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * xmlIO.c: applied small changes to portability layer for - compilation on DJGPP Ms-DOS compiler. - -Sat Jul 5 22:30:25 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * parser.c HTMLparser.c: use the character() SAX callback - if the cdataBlock ain't defined. - * xpath.c: fix bug #115349 allowing compilation when configured - with --without-xpath since the Schemas code needs NAN and co. - -Sat Jul 5 00:51:30 HKT 2003 William Brack <wbrack@mmm.com.hk> - - Fixed problem with multi-threading, shown by the test program - testThreads. After fix, ran multiple tests on various speed - machines (single and dual processor X86), which all seem okay. - - * catalog.c: added missing xmlRMutexUnlock in xmlLoadCatalog - - * threads.c: added missing initialisation for condition variable - in xmlNewRMutex. - -Sat Jun 21 16:10:24 CEST 2003 Daniel Veillard <daniel@veillard.com> - - Applying IPv6 patch from Archana Shah <archana.shah@wipro.com> - closing bug #114837 - - * configure.in: Added checks for IPv6 support and getaddrinfo(). - - * acconfig.h: Defined HAVE_GETADDRINFO and SUPPORT_IP6. - - * config.h.in: Defined HAVE_GETADDRINFO and SUPPORT_IP6. - - * nanoftp.c: Structure xmlNanoFTPCtxt contains either sockaddr_storage - field or sockaddr_in field, depending upon the availability of IPv6 - support. - have_ipv6(): Added to check for run-time IPv6 support. - (xmlNanoFTPScanURL), (xmlNanoFTPUpdateURL), (xmlNanoFTPScanProxy): - Modified to parse a URI with IPv6 address given in []. - (xmlNanoFTPConnect): Changed to use getaddrinfo for address - resolution, if it is available on the system, as gethostbyname - does not return IPv6 addresses on some platforms. - (xmlNanoFTPGetConnection): Modified type of dataAddr variable to - sockaddr_storage or sockaddr_in depending upon the IPv6 support. - Sending EPSV, EPRT or PASV, PORT depending upon the type of address - we are dealing with. - - * nanohttp.c: (have_ipv6): Added to check for run-time IPv6 support. - (xmlNanoHTTPScanURL), (xmlNanoHTTPScanProxy): Modified to parse - a URI with IPv6 address given in []. - (xmlNanoHTTPConnectHost): Modified to use getaddrinfo if it is - available on the system. Also IPv6 addresses will be resolved by - gethostbyname only if IPv6 run-time support is available. - (xmlNanoHTTPConnectAttempt): Modified to deal with IPv6 address. - -Sat Jun 14 18:46:51 CEST 2003 Igor Zlatkovic <igor@zlatkovic.com> - - * win32/configure.js include/win32config.h - include/libxml/xmlversion.h.in: Applied the patch for BCB - by Eric Zurcher. - -Fri Jun 13 14:27:19 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * doc/Makefile.am doc/html/*: reverted back patch for #113521, - due to #115104 and while fixing #115101 . HTML URLs must not - be version dependent. - -Fri Jun 13 12:03:30 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * entities.c: do not generate " for " outside of attributes - * result//*: this changes the output of some tests - -Mon Jun 9 12:28:58 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * parser.c xmlIO.c: trying to fix #114277 about when file - remapping and escaping should really be attempted. - -Mon Jun 9 11:06:09 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * doc/*: applied a patch from Gman for building docs - * valid.c xmllint.c include/libxml/valid.h: applied a patch from - Gary Pennington to provide an allocator for xmlValidCtxt - * xmlreader.c: applied patch from Jacek Konieczny fixing bug - #113580 about data not being passed immediately. - -Thu Jun 5 11:31:02 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * tree.c: applied a couple of patches from Mark Itzcovitz - to handle saving back "UTF-16" documents. - -Mon Jun 2 21:56:15 MVT 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng.c xmlschemas.c include/libxml/schemasInternals.h: committing - some work done while in the Maldives (hence the timezone on the - laptop !) - * result/schemas/length3* test/schemas/deter0_* - test/schemas/group0_*: some tests added too - -Mon Jun 2 15:34:17 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * encoding.c: small fix - * xmlIO.c: fixed an error message - -Tue May 20 14:21:23 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * parserInternals.c: fixing Red Hat bug #91013 where xmllint was - accepting an improper UTF8 sequence - -Sat May 17 12:53:11 CEST 2003 Igor Zlatkovic <igor@zlatkovic.com> - - * threads.c: applied the patch from Stéphane Bidoul for getting - rid of extra threads in a dynamic library. - * win32/configure.js: threads default to 'native' now. - -Fri May 16 13:17:52 EDT 2003 Daniel Veillard <daniel@veillard.com> - - * HTMLtree.c: fixing bug #112904: html output method escaped - plus sign character in URI attribute. - -Thu May 15 18:06:18 EDT 2003 Daniel Veillard <daniel@veillard.com> - - * build_glob.py global.data globals.c parser.c - include/libxml/globals.h: patch from Stéphane Bidoul for setting - up threads global defaults. - * doc/libxml2-api.xml: this extends the API with new functions - * python/tests/Makefile.am python/tests/reader2.py - python/tests/thread2.py: integrated the associated testcase and - fixed the error string used in reader2 - -Wed May 14 14:56:46 EDT 2003 Daniel Veillard <daniel@veillard.com> - - * configure.in libxml.spec.in python/Makefile.am: trying - to conciliate --with-python= requirements and RPM builds, - a PITA really... - -Tue May 13 18:30:34 EDT 2003 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: oops last commit introduced a memory leak. - -Tue May 13 18:10:38 EDT 2003 Daniel Veillard <daniel@veillard.com> - - * xmllint.c doc/xmllint.xml: added --nonet option - * doc/Makefile.am: fixing #112803 by adding --nonet when calling - xsltproc or xmllint - * doc/xmllint.xml doc/xmllint.1: also added --schema doc and - rebuilt - * HTMLparser.c: cleaned up the HTML parser context build when - using an URL - -Tue May 13 16:35:04 EDT 2003 Daniel Veillard <daniel@veillard.com> - - * libxml.spec.in: added a comment about bug #112902 - -Mon May 12 21:58:00 EDT 2003 William Brack <wbrack@mmm.com.hk> - - * minor cleanup of configure '--help' display - * error.c: enhanced xmlParserPrintFileContext to fix bug #109942 - -Mon May 12 17:53:30 EDT 2003 Daniel Veillard <daniel@veillard.com> - - * tree.c: PI nodes in external subset were not freed :-\ - fixes bug #112842 - -Mon May 12 11:23:27 EDT 2003 Daniel Veillard <daniel@veillard.com> - - * xmllint.c: added --schema option to run WXS schema validation - * xmlschemas.c xmlschemastypes.c include/libxml/schemasInternals.h: - tried to improve error reporting in the Schema code, some cleanup - too. - -Sun May 11 16:13:20 EDT 2003 Daniel Veillard <daniel@veillard.com> - - * xmlschemas.c: fixed some problems in the handling of errors, - and attributes addressed by references. - * test/schemas/* result/schemas/*: dropped the verbosity level - and added a couple of new tests - -Sat May 10 16:01:21 EDT 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng.c: Stéphane Bidoul found an off by one addressing - error on the error handling. - -Fri May 9 19:08:20 EDT 2003 Daniel Veillard <daniel@veillard.com> - - * xmlschemastypes.c: trying to fix #112673 - -Fri May 9 18:14:16 EDT 2003 Daniel Veillard <daniel@veillard.com> - - * DOCBparser.c catalog.c parser.c relaxng.c: removed multiple - warning, this fixed a bug and should close #111574 - -Fri May 9 15:34:32 EDT 2003 Daniel Veillard <daniel@veillard.com> - - * xmlschemas.c: fixing bug #104081 with xs:all with an element - holding minOccurs="0" - * test/schemas/all_* result/schemas/all_*: added some regression - tests for that bug - * xmllint.c xmlreader.c: patches from Joerg Schmitz-Linneweber and - Garry Pennington to compile without schemas support. - -Thu May 1 10:02:35 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * tree.c: fixed a problem with xmlUnlinkNode() for DTDs. - -Wed Apr 30 14:16:08 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * xml2-config.in: try to fix Red hat bug #89957, do not - output -L/usr/lib64 - * xmlreader.c: fixed a typo in a comment - -Tue Apr 29 07:32:02 MDT 2003 John Fleck <jfleck@inkstain.ent> - - * doc/tutorial/aph.html, ix01.html - forgot to cvs add the new files. Thanks to Roland van Laar - for pointing this out - -Tue Apr 29 14:36:49 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * xmlschemas.c doc/libxml2-api.xml: fixing a function comment - * doc/Makefile.am doc/apibuild.py doc/gnome-xml.sgml: switching - to the XML/XSLT doc generation closing #111799 - * doc/html/*: complete update of the HTML results - -Mon Apr 28 14:51:41 CEST 2003 Igor Zlatkovic <igor@zlatkovic.com> - - * win32/defgen.xsl: fixed the conditional for unicode map, - removed hardcoded schema entries - -Mon Apr 28 02:19:00 CEST 2003 Igor Zlatkovic <igor@zlatkovic.com> - - * win32/defgen.xsl: new file, stylesheet for generating - win32/libxml2.def.src from doc/libxml2-api.xml - * win32/libxml2.def.src: is autogenerated from now on, changes - to this file will not appear here anymore - -Mon Apr 28 00:12:11 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * win32/configure.js python/setup.py.in: applied patch - from Stéphane Bidoul for the Python bindings on the new - release. - -Sun Apr 27 17:56:21 CEST 2003 Igor Zlatkovic <igor@zlatkovic.com> - - * debugXML.c: included libxml/uri.h for xmlCanonicPath - declaration - * win32/configure.js: thread-enabled build is now default - * win32/libxml2.def.src: added more exports - -Sun Apr 27 00:23:05 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * NEWS doc/*.xsl doc/*.html: updated the web site separated - developers from common pages, made the transition to XHTML1, - added validity checking to the makefile rules. - -Sat Apr 26 23:17:51 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * parser.c: fix for xmlIOParseDTD same as previous and reported - by Petr Pajas - -Sat Apr 26 15:26:04 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * parser.c: applied fix to xmlSAXParseDTD from Malcolm Tredinnick - closing #111638 - -Sat Apr 26 14:00:58 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * python/generator.py: fixed a problem in the generator where - the way functions are remapped as methods on classes was - not symmetric and dependent on python internal hash order, - as reported by Stéphane Bidoul - -Fri Apr 25 21:52:33 MDT 2003 John Fleck <jfleck@inkstain.net> - - * doc/tutorial: - xmltutorial.xml - xmltutorial.pdf - *.html - add appendix on generating compiler flags, more indexing - -Sat Apr 26 01:10:48 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * triodef.h vms/build_libxml.com: applied patch from Craig A. Berry - to get libxml-2.5.7 to compile on OpenVMS - -Fri Apr 25 18:42:35 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * parser.c: fixing an xmlParseDTD bug raised by Petr Pajas - -Fri Apr 25 15:20:29 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * doc/Makefile.am doc/xmlcatalog.1 doc/xmlcatalog_man.xml - doc/xmllint.1 doc/xmllint.xml: automated the generation of the - man page based on xsltproc and a stylesheet PI in the XML. - -Fri Apr 25 12:37:33 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * doc/xmllint.*: trying to fix #110541 where generated - character preventing rendering by the man command. - -Fri Apr 25 01:09:23 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * NEWS configure.in: preparing release 2.5.7 - * doc/*: updated and rebuilt the docs - * doc/apibuild.py: fixed the script - -Thu Apr 24 19:11:12 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * Makefile.am doc/apibuild.py: make sure the OOM code don't - get in the way of the builds - * doc/libxml2-api.xml python/libxml2class.txt: automatic update - -Thu Apr 24 18:01:46 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * Makefile.am testOOM.c testOOMlib.[ch] : integrated the Out Of - Memory test from Havoc Pennington #109368 - * SAX.c parser.c parserInternals.c tree.c uri.c valid.c - xmlmemory.c xmlreader.c xmlregexp.c include/libxml/tree.h - include/libxml/parser.h: a lot of memory allocation cleanups - based on the results of the OOM testing - * check-relaxng-test-suite2.py: seems I forgot to commit the - script. - -Wed Apr 23 17:16:41 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * xmlschemastypes.c: trivial fix for 109774 removing a warning - -Wed Apr 23 15:49:32 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * DOCBparser.c SAX.c catalog.c debugXML.c parser.c: try to find - more places where xmlCanonicPath() must be used to convert - filenames to URLs, trying to fix #111088 - -Wed Apr 23 09:35:12 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * python/libxml.c python/libxml.py: applied patch from - Brent M Hendricks adding binding for xmlCatalogAddLocal - -Tue Apr 22 15:18:01 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: tried to fix #98879 again in a more solid - way. - -Tue Apr 22 13:58:43 CEST 2003 Igor Zlatkovic <igor@zlatkovic.com> - - * win32/libxml2.def.src: added more exports from the relaxng and - xmlreader clan - -Tue Apr 22 10:35:13 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * SAX.c test/valid/ns* test/result/ns*: applied the patch - provided by Brent Hendricks fixing #105992 and integrated the - examples in the testsuite. - -Tue Apr 22 01:06:09 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * TODO: updated a bit - * configure.in: fixed the comment, threads now default to on - * parserInternals.c: fixed an erroneous xmlMallocAtomic() call - -Mon Apr 21 23:33:38 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * globals.c libxml.h parser.c parserInternals.c tree.c xmllint.c - xmlreader.c include/libxml/parser.h: a lot of performance work - especially the speed of streaming through the reader and push - interface. Some thread related optimizations. Nearly doubled the - speed of parsing through the reader. - -Sun Apr 20 10:36:05 MDT 2003 John Fleck <jfleck@inkstain.net> - - * doc/xmllint.xml - * doc/xmllint.1 - update man page to explain use of --stream - -Sat Apr 19 02:03:24 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * DOCBparser.c HTMLparser.c c14n.c catalog.c encoding.c globals.c - nanohttp.c parser.c parserInternals.c relaxng.c tree.c uri.c - xmlmemory.c xmlreader.c xmlregexp.c xpath.c xpointer.c - include/libxml/globals.h include/libxml/xmlmemory.h: added - xmlMallocAtomic() to be used when allocating blocks which - do not contains pointers, add xmlGcMemSetup() and xmlGcMemGet() - to allow registering the full set of functions needed by - a garbage collecting allocator like libgc, ref #109944 - -Fri Apr 18 16:37:41 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * configure.in: switched to have thread support enabled by default, - didn't got troubles with ABI compatibility on Linux, hope it - won't break on strange OSes, if yes, report the system ID - * doc/libxml2-api.xml: just rebuilt the API - -Fri Apr 18 14:31:15 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * libxml.h include/libxml/parser.h parser.c xmlIO.c DOCBparser.c: - added support for large file, tested with a 3+GB instance, - and some cleanup. - * catalog.c: added a TODO - * Makefile.am: added some "make tests" comments - -Thu Apr 17 14:51:57 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng.c: some cleanups - * doc/xmlreader.html: extended the document to cover RelaxNG and - tree operations - * python/tests/Makefile.am python/tests/reader[46].py: added some - xmlReader example/regression tests - * result/relaxng/tutor*.err: updated the output of a number of tests - -Thu Apr 17 11:35:37 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng.c: valgrind pointed out an uninitialized variable error. - -Thu Apr 17 11:06:28 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * include/libxml/relaxng.h relaxng.c include/libxml/xmlreader.h - xmlreader.c: augnemting the APIs, cleanups. - * parser.c: cleanup bug #111005 - * xmlIO.c: added some missing comments - -Wed Apr 16 17:46:50 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng.c xmllint.c: more work on RelaxNG streaming validation - trying to improve the subset compiled, and more testing. - * doc/downloads.html doc/xml.html doc/xmlmem.html: some updates on the - documentation - * test/relaxng/tutor11_1_3.xml: fixes the DTD path - * result/relaxng/*.err: fix some of the outputs - -Wed Apr 16 01:28:15 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng.c xmlreader.c xmllint.c include/libxml/relaxng.h - include/libxml/xmlreader.h: implemented streaming of - RelaxNG (when possible) on top of the xmlReader interface, - provided it as xmllint --stream --relaxng .rng .xml - This seems to mostly work. - * Makefile.am: updated to test RelaxNG streaming - -Mon Apr 14 18:08:33 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng.c include/libxml/relaxng.h: integrated the regexp - based validity checking of fragments of the document for - which the RNG can be compiled to regexps. Works on all regression - tests, only fix needed is related to error messages. - -Sun Apr 13 21:51:00 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng.c xmlregexp.c include/libxml/xmlautomata.h - include/libxml/xmlregexp.h: Starting work precompiling - parts of RelaxNG schemas. Not plugged onto validity checking - yet, just the regexp building part. Needed to extend some - of the automata and regexp APIs. - -Fri Apr 11 21:36:21 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * xmllint.c xmlreader.c include/libxml/xmlreader.h: make sure - xmllint --stream and xmllint --stream --valid returns errors - code appropriately - -Fri Apr 11 10:59:24 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * xmlreader.c include/libxml/xmlreader.h: Added the Expand() - and Next() operation to work on subtrees within the reader - framework. - * doc/libxml2-api.xml python/libxml2class.txt: resulting updates - * python/tests/reader5.py: added an example for those new - functions of the reader. - -Thu Apr 10 23:38:13 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * HTMLtree.c: patch from Vasily Tchekalkin to fix #109865 - -Thu Apr 10 15:32:44 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * xmlreader.c: fixing HasValue for namespace as raised by - Denys Duchier - -Wed Apr 9 14:07:18 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c include/libxml/HTMLparser.h: exported - htmlCreateMemoryParserCtxt() it was static - -Wed Apr 9 13:21:48 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * xmlschemas.c xmlschemastypes.c include/libxml/xmlschemas.h: - update from Charles Bozeman for date and duration types - * test/schemas/date_0.* test/schemas/dur_0.* - result/schemas/date_0.* result/schemas/dur_0.*: updated too - -Mon Apr 7 12:19:26 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * tree.c valid.c xpath.c include/libxml/tree.h include/libxml/valid.h: - fixing bug #107129, removing excessive allocation and calls - to *printf in the code to build QName strings. - -Sat Apr 5 11:41:36 CEST 2003 Igoe Zlatkovic <igor@zlatkovic.com> - - * win32/libxml2.def.src: fixed conditional exports, reported by - Luke Murray. - -Fri Apr 4 18:08:00 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * parser.c: fixed a possible problem with xmlRecoverMemory() - -Thu Apr 3 17:24:44 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * trio.c trio.h triodef.h trionan.c trionan.h triop.h triostr.c - triostr.h: Bjorn sent an update for the TRIO portability layer. - -Tue Apr 1 21:57:26 CEST 2003 Igor Zlatkovic <igor@zlatkovic.com> - - * win32/libxml2.def.src: exported new functions - -Tue Apr 1 13:09:46 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * configure.in NEWS: preparing release 2.5.6 - * doc/*: updated and rebuilt the docs - -Tue Apr 1 11:52:15 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * SAX.c: fixed an uninitialized memory access pointed by valgrind - on C14Ntests - -Tue Apr 1 00:12:28 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng.c: one more fixup of error message reporting - -Mon Mar 31 18:36:32 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng.c: more work on bug #109225, and fixed an uninitialized - variable pointed out by valgrind - -Mon Mar 31 18:05:22 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng.c: try to work on bug #109225 and provide better - error reports. - * result/relaxng/* : this change the output of a number of tests - * xinclude.c: fixing the parsed entity redefinition problem - raised on the list. - * test/schemas/date_0.xsd: updated the date test c.f. E2-12 - -Mon Mar 31 13:19:04 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * xmlschemastypes.c: fixed date comparison to handle the tzo - The only failures left are disagreements on Notations and - '+1' not being allowed for ulong, uint, ushort and ubyte. - -Mon Mar 31 12:11:47 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * xmlschemastypes.c: fixed gMonth parsing routine accordingly - to the XML Schemas errata - http://www.w3.org/2001/05/xmlschema-errata#e2-12 - -Sun Mar 30 23:04:18 CEST 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng.c xmlschemastypes.c: more work on XML Schemas datatypes - and facets support. Currently only schemas with binHex or - base64 don't compile. A few error left in the test suite: - found 1035 test instances: 919 success 23 failures - most are gdate or gdateyear failing check, and a few cases where - James clark tests results are strange. - * valid.c: allow to reuse the Notation checking routine without - having a validation context. - * SAX.c: removed a #if 0 - -Sat Mar 29 17:35:05 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xinclude.c: forgot to apply one check from #106931 patch - * xmlschemastypes.c: more work on XML Schemas datatypes - -Sat Mar 29 11:49:25 CET 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng.c include/libxml/relaxng.h xmlschemastypes.c: more work - on cleaning up XML Schemas datatypes based on James Clark tests - test/xsdtest/xsdtest.xml - -Fri Mar 28 14:24:08 CET 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng.c: implemented comparisons for Schemas values. - * xmlschemastypes.c include/libxml/xmlschemastypes.h: fixed - some bugs in duration handling, comparisons for durations - and decimals, removed all memory leaks pointed out by James - testsuite. Current status is now - found 238 test schemas: 197 success 41 failures - found 1035 test instances: 803 success 130 failures - -Fri Mar 28 00:41:55 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xmlschemas.c include/libxml/xmlschemas.h: fixed bugs and memory - leaks in the W3C XML Schemas code - * xmlschemastypes.c: implemented nonPositiveInteger - * test/schemas/length2_0.xsd result/schemas/length2_0_0.err: - fixed the test and result. - -Thu Mar 27 22:23:07 CET 2003 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c tree.c: two patches from James Bursa on the HTML - parser and a typo - * xmlschemastypes.c: reindenting, fixing a memory access - problem with dates. - -Thu Mar 27 15:53:35 CET 2003 Daniel Veillard <daniel@veillard.com> - - * parser.c: fixing #109227 providing more context in case of - start/end tag mismatch - * python/tests/ctxterror.py python/tests/readererr.py: update the - tests accordingly - -Thu Mar 27 15:22:41 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xinclude.c: should fix #109327 errors on memory accesses - -Thu Mar 27 15:06:13 CET 2003 Daniel Veillard <daniel@veillard.com> - - * HTMLtree.c: Fixed reopening of #78662 <form action="..."> - is an URI reference - -Wed Mar 26 22:38:39 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xpath.c: fixed bug #109160 on non-ASCII IDs - -Wed Mar 26 17:30:37 CET 2003 Daniel Veillard <daniel@veillard.com> - - * parser.c: Norm suggested a nicer error message for xml:space values - errors - -Wed Mar 26 01:34:19 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xpath.c include/libxml/xpath.h: first part of the fix to - performance bug #108905, adds xmlXPathOrderDocElems() providing - document order for nodes. - * python/libxml.c: Python may require TRIO as Albert Chin pointed out - -Tue Mar 25 16:07:00 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xmlschemastypes.c: removing a warning with Sun compiler - bug #109154 - -Tue Mar 25 07:02:56 MST 2003 John Fleck <jfleck@inkstain.net> - - * doc/xmllint.xml - * doc/xmllint.1 - update xmllint man page with --relaxng option - -Tue Mar 25 12:07:03 CET 2003 Daniel Veillard <daniel@veillard.com> - - * python/setup.py.in : was missing "drv_libxml2.py" - -Mon Mar 24 19:38:05 CET 2003 Daniel Veillard <daniel@veillard.com> - - * tree.c xpath.c: some changes related to the new way of - handling Result Value Tree, before 2.5.5 - -Mon Mar 24 16:36:23 CET 2003 Daniel Veillard <daniel@veillard.com> - - * configure.in NEWS: preparing release 2.5.5 - * doc/* : updated the documentation and regenerated it. - -Mon Mar 24 14:56:01 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xpath.c: fixed some problems related to #75813 about handling - of Result Value Trees - -Sun Mar 23 22:57:20 CET 2003 Daniel Veillard <daniel@veillard.com> - - * uri.c: applied a set of patches from Lorenzo Viali correcting - URI parsing errors. - -Sun Mar 23 22:00:14 CET 2003 Daniel Veillard <daniel@veillard.com> - - * parser.c: validity status was not passed back when validating in - entities, but raised by Oliver Fischer - -Sun Mar 23 21:30:50 CET 2003 Daniel Veillard <daniel@veillard.com> - - * HTMLtree.c: avoid escaping ',' in URIs - -Sun Mar 23 12:57:00 CET 2003 Daniel Veillard <daniel@veillard.com> - - * parser.c: fixing bug #108976 get the ID/REFs to reference - the ID in the document content and not in the entity copy - * SAX.c include/libxml/parser.h: more checking of the ID/REF - stuff, better solution for #107208 - * xmlregexp.c: removed a direct printf, dohhh - * xmlreader.c: fixed a bug on streaming validation of empty - elements in entities - * result/VC/ElementValid8 test/VCM/v20.xml result/valid/xhtml1.xhtml: - cleanup of the validation tests - * test/valid/id* test/valid/dtds/destfoo.ent result/valid/id*: - added more ID/IDREF tests to the suite - -Sat Mar 22 23:38:08 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xmlreader.c: fixed #107043 removing 2 warnings with Sun One - compiler. - -Sat Mar 22 18:50:45 CET 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng.c: valgrind'ed and cleaned up a couple of memory issues. - -Sat Mar 22 16:15:50 CET 2003 Daniel Veillard <daniel@veillard.com> - - * SAX.c: fix bug #107208 avoid false duplicates when ID/REFs are - defined in entities content - -Sat Mar 22 15:53:27 CET 2003 Daniel Veillard <daniel@veillard.com> - - * SAX.c: Fixed validation bug #108858 on namespace names using - entities and reported by Brent Hendricks - * xmllint.c: report xmlTextReaderHasValue() result in --stream - --debug output. - -Sat Mar 22 13:32:39 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xmlreader.c: fixed bug #108801 reported by Malcolm Tredinnick - about the DocType node not being reported sometimes. - * python/tests/reader.py: added to test to the regression checks - -Sat Mar 22 01:57:40 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xmlreader.c: fixed bug #108546 on long CDATA (or text nodes) - reported by Edd Dumbill - -Sat Mar 23 01:00:24 CET 2003 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c parser.c parserInternals.c: patch from - johan@evenhuis.nl for #107937 fixing some line counting - problems, and some other cleanups. - * result/HTML/: this result in some line number changes - -Fri Mar 21 22:19:14 CET 2003 Daniel Veillard <daniel@veillard.com> - - * configure.in Makefile.am: fixed Red Hat bug #86118 use libxml2.spec - instead of libxml.spec - * relaxng.c: fixed some of the error reporting excessive - verbosity - * catalog.c debugXML.c valid.c xmlreader.c xmlschemas.c xpath.c - xmlschemastypes.c: removed some warnings from gcc - * doc/libxml2-api.xml: rebuilt - -Fri Mar 21 17:25:23 CET 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng.c: another optimization, for choice this time - * result/relaxng/spec1* result/relaxng/tutor12_1* - result/relaxng/tutor3_7: cleanups. - -Fri Mar 21 13:41:23 CET 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng.c: fixed xmlRelaxNGNodeMatchesList - * test/relaxng/testsuite.xml: augmented the test suite - * result/relaxng/spec1* result/relaxng/tutor12_1*: this fixes - some schemas validation tests in the presence of foreign - namespaces. - -Fri Mar 21 02:23:34 CET 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng.c: added another interleave speedup. - -Thu Mar 20 17:22:00 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xmlschemastypes.c: added integer and fixed one of the - IDREFS regression tests pbm - * result/relaxng/docbook_0.err: updated - -Wed Mar 19 21:58:47 CET 2003 Daniel Veillard <daniel@veillard.com> - - * valid.c xmlschemastypes.c: attempt to cope with ID/IDREF(S) - declared both in the DTD and in the Schemas <grin/> - * relaxng.c: more debug, added a big optimization for <mixed> - * test/relaxng/testsuite.xml: augmented the testsuite - * test/relaxng/ result/relaxng: added the RelaxNG spec and a - DocBook example to the regression tests - -Wed Mar 19 11:34:10 CET 2003 Daniel Veillard <daniel@veillard.com> - - * check-xsddata-test-suite.py: cosmetic change for output - * relaxng.c: try to minimize calls to malloc/free for states. - -Tue Mar 18 17:50:31 CET 2003 Daniel Veillard <daniel@veillard.com> - - * tree.c: removed a warning - * xmlschemastypes.c: more cleanup, added ENTITY and ENTITIES - support - * check-relaxng-test-suite.py check-xsddata-test-suite.py: - cleanup/improvements of the regression tests batch - * test/relaxng/testsuite.xml: augmented libxml2 own testsuite - -Tue Mar 18 12:36:22 CET 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng.c: fixed error msg cleanup deallocation - * xmlschemastypes.c: added a function to handle lists of - atomic types, added support for IDREFS - -Tue Mar 18 01:28:15 CET 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng.c valid.c xmlschemastypes.c: added Datatype ID - and IDREF, usable from RelaxNG now - * include/libxml/xmlschemastypes.h: need to add a new interface - because the validation modifies the infoset - * test/relaxng/testsuite.xml: extended the testsuite - -Mon Mar 17 16:34:07 CET 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng.c: fixed the last core RelaxNG bug known #107083, - schemas datatype ID/IDREF support still missing though. - * xmlreader.c: fix a crashing bug with prefix raised by - Merijn Broeren - * test/relaxng/testsuite.xml: augmented the testsuite with - complex inheritance tests - -Sun Mar 16 18:45:50 CET 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng.c: switched back to the previous Relax-NG code base, - the derivation algorithm need severe constraining code to avoid - combinatorial explosion. Fixed the problem with Sebastian Rahtz - TEI based example and other bugs - * result/relaxng/*err: updated the results - * test/relaxng/testsuite.xml: started a new test suite - -Sat Mar 15 22:26:46 CET 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng.c include/libxml/relaxng.h: After coming to the conclusion - that the original RelaxNG validation code was un-fixeable, it got - rewritten to use the derivation algorithm from James Clark and - redebugged it (nearly) from scratch: - found 373 test schemas: 372 success 1 failures - found 529 test instances: 529 success 0 failures - -Tue Mar 11 12:08:23 CET 2003 Daniel Veillard <daniel@veillard.com> - - * SAX.c parser.c: fix some recursion problems introduced in the - last release. - * relaxng.c: more debugging of the RNG validation engine, still - problems though. - -Mon Mar 10 14:10:47 CET 2003 Daniel Veillard <daniel@veillard.com> - - * Makefile.am: stop generating wrong result file with * in name - * relaxng.c: fixing the include bug raised by Sebastian Rahtz - * result/relaxng/demo* test/relaxng/demo: added the tests from - Sebastian reproducing the problem. - -Sun Mar 9 18:02:31 MST 2003 John Fleck <jfleck@inkstain.net> - - * doc/xmllint.1: regenerating man page from xmllint.xml to pick - up Aleksey's change - -Sun Mar 9 13:53:16 2003 Aleksey Sanin <aleksey@aleksey.com> - - * xmllint.c doc/xmllint.xml: use $XMLLINT_INDENT environment - variable to control the indentation for the xmllint "--format" - option - -Sat Mar 8 14:27:43 CET 2003 Igor Zlatkovic <igor@zlatkovic.com> - - * encoding.c: applied Gennady's patch against buffer overrun - -Fri Mar 7 19:29:40 CET 2003 Daniel Veillard <daniel@veillard.com> - - * test/xsdtest/xsdtest.xml uri.c: after and exchange with James - Clark it appeared I had bug in URI parsing code ... - * relaxng.c include/libxml/relaxng.h: completely revamped error - reporting to not lose message from optional parts. - * xmllint.c: added timing for RNG validation steps - * result/relaxng/*: updated the result, all error messages changed - -Fri Mar 7 15:18:32 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xpath.c: fix bug #107804, the algorithm used for document order - computation was failing on attributes. - -Thu Mar 6 22:35:50 CET 2003 Daniel Veillard <daniel@veillard.com> - - * valid.c: fix bug #107764 , possibility of buffer overflow - in xmlValidDebug() - -Wed Mar 5 17:41:37 CET 2003 Daniel Veillard <daniel@veillard.com> - - * nanoftp.c include/libxml/nanoftp.h: adding xmlNanoFTPDele() - from Philipp Dunkel - -Wed Mar 5 10:57:09 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xmlschemastype.c: made powten array static it should not be exported - * HTMLparser.c: fix bug #107361 by reusing the code from the XML - parser function. - * testHTML.c: get rid of valgrind messages on the HTML SAX tests - -Fri Feb 28 00:23:00 CET 2003 Daniel Veillard <daniel@veillard.com> - - * tree.c: fixed a node dump crash on attributes - * test/xsdtest/xsdtest.xml test/xsdtest/xsdtest.xsl: fixed - an URI test bug and get better output. - -Thu Feb 27 22:28:40 CET 2003 Daniel Veillard <daniel@veillard.com> - - * check-xsddata-test-suite.py: give more infos - * relaxng.c: fix a bug reported by Sebastian Rahtz and - REF->DEF in attribute values. - -Thu Feb 27 21:09:32 CET 2003 Daniel Veillard <daniel@veillard.com> - - * check-xsddata-test-suite.py test/xsdtest/xsdtest.xml - test/xsdtest/xsdtest.xsl: import of the XSD Datatype - regression tests from James Clark. - -Thu Feb 27 18:40:04 CET 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng.c xmlschemas.c xmlschemastypes.c - include/libxml/xmlschemastypes.h: added param support for relaxng - type checking, started to increment the pool of simple types - registered, still much work to be done on simple types and - facets checkings. - -Wed Feb 26 16:45:39 CET 2003 Daniel Veillard <daniel@veillard.com> - - * entities.c: fixes again one of the problem raised by - James Clark in #106788 - -Wed Feb 26 15:46:48 CET 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng.c: Fixed a couple of problem raised by James Clark - in bug #107083, the support for ID/IDREF/IDREFS at the WXS - datatype level still not fixed though. - -Mon Feb 24 21:09:19 CET 2003 Daniel Veillard <daniel@veillard.com> - - * configure.in: preparing release 2.5.4 - * doc/*: updated and rebuilt the docs - * relaxng.c: removed warnings - * result/relaxng/*: updated the results - -Mon Feb 24 20:53:17 CET 2003 Daniel Veillard <daniel@veillard.com> - - * valid.c: fixes a DTD regexp generation problem. - -Mon Feb 24 20:12:57 CET 2003 Daniel Veillard <daniel@veillard.com> - - * parser.c: fixes bug #105998 about false detection of - attribute consumption loop. - -Mon Feb 24 19:14:57 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xinclude.c: Fixes bug #106931 in XInclude entities merging. - -Mon Feb 24 18:50:35 CET 2003 Daniel Veillard <daniel@veillard.com> - - * SAX.c: fixed bug #105992 - -Mon Feb 24 18:14:16 CET 2003 Daniel Veillard <daniel@veillard.com> - - * tree.c: fixed xmlSetProp and al. when the node passed is not an - element. - * relaxng.c: fixed bugs 7.3 (though not complete) and memory leaks - found 373 test schemas: 369 success 4 failures - found 529 test instances: 525 success 4 failures - * check-relaxng-test-suite.py: added memory debug reporting - -Mon Feb 24 12:41:54 CET 2003 Daniel Veillard <daniel@veillard.com> - - * uri.c parser.c: some warning removal on Igor's patch - * tree.c: seems I messed up with #106788 fix - * python/libxml.c: fixed some base problems when Python provides - the resolver. - * relaxng.c: fixed the interleave algorithm - found 373 test schemas: 364 success 9 failures - found 529 test instances: 525 success 4 failures - the resulting failures are bug in the algorithm from 7.3 and - lack of support for params - -Sun Feb 23 14:49:39 CET 2003 Daniel Veillard <daniel@veillard.com> - - * parser.c: another fix for nodeinfo in entities problem - * tree.c entities.c: fixed bug #106788 from James Clark - some spaces need to be serialized as character references. - -Sat Feb 22 18:28:16 CET 2003 Igor Zlatkovic <igor@zlatkovic.com> - - * parser.c uri.c: fixed the bug I introduced in the path - handling, reported by Sebastian Bergmann - -Sat Feb 22 00:19:48 CET 2003 Daniel Veillard <daniel@veillard.com> - - * parser.c: fixing some nodeinfo in entities problem raised - by Glenn W. Bach - * relaxng.c: implemented the first section 7.3 check - * result/relaxng/*: updated the results - -Fri Feb 21 18:12:19 CET 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng.c: fixed some problems in the previous commit - and finished implementing 4.16 rules checking - found 373 test schemas: 353 success 20 failures - found 529 test instances: 519 success 6 failures - * result/relaxng/*: updated the results - -Fri Feb 21 16:37:39 CET 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng.c: implemented checks from section 7.2 - -Thu Feb 20 16:00:31 CET 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng.c: implemented the checks from section 7.1, fixed - some of the 4.20 and 4.21 problems. - found 373 test schemas: 338 success 35 failures - found 529 test instances: 519 success 6 failures - * result/relaxng/*: updated the results - -Thu Feb 20 01:09:24 CET 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng.c: implemented the 4.20 and 4.21 simplification rules. - * result/relaxng/*: updated the results - -Wed Feb 19 18:30:30 CET 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng.c: more bugfixes - * result/relaxng/*: updated the results - -Wed Feb 19 15:39:56 CET 2003 Igor Zlatkovic <igor@zlatkovic.com> - - * DOCBparser.c: obsoleted xmlNormalizeWindowsPath - * HTMLparser.c: obsoleted xmlNormalizeWindowsPath - * SAX.c: ensured xmlDoc.URL is always canonic - * parser.c: obsoleted xmlNormalizeWindowsPath - * uri.c include/libxml/uri.h: introduced xmlCanonicPath - * xmlIO.c include/libxml/xmlIO.h: obsoleted xmlNormalizeWindowsPath - * win32/libxml2.def.src: added few exports - -Wed Feb 19 14:26:51 CET 2003 Daniel Veillard <daniel@veillard.com> - - * Makefile.am configure.in: patched to have shared libraries - for Python regression tests and static binaries for gdb debug - in my development environment - * relaxng.c: more bugfixes - found 373 test schemas: 296 success 77 failures - found 529 test instances: 516 success 8 failures - * result/relaxng/*: updated the results - -Wed Feb 19 01:17:48 CET 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng.c: guess what ! Relax-NG bugfixing, what a surprise... - -Tue Feb 18 22:09:50 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xmlschemastypes.c: float/double check bugfix - * tree.c include/libxml/tree.h: exported a function for NMTOKEN - validation - * xmlreader.c: add a TODO for Jody - * relaxng.c: bugfix bugfix bugfix - found 373 test schemas: 300 success 73 failures - found 529 test instances: 507 success 10 failures - * result/relaxng/*: updated the results - -Tue Feb 18 00:33:17 CET 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng.c check-relaxng-test-suite.py: more RelaxNG bug hunting - -Mon Feb 17 18:23:32 CET 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng.c check-relaxng-test-suite.py: more work on the - RelaxNG implementation conformance testing. - found 373 test schemas: 284 success 89 failures - found 529 test instances: 448 success 47 failures - * result/relaxng/*: updated the results - -Sun Feb 16 16:48:38 CET 2003 Daniel Veillard <daniel@veillard.com> - - * ChangeLog tree.c doc/libxml-doc.el doc/libxml2-api.xml: applied - a patch from Kjartan Maraas to fix some typos - -Sun Feb 16 16:40:52 CET 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng.c: more bug-hunting - * testRelax.c include/libxml/relaxng.h: added --tree to dump the - intermediate rng tree - * python/generator.py: patch from Stéphane Bidoul to fix the generator - on python < 2.2 - -Fri Feb 14 17:49:26 CET 2003 Daniel Veillard <daniel@veillard.com> - - * check-relaxng-test-suite.py relaxng.c: more testing on the - Relax-NG front, cleaning up the regression tests failures - current state and I forgot support for "mixed": - found 373 test schemas: 280 success 93 failures - found 529 test instances: 401 success 68 failures - * tree.c include/libxml/tree.h xmlschemastypes.c: finished and - moved the Name, NCName and QName validation routine in tree.c - * uri.c: fixed handling of URI ending up with #, i.e. having - an empty fragment ID. - * result/relaxng/*: updated the results - -Thu Feb 13 16:49:24 CET 2003 Daniel Veillard <daniel@veillard.com> - - * check-xinclude-test-suite.py: improved the script accordingly - to the XInclude regression tests updates - * xpointer.c: Implemented XPointer element() Scheme W3C PR of 13 - November 2002 - * result/XPath/xptr/chapterschildseq result/XPath/xptr/vidchildseq - test/XPath/xptr/chapterschildseq test/XPath/xptr/vidchildseq: - augmented the Xpointer testsuite for the element() scheme - -Thu Feb 13 12:00:30 CET 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng.c: added TODO for the DTD compatibility spec - * xinclude.c: more bug fixes driven by the testsuite - -Tue Feb 11 19:01:02 CET 2003 Daniel Veillard <daniel@veillard.com> - - * check-xinclude-test-suite.py xinclude.c: Work on the W3C/NIST - regression tests for XInclude, improved the script, improving - XInclude error reporting mechanism - -Mon Feb 10 17:19:14 CET 2003 Daniel Veillard <daniel@veillard.com> - - * NEWS doc/* configure.in: preparing release 2.5.3 - -Mon Feb 10 17:11:22 CET 2003 Daniel Veillard <daniel@veillard.com> - - * tree.c: trying to fix #104934 about some XHTML1 serialization - issues. - -Mon Feb 10 16:41:13 CET 2003 Daniel Veillard <daniel@veillard.com> - - * encoding.c xmlIO.c: fixing bug #104646 about iconv based - encoding conversion when the input buffer stops in the - middle of a multibyte char - -Mon Feb 10 15:24:47 CET 2003 Daniel Veillard <daniel@veillard.com> - - * test/relaxng/OASIS/spectest.xml: OASIS RelaxNG testsuite - * check-relaxng-test-suite.py: python script to run regression - against OASIS RelaxNG testsuite - * relaxng.c: some cleanup tweaks - * HTMLparser.c globals.c: cleanups in comments - * doc/libxml2-api.xml: updated the API - * result/relaxng/*: errors moved files, so large diffs but - no changes at the semantic level. - -Mon Feb 10 01:00:31 CET 2003 Daniel Veillard <daniel@veillard.com> - - * tree.c: fixing #105678 problem when dumping a namespace node. - -Mon Feb 10 00:30:01 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xpath.c: fixed doc comment problems - * python/generator.py python/libxml_wrap.h python/types.c: adding - RelaxNG wrappers - * python/tests/Makefile.am python/tests/relaxng.py: added a specific - test of those early Python RelaxNG bindings - -Sun Feb 9 15:18:43 CET 2003 Daniel Veillard <daniel@veillard.com> - - * libxml.spec.in: fixes a libtool problem on AMD 64bits builds - * relaxng.c: found the validation problem I had with interleave - when not covering all remaining siblings - * Makefile.am test.relaxng/* result/relaxng/*: augmented the - testsuite and check the RNG schemas against the RNG schemas - given in appendix A - -Sat Feb 8 18:55:43 CET 2003 Igor Zlatkovic <igor@zlatkovic.com> - - * win32/Makefile.msvc: updates for RelaxNG - * win32/Makefile.mingw: updates for RelaxNG - * win32/libxml2.def.src: added RelaxNG exports - -Fri Feb 7 14:00:53 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xinclude.c: applied another bug fix from Sean Chittenden - -Fri Feb 7 13:34:08 CET 2003 Daniel Veillard <daniel@veillard.com> - - * configure.in xmllint.c: I f...ed up the default configuration - of schemas and --relaxng option display in xmllint, pointed by - Morus Walter. - * xlink.c: Sean Chittenden pointed a couple of errors in the XLink - detection module, fixes bug #105374. - -Fri Feb 7 01:43:38 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xmlschemastypes.c: added the boolean base type. - -Thu Feb 6 10:23:52 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xmlschemastypes.c: started implementing some of the missing - default simple types - * result/relaxng/*: updated the results - -Wed Feb 5 15:28:04 CET 2003 Daniel Veillard <daniel@veillard.com> - - * NEWS doc/*: updated the docs, ready for 2.5.2 release - -Wed Feb 5 14:15:59 CET 2003 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c tree.c xmlIO.c: comments cleanups - * Makefile.am: use xmllint for doing the RelaxNG tests - * configure.in: preparing 2.5.2 made schemas support default to - on instead of off - * relaxng.c: removed the verbosity - * xmllint.c: added --relaxng option - * python/generator.py python/libxml_wrap.h: prepared the integration - of the new RelaxNG module and schemas - * result/relaxng/*: less verbose output - -Wed Feb 5 12:00:36 CET 2003 Daniel Veillard <daniel@veillard.com> - - * valid.c: do not run content model validation if the - content is not determinist - -Wed Feb 5 11:43:58 CET 2003 Daniel Veillard <daniel@veillard.com> - - * SAX.c: added the redefinition of namespaced attribute - check that was missing as Fabrice Desré pointed out. - -Wed Feb 5 11:09:29 CET 2003 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c include/libxml/HTMLparser.h: applied HTML - improvements from Nick Kew, allowing to do more checking - to HTML elements and attributes. - -Tue Feb 4 23:47:06 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xinclude.c: fixing bug #105137 about entities declaration - needing to be copied to the including document. - -Tue Feb 4 20:26:22 CET 2003 Daniel Veillard <daniel@veillard.com> - - * catalog.c: fixed bug #104817 with delegateURI - * xpath.c: fixing bugs #104123 and #104125 - -Tue Feb 4 17:12:56 CET 2003 Daniel Veillard <daniel@veillard.com> - - * configure.in valid.c xmlreader.c python/libxml_wrap.h - python/types.c: fixing #104096 to compile without regexps - -Tue Feb 4 16:31:55 CET 2003 Daniel Veillard <daniel@veillard.com> - - * valid.c: fixing bug #103969 forgot to add an epsilon transition - when building the automata for elem* - -Tue Feb 4 16:21:07 CET 2003 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: applied patch from Arne de Bruijn fixing - bug #103827 - -Tue Feb 4 16:17:09 CET 2003 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: updating a comment, fixing #103776 - -Tue Feb 4 16:05:53 CET 2003 Daniel Veillard <daniel@veillard.com> - - * parser.c: fixing bug 105049 for validity checking of content - within recursive entities. - -Tue Feb 4 15:40:54 CET 2003 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: try to fix # 105049 - * relaxng.c xmlschemastypes.c: a couple of changes and extensions - * tree.c: updated a function comment - -Tue Feb 4 00:20:58 CET 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng: more work on grammars and refs/defs - * test/relaxng/* result/relaxng/*: augmented/updated the - regression tests - -Mon Feb 3 14:16:59 CET 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng: more work on name classes, except support - * test/relaxng/* result/relaxng/*: augmented/updated the - regression tests - -Mon Feb 3 11:56:05 CET 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng: more work on name classes, the "validate all" schemas - seems to work now. - * test/relaxng/* result/relaxng/*: augmented/updated the - regression tests - -Mon Feb 3 09:50:26 CET 2003 Daniel Veillard <daniel@veillard.com> - - * python/libxml.c: removed an unprotedted debug message Aleksi Suhonen - * parser.c: put a guard against infinite document depth, basically - trying to avoid another kind of DoS attack. - * relaxng.c: some code w.r.t. nameClasses - -Sun Feb 2 17:01:43 CET 2003 Daniel Veillard <daniel@veillard.com> - - * test/relaxng/* result/relaxng/*: check all the namespace support - was actually correct based on tutorial section 10. - -Sun Feb 2 15:33:38 CET 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng: include seems to work okay now - * test/relaxng/* result/relaxng/*: augmented/updated the - regression tests - -Sat Feb 1 19:44:58 CET 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng.c: a bit of work done in the train back. - * test/relaxng/*: added one of the include tests - -Thu Jan 30 14:06:55 CET 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng: more work done in the train - * test/relaxng/* result/relaxng/*: augmented/updated the - regression tests - -Wed Jan 29 23:44:58 CET 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng.c: debugging of externalRef - * test/relaxng/* result/relaxng/*: augmented/updated the - regression tests - -Wed Jan 29 22:06:04 CET 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng.c: more work on Relax-NG, implementing externalRef - * test/relaxng/* result/relaxng/*: augmented/updated the - regression tests - * Makefile.am: cleanup to Relaxtests target - -Wed Jan 29 00:08:38 CET 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng.c: more work on Relax-NG, implementing interleave - * test/relaxng/* result/relaxng/*: augmented/updated the - regression tests - -Tue Jan 28 21:56:49 CET 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng.c: more work on Relax-NG, implementing interleave - * test/relaxng/* result/relaxng/*: augmented/updated the - regression tests - -Mon Jan 27 07:35:29 MST 2003 John Fleck <jfleck@inkstain.net> - - * doc/tutorial/customfo.xsl - * doc/tutorial/customhtml.xsl - adding stylesheet customizations used to generate fo - for pdf and html - -Mon Jan 27 13:29:43 CET 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng.c: more work on Relax-NG - * test/relaxng/* result/relaxng/*: augmented/updated the - regression tests - * xmlschemastypes.c: added a number of base type definition but not - the associated checks, those are still TODOs - -Sun Jan 26 17:37:06 MST 2003 John Fleck <jfleck@inkstain.net> - - in docs/tutorial: - * apa.html - * apb.html - * apc.html - * apd.html - * ape.html - * apf.html - * apg.html - * ar01s02.html - * ar01s03.html - * ar01s04.html - * ar01s05.html - * ar01s06.html - * ar01s07.html - * ar01s08.html - * index.html - * xmltutorial.pdf - * xmltutorial.xml - add index to tutorial - -Sun Jan 26 17:02:29 MST 2003 John Fleck <jfleck@inkstain.net> - - * doc/xmlcatalog.1 - * doc/xmlcatalog_man.html - * doc/xmlcatalog_man.xml - belatedly fixing bug #93622 (adds rewriteURI type to - "--add" option in xmlcatalog man page - -Sun Jan 26 20:47:26 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xmlcatalog.c xmllint.c: applied patch for NetBSD by - Julio Merino, closing #104475 - -Sun Jan 26 20:38:43 CET 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng.c: more work on Relax-NG - * test/relaxng/* result/relaxng/*: augmented/updated the - regression tests - -Sun Jan 26 01:49:58 CET 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng.c: more work on Relax-NG - * test/relaxng/* result/relaxng/*: augmented/updated the - regression tests - -Sat Jan 25 18:59:54 CET 2003 Daniel Veillard <daniel@veillard.com> - - * README: updated the policy on private mail answers - * relaxng.c: more work on Relax-NG - * test/relaxng/* result/relaxng/*: augmented/updated the - regression tests - -Fri Jan 24 15:12:44 CET 2003 Daniel Veillard <daniel@veillard.com> - - * error.c parser.c tree.c: applied a documentation patch from - Stefan Kost - -Fri Jan 24 02:00:50 CET 2003 Daniel Veillard <daniel@veillard.com> - - * relaxng.c: more work on Relax-NG - * doc/*: regenerated the docs - * test/relaxng/* result/relaxng/*: updated and augmented the - Relax-NG regression tests and results - -Thu Jan 23 19:26:20 CET 2003 Daniel Veillard <daniel@veillard.com> - - * Makefile.am configure.in relaxng.c include/libxml/relaxng.h: - First commit of the new Relax-NG validation code, not generally - useful yet. - * test/relaxng/* result/relaxng/*: current state of the regression - tests - -Thu Jan 23 19:22:54 CET 2003 Daniel Veillard <daniel@veillard.com> - - * tree.c: minimized the memory allocated for GetContent - and a bit of cleanup. - -Thu Jan 23 17:41:37 CET 2003 Daniel Veillard <daniel@veillard.com> - - * python/generator.py: seems there is no good reasons to - not generate bindings for XPointer - -Tue Jan 21 13:19:35 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xmlreader.c doc/apibuild.py: applied a new patch from - Stéphane Bidoul for cleanups - * doc/libxml2-api.xml: rebuilt the API description with - new entry points - -Mon Jan 20 23:25:00 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xmlreader.c python/drv_libxml2.py python/generator.py - python/libxml.c python/libxml.py python/libxml_wrap.h - python/types.c: patch from Stéphane Bidoul for better per - context error message APIs - * python/tests/ctxterror.py python/tests/readererr.py: - update of the tests - -Sun Jan 19 17:09:28 MST 2003 John Fleck <jfleck@inkstain.net> - - * doc/guidelines.html - grammar and spelling cleanup - -Fri Jan 17 00:31:30 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xmlreader.c include/libxml/xmlreader.h python/generator.py - python/libxml.c python/libxml.py win32/libxml2.def.src: applied - a patch from Stéphane Bidoul to allow per XMLtextReader error - and warning handling - * python/tests/Makefile.am python/tests/readererr.py: adding the - specific regression test - -Tue Jan 14 17:00:08 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xpath.c: Alexey Efimov pointed out that concat('a', 'b', ) - should raise a syntax error - -Tue Jan 14 15:39:14 CET 2003 Daniel Veillard <daniel@veillard.com> - - * python/libxml.c: cleanup patch from Stéphane Bidoul - -Tue Jan 14 14:41:18 CET 2003 Daniel Veillard <daniel@veillard.com> - - * encoding.c: fixing bug #103100 with a dummy UTF8ToUTF8 copy - -Tue Jan 14 12:40:29 CET 2003 Daniel Veillard <daniel@veillard.com> - - * python/generator.py python/libxml.c python/libxml.py - python/libxml_wrap.h python/types.c: applied and fixed a patch - from Stéphane Bidoul to provide per parser error handlers at the - Python level. - * python/tests/Makefile.am python/tests/ctxterror.py: added a - regression test for it. - -Tue Jan 14 01:15:04 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xmlreader.c: fixed the streaming property of the reader, - it was generating tree faster than consuming it. Pointed out - by Nate Myers - * tree.c: fixed a bug in xmlSaveFormatFileEnc if passed a NULL doc - -Sun Jan 12 22:18:02 CET 2003 Igor Zlatkovic <igor@stud.fh-frankfurt.de> - - * win32/libxml2.def.src: added more xmlreader and other exports - -Fri Jan 10 18:04:32 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xpath.c: fix to the XPath implementation for parent and - ancestors axis when operating on a Result Value Tree. - Fixes bug #100271 - -Fri Jan 10 17:07:01 CET 2003 Daniel Veillard <daniel@veillard.com> - - * nanoftp.c nanohttp.c xmlIO.c: patch from Stefano Zacchiroli - to fix some URI/file escaping problems - -Fri Jan 10 16:20:34 CET 2003 Daniel Veillard <daniel@veillard.com> - - * python/generator.py: fixed a bug raised by Raymond Wiker, - docSetRootElement() should not raise an exception if the - return is None - -Fri Jan 10 14:13:03 CET 2003 Daniel Veillard <daniel@veillard.com> - - * python/libxml.py python/libxml.c python/libxml2-python-api.xml: - fixed bug #102181 by applying the suggested change and fixing - the generation/registration problem. - -Fri Jan 10 13:47:55 CET 2003 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: fixed bug #102960 by reusing the XML name parsing - routines. - -Fri Jan 10 00:16:49 CET 2003 Daniel Veillard <daniel@veillard.com> - - * parser.c: one more IsEmptyElement craziness, that time in - external parsed entities if substitution is asked. - * python/tests/reader3.py: added a specific test. - -Thu Jan 9 22:35:31 CET 2003 Daniel Veillard <daniel@veillard.com> - - * python/drv_libxml2.py: update from Stéphane Bidoul: python 2.1 - support and improved error handler registration - -Thu Jan 9 14:16:38 CET 2003 Daniel Veillard <daniel@veillard.com> - - * HTMLtree.c tree.c: fixes #102920 about namespace handling in - HTML output and section 16.2 "HTML Output Method" of XSLT-1.0 - * README: fixed a link - -Wed Jan 8 18:32:25 CET 2003 Daniel Veillard <daniel@veillard.com> - - * configure.in doc/* NEWS: preparing 2.5.1 release - * SAX.c parser.c: fixing XmlTextReader bug - -Wed Jan 8 00:13:01 CET 2003 Daniel Veillard <daniel@veillard.com> - - * SAX.c: fuck, I introduced a memory leak on external parsed - entities in 2.5.0 :-( - -Tue Jan 7 12:12:45 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xmllint.c: another fix needed as pointed by Christophe Merlet - for --stream --debug if compiled without debug support. - -Mon Jan 6 20:53:08 MST 2003 John Fleck <jfleck@inkstain.net> - - * doc/xmllint.xml - * doc/xmllint.1: - update man page with --stream and --chkregister - -Tue Jan 7 01:17:26 CET 2003 Daniel Veillard <daniel@veillard.com> - - * globals.c: fixed --with-threads compile - * xmllint.c: fixed --without-debug compile - * include/libxml/globals.h: cleanup - * include/libxml/schemasInternals.h: add a missing include - -Mon Jan 6 14:06:07 CET 2003 Daniel Veillard <daniel@veillard.com> - - * configure.in NEWS: preparing 2.5.0 release - * SAX.c: only warn in pedantic mode about namespace name - brokenness - * globals.c: fix a doc generation problem - * uri.c: fix #101520 - * doc/*: updated and rebuilt the doc for the release, including - stylesheet update - * python/Makefile.am: fix a filename bug - -Mon Jan 6 12:05:12 CET 2003 Daniel Veillard <daniel@veillard.com> - - * doc/tutorial/* : fixed #101894 if doc == NULL xmlFreeDoc - should not be called. - -Mon Jan 6 11:59:09 CET 2003 Daniel Veillard <daniel@veillard.com> - - * libxml-2.0.pc.in: applied the patch to fix #101894 - -Sun Jan 5 23:35:47 CET 2003 Daniel Veillard <daniel@veillard.com> - - * tree.c : applied patch from Lukas Schroeder for register callbacks - * valid.c: modified patch from Lukas Schroeder to test - register callbacks with --chkregister - -Sun Jan 5 02:23:20 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xmlreader.c: seriously changed the way data are pushed to - the underlying parser, go by block of 512 bytes instead of - tryng to detect tag boundaries at that level. Changed the - way empty element are detected and tagged. - * python/tests/reader.py python/tests/reader2.py - python/tests/reader3.py: small changes mostly due to context - reporting being different and DTD node being reported. Some - errors previously undetected are now caught and fixed. - * doc/xmlreader.html: flagged last section as TODO - -Sat Jan 4 20:40:28 CET 2003 Daniel Veillard <daniel@veillard.com> - - * python/libxml.py: integrated the Python 2.2 optimizations - from Hannu Krosing, while maintaining compatibility with - 1.5 and 2.1 - -Sat Jan 4 17:33:17 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xmllint.c: a bit of cleanup - * xmlreader.c: small fix - * doc/xmlreader.html: more work on the XmlTextReader tutorial - * python/libxml.py: a few fixes pointed out by Hannu Krosing - -Sat Jan 4 13:46:14 CET 2003 Daniel Veillard <daniel@veillard.com> - - * python/setup.py.in: patch from Stéphane Bidoul to include - drv_libxml2.py in setup.py - -Sat Jan 4 01:43:06 CET 2003 Daniel Veillard <daniel@veillard.com> - - * doc/xmlreader.html: starting documenting the new XmlTextReader - interface. - -Fri Jan 3 17:18:32 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xmllint.c: added the --stream flag to use the TextReader API - * xmlreader.c: small performance tweak - -Fri Jan 3 13:50:55 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xmlreader.c python/tests/reader2py: okay the DTD validation - code on top of the XMLTextParser API should be solid now. - -Fri Jan 3 02:17:18 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xmlreader.c python/tests/reader2py: Fixing some more mess - with validation and recursive entities while using the - reader interface, it's getting a bit messy... - -Thu Jan 2 15:15:26 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xmlreader.c python/tests/reader.py: another couple of problem - related to IsEmptyElement reported by Stéphane Bidoul needed - some fixes. - -Thu Jan 2 13:57:07 CET 2003 Daniel Veillard <daniel@veillard.com> - - * libxml.spec.in python/Makefile.am python/drv_libxml2.py: - integrated drv_libxml2.py Python xml.sax driver from Stéphane Bidoul - based on the python XmlTextReader interface. - -Wed Jan 1 22:05:40 CET 2003 Daniel Veillard <daniel@veillard.com> - - * tree.c: backing out one change in the last patch which broke the - regression tests - -Wed Jan 1 21:57:28 CET 2003 Daniel Veillard <daniel@veillard.com> - - * global.data globals.c tree.c include/libxml/globals.h: applied - an old patch from Lukas Schroeder to track node creation and - destruction. Probably missing a lot of references at the moment - and not usable reliably. - -Wed Jan 1 20:12:07 CET 2003 Daniel Veillard <daniel@veillard.com> - - * NEWS doc/Makefile.am doc/news.xsl: generate the NEWS file - from doc/news.html and a stylesheet - -Wed Jan 1 16:09:57 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xmlreader.c python/tests/reader.py: fixed another couple of - xmlreader bugs reported by Stéphane Bidoul and added tests. - -Wed Jan 1 15:42:54 CET 2003 Daniel Veillard <daniel@veillard.com> - - * xmlreader.c python/tests/reader2.py: fixed another validity - checking in external parsed entities raised by Stéphane Bidoul - and added a specific regression test. - * python/tests/reader3.py: cleanup - -Tue Dec 31 15:44:02 CET 2002 Daniel Veillard <daniel@veillard.com> - - * xmlreader.c python/tests/reader2.py: fixed a problem with - validation within entities pointed by Stéphane Bidoul, augmented - the tests to catch those. - -Tue Dec 31 12:15:37 CET 2002 Daniel Veillard <daniel@veillard.com> - - * python/generator.py: modified the generator to allow keeping - class references when creating new classes, needed to fix a bug - pointed by Stéphane Bidoul where the input buffer of the - xmlTextReader instance gets destroyed if the python wrapper for - the input is not referenced anymore. - -Mon Dec 30 19:39:36 CET 2002 Daniel Veillard <daniel@veillard.com> - - * xmlreader.c python/tests/reader.py: fixed another pair of problem - pointed by Stéphane Bidoul: depth start at 0 and a parse problem. - -Mon Dec 30 13:36:50 CET 2002 Daniel Veillard <daniel@veillard.com> - - * xmlreader.c python/tests/reader.py: fixed another problem - pointed by Stéphane Bidoul - -Mon Dec 30 12:39:55 CET 2002 Daniel Veillard <daniel@veillard.com> - - * xmlreader.c python/tests/reader.py: fixed a limit case problem - with "<a/>" - -Mon Dec 30 11:53:44 CET 2002 Daniel Veillard <daniel@veillard.com> - - * SAX.c: warn on xmlns:prefix="foo" - * xmlreader.c python/tests/reader.py: fixed a couple of problem - for namespace attributes handling. - -Mon Dec 30 00:59:07 CET 2002 Daniel Veillard <daniel@veillard.com> - - * entities.c parser.c tree.c include/libxml/entities.h: Fixed - a really nasty problem raised by a DocBook XSLT transform - provided by Sebastian Bergmann - -Sun Dec 29 12:13:18 CET 2002 Daniel Veillard <daniel@veillard.com> - - * xmlreader.c python/tests/reader.py: fixed a bug pointed out - by Stéphane Bidoul and integrated it into the tests - -Sat Dec 28 23:49:12 CET 2002 Daniel Veillard <daniel@veillard.com> - - * xmlreader.c include/libxml/xmlreader.h doc/libxml2-api.xml: - extended the XmlTextReader API a bit, adding accessors for - the current doc and node, and an entity substitution mode for - the parser. - * python/libxml.py python/libxml2class.txt: related updates - * python/tests/Makefile.am python/tests/reader.py - python/tests/reader2.py python/tests/reader3.py: updated a bit - the old tests and added a new one to test the entities handling - -Sat Dec 28 22:11:57 CET 2002 Daniel Veillard <daniel@veillard.com> - - * python/generator.py python/libxml2class.txt - python/tests/reader.py python/tests/reader2.py: changed the - generator to provide casing for the XmlTextReader similar to - C# so that examples and documentation are more directly transposable. - Fixed the couple of tests in the suite. - -Sat Dec 28 15:55:32 CET 2002 Daniel Veillard <daniel@veillard.com> - - * doc/guidelines.html: added a document on guildeline for - publishing and deploying XML - -Fri Dec 27 20:35:15 CET 2002 Daniel Veillard <daniel@veillard.com> - - * valid.c xmlreader.c: final touch running DTD validation - on the XmlTextReader - * python/tests/Makefile.am python/tests/reader2.py: added a - specific run based on the examples from test/valid/*.xml - -Fri Dec 27 15:17:20 CET 2002 Daniel Veillard <daniel@veillard.com> - - * python/libxml.py: added a few predefined xmlTextReader parser - configuration values. - -Fri Dec 27 12:57:22 CET 2002 Daniel Veillard <daniel@veillard.com> - - * python/libxml_wrap.h: trying to fix #102037 - -Fri Dec 27 12:18:14 CET 2002 Daniel Veillard <daniel@veillard.com> - - * SAX.c: fixing bug #95296, when the predefined entities - are redefined in the DTD the default one must be used - instead anyway. - -Wed Dec 25 19:22:06 MST 2002 John Fleck <jfleck@inkstain.net> - - * doc/xmllint.xml - * doc/xmllint.1 - Add discussion of XML_DEBUG_CATALOG to xmllint man - page - bug #100907 - -Mon Dec 23 16:54:22 CET 2002 Daniel Veillard <daniel@veillard.com> - - * xmlreader.c: Fixed the empty node detection to avoid reporting - an nonexistent close tag. - -Mon Dec 23 15:42:24 CET 2002 Daniel Veillard <daniel@veillard.com> - - * python/libxml.c python/setup.py.in: patch from Stéphane Bidoul - for Python 2.1 - -Sun Dec 22 11:24:06 CET 2002 Daniel Veillard <daniel@veillard.com> - - * testC14N.c vms/config.vms: applied Craig A. Berry patches for VMS - -Fri Dec 20 11:27:49 CET 2002 Daniel Veillard <daniel@veillard.com> - - * doc/libxml2-api.xml python/tests/reader.py: one really need - to provide the base URI information when creating a reader parser - from an input stream. Updated the API and the example using it. - -Fri Dec 20 01:11:30 CET 2002 Daniel Veillard <daniel@veillard.com> - - * testReader.c xmlreader.c valid.c include/libxml/tree.h - include/libxml/valid.h include/libxml/xmlreader.h: working on - DTD validation on top of xml reader interfaces. Allows to - validate arbitrary large instances. This required some extensions - to the valid module interface and augmenting the size of xmlID - and xmlRef structs a bit. - * uri.c xmlregexp.c: simple cleanup. - -Wed Dec 18 15:51:22 CET 2002 Daniel Veillard <daniel@veillard.com> - - * xmlreader.c include/libxml/xmlreader.h doc/libxml2-api.xml: more - work on the xml reader interfaces. - * AUTHORS MAINTAINERS doc/* win32/*: updated Igor's mail and the - Web page for the Windows binaries. - -Tue Dec 17 19:31:07 CET 2002 Daniel Veillard <daniel@veillard.com> - - * xmlIO.c: applied a patch for VMS following the report by - Nigel Hall - -Tue Dec 17 11:29:41 CET 2002 Daniel Veillard <daniel@veillard.com> - - * parser.c: the parseStartTag bug fix wasn't complete. - -Mon Dec 16 23:00:05 CET 2002 Daniel Veillard <daniel@veillard.com> - - * parser.c: Vyacheslav Pindyura managed to trigger a bug in - parseStartTag, fixing it. - * test/att4 result/att4 result/noent/att4: adding the test - * xmlreader.c include/libxml/xmlreader.h doc/libxml2-api.xml: added - more methods to XmlTextReader. - -Mon Dec 16 19:31:16 CET 2002 Igor Zlatkovic <igor@stud.fh-frankfurt.de> - - * win32/libxml2.def.src: added more xml reader exports - * win32/Makefile.msvc win32/Makefile.mingw: added xml reader interface - to the build - -Mon Dec 16 06:36:54 MST 2002 John Fleck <jfleck@inkstain.net> - - * doc/tutorial/xmltutorial.xml - plus generated html and pdf - Updating tutorial again based on further comments from Niraj - Tolia on the last iteration - -Sun Dec 15 21:27:30 MST 2002 John Fleck <jfleck@inkstain.net> - - * doc/tutorial/xmltutorial.xml - * doc/tutorial/includekeyword.c - * doc/tutorial/includegetattribute.c - plus generated html and pdf - Adding fix from Niraj Tolia to tutorial to properly free memory. - -Mon Dec 16 00:34:25 CET 2002 Daniel Veillard <daniel@veillard.com> - - * xmlreader.c include/libxml/xmlreader.h doc/libxml2-api.xml: added - more methods of XmlTextReader. - * python/libxml2class.txt python/tests/reader.py: this increased the - methods in the bndings, augmented the test to check those new - functions. - -Sat Dec 14 23:57:39 CET 2002 Daniel Veillard <daniel@veillard.com> - - * xmlreader.c doc/libxml2-api.xml: added the close and getattribute - methods of XmlTextReader. - * python/generator.py python/libxml_wrap.h python/types.c - python/libxml2class.txt: added the reader to the Python bindings - * python/tests/Makefile.am python/tests/reader.py: added a specific - test for the Python bindings of the Reader APIs - * parser.c: small cleanup. - -Fri Dec 13 11:39:44 CET 2002 Daniel Veillard <daniel@veillard.com> - - * xinclude.c: fallback was only copying the first child not the - full child list of the fallback element, closes #89684 as reopened - by Bernd Kuemmerlen - -Thu Dec 12 13:34:59 CET 2002 Igor Zlatkovic <igor@stud.fh-frankfurt.de> - - * win32/libxml2.def.src: exported htmlNodeDumpOutput - -Thu Dec 12 10:59:11 CET 2002 Daniel Veillard <daniel@veillard.com> - - * configure.in: preparing release of 2.4.30 - * doc/apibuild.py doc/libxml2-api.xml: fixups to the api builder, - gives enum values, fix functype return type, put back fields in - structs - * doc/*: updated the docs rebuilt - -Thu Dec 12 01:09:34 CET 2002 Daniel Veillard <daniel@veillard.com> - - * HTMLtree.c include/libxml/HTMLtree.h: patch from Mark Vakoc - about htmlNodeDumpOutput location. - * xpath.c: removed an undefined function signature - * doc/apibuild.py doc/libxml2-api.xml: the script was exporting - too many symbols in the API breaking the python bindings. - Updated with the libxslt/libexslt changes. - -Wed Dec 11 20:26:15 CET 2002 Daniel Veillard <daniel@veillard.com> - - * configure.in: preparing release of 2.4.29 - * doc/*: rebuilt the docs and API - * xmlreader.c: a few more fixes for the XmlTextReader API - -Wed Dec 11 18:01:15 CET 2002 Igor Zlatkovic <igor@stud.fh-frankfurt.de> - - * include/win32config.h: applied mingw patch from Magnus Henoch - -Wed Dec 11 16:58:48 CET 2002 Daniel Veillard <daniel@veillard.com> - - * catalog.c doc/libxml2-api.xml: a bit more cleanup - -Wed Dec 11 14:54:47 CET 2002 Daniel Veillard <daniel@veillard.com> - - * doc/apibuild.py doc/libxml2-api.xml doc/Makefile.am: new API - building Python script, does the C parsing directly, generates - a better API description including structure fieds defs and - enums. Still a couple of bugs, but good enough for the python - wrappers now. - * DOCBparser.c SAX.c nanohttp.c parser.c parserInternals.c tree.c - valid.c xmlIO.c xmlmemory.c xmlreader.c xmlregexp.c xmlschemas.c - include/libxml/schemasInternals.h include/libxml/tree.h: more - cleanup based on the python analysis script reports. - * libxml.spec.in: make sure the API XML description is part of the - devel package. - -Tue Dec 10 16:16:34 CET 2002 Daniel Veillard <daniel@veillard.com> - - * DOCBparser.c HTMLparser.c c14n.c debugXML.c encoding.c hash.c - nanoftp.c nanohttp.c parser.c parserInternals.c testC14N.c - testDocbook.c threads.c tree.c valid.c xmlIO.c xmllint.c xmlmemory.c - xmlreader.c xmlregexp.c xmlschemas.c xmlschemastypes.c xpath.c: - code cleanup, especially the function comments. - * tree.c: fixed a small bug when freeing nodes which are XInclude ones. - -Mon Dec 9 15:08:17 CET 2002 Daniel Veillard <daniel@veillard.com> - - * Makefile.am xmlreader.c include/libxml/Makefile.am - include/libxml/xmlreader.h: Adding a new set of APIs based on - the C# TextXmlReader API but converted to C. Allow to parse - in constant memory usage, far simpler to program and explain - than the SAX like APIs, unfinished but working. - * testReader.c: test program - -Sun Dec 8 18:36:01 CET 2002 Igor Zlatkovic <igor@stud.fh-frankfurt.de> - - * win32/libxml2.def.src: applied YALDSP from Mark Vakoc - -Wed Dec 4 16:08:49 CET 2002 Daniel Veillard <daniel@veillard.com> - - * tree.c: Chip turner indicated that XHTML1 serialization - rule for style actually break on both IE and Mozilla, - try to avoid the rule if escaping ain't necessary - -Wed Dec 4 12:43:28 CET 2002 Daniel Veillard <daniel@veillard.com> - - * nanhttp.c: handle HTTP URL escaping, problem reported by - Glen Nakamura and Stefano Zacchiroli - -Sat Nov 30 12:19:17 CET 2002 Daniel Veillard <daniel@veillard.com> - - * DOCBparser.c HTMLparser.c parser.c valid.c xpath.c: code cleanup - -Thu Nov 28 12:53:22 CET 2002 Daniel Veillard <daniel@veillard.com> - - * uri.c: Johann Richard pointed out some XPointer problems for - URN based URI references in XInclude. Modified the URI parsing - and saving routines to allow correct parsing and saving of - XPointers, especially when attached to "opaque" scheme accordingly - to RFC 2396 - -Wed Nov 27 20:36:08 CET 2002 Daniel Veillard <daniel@veillard.com> - - * HTMLtree.c include/libxml/HTMLtree.h: applied the same kind - of refactoring to the HTML saving code. - * doc/libxml2-*.xml doc/API*.html: slight API changes got reflected - in the doc. - -Wed Nov 27 12:40:16 CET 2002 Daniel Veillard <daniel@veillard.com> - - * tree.c include/libxml/tree.h: refactored the XML dump of a node - to a buffer API to reuse the generic dump to an OutputIO layer, - this reduces code, fixes xmlNodeDump() for XHTML, also made - xmlNodeDump() now return the number of byte written. - -Wed Nov 27 09:00:00 CET 2002 Daniel Veillard <daniel@veillard.com> - - * python/setup.py.in: another patch from Stéphane Bidoul for - Python bindings on Windows - * doc/parsedecl.py: small cleanup - -Mon Nov 25 17:28:53 CET 2002 Daniel Veillard <daniel@veillard.com> - - * libxml.spec.in configure.in: add a line in %changelog for releases - -Mon Nov 25 14:18:27 CET 2002 Daniel Veillard <daniel@veillard.com> - - * parser.c: patch from Marcus Clarke fixing a problem in entities - parsing that was detected in KDe documentations environment. - -Mon Nov 24 14:13:21 CET 2002 ERDI Gergo <cactus@cactus.rulez.org> - - * python/libxml.c (libxml_prev): Return the previous as opposed to - the next node (I guess this is the result of some cut & paste programming:) - -Sat Nov 23 17:22:22 CET 2002 Daniel Veillard <daniel@veillard.com> - - * doc/Makefile.am: Jan Rafaj pointed a bug in the Makefile. - -Sat Nov 23 12:21:24 CET 2002 Daniel Veillard <daniel@veillard.com> - - * python/generator.py python/libxml.c python/setup.py.in: trying - to fix the Python bindings build on Windows (Stéphane Bidoul) - -Fri Nov 22 22:41:34 CEST 2002 Igor Zlatkovic <igor@stud.fh-frankfurt.de> - - * win32/configure.js: added option for python bindings - * win32/libxml2.def.src: added more exports - -Fri Nov 22 18:50:34 CET 2002 Igor Zlatkovic <igor@stud.fh-frankfurt.de> - - * win32/Makefile.mingw: fixed unresolved symbols when linking with - pthreads - * win32/wince/*: applied updates to Windows CE port from Javier - -Fri Nov 22 15:51:22 CET 2002 Daniel Veillard <daniel@veillard.com> - - * configure.in: preparing 2.4.28 - * libxml.spec.in doc/Makefile.am: some cleanup - * doc/*: updated the news and regenerated. - -Fri Nov 22 14:15:14 CET 2002 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: final touch at closing #87235 </p> end tags - need to be generated. - * result/HTML/cf_128.html result/HTML/test2.html result/HTML/test3.html: - this change slightly the output of a few tests - * doc/*: regenerated - -Fri Nov 22 13:26:19 CET 2002 Daniel Veillard <daniel@veillard.com> - - * parserInternals.c: fixing bug #99190 when UTF8 document are - parsed using the progressive parser and the end of the chunk - is in the middle of an UTF8 multibyte character. - -Fri Nov 22 13:13:00 HKT 2002 William Brack <wbrack@mmm.com.hk> - - * threads.c: fixed initialization problem in xmlNewGlobalState - which was causing crash. - * globals.c: removed duplicate call to initxmlDefaultSAXHandler - in xmlInitializeGlobalState. - * parserInternals.c: cleaned up ctxt->sax initialisation. - -Thu Nov 21 15:05:45 CET 2002 Daniel Veillard <daniel@veillard.com> - - * tree.c include/libxml/tree.h: modified the existing APIs - to handle XHTML1 serialization rules automatically, also add - xmlIsXHTML() to libxml2 API. Some tweaking to make sure - libxslt serialization uses it when needed without changing - the library API. - * test/xhtml1 result/noent/xhtml1 result/valid/xhtml1.xhtml - result/xhtml1: added a new test specifically for xhtml1 output - and updated the result of one XHTML1 test - -Wed Nov 20 14:24:56 CET 2002 Daniel Veillard <daniel@veillard.com> - - * xinclude.c parserInternals.c encoding.c: fixed #99082 - for xi:include encoding="..." support on text includes. - * result/XInclude/tstencoding.xml test/XInclude/docs/tstencoding.xml - test/XInclude/ents/isolatin.txt : added a specific regression test - * python/generator.py python/libxml2class.txt: fixed the generator - the new set of comments generated for doc/libxml2-api.xml were - breaking the python generation. - -Tue Nov 19 23:25:47 CET 2002 Daniel Veillard <daniel@veillard.com> - - * doc/Makefile.am: repair some problem if gtk-doc fail or such - * configure.in: patch for Solaris on new autoconf closes #98880 - * doc/parsedecl.py: repair the frigging API building script, - did I say that python xmllib sucks ? - * doc/libxml2-api.xml doc/libxml2-refs.xml: regenerated, reordering - and some comment are no more truncated. - -Tue Nov 19 09:09:04 CET 2002 Daniel Veillard <daniel@veillard.com> - - * parser.c: Martin Stoilov pointed out a potential leak in - xmlCreateMemoryParserCtxt - -Mon Nov 18 16:05:51 CET 2002 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: fixed bug #98879 a corner case when 0 is - included in HTML documents and using the push parser. - -Mon Nov 18 00:11:24 CET 2002 ERDI Gergo <cactus@cactus.rulez.org> - - * configure.in (PYTHON_SITE_PACKAGES): If --with-python is - specified, look for the Python interpreter not just in the - specified root but also in the specified location. Fixes #98825 - -Sun Nov 17 23:36:06 CET 2002 Daniel Veillard <daniel@veillard.com> - - * python/libxml.c: fixing bug #98792 , node may have no doc - and dereferencing without checking ain't good ... - -Sun Nov 17 10:25:43 CET 2002 Daniel Veillard <daniel@veillard.com> - - * configure.in: preparing release 2.4.27 - * doc/* : updated and rebuilt the docs - * doc/Makefile.am libxml.spec.in: try to make sure the tutorial - and all the docs are actually packaged and in the final RPMs - * parser.c parserInternals.c include/libxml/parser.h: restore - xmllint --recover feature. - -Sat Nov 16 16:30:25 CET 2002 Daniel Veillard <daniel@veillard.com> - - * parser.c xpath.c: fixing #96925 which was also dependent on the - processing of parsed entities, and XPath computation on sustitued - entities. - * testXPath.c: make sure entities are substituted. - -Fri Nov 15 16:22:54 CET 2002 Daniel Veillard <daniel@veillard.com> - - * parser.c: fixed #96594, which was totally dependent on the - processing of internal parsed entities, which had to be changed. - -Fri Nov 15 12:16:07 CET 2002 Daniel Veillard <daniel@veillard.com> - - * Makefile.am python/Makefile.am python/tests/Makefile.am: - trying to fix bug #98517 about building outside the source tree - * doc/xml.html doc/FAQ.html: fixed the link to libiconv #94585 - -Thu Nov 14 18:41:55 CEST 2002 Igor Zlatkovic <igor@stud.fh-frankfurt.de> - - * include/win32config.h: cleanup - * win32/Makefile.mingw: integrated mingw in JScript configure - * win32/Makefile.msvc: modified to allow mingw coexistence - * win32/configure.js: integrated mingw - * win32/Readme.txt: cleanup - -Tue Nov 12 22:06:45 CET 2002 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: strengthen the guard in the Pop macros, - like in the XML parser, closes bug #97315 - -Tue Nov 12 21:56:39 CET 2002 Daniel Veillard <daniel@veillard.com> - - * include/libxml/parser.h: fixed bug #98338 , fatalError SAX - callback is never used. - -Tue Nov 12 13:32:50 CET 2002 Daniel Veillard <daniel@veillard.com> - - * parserInternals.c: fixed the initialization of the SAX structure - which was breaking xsltproc - * xpath.c: patch from Petr Pajas for CDATA nodes - * tree.c: patch from Petr Pajas improving xmlGetNodePath() - * parser.c include/libxml/parser.h: patch from Peter Jones - removing a leak in xmlSAXParseMemory() and adding the - function xmlSAXParseMemoryWithData() - -Mon Nov 11 20:47:03 MST 2002 John Fleck <jfleck@inkstain.net> - - adding pdf of tutorial, changing web page to link to it - * doc/tutorial/xmltutorial.pdf - * doc/xml.html - * doc/docs.html - -Sun Nov 10 20:48:57 MST 2002 John Fleck <jfleck@inkstain.net> - - * doc/tutorial/ar01s08.html - adding file what I forgot for tutorial - -Sun Nov 10 20:33:13 MST 2002 John Fleck <jfleck@inkstain.net> - - Adding encoding discussion to tutorial - Added: - * doc/tutorial/images/*.png: DocBook admonition image files - * doc/tutorial/apf.html, apg.html: new generated html - * doc/tutorial/includeconvert.c: conversion code entity file - changed: - * doc/tutorial/xmltutorial.xml: DocBook original - * doc/tutorial/*.html: generated html - -Fri Nov 8 17:59:32 CEST 2002 Igor Zlatkovic <igor@stud.fh-frankfurt.de> - - * include/libxml/*.h: retired xmlwin32version.h - * doc/Makefile.am: retired xmlwin32version.h - * win32/configure.js: retired xmlwin32version.h - -Fri Nov 8 16:55:47 CEST 2002 Igor Zlatkovic <igor@stud.fh-frankfurt.de> - - * win32/libxml2.def.src: exported additional symbols - * include/libxml/xmlmemory.h: exported the rest of the xmlMem* - sisterhood - -Fri Nov 8 16:08:13 CET 2002 Daniel Veillard <daniel@veillard.com> - - * globals.c: fixed a typo pointed out by Igor - * xpath.c: try to speed up node compare using line numbers - if available. - -Thu Nov 7 15:16:02 CET 2002 Daniel Veillard <daniel@veillard.com> - - * tree.c: make xmlFreeNode() handle attributes correctly. - -Wed Nov 6 23:51:11 CET 2002 Igor Zlatkovic <igor@stud.fh-frankfurt.de> - - * catalog.c: completed the #96963 fix, as reported by Karl - Eichwalder - -Wed Nov 6 16:48:44 CET 2002 Daniel Veillard <daniel@veillard.com> - - * xpointer.c: tried to fix bug #97852 reported by Nicolas Noffke - -Sun Nov 3 10:43:44 CET 2002 Daniel Veillard <daniel@veillard.com> - - * Makefile.am: switched the order of a couple of includes - to fix bugs #97100 - -Thu Oct 31 17:11:46 CEST 2002 Igor Zlatkovic <igor@stud.fh-frankfurt.de> - - * catalog.c: fixed bug #96963, reverted to the old behaviour of - xmlLoadCatalogs that used to separate directories with a ':'. - -Thu Oct 31 16:55:21 CEST 2002 Igor Zlatkovic <igor@stud.fh-frankfurt.de> - - * threads.c: improvements to the Windows-side of thread handling - * testThreads.c: conditionally excluded unistd.h - * testThradsWin32.c: broke overlong lines - * include/win32config.h: adapted thread-related macros to the new - scheme and for pthreads on Windows - * win32/Makefile.msvc: introduced a more flexible thread build, - added testThreads[Win32].c to the build - * win32/configure.js: introduced a more flexible thread config - -2002-10-31 John Fleck <jfleck@inkstain.net> - - * doc/xml.html (and, by implication, FAQ.html) - added UTF-8 conversaion FAQ from Marcus Labib Iskander - -Tue Oct 29 18:32:33 CET 2002 Igor Zlatkovic <igor@stud.fh-frankfurt.de> - - * configure.in: removed xmlwin32version.h - * include/libxml/Makefile.am: removed xmlwin32version.h - -Mon Oct 28 14:01:29 CET 2002 Daniel Veillard <daniel@veillard.com> - - * tree.c: applied patch from Brian Stafford to fix a bug - in xmlReconciliateNs() - -Mon Oct 28 13:51:55 CET 2002 Daniel Veillard <daniel@veillard.com> - - * tree.c: applied patch from Christian Glahn to allow - xmlNewChild() on document fragment nodes - -Sat Oct 26 15:27:00 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * parser.c: Christian Glahn found a problem with a recent - patch to xmlParseBalancedChunkMemoryRecover() - * xmlschemas.c: Charles Bozeman fixed some Schemas validation - problems - * result/schemas/elem* result/schemas/seq* test/schemas.elem* - test/schemas/seq*: added the test cases from Charles - -Wed Oct 23 16:42:29 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * Makefile.am config.h.in libxml.spec.in doc/Makefile.am: - serious cleanup of the spec file and associated changes - in the Makefiles. - * valid.c: try to remove some warnings on x86_64 - -Wed Oct 23 10:53:42 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * include/Makefile.am: added winsockcompat.h to EXTRA_DIST to - fix bug #96586 - -Tue Oct 22 21:13:06 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: Mikhail Sogrine pointed out a bug in HTML - parsing, applied his patch - * result/HTML/attrents.html result/HTML/attrents.html.err - result/HTML/attrents.html.sax test/HTML/attrents.html: - added the test and result case provided by Mikhail Sogrine - -Tue Oct 22 19:33:20 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * vms/build_libxml.com vms/config.vms vms/readme.vms - include/libxml/parser.h include/libxml/parserInternals.h - include/libxml/tree.h include/libxml/xmlIO.h - HTMLparser.c catalog.c debugXML.c parser.c parserInternals.c - tree.c triodef.h trionan.c uri.c xmlIO.c xpath.c: - Applied the VMS update patch from Craig A. Berry - * doc/*.html: update - -Tue Oct 22 16:27:31 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * include/libxml/encoding.h encoding.c: made xmlGetUTF8Char public - -Tue Oct 22 16:25:18 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * debugXML.c: adding a grep command to --shell in xmllint - for T.V. Raman - -Tue Oct 22 16:23:57 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * xmlcatalog.c: tried to fix some of the problem with --sgml - -Mon Oct 21 09:57:10 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * parser.c: tried to fix bug #91500 where doc->children may - be overridden by a call to xmlParseBalancedChunkMemory() - -Mon Oct 21 09:04:32 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * catalog.c: tried to fix bug #90945 w.r.t. parsing of system - identifiers in SGML catalogs containing '&' - -Sun Oct 20 23:31:47 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * python/types.c: fixed bugs when passing result value tree - to Python functions. - -Fri Oct 18 13:18:53 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * configure.in: preparing the release of 2.4.26 - * doc/*: updated and rebuilt the documentation - -Wed Oct 16 20:01:46 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * parser.c: fixed a XML Namespace compliance bug reported by - Alexander Grimalovsky - -Wed Oct 16 17:18:42 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * HTMLtree.c: fixed serialization of script and style when - they are not lowercase (i.e. added using the API to the tree). - -Wed Oct 16 16:31:05 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * valid.c: make xmlValidateDocument emit a warning msg if there - is no DTD, pointed by Christian Glahn - -Wed Oct 16 16:05:38 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * xmlregexp.c xmlschemas.c: fixed the validation of sequences - content model when some of the blocks have min or max, and a couple - of bugs found in the process. - * result/schemas/list0* test/schemas/list0*: added some specific - regression tests - -Tue Oct 15 12:41:01 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * README: updated the contact information - -Tue Oct 15 10:35:57 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * Makefile.am: use test -f instead of test -e since Solaris /bin/sh - misses it, reported by Peter Bray. - -Mon Oct 14 17:37:32 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * tree.c: investigating xmlNodeGetContent() on namespace nodes - and removed a few warnings - -Mon Oct 14 13:12:55 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * parser.c: Christian Glahn found a small bug in the push parser. - * xmlIO.c include/libxml/xmlIO.h: cleaned up and made xmlCheckFilename - public - -Wed Oct 9 23:11:02 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * xmlschemas.c include/libxml/xmlschemas.h: added - xmlSchemaNewMemParserCtxt to parse a schemas from a memory area - * testSchemas.c: added --memory to test the new interface - -Wed Oct 9 16:22:54 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * doc/index.py doc/search.php: integrated the XSLT indexing, - a few fixed in the indexer, added a scope selection at the - search level. - -Wed Oct 9 12:18:37 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * valid.c: Joe Marcus Clarke reported a segfault on FBsd - this was due to uninitialized parts of the validation context - -Tue Oct 8 23:24:20 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * debugXML.c: applied patch from Mark Vakoc except the API - change, preserved it. - * doc/*: updated the docs to point to the search engine for - information lookup or before bug/help reports. - -Tue Oct 8 18:53:31 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * doc/index.py doc/search.php: added mailing-list archives - indexing and lookup - -Tue Oct 8 10:25:07 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * tree.c: patch from Mark Vakoc to fix xmlNodeGetPath() - -Mon Oct 7 13:12:03 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * doc/index.py: improved HTML indexing - * doc/search.php: make the queries also lookup the HTML based indexes - -Sun Oct 6 23:50:29 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * doc/index.py: added HTML page indexing - -Fri Oct 4 15:33:55 CEST 2002 Igor Zlatkovic <igor@stud.fh-frankfurt.de> - - * xmlIO.c: extended Windows path normalisation to fix the base - problem in libxslt. - * catalog.c: fixed list handling in XML_CATALOG_FILES - -Fri Oct 4 13:43:02 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * valid.c: typo/bug found by Christian Glahn - -Sun Sep 29 19:44:10 CEST 2002 Igor Zlatkovic <igor@stud.fh-frankfurt.de> - - * xmlIO.c: applied Windows CE patch from Javier. - * win32/wince: new directory, contains support for the PocketPC - with Windows CE from Javier. - * include/win32config.h: reorganised, removed duplicate - definitions and applied WinCE patch from Javier. - * include/wsockcompat.h: new file, now contains WinSock - compatibility macros. - * win32/Makefile.msvc: introduced double-run compilation. - -Thu Sep 26 19:48:06 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * configure.in include/libxml/xmlwin32version.h: preparing release - of 2.4.25 - * doc/*: updated and regenerated the docs and web pages. - -Thu Sep 26 17:33:46 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * SAX.c valid.c include/libxml/valid.h: fixed bug #92518 validation - error were not covering namespace declarations. - * result/valid/dia.xml test/valid/dia.xml: the test wasn't valid, - it was missing the attribute declaration for the namespace - * result/VC/NS3: the fix now report breakages in that test - -Thu Sep 26 14:39:07 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * HTMLtree.c: fixing bug #94241 on HTML boolean attributes - -Thu Sep 26 14:25:33 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * doc/*: added the 3 new modules xmlregexp xmlautomata and xmlunicode - and regenerated the docs and web site - -Thu Sep 26 11:45:42 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * xinclude.c xmlschemas.c xmlschemastypes.c xpath.c: make sure - ATTRIBUTE_UNUSED is always put after the attribute declaration, - not before - -Thu Sep 26 11:33:28 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * python/generator.py python/libxml2class.txt: fixed a stupid error - breaking the python API - -Thu Sep 26 00:31:46 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * trio.c trio.h triodef.h trionan.c trionan.h triop.h - triostr.c triostr.h: applied a trio update patch from - Bjorn Reese which should work with MinGW - -Thu Sep 26 00:21:18 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * tree.c: improving some documentation comments - * xmlregexp.c: found and fixed a mem leak with python regression tests - * doc/*: rebuilt the doc and the API XML file including the - xmlregexp.h xmlautomata.h and xmlunicode.h headers - * python/generator.py python/libxml2class.txt python/libxml_wrap.h - python/types.c: added access to the XML Schemas regexps from - python - * python/tests/Makefile.am python/tests/regexp.py: added a - simple regexp bindings test - -Tue Sep 24 08:10:48 MDT 2002 John Fleck <jfleck@inkstain.net> - - * doc/xml.html: - fixing ftp links - thanks to Vitaly Ostanin - -Tue Sep 24 16:08:17 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * xmlregexp.c: fixed the data callback on transition functionality - which was broken when using the compact form - * result/schemas/*: updated the results, less verbose, all tests - pass like before - * DOCBparser.c testAutomata.c testC14N.c testSchemas.c testThreads.c - testXPath.c valid.c xinclude.c xmllint.c xmlregexp.c xmlschemas.c - xmlschemastypes.c xpath.c python/libxml.c: removed a bunch of - annoying warnings - * xpath.c: try to provide better error report when possible - -Sat Sep 21 14:56:37 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * Makefile.am: fixed a breakage raised by Jacob - -Fri Sep 20 20:08:18 CEST 2002 Igor Zlatkovic <igor@stud.fh-frankfurt.de> - - * include/win32config.h: added HAVE_ERRNO_H definition for parts - which don't use sockets - -Fri Sep 20 18:40:50 CEST 2002 Igor Zlatkovic <igor@stud.fh-frankfurt.de> - - * win32/Makefile.msvc: applied zlib patch from Daniel Gehriger - * win32/configure.js: applied zlib patch from Daniel Gehriger - -Fri Sep 20 15:40:14 CEST 2002 Igor Zlatkovic <igor@stud.fh-frankfurt.de> - - * win32/configure.js: applied the patch from Mark Vakoc for - regexp support - * win32/libxml2.def.src: applied the patch from Mark Vakoc - for regexp support - -Fri Sep 20 15:35:33 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * xmlschemastypes.c: as pointed by Igor Float and Double - parsing ain't finished yet - -Fri Sep 20 14:00:16 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * Makefile.am configure.in: trying to fix #88412 by bypassing - all the python subdir if python ain't detected - -Thu Sep 19 21:46:53 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * Makefile.am configure.in include/libxml/xmlversion.h.in: - made configuring with regexps/automata/unicode the default - but without schemas ATM - * testRegexp.c valid.c xmlregexp.c include/libxml/xmlregexp.h: - fixed the regexp based DTD validation performance and memory - problem by switching to a compact form for determinist regexps - and detecting the determinism property in the process. Seems - as fast as the old DTD validation specific engine :-) despite - the regexp built and compaction process. - -Wed Sep 18 18:27:26 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * valid.c: determinism is debugged, new DTD checking code now works - but xmlFAComputesDeterminism takes far too much CPU and the whole - set usues too much memory to be really usable as-is - -Wed Sep 18 00:54:30 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * tree.c: fixed another stupid bug in xmlGetNodePath() - * xmllint.c: --version now report the options compiled in - -Tue Sep 17 23:48:07 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: small cleanup - * valid.c xmlregexp.c: switched DTD validation to use only regexp - when configured with them. A bit of debugging around the determinism - checks is still needed - -Tue Sep 17 21:22:25 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * python/libxml_wrap.h: stupid bug found by mattam@netcourrier.com - -Tue Sep 17 19:58:26 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * xmlIO.c: small portability glitch fixed. - -Mon Sep 17 12:38:08 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * xmlschemastypes.c: incomplete steps for real/double support - * testAutomata.c include/libxml/xmlautomata.h - include/libxml/xmlregexp.h: avoiding a compilation problem - * valid.c include/libxml/valid.h: starting the work toward using - the regexps for actual DTD validation - -Fri Sep 13 16:46:14 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * hash.c: cosmetic cleanup - * valid.c include/libxml/tree.h include/libxml/valid.h: started - integrating a DTD validation layer based on the regexps - -Thu Sep 12 18:01:29 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * xmlregexp.c xmlschemas.c: fixed a bug reported by Jeff Goff, - the determinism was tested before eliminating the epsilon - transitions :-( - -Thu Sep 12 16:57:45 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * python/generator.py python/libxml.c python/libxml.py - python/libxml2-python-api.xml python/libxml2class.txt - python/libxml_wrap.h python/types.c: updated the python - bindings, added code for easier File I/O, and the ability to - define a resolver from Python fixing bug #91635 - * python/tests/Makefile.am python/tests/inbuf.py - python/tests/outbuf.py python/tests/pushSAXhtml.py - python/tests/resolver.py python/tests/serialize.py: updated - and augmented the set of Python tests. - -Tue Sep 10 21:05:28 CEST 2002 Igor Zlatkovic <igor@stud.fh-frankfurt.de> - - * win32/configure.js: added more readme info for the binary - package. - -Tue Sep 10 14:15:18 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * xmlIO.c: fixed a stupid out of bound array error - -Tue Sep 10 13:09:14 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * include/libxml/xmlIO.h xmlIO.c parser.c HTMLparser.c DOCBparser.c: - messing around with support for Windows path, cleanups, - trying to identify and fix the various code path to the - filename access. Added xmlNormalizeWindowsPath() - -Thu Sep 5 16:19:18 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * error.c valid.c: working on better error reporting of validity - errors, especially providing an accurate context. - * result/valid/xlink.xml.err result/valid/rss.xml.err: better - error reports in those cases. - -Thu Sep 5 13:29:47 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * DOCBparser.c HTMLparser.c c14n.c entities.c list.c - parser.c parserInternals.c xmlIO.c: get rid of all the - perror() calls made in the library execution paths. This - should fix both #92059 and #92385 - -Thu Sep 5 13:13:17 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * xmllint.c: memory leak reporting was broken after a change - of the preprocessor symbol used to activate it. - -Thu Sep 5 13:10:57 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * tree.c: try to make the copy function work for node of - type XML_DOCUMENT_FRAG_NODE, they are only created by the - DOM layers though, not libxml2 itself. - -Thu Sep 5 12:57:38 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * valid.c: try to provide file and line information, not all - messages are covered, but it's a (good) start - -Thu Sep 5 12:49:35 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * xinclude.c: reimplemented a large part of the XInclude - processor, trying to minimize resources used, James Henstridge - provided a huge test case which was exhibiting severe memory - consumption problems. - -Thu Sep 5 10:07:13 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * python/Makefile.am: applied patch from Christophe Merlet to - reestablish DESTDIR - -Wed Sep 4 14:13:34 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * libxml.spec.in: fixes library path for x86_64 AMD - -Tue Sep 3 21:14:19 MDT 2002 John Fleck <jfleck@inkstain.net> - - * doc/tutorial/includekeyword.c - * doc/tutorial/xmltutorial.xml: - (plus resulting generated html files) - fixing one spot I missed in the tutorial where I hadn't freed - memory properly - -Sat Aug 31 19:31:17 MDT 2002 John Fleck <jfleck@inkstain.net> - - * doc/tutorial/includeaddattribute.c - * doc/tutorial/includeaddkeyword.c - * doc/tutorial/includegetattribute.c - * doc/tutorial/includekeyword.c - * doc/tutorial/xmltutorial.xml - * doc/tutorial/*.html: - update tutorial to properly free memory (thanks to Christopher - R. Harris for pointing out that this needs to be done) - * doc/tutorial/images/callouts/*.png: - added image files so the callouts are graphical, making it - easier to read ( use "--param callout.graphics 1" to generate - html with graphical callouts) - -Wed Aug 28 13:44:54 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * doc/Libxml2-Logo-180x168.gif doc/Libxml2-Logo-90x34.gif: - nice logos generated by Marc Liyanage - * doc/site.xsl *.html: changed the stylesheet to show the new - logo and regenerated the pages - -Sun Aug 25 16:38:05 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * xmlIO.c: handle Windows specific file://localhost/ semantic ... - -Thu Aug 22 22:03:19 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * xpath.c: possible mem leak patch from Jason Adams - -Thu Aug 22 17:27:30 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * xpath.c: integrated xf:escape-uri() from Wesley Terpstra - in the XQuery namespace - * configure.in: preparing 2.4.24 - * doc/*.html: updated the web pages - -Thu Aug 22 16:19:42 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * python/generator.py: closing bug #85258 by generating conditional - compile check to avoid linking to routines not configured in. - -2002-08-22 Havoc Pennington <hp@pobox.com> - - * autogen.sh: update error message for missing automake - -Thu Aug 22 11:45:50 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * python/Makefile.am: typo in target name resulted in libxml2.py - to not be rebuilt. fixed DESTDIR similarly to the libxslt one. - -Thu Aug 22 09:15:00 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * win32/win32/Makefile.mingw: updated with version from - Elizabeth Barham at http://soggytrousers.net/repository/ - -Tue Aug 20 16:40:48 CEST 2002 Igor Zlatkovic <igor@stud.fh-frankfurt.de> - - * win32/Makefile.msvc: added the prefix location to the include - and lib search path. - -2002-08-18 Havoc Pennington <hp@pobox.com> - - * autogen.sh: hardcode aclocal-1.4/automake-1.4 so that users with - both automake 1.6 and 1.4 installed get the right automake. Means - compilation from CVS will now require the latest automake 1.4 - release, or manually creating symlinks called "automake-1.4" and - "aclocal-1.4" - -Wed Aug 14 18:54:19 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * configure.in python/Makefile.am: more AMD 64 induced changes from - Frederic Crozat - -Wed Aug 14 16:43:53 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * xinclude.c: oops I was missing the xml:base fixup too - * result/XInclude/*.xml: this adds xml:base attributes to most - results of the tests - -Wed Aug 14 16:05:37 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * xinclude.c: quick but apparently working implementation of - xi:fallback, should close bug #89684 - * Makefile.am test/XInclude/docs/fallback.xml - result/XInclude/fallback.xml: added a basic test for fallback, - and run with --nowarning to avoid a spurious warning - * configure.in: applied patch from Frederic Crozat for python - bindings on AMD 64bits machines. - -Wed Aug 14 10:47:46 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * parser.c: xmlSAXUserParseMemory() really ought to fail if - the caller don't pass a SAX callback block. - -Wed Aug 14 10:29:02 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * tree.c: applied the same fix for the XML-1.0 namespace to - xmlSearchNsByHref() as was done for xmlSearchNs() - -Mon Aug 12 16:52:08 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * libxml.3: small cleanup of the man page - * HTMLtree.c: fixed a potential problem raised by Petr Vandrovec - when serializing HREF attributes generated by XSLT. - -Mon Aug 12 15:24:05 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * HTMLtree.c include/libxml/HTMLtree.h: integrated a cleaned up - version of Marc Liyanage' patch for boolean attributes in HTML - output - -Mon Aug 12 14:11:59 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * python/tests/serialize.py: fixed the test results, indenting - behaviour changed slightly - -Thu Aug 8 11:00:26 2002 Aleksey Sanin <aleksey@aleksey.com> - - * win32/dsp/libxml2.def.src win32/libxml2.def.src: added - new c14n function to Windows def files - -Fri Aug 2 16:46:46 2002 Aleksey Sanin <aleksey@aleksey.com> - - * c14n.c: fixed a memory leak in c14n code - -Sat Aug 3 00:15:06 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * parser.c include/libxml/parser.h: adding a new API for Christian - Glahn: xmlParseBalancedChunkMemoryRecover - * valid.c: patch from Rick Jones for some grammar cleanup in - validation messages - * result/VC/* result/valid/*: this slightly change some of the - regression tests outputs - -Thu Aug 1 14:50:28 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * tree.c: trying to fix a problem in namespaced attribute handling - raised by Christian Glahn - -Thu Aug 1 12:17:30 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * encoding.c include/libxml/encoding.h: Opening the interface - xmlNewCharEncodingHandler as requested in #89415 - * python/generator.py python/setup.py.in: applied cleanup - patches from Marc-Andre Lemburg - * tree.c: fixing bug #89332 on a specific case of losing - the XML-1.0 namespace on xml:xxx attributes - -Wed Jul 31 23:27:42 2002 Aleksey Sanin <aleksey@aleksey.com> - - * c14n.c include/libxml/c14n.h: fixed one more c14n + namespaces - corner case from new Merlin's test suite and added a callback - that will be used to improve xmlsec performance - -Mon Jul 29 18:22:00 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * HTMLtree.c: trying to fix the <style> escaping problem in - HTML serialization bug #89342 - -Thu Jul 25 01:33:47 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * doc/xml.html doc/*.html: applied syntax patch from Rick Jones - and rebuilt the web site. - -Mon Jul 22 11:04:48 PDT 2002 Aleksey Sanin <aleksey@aleksey.com> - - * include/libxml/tree.h: added _private member to xmlNs struct - -Sun Jul 21 17:48:47 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: fixing bug #84876 based on the xml working - code. - -Sun Jul 21 19:15:00 HKT 2002 William Brack <wbrack@mmm.com.hk> - - * python/Makefile.am: enhanced to fix bug 72012 (errors - when using '-jX' make parameter) - -Fri Jul 19 16:35:00 HKT 2002 William Brack <wbrack@mmm.com.hk> - - * xpath.c: small additional enhancement for booleans - compared to nodesets - -Wed Jul 17 19:48:14 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * HTMLtree.c: changed the order of the encoding declaration - attributes in the meta tags due to a bug in IE/Mac - -Fri Jul 12 08:45:00 HKT 2002 William Brack <wbrack@mmm.com.hk> - - * xpath.c: enhanced handling of booleans (especially '=' - and '!=' for nodesets) - fixes bug 85256. Added new - routine xmlXPathNotEqualValues for more proper handling - of '!=' when nodesets are involved. - -Thu Jul 11 21:45:52 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * doc/Makefile.am: fixing Red Hat bug #68614 by adding the - doc/xmlcatalog_man.xml to the source distribution - -Wed Jul 10 21:26:13 CEST 2002 Igor Zlatkovic <igor@stud.fh-frankfurt.de> - - * win32/Makefile.msvc: Added a copy *.pdb to install, few have - asked for this. - -Sat Jul 6 21:55:59 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * configure.in: preparing 2.4.23 - * doc/*: rebuilt the docs - -Sat Jul 6 21:11:20 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * parser.c: fixing bug #84169 by fixing the - comment of xmlCreatePushParserCtxt to describe the - encoding detection parameters better. - -Sat Jul 6 19:44:56 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * valid.c: fixing bug #79331 in one path the lookup for - ID attributes on a namespaced node wasn't handled correctly :-\ - -Fri Jul 5 20:07:43 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: trying to fix 87235 about discarded white - spaces in the HTML parser. - * result/HTML/*: this changes the output of a number of HTML - regression tests - -Mon Jul 1 23:23:41 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * xpath.c: applied patch from Richard Jinks for the namespace - axis + fixed a memory error. - * parser.c parserInternals.c: applied patches from Peter Jacobi - removing ctxt->token for good. - * xmlschemas.c xmlschemastypes.c: fixed a few memory leaks - popped out by the regression tests. - * Makefile.am: patch for threads makefile from Gary Pennington - -Fri Jun 28 19:38:00 HKT 2002 William Brack <wbrack@mmm.com.hk> - - * xpath.c: enhanced behaviour of position() after usage of - expressions involving preceding-sibling (et al). - -Tue Jun 18 09:58:48 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * hash.c: applied a patch from Peter Jacobi to solve a problem - when compiling with the Watcom C on Win32 - * result/schemas/*.err: the change of hashing algo generated - permutations in the output - -Mon Jun 17 19:02:49 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * hash.c: applied patch from Sander Vesik improving the quality of - the hash function. - -2002-06-14 Aleksey Sanin <aleksey@aleksey.com> - - * DOCBparser.c HTMLparser.c debugXML.c encoding.c - nanoftp.c nanohttp.c parser.c tree.c uri.c xmlIO.c - xmllint.c xpath.c: replaced sprintf() with snprintf() - to prevent possible buffer overflow (the bug was pointed - out by Anju Premachandran) - -Thu Jun 13 17:30:25 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * parser.c: removed an uninitialized data error popped by valgrind - on PE references - -Wed Jun 12 21:38:46 MDT 2002 John Fleck <jfleck@inkstain.net> - - * doc/xml.html - adding tutorial reference to the web page - -Wed Jun 12 21:26:08 MDT 2002 John Fleck <jfleck@inkstain.net> - - * doc/tutorial/xmltutorial.xml - * doc/tutorial/ar01s07.html - * doc/tutorial/ape.html - * doc/tutorial/includegetattribute.c - adding section to tutorial about retrieving an attribute - value - -Tue Jun 11 12:07:04 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * parser.c: applied a couple of patches from Peter Jacobi to start - to get rid of ctxt->token, with a possible significant speed - improvement to be gained once done. Better compliance with PE - references constructs in DTDs too. - * test/valid/t[0-9]* result/valid/t[0-9]*: added a set of tests - from Peter too - -Tue Jun 11 09:25:12 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * parser.c: Babak Vahedipour-Kunze reported that openTag in - xmlParseElement was likely to have been deallocated at the - time of the report, possibly leading to segfault. Just report - the tag name now. - -Mon Jun 10 18:00:02 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * xpath.c: patch from Richard Jinks for XPath substring() function - * result/XPath/expr/strings test/XPath/expr/strings: new set of tests - -2002-06-06 Aleksey Sanin <aleksey@aleksey.com> - - * xmlIO.c: patch from Rachel Hestilow to fix bug #84340 - -Wed Jun 5 19:14:49 MDT 2002 John Fleck <jfleck@inkstain.net> - - *doc/FAQ.html - fixing typos in FAQ, thanks to Robert Funnell for the - editing help - -Wed Jun 5 14:50:24 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * NEWS: got complaints from rpmlint that it was empty - -Tue Jun 4 09:09:18 MDT 2002 John Fleck <jfleck@inkstain.net> - - * added doc/tutorial, including: - apa.html - apb.html - apc.html - apd.html - ar01s02.html - ar01s03.html - ar01s04.html - ar01s05.html - ar01s06.html - includeaddattribute.c - includeaddkeyword.c - includekeyword.c - includestory.xml - index.html - xmltutorial.xml - libxml tutorial, including generated html - -Mon Jun 3 21:21:26 2002 Aleksey Sanin <aleksey@aleksey.com> - - * result/c14n/exc-without-comments/merlin-c14n-two-* - result/c14n/without-comments/merlin-c14n-two-* - test/c14n/exc-without-comments/merlin-c14n-two-* - test/c14n/without-comments/merlin-c14n-two-* - testC14N.c Makefile.am: added merlin-c14n-two.tar.gz tests for - c14n/exc-c14n and slightly modified test script to handle - these test cases - * c14n.c: fixed bugs for complicated nodes set (namespace - without node and others from merlin-c14n-two.tar.gz) - * include/libxml/xpathInternals.h win32/dsp/libxml2.def.src - win32/libxml2.def.src: "opened" xmlXPathNodeSetFreeNs() function - for xmlsec performance patch - * xpath.c: fixed self::node() for namespaces and attributes - -Mon Jun 03 00:04:21 2002 Chema Celorio <chema@ximian.com> - - * tree.h: added xmlDocFormatDump which is just as xmlDocDump - but with the format parameter - * tree.c: made xmlDocDump a wrapper around xmlDocFormatDump - -Fri May 31 12:16:48 2002 Aleksey Sanin <aleksey@aleksey.com> - - * Makefile.am: updated c14n tests suite - * c14n.c: performance improvement for previous c14n patch - -Fri May 31 11:47:12 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * parser.c: another peroformance patch from Peter Jacobi, that - time on parsing attribute values. - -Thu May 30 23:34:27 2002 Aleksey Sanin <aleksey@aleksey.com> - - * Makefile.am result/c14n/* test/c14n/*: C14N tests integrated - into LibXML2 test suite - -Thu May 30 21:23:06 2002 Aleksey Sanin <aleksey@aleksey.com> - - * c14n.c: propagating xpath ancesstors node fix to c14n - plus small performance improvement to reduce number of - mallocs - * xpath.c: fixed ancestors axis processing for namespace nodes - -Wed May 29 10:21:39 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * SAX.c parser.c tree.c include/libxml/tree.h: performance patch from - Peter Jacobi - -Mon May 27 23:18:33 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * configure.in: preparing 2.4.22 - -Mon May 27 16:44:04 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c win32/libxml2.def.src win32/dsp/libxml2.def.src - include/libxml/HTMLparser.h: fixing #79334 making htmlParseDocument - a public entry point. - * doc/*: rebuilt the API and docs - -Mon May 27 14:16:28 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * xpath.c: patch from Richard Jinks to fix a problem introduced - in the previous patch and pointed by Norm - -Fri May 24 13:10:22 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * libxml.spec.in: fixing bug #81112 - -Fri May 24 13:03:24 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * uri.c: fixing bug #82848 - -Fri May 24 09:54:49 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * result/catalogs/mycatalog.full: Aleksey's commit changed the - output of one catalog test - -Fri 24 May 2002 12:17:45 AM PDT Aleksey Sanin <aleksey@aleksey.com> - - * global.data globals.c tree.c include/libxml/globals.h - win32/libxml2.def.src win32/dsp/libxml2.def.src: changed - default value for global parameter xmlIndentTreeOutput to 1 and - introduced new global parameter xmlTreeIndentString (the string - used to do one-level indent) with default value " " (as it was - in tree.c) - -Thu May 23 13:55:57 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * Makefile.am: Merijn Broeren pointed out a problem when compiling - with trio and schemas. - -Wed May 22 11:57:49 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * xpath.c: patch from Richard Jinks to fix the problem raised in - http://mail.gnome.org/archives/xml/2002-April/msg00246.htm - -Wed May 22 08:38:19 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * xmlschemas.c: a bit of work on import. - * xmlschemastypes.c: Charles Bozeman provided a compare function - for date/time types so min/max facet restrictions should work, - indeterminate comparisons return an error instead of equal. - * test/schemas/date_0* result/schemas/date_0_0: specific test - from Charles Bozeman too - -Sat May 18 09:54:12 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * libxml.3 doc/buildDocBookCatalog: apply a couple of patches - from Christian Cornelssen fixing the man pages and the Catalog - building script. - * xmlschemas.c include/libxml/schemasInternals.h: nothing new yet - next step is <xs:import> I now have a reasonable understanding - of how it works. - -Thu May 16 10:43:26 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * xmlIO.c: applied a small buffer performance patch from Gary Pennington - -Wed May 15 00:25:34 CEST 2002 Igor Zlatkovic <igor@stud.fh-frankfurt.de> - - * win32/libxml2.def.src: exported xmlXPathNodeSetAddNs() - -Tue May 14 13:00:48 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * xpath.c: fixing an XPath function evaluation bug pointed out - by Alexey Efimov where the context was lost when evaluating - the function arguments - -Mon 13 May 2002 11:37:39 PM PDT Aleksey Sanin <aleksey@aleksey.com> - - * xpath.c include/libxml/xpathInternals.h: made xmlXPathNodeSetAddNs() - function public for XMLSec performance optimizations - -Mon May 13 12:32:22 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * python/generator.py python/libxml2class.txt : fixed a problem - with the HTML parser pointed by Gary Benson - * python/tests/Makefile.am python/tests/pushSAXhtml.py: sdding the - example - -Thu 09 May 2002 11:19:00 AM PDT Aleksey Sanin <aleksey@aleksey.com> - * parser.c: fixed bug #81159 (memory growth in SAX) - -Tue 07 May 2002 09:20:21 AM PDT Aleksey Sanin <aleksey@aleksey.com> - * xpath.c: fixed bug #78858 (the real fix) - -Sat 04 May 2002 11:56:31 PM PDT Aleksey Sanin <aleksey@aleksey.com> - * xpath.c: fixed bug #78858 (quick and durty fix to hide the problem) - -Sun May 5 08:57:08 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * tree.c: modified xmlNodeSetBase to allow changing the - base of a document. - -Fri May 3 09:20:41 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * xmlschemastypes.c: patch Charles Bozeman for validation of - all the date, time, and duration types - * test/schemas/dur_0* result/schemas/dur_0*: associated tests - * configure.in: fixed an error pointed by an user - * xml2-config.in: fixed an error pointed by an user - -Wed 01 May 2002 11:29:27 AM PDT Aleksey Sanin <aleksey@aleksey.com> - - * include/libxml/xmlIO.h win32/dsp/libxml2.def.src - win32/libxml2.def.src xmlIO.c: exported default - 'file:', 'http:' and 'ftp:' protocols input handlers - and made protocols comparison case insensitive - -Tue Apr 30 16:29:05 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * configure.in: Neven Has detected a typo - -Tue Apr 30 08:48:11 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * AUTHORS HACKING: added Aleksey Sanin <aleksey@aleksey.com> - as one of the persons allowed to commit directly to the - module. - -Mon Apr 29 17:48:26 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * configure.in include/libxml/xmlwin32version.h: preparing 2.4.21 - * valid.c: raised a too low limit - * doc/*: rebuilt the docs - -Wed Apr 24 13:41:03 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * test/XPath/expr/floats test/XPath/expr/functions - result/XPath/expr/floats result/XPath/expr/functions - xpath.c: another XPath conformance patch from Richard Jinks - -Tue Apr 23 19:50:40 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * xmlschemas.c: fixed validation of attribute groups. - * test/schemas result/schemas: added an example from the primer - -Tue Apr 23 09:11:37 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * Makefile.am xmlschemas.c xmlschemastypes.c: more work on Schemas - * test/schemas result/schemas: updated the test list - -Mon Apr 22 17:59:14 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * TODO: updated a bit - * parser.c: made a comment more specific - * xmlregexp.c xmlschemas.c xmlschemastypes.c: more work on the - Schemas conformance. - * test/schemas result/schemas: updated the test list - -Sat Apr 20 19:36:39 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * xmlregexp.c xmlschemas.c include/libxml/xmlautomata.h: - implementing xs:all with minOccurs = 0 - * tes/schemas/* result/schemas/*: added more tests covering - xs:all - -Sat Apr 20 09:22:50 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * xmlregexp.c: first implementation of the all particle, this - may need to be revisited for case where not all transitions - must be crossed. - -Fri Apr 19 18:26:04 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * tree.c: another entity processing update from Markus Henke - -Fri Apr 19 17:14:24 CEST 2002 Bjorn Reese <breese@users.sourceforge.net> - - * trionan.c: fixed crash on OSF/1 - -Fri Apr 19 09:00:56 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * xmlschemas.c: more Schemas work - * test/schemas/* result/schemas/*: added more tests coming - from the spec. - -Thu Apr 18 23:00:02 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * c14n.c: patch from Aleksey Sanin reflecting a change in the - ExcC14N specification - -Thu Apr 18 18:38:30 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * tree.c: patch from Markus Henke, fix for recursive entities. - -Thu Apr 18 17:49:24 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * xpath.c: fix a problem with string() on a document node. - -Thu Apr 18 16:40:42 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * Makefile.am xmlschemas.c: more Schemas work - * test/schemas/* result/schemas/*: added more tests coming - from the spec. - -Thu Apr 18 13:52:52 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * HTMLtree.c: fixed & serialization bug introduced in 2.4.20 - * result/HTML/*: this changes a few things in the results - -Wed Apr 17 20:34:37 CEST 2002 Igor Zlatkovic <igor@stud.fh-frankfurt.de> - - * include/libxml/tree.h: eliminated 'declaration different than - prototype' warning - * include/win32config.h: "resolved" conflicts with errno.h - -Wed Apr 17 18:26:07 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * xmlregexp.c xmlschemas.c include/libxml/xmlautomata.h: more work - on the automata interfaces and debug of counted choices - * test/schemas/* result/schemas/*: added a number of tests - -Wed Apr 17 11:03:03 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * xmlschemas.c xmlschemastypes.c include/libxml/xmlschemas.h: - a bit of work on Schemas - * testSchemas.c: try to make it more useful - * test/schemas/* result/schemas/* Makefile.am: changed the - Schemas regression test procedure, started adding a few samples - -Tue Apr 16 19:52:01 CEST 2002 Igor Zlatkovic <izlatkovic@stud.fh-frankfurt.de> - - * include/libxml/encoding.h: Patch for the Borland C++ builder - * include/libxml/tree.h: Patch for the Borland C++ builder - * threads.c: Patch for the Borland C++ builder - * win32/bcb5: New directory for the Borland C++ builder - project files - -Tue Apr 16 19:46:55 CEST 2002 Igor Zlatkovic <izlatkovic@stud.fh-frankfurt.de> - - * win32/Makefile.msvc: Update for XML Schema support - * win32/configure.js: Update for XML Schema support - * win32/libxml2.def.src: Update for XML Schema support - -Tue Apr 16 17:46:43 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * Makefile.am TODO_SCHEMAS configure.in genUnicode.py testAutomata.c - testRegexp.c testSchemas.c xmlregexp.c xmlschemas.c xmlschemastypes.c - xmlunicode.c include/libxml/Makefile.am - include/libxml/schemasInternals.h include/libxml/xmlautomata.h - include/libxml/xmlregexp.h include/libxml/xmlschemas.h - include/libxml/xmlschemastypes.h include/libxml/xmlunicode.h - include/libxml/xmlversion.h.in : merged the current state of - XML Schemas implementation, it is not configured in by default, - a specific --schemas configure option has been added. - * test/automata test/regexp test/schemas Makefile.am - result/automata result/regexp result/schemas: - merged automata/regexp/schemas regression tests - -Tue Apr 16 09:48:44 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * xpath.c: Gary found a compile time problem, fixes #78823 - -Mon Apr 15 19:11:36 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * configure.in: release of 2.4.20 - * doc/*: updated and rebuilt the docs - -Mon Apr 15 14:55:53 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * python/Makefile.am: patch from Cristian Gafton to build on - Red Hat 6.2, should also fix #75779 - -Mon Apr 15 12:14:49 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * valid.c: first part of fixing #78729 - -Sun Apr 14 23:44:58 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * HTMLtree.c uri.c: fixing bug #78662 i.e. add proper - escaping of URI when saving HTML files. - * result/HTML/*: this impacted some tests - -Sun Apr 14 14:55:15 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * configure.in: trying to fix #77441 - -Fri Apr 12 23:02:16 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * include/libxml/xmlIO.h: Hallski complained it could not be - included by itself. - -Thu Apr 11 10:23:36 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * configure.in: applied an IEEE flag patch for OSF/1 #77825 - -Wed Apr 10 23:31:34 CEST 2002 Igor Zlatkovic <igor@stud.fh-frankfurt.de> - - * win32/configure.js: patch from Nilo for the c14n option - * win32/Makefile.msvc: fixed libxml2.def generation with threads - -Wed Apr 10 21:24:16 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * xpath.c include/libxml/xmlwin32version.h.in: Silvan Minghetti - pointed erroneous use of LIBXML_THREADS_ENABLED instead of - LIBXML_THREAD_ENABLED - -Wed Apr 10 18:12:52 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * xpath.c: another patch from Richard Jinks for substring conformance - * test/XPath/expr/floats test/XPath/expr/strings - result/XPath/expr/floats result/XPath/expr/strings: update of the - test suite to check those. - -Wed Apr 10 13:29:49 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * xpath.c: patch from Richard Jinks for .x float parsing. - -Tue Apr 9 18:09:31 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * parser.c: patch from Markus Henke when an encoding ain't recognized - -Tue Apr 9 15:47:14 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * libxml.m4: got a report that #include <string.h> was needed - -Tue Apr 9 11:51:25 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * xmllint.c: applied a fix from Anthony Jones for -o /--output - -Tue Apr 2 20:27:11 MST 2002 John Fleck <jfleck@inkstain.net> - - * doc/example.html: fixing typo - -Mon Apr 1 10:02:57 CEST 2002 Daniel Veillard <daniel@veillard.com> - - * xpath.c: fixed a bug in the nodeset to boolean comparison code - pointed out by Melvyn Sopacua. - -Fri Mar 29 23:41:53 CET 2002 Daniel Veillard <daniel@veillard.com> - - * libxml.m4: Frédéric Crozat gave a patch related to the change - of Include paths breaking the libxml.m4 - -Fri Mar 29 18:25:54 CET 2002 Daniel Veillard <daniel@veillard.com> - - * xpath.c: Fix bug #76927 forgot to save some context - when evaluating binary expressions - -Thu Mar 28 19:22:48 CET 2002 Daniel Veillard <daniel@veillard.com> - - * configure.in: fixed configure for MPE/iX from Markus Henke - * xmlmemory.c: fixed initialization problems - * xpath.c: another set of patches from Richard Jinks this - fixes "make XPathtests" on linux - -Wed Mar 27 17:09:43 CET 2002 Daniel Veillard <daniel@veillard.com> - - * trionan.c trionan.h xpath.c: more patches from Richard Jinks - * test/XPath/expr/compare test/XPath/expr/equality - test/XPath/expr/floats test/XPath/expr/functions - test/XPath/expr/strings result/XPath/expr/compare - result/XPath/expr/equality result/XPath/expr/floats - result/XPath/expr/functions result/XPath/expr/strings: Updated - tests though they show a divergence on Linux - -Wed Mar 27 10:06:53 CET 2002 Daniel Veillard <daniel@veillard.com> - - * xpath.c trionan.c: previous commit also included patches - from Richard Jinks on some IEEE support corner case - -Wed Mar 27 10:03:11 CET 2002 Daniel Veillard <daniel@veillard.com> - - * AUTHORS HACKING: Added Igor Zlatkovic as official maintainer - * python/Makefile.am python/tests/Makefile.am: Albert Chin pointed - that $(datadir) should be used for docs - -Tue Mar 26 13:43:16 CET 2002 Daniel Veillard <daniel@veillard.com> - - * xmlIO.c: Thomas Steinborn pointed out #76404 that libxml2 - could leak filedescriptors - -Tue Mar 26 08:55:53 CET 2002 Daniel Veillard <daniel@veillard.com> - - * configure.in nanohttp.c: applied patch from Allan Clark for - UnixWare/OpenServer - -Mon Mar 25 17:45:44 CET 2002 Daniel Veillard <daniel@veillard.com> - - * configure.in: preparing 2.4.19 - * doc/*: rebuilt the docs - -Mon Mar 25 17:34:06 CET 2002 Daniel Veillard <daniel@veillard.com> - - * nanohttp.c: fixing #76043, got fed up with non-portability - of that piece of code. - -Mon Mar 25 13:08:21 CET 2002 Daniel Veillard <daniel@veillard.com> - - * valid.c SAX.c: Never commit without running "make tests" :-( - fix a couple of stupidities in the previous commit - * result/*: a few changes in some attribute order result of previous - commit. - -Mon Mar 25 11:46:05 CET 2002 Daniel Veillard <daniel@veillard.com> - - * valid.c SAX.c: fixed bug #76168, attribute redeclared in - the internal subset should not raise duplicate ID errors, - also there was a small bug in conjunction to namespace - declarations defaulted and xml:xxx attributes DTD definitions. - -Fri Mar 22 15:13:49 CET 2002 Daniel Veillard <daniel@veillard.com> - - * xpath.c: Richard Jinks also raised some rounding problems - this tries to fix them - -Fri Mar 22 13:22:09 CET 2002 Daniel Veillard <daniel@veillard.com> - - * xpath.c: Richard Jinks spotted an incoherent memory allocation - behaviour in xmlXPathCastToString() - -Thu Mar 21 14:25:29 CET 2002 Daniel Veillard <daniel@veillard.com> - - * encoding.c: fixed a bug in the ISO-Latin 1 to UTF8 encoder - raised by Morus Walter - -Thu Mar 21 14:07:13 CET 2002 Daniel Veillard <daniel@veillard.com> - - * xmlcatalog.c include/libxml/xmlversion.h.in: applied 2 fixups - from Igor - -Thu Mar 21 13:30:06 CET 2002 Daniel Veillard <daniel@veillard.com> - - * xpath.c: fixing #75619, related to a problem when trying - to evaluate condition when the current node set resulting - from that sub-step evaluation is empty. Also fixes 2 potential - problem with previous-sibling and next-siblings axis. - -Thu Mar 21 09:03:59 CET 2002 Daniel Veillard <daniel@veillard.com> - - * c14n.c: patch from Mark Vakoc to build C14N if DocBook and - HTML support is not configured in. - -Wed Mar 20 22:42:42 CET 2002 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c error.c parser.c parserInternals.c tree.c xmlIO.c - include/libxml/tree.h: dohh I really didn't intended to commit - this test version :-( - -Wed Mar 20 20:20:57 CET 2002 Daniel Veillard <daniel@veillard.com> - - * testSAX.c: I wanted to see the real speed at the SAX interface - after a little too many Ximianer started complaining about the - parser speed. - added a --quiet option: - paphio:~/XML -> ls -l db100000.xml - -rw-rw-r-- 1 veillard www 20182040 Mar 20 10:30 db100000.xml - paphio:~/XML -> time ./testSAX --quiet db100000.xml - 3200006 callbacks generated - real 0m1.270s - Which means 16MBytes/s and 3Mcallback/s - -Tue Mar 19 19:33:57 CET 2002 Daniel Veillard <daniel@veillard.com> - - * xpath.c: valgrind spotted another error that time when running - on libxslt regression tests - -Tue Mar 19 15:24:49 CET 2002 Daniel Veillard <daniel@veillard.com> - - * Makefile.am: adding "make valgrind" running the full regression - tests (except python ones) under Valgrind (using valgrind -q - which was kindly added by the author). - * valid.c: stupid bug pinpointed by Valgrind, the regression tests - passes cleanly now except an obcure floating point initialization - raised in log10() in one XPath regression test ??? - * tree.c: edited some comments to close #75244 - -Tue Mar 19 12:15:20 CET 2002 Daniel Veillard <daniel@veillard.com> - - * xpath.c: pretty insane thing, the xmlXPathFormatNumber() - was not serializing 1 as "1" if LC_ALL=sv_SE :-( and in the - context of ScrollKeeper, made sure that if the number is - an integer, the serialization follows the description at - http://www.w3.org/TR/xpath#section-String-Functions - -Mon Mar 18 19:18:13 CET 2002 Daniel Veillard <daniel@veillard.com> - - * configure.in: preparing 2.4.18 - * doc/*: updated and rebuilt the web site - * *.c libxml.h: implement the new IN_LIBXML scheme discussed with - the Windows and Cygwin maintainers. - * parser.c: humm, changed the way the SAX parser work when - xmlSubstituteEntitiesDefault(1) is set, it will then - do the entity registration and loading by itself in case the - user provided SAX getEntity() returns NULL. - * testSAX.c: added --noent to test the behaviour. - -Mon Mar 18 12:44:23 CET 2002 Daniel Veillard <daniel@veillard.com> - - * parser.c: Wilfried Teiken provided a hackish but working - way to get context reported back on entities when parsing - with SAX and without breaking the DOM build. - -Sun Mar 17 11:31:55 CET 2002 Daniel Veillard <daniel@veillard.com> - - * c14n.c: applied a new patch from Aleksey Sanin - * doc/site.xsl doc/xml.html doc/*.html: updated the documentation - to reference Aleksey implementation of XML digital Signatures - -Sat Mar 16 23:01:42 CET 2002 Daniel Veillard <daniel@veillard.com> - - * xpath.c: small fix to avoid potential problem due to - ordering of freeing data - * python/Makefile.am: people were complaining about - the generated file in python dir not being built - -Fri Mar 15 23:21:40 CET 2002 Daniel Veillard <daniel@veillard.com> - - * libxml.spec.in python/Makefile.am python/tests/Makefile.am - python/generator.py python/libxml.c python/types.c: Cleanup - of the python Makefiles based on Jacob and James feedback, - fixed the spec file accordingly, fixed the number of warning - that passing my pedantic CFLAGS was generating. Conclusion - is that Python includes are real crap. - -Fri Mar 15 19:41:25 CET 2002 Daniel Veillard <daniel@veillard.com> - - * configure,in: it was reported quite a few times that - xml2-config --cflags should not output - -I$includeprefix/libxml2/libxml because libxml2 header names - clashes with existing names like list.h from C++ stl. - Includes should be #include<libxml/xxx.h> so ... - -Fri Mar 15 10:41:50 CET 2002 Daniel Veillard <daniel@veillard.com> - - * c14n.c: another patch from Aleksey Sanin - -Fri Mar 15 08:55:55 CET 2002 Daniel Veillard <daniel@veillard.com> - - * c14n.c: applied patch from Aleksey Sanin fixing a problem in the - canonicalization algorithm - * doc/xml.html doc/index.html: added the C14N references on the - index page. - -2002-03-13 jacob berkman <jacob@ximian.com> - - * python/Makefile.am: remove LDADD and CFLAGS as this is broken - usage, redundant, and gcc specific - -Wed Mar 13 11:00:59 CET 2002 Daniel Veillard <daniel@veillard.com> - - * xpath.c: speedup some node selection operations, this can - have a significant impact on DocBook Norm's stylesheets - * nanohttp.c: someone reported that SOCKLEN_T may not be defined - make sure it's always the case - * debugXML.c: distinguish CDATA and comments in ls operations - -Tue Mar 12 19:45:24 CET 2002 Daniel Veillard <daniel@veillard.com> - - * include/libxml/*.h: Heiko W. Rupp fixed a lot of comments - to generate better API descriptions etc... - -Mon Mar 11 10:10:30 CET 2002 Daniel Veillard <daniel@veillard.com> - - * c14n.c: Fixing #74186, made sure all boolean expressions - get fully parenthesized, ran indent on the output - * configure.in HTMLtree.c SAX.c c14n.c debugXML.c tree.c xpointer.c - include/libxml/tree.h: also #74186 related, removed the - --with-buffers option, and all the preprocessor conditional - sections that were resulting from it. - -Sun Mar 10 17:47:58 CET 2002 Daniel Veillard <daniel@veillard.com> - - * valid.c: applied patch from Dodji Seketeli fixing an - uninitialized variable in xmlValidGetValidElements() - -Sat Mar 9 15:10:49 CET 2002 Daniel Veillard <daniel@veillard.com> - - * c14n.c: fixed a few comments - * doc/*.html doc/*/*.html: regenerated the docs and added - the C14N API - * doc/api.xsl doc/gnome-xml.sgml: fixups and added IDs - -Sat Mar 9 11:16:11 CET 2002 Daniel Veillard <daniel@veillard.com> - - * check-xml-test-suite.py: fix to adapt varaiations in the - bindings - * configure.in python/setup.py python/setup.py.in: fixed to - have the version of the python scripts automatically updated - -Fri Mar 8 16:45:55 CET 2002 Daniel Veillard <daniel@veillard.com> - - * tree.c: fixed a bug newly introduced and pointed by Uwe Fechner - in xmlCopyProp() - -Fri Mar 8 15:49:10 CET 2002 Daniel Veillard <daniel@veillard.com> - - * configure.in: preparing 2.4.17 release - * doc/*: updated and rebuilt the docs - * xpath.c: fixed a comment - * python/libxml.c: fixed a possible reentrancy problem - -Thu Mar 7 23:19:28 CET 2002 Daniel Veillard <daniel@veillard.com> - - * tree.c python/tests/Makefile.am python/tests/attribs.py: - fixed xmlHasNsProp() bugs for defaulted from DTD attribs, - added a specific regression test - * python/generator.py: xmlHasNsProp() and xmlHasProp() shall - not raise exceptions when failing to find the attribute. - -Thu Mar 7 16:11:35 CET 2002 Daniel Veillard <daniel@veillard.com> - - * configure.in xmllint.c: owen pointed out a problem with the - ftme fix, gettimeofday() was not detected by configure and - the ftime header wasn't included, dohhh - -Thu Mar 7 12:19:36 CET 2002 Daniel Veillard <daniel@veillard.com> - - * configure.in xmllint.c: trying to fix #71457 for timing - precision when gettimeofday() is not available but ftime() is - -Thu Mar 7 11:24:02 CET 2002 Daniel Veillard <daniel@veillard.com> - - * libxml.spec.in doc/Makefile.am: Fixed #73408 missing images - are now copied on install and part of the -devel RPM - -Thu Mar 7 09:34:16 CET 2002 Daniel Veillard <daniel@veillard.com> - - * xpath.c: trying to avoid bug #72150 which was apparently - caused by a gcc bug (or a processor problem) as detailed - at http://veillard.com/gcc.bug - -Thu Mar 7 01:02:37 CET 2002 Daniel Veillard <daniel@veillard.com> - - * tree.c python/tests/Makefile.am python/tests/cutnpaste.py: - fixed xmlReconciliateNs(), added a Python test/example for - inter-document cut'n paste - * python/libxml.py: fixed node.doc on document nodes and added - xpathEval() onto node objects - -Wed Mar 6 22:38:03 CET 2002 Daniel Veillard <daniel@veillard.com> - - * HTMLtree.c: fixed some htmlSetMetaEncoding() problems - * python/libxml.c python/tests/Makefile.am python/tests/serialize.py: - fixup and integrated tests for the serialization stuff - -Wed Mar 6 19:40:57 CET 2002 Daniel Veillard <daniel@veillard.com> - - * Makefile.am libxml.3 libxml.4 libxml.spec.in: Fixed bug #72570 - moved the libxml man page to section 3 - -Wed Mar 6 18:34:07 CET 2002 Daniel Veillard <daniel@veillard.com> - - * tree.c: fix bug #72490 - * python/libxml.c python/libxml.py: added methods serialize() - and saveTo() to all node elements. - -Tue Mar 5 21:27:03 CET 2002 Daniel Veillard <daniel@veillard.com> - - * xmlIO.c: closed #73430, don't read from an input source - which indicated an end-of-file or an error. - -Tue Mar 5 16:33:42 CET 2002 Daniel Veillard <daniel@veillard.com> - - * parser.c: make sure SAX endDocument is always called as - this could result in a Python memory leak otherwise (it's - used to decrement ref-counting) - * python/generator.py python/libxml.c python/libxml.py - python/libxml2-python-api.xml python/libxml2class.txt - python/tests/error.py python/tests/xpath.py: implemented - the suggestions made by Gary Benson and extended the tests - to match it. - -Tue Mar 5 10:35:24 CET 2002 Daniel Veillard <daniel@veillard.com> - - * python/generator.py: applied patch fixing #73450 - -Mon Mar 4 17:59:29 CET 2002 Daniel Veillard <daniel@veillard.com> - - * xpath.c: fixing #61290 "namespace nodes have no parent" - long standing divergence from the XPath REC. NodeSets - simply hold a copy of namespace nodes and those node ->next - points to the parent (which may not be the node carrying the - definition). - * include/libxml/xpath.h: flagged but didn't added a possible - speedup - * DOCBparser.c HTMLparser.c: removed some warnings from push - parser due to new state being added. - * tree.c: new fix from Boris Erdmann - * configure.in c14n.c include/libxml/c14n.h testC14N.c: added - the XML Canonalization support from Aleksey Sanin - -Sun Mar 3 15:12:42 CET 2002 Daniel Veillard <daniel@veillard.com> - - * tree.c: patch from Boris Erdmann fixing some namespace odities - with xmlCopyNode() - -Sat Mar 2 10:33:04 CET 2002 Daniel Veillard <daniel@veillard.com> - - * xmlIO.c: fix bug #72706 when loading a NULL entity - -Fri Mar 1 17:14:42 CET 2002 Daniel Veillard <daniel@veillard.com> - - * SAX.c: Fixed #72346, about handling of xmlns:foo="", this could - actually change in a future XML Namespace revision. - -Fri Mar 1 17:12:15 CET 2002 Daniel Veillard <daniel@veillard.com> - - * python/types.c python/tests/Makefile.am python/tests/xpathret.py: - added the possibility of returning nodesets from XPath extension - functions written in Python - -Fri Mar 1 13:56:12 CET 2002 Daniel Veillard <daniel@veillard.com> - - * python/*: committing some Python bindings work done while travelling - -Fri Mar 1 10:11:15 CET 2002 Daniel Veillard <daniel@veillard.com> - - * xmllint.c: close #72663 and #72658, don't memdump unless compiled - explicitly with memory debugging switched on - -Sat Feb 23 11:08:09 CET 2002 Daniel Veillard <daniel@veillard.com> - - * python/generator.py python/libxml.c python/libxml2-python-api.xml - python/libxml2class.txt python/libxml_wrap.h python/types.c: - Added wrapper for the xmlURIPtr type, provided accessors, fixed - the accessor generator for strings - * python/tests/Makefile.am python/tests/tstURI.py: added a specific - regression test. - -Fri Feb 22 23:44:57 CET 2002 Daniel Veillard <daniel@veillard.com> - - * python/README python/generator.py python/libxml.c python/setup.py: - added the 'usual' setup.py to allow building a libxml2-python - module based on the same code. The initialization is however - different the 2 .so files fo libxml2 and libxslt are identical and - they entry point initialize both libraries. this is done to avoid - some possible nasty problem since the Python don't merge the maps - of all shared modules. - -Wed Feb 20 23:16:08 CET 2002 Daniel Veillard <daniel@veillard.com> - - * parser.c: fixed a push/encoding bug reported by Michael - on librsvg - -Wed Feb 20 19:54:05 CET 2002 Daniel Veillard <daniel@veillard.com> - - * include/libxml/parserInternals.h: fixes a misplaced #endif - -Wed Feb 20 17:47:55 CET 2002 Daniel Veillard <daniel@veillard.com> - - * parser.c valid.c: found and fixed a couple of allocation bugs - -Wed Feb 20 15:36:03 CET 2002 Daniel Veillard <daniel@veillard.com> - - * doc/xml.html doc/python.html doc/*: added a Python and binding - page describing the current state of the Python bindings and - giving pointers to the other languages wrappers. - -Wed Feb 20 11:16:15 CET 2002 Daniel Veillard <daniel@veillard.com> - - * configure.in include/libxml/xmlwin32version.h: preparing 2.4.16 - * doc/* python/libxml2class.txt: updated and rebuilt the docs, - rebuilt the API and web site - * xpath.c: fixed #71978 portability bugs - -Tue Feb 19 22:49:36 CET 2002 Daniel Veillard <daniel@veillard.com> - - * SAX.c: oops broke automatic defaulting of namespaces attributes. - -Tue Feb 19 22:01:35 CET 2002 Daniel Veillard <daniel@veillard.com> - - * include/libxml/parserInternals.h parser.c: had to change - 2 internal parsing API when processing document content - to check the start and end of element content are defined - in the same entity - * valid.c include/libxml/valid.h: attribute normalization can - generate a validity error added xmlValidCtxtNormalizeAttributeValue() - with the context to report it. - * SAX.c: fixed the last known bugs, crazy validation constraints - when a document is standalone seems correctly handled. There - is a couple of open issues left which need consideration especially - PE93 on external unparsed entities and standalone status. - Ran 1819 tests: 1817 succeeded, 2 failed and 0 generated an error in 8.26 s. - The 2 tests left failing are actually in error. Cleanup done. - -Tue Feb 19 15:17:02 CET 2002 Daniel Veillard <daniel@veillard.com> - - * valid.c: implemented E59 spaces in CDATA does not match the - nonterminal S - -Tue Feb 19 14:44:53 CET 2002 Daniel Veillard <daniel@veillard.com> - - * SAX.c parser.c valid.c: more validation test fixups - * check-xml-test-suite.py: added duration info for the tests - -Mon Feb 18 23:25:08 CET 2002 Daniel Veillard <daniel@veillard.com> - - * parser.c valid.c: a couple of errors were reported but not - saved back as such in the parsing context. Down to 1% failure rate - Ran 1819 tests: 1801 succeeded, 18 failed and 0 generated an error - -Mon Feb 18 20:16:15 CET 2002 Daniel Veillard <daniel@veillard.com> - - * xmlInternald.c: isExtender was missing a char - * parser.c include/libxml/parser.h: % are acceptable in the - internal subset if within a PUBLIC ID - -Mon Feb 18 19:27:32 CET 2002 Daniel Veillard <daniel@veillard.com> - - * SAX.c parserInternals.c valid.c: more work on the conformance - suite. Took the step to finally block documents with encoding - errors. It's a fatal error per the spec, people should have fixed - their documents by now. - -Mon Feb 18 15:30:14 CET 2002 Daniel Veillard <daniel@veillard.com> - - * check-xml-test-suite.py: fixed the test script after some discussion - on the semantic of TYPE="error" - * Makefile.am: added the script to the distrib - -Mon Feb 18 12:17:41 CET 2002 Daniel Veillard <daniel@veillard.com> - - * SAX.c entities.c: fixed a couple of conformances issues deep - into the validation code (standalone and undeclared Notations) - -Mon Feb 18 00:17:24 CET 2002 Daniel Veillard <daniel@veillard.com> - - * parser.c: fixed #71741 supid typo an a bug about encoding parsing - stayed there for years ! - -Mon Feb 18 00:06:42 CET 2002 Daniel Veillard <daniel@veillard.com> - - * valid.c SAX.c: fixed #71740 NotationDecl with a required field - missing - -Sun Feb 17 23:45:40 CET 2002 Daniel Veillard <daniel@veillard.com> - - * check-xml-test-suite.py: improved the behaviour a bit as - well as the logs - * parser.c valid.c SAX.c: fixed a few more bugs - "Ran 1819 tests: 1778 succeeded, 41 failed, and 0 generated an error" - -Sun Feb 17 20:41:37 CET 2002 Daniel Veillard <daniel@veillard.com> - - * check-xml-test-suite.py: python script to run regression tests - against the XML Test suite of W3C/OASis - * SAX.c: fixed a validation bug - * parser.c: fixed 3 errors pointed by the test suite - * doc/buildDocBookCatalog: fixed a typo pointed by drake - * python/Makefile.am: fixed a dependendy - -Fri Feb 15 21:47:13 CET 2002 Daniel Veillard <daniel@veillard.com> - - * xmlmemory.c: avoid a warning bug #71594 - -Wed Feb 13 22:13:33 CET 2002 Daniel Veillard <daniel@veillard.com> - - * xmlmemory.c: Jesse Perry provided a patch to remove a few - warning on alpha/Tru64 - -Wed Feb 13 14:30:49 CET 2002 Daniel Veillard <daniel@veillard.com> - - * include/libxml/entities.h: fixing a comment - * valid.c: fixing some troubles with validity check on namespaces - * result/VC/NS3 test/VC/NS3: added a specific regression test - -Wed Feb 13 14:05:24 CET 2002 Daniel Veillard <daniel@veillard.com> - - * tree.c: Fixing #71342 serializing '\n' in attribute values - * result/noent/att3 result/att3 test/att3: added a specific - test. - -Tue Feb 12 14:45:32 CET 2002 Daniel Veillard <daniel@veillard.com> - - * python/libxml.c: couple of bug fixes - -Mon Feb 11 19:41:29 CET 2002 Daniel Veillard <daniel@veillard.com> - - * python/*.py: removed tabs and used spaces. - -Mon Feb 11 19:25:44 CET 2002 Daniel Veillard <daniel@veillard.com> - - * configure.in include/libxml/xmlwin32version.h: preparing 2.4.15 - * doc/news.html doc/xml.html doc/xmlio.html: rebuilt some docs - -Mon Feb 11 14:53:24 CET 2002 Daniel Veillard <daniel@veillard.com> - - * doc/xmlcatalog_man.xml: trying to close Red Hat bug #58707 - https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=58707 - -Mon Feb 11 09:53:02 CET 2002 Daniel Veillard <daniel@veillard.com> - - * include/libxml/encoding.h include/libxml/entities.h - include/libxml/globals.h include/libxml/parser.h - include/libxml/threads.h include/libxml/tree.h - include/libxml/xmlmemory.h: trying to fix the include mess - -Mon Feb 11 08:53:33 CET 2002 Daniel Veillard <daniel@veillard.com> - - * include/libxml/xmlmemory.h: reverted part of the previous - attempt to provide #69655, this was breaking the build. - -Sun Feb 10 14:13:34 CET 2002 Daniel Veillard <daniel@veillard.com> - - * HTMLtree.c Makefile.am build_glob.py configure.in debugXML.c - globals.c parser.c threads.c tree.c valid.c xmlmemory.c - xpath.c xpointer.c include/libxml/globals.h include/libxml/parser.h - include/libxml/parserInternals.h include/libxml/tree.h - include/libxml/xmlmemory.h include/libxml/xpathInternals.h: - Tentatively fixed #69655 , make compiling with -Wredundant-decls - clean. - * python/libxml.c: fixed a warning. - -Sun Feb 10 12:02:59 CET 2002 Daniel Veillard <daniel@veillard.com> - - * tree.c valid.c xinclude.c: fix #68882, cleanup the XInclude - copying of node, merge back IDs in the target document. - * result/XInclude/docids.xml test/XInclude/docs/docids.xml - test/XInclude/ents/ids.xml: test case - * result/VC/ElementValid4: output changed due to a typo fix - -Sat Feb 9 23:15:04 CET 2002 Daniel Veillard <daniel@veillard.com> - - * python/Makefile.am: seems some version of automake didn't - generate the dependencies right as Jacob found out. Add - an extra dependency rule. - -Sat Feb 9 18:59:23 CET 2002 Daniel Veillard <daniel@veillard.com> - - * parserInternals.c valid.c: Justin Fletcher found some parts - of the code needing cleanup - * libxml.spec.in python/Makefile.am python/generator.py - python/libxml.c python/libxml.py: Fixed the python Makefiles - corrected a bug showing up on ia64, changed the name of the - python internal module too - -Fri Feb 8 15:19:28 CET 2002 Daniel Veillard <daniel@veillard.com> - - * Makefile.am: applied patch from Andris Pavenis for binary - name suffixes - -Fri Feb 8 14:43:17 CET 2002 Daniel Veillard <daniel@veillard.com> - - * xmllint.c win32/win32config.h: fixing #68748 - -Fri Feb 8 14:37:05 CET 2002 Daniel Veillard <daniel@veillard.com> - - * valid.c: fixing #70166 - -Fri Feb 8 14:31:24 CET 2002 Daniel Veillard <daniel@veillard.com> - - * valid.c: fixing #70077 - -Fri Feb 8 14:24:02 CET 2002 Daniel Veillard <daniel@veillard.com> - - * Copyright Makefile.am README configure.in libxml.spec.in: - Changed to the MIT Licence - * doc/FAQ.html doc/catalog.html doc/intro.html doc/xml.html - doc/xmlio.html: updated the doc accordingly - * include/libxml/xmlwin32version.h configure.in: preparing - 2.4.14 release - * python/generator.py python/libxml.c python/libxml2-python-api.xml - python/libxml2class.txt python/libxml_wrap.h python/types.c: - fixed the const xmlChar * wrapper and generator, XPath extension - functions now use the context as first argument - * python/tests/tstxpath.py python/tests/xpath.py - python/tests/xpathext.py: Updated the tests accordingly - * tree.c: fixed bug #70067 - -Thu Feb 7 17:33:58 CET 2002 Daniel Veillard <daniel@veillard.com> - - * Makefile.am: cleanup - * debugXML.c: always use stdout if output is NULL - * xmlIO.c: don't close filedescriptors passed to outputBuffers - * python/Makefile.am python/generator.py python/libxml2class.txt - python/libxml_wrap.h python/types.c: augmented the number of bindings - handling FILE * and XPath contexts - * python/tests/Makefile.am: avoid a stupid problem due to the - use of TEST. - -Wed Feb 6 23:37:07 CET 2002 Daniel Veillard <daniel@veillard.com> - - * configure.in: fixed stupid bug #70738 found by alfons hoogervorst - -Wed Feb 6 17:04:51 CET 2002 Daniel Veillard <daniel@veillard.com> - - * python/TODO python/libxml.c: cleanup the extension function lookup - * xmlmemory.c include/libxml/xmlmemory.h: always compile the list - -Tue Feb 5 17:33:30 CET 2002 Daniel Veillard <daniel@veillard.com> - - * configure.in python/Makefile.am: do not install outside - of prefix - -Mon Feb 4 15:05:55 CET 2002 Daniel Veillard <daniel@veillard.com> - - * python/TODO python/libxml.c: started adding SAX interfaces - * python/tests/Makefile.am python/tests/pushSAX.py: added a basic - SAX test - -Mon Feb 4 01:12:42 CET 2002 Daniel Veillard <daniel@veillard.com> - - * tree.c: hardened the addChild function - * python/generator.py python/libxml.c python/libxml2-python-api.xml - python/libxml2class.txt python/libxml_wrap.h python/TODO: - added accessors needed for xmlNode, a bit more testing and - extension of interfaces - * python/tests/Makefile.am python/tests/build.py: added a test - build from scratch/save/load/check - -Sun Feb 3 21:10:39 CET 2002 Daniel Veillard <daniel@veillard.com> - - * parserInternals.c: change a small bit in the way valididy - error messages get initialized - * python/TODO python/libxml.c python/libxml2-python-api.xml - python/libxml2class.txt python/libxml_wrap.h python/types.c: - added some memory debugging to track leaks at the libxml2 level - * python/tests/*.py: changed all tests to check for leaks, - there is just one left in XPath extension registrations. - -Sun Feb 3 17:50:46 CET 2002 Daniel Veillard <daniel@veillard.com> - - * python/TODO python/generator.py python/libxml2-python-api.xml - python/libxml2class.txt: more accessor classes for the parser - context, allow to switch on and check validity - * python/tests/Makefile.am python/tests/error.py - python/tests/invalid.xml python/tests/valid.xml - python/tests/validate.py: added more test and added error.py - which I forgot to commit in the last step - -Sun Feb 3 16:03:55 CET 2002 Daniel Veillard <daniel@veillard.com> - - * python/Makefile.am python/types.c: cleanup - * python/libxml.c python/libxml.py python/libxml_wrap.h - python/generator.py python/libxml2-python-api.xml - python/libxml2class.txt: added class for parser context, added - first cut for push mode support. Added a framework to generate - accessors functions. - * python/tests/Makefile.am python/tests/push.py: added a push - test - -Sun Feb 3 00:17:26 CET 2002 Daniel Veillard <daniel@veillard.com> - - * python/Makefile.am python/TODO python/libxml.py: fixed a small - bug a bit of cleanup. - -Sat Feb 2 22:47:10 CET 2002 Daniel Veillard <daniel@veillard.com> - - * python/Makefile.am python/libxml.c python/libxml2-python-api.xml - python/libxml2class.txt: adding error redirections and preformat - to a python handler - * python/tests/Makefile.am python/tests/*.py: cleanup made all - tests self checking - -Sat Feb 2 13:18:54 CET 2002 Daniel Veillard <daniel@veillard.com> - - * python/libxml.c python/libxml.py: fixed a stupid bug when renaming - a function - -Sat Feb 2 11:25:51 CET 2002 Daniel Veillard <daniel@veillard.com> - - * libxml.spec.in python/Makefile.am python/TODO python/generator.py - python/libxml.c python/libxml2-python-api.xml - python/libxml2class.txt: Progressing through the TODOs, class - description output, extra XML API, RPM now builds the wrappers - for all python installed versions - -Sat Feb 2 10:13:52 CET 2002 Daniel Veillard <daniel@veillard.com> - - * configure.in libxml.spec.in python/Makefile.am python/TODO - python/generator.py python/libxml2class.txt: added more information - in the libxml2-python package including docs. Slightly changed - the class hierarchy - * python/tests/*: added basic regression tests infrastructure too - -Fri Feb 1 23:11:58 CET 2002 Daniel Veillard <daniel@veillard.com> - - * configure.in libxml.spec.in example/Makefile.am python/Makefile.am: - added libxml2-python as part of the packages installed - -Fri Feb 1 18:48:19 CET 2002 Daniel Veillard <daniel@veillard.com> - - * python/Makefile.am python/generator.py python/libxml.c - python/libxml.py: more work, now able to extend the - XPath interpreter with functions written in python. - -Fri Feb 1 10:28:51 CET 2002 Daniel Veillard <daniel@veillard.com> - - * python/Makefile.am: Jacob sent a patch to allow building from - tarfile. - -Fri Feb 1 00:40:48 CET 2002 Daniel Veillard <daniel@veillard.com> - - * python/Makefile.am python/libxml.c configure.in Makefile.am: - inserted the python wrappers build, I hope this won't be too - unportable - -Thu Jan 31 21:27:37 CET 2002 Daniel Veillard <daniel@veillard.com> - - * xpath.c: minor optimization - * python/generator.py python/libxml.c python/libxml.py - python/libxml_wrap.h: more work on the python bindings, - they now support XPath and there is no evident leak - -Thu Jan 31 00:48:06 CET 2002 Daniel Veillard <daniel@veillard.com> - - * python/generator.py python/libxml.c python/libxml.py: - more work on the python bindings generator. - -Wed Jan 30 21:51:26 CET 2002 Daniel Veillard <daniel@veillard.com> - - * python/generator.py python/libxml.c python/libxml_wrap.h: - more work on the python bindings. - -Wed Jan 30 17:35:33 CET 2002 Daniel Veillard <daniel@veillard.com> - - * python/generator.py python/libxml.c python/libxml.py - python/libxml_wrap.h: committed early version of a python binding - for private use only ATM - -Sat Jan 26 22:41:13 CET 2002 Daniel Veillard <daniel@veillard.com> - - * entities.c tree.c include/libxml/entities.h: applied patch - from Anthony Jones to implement copy of DTD subtree too. Had - just to keep 2 function private which really ought to become - public ones. - -Fri Jan 25 15:14:55 CET 2002 Daniel Veillard <daniel@veillard.com> - - * xmllint.c: added pointers to the web pages in the usage() - -Thu Jan 24 17:04:04 CET 2002 Daniel Veillard <daniel@veillard.com> - - * tree.c: more fixes from Petr Kozelka for attribute handling - in the tree API to align the semantic with DOM. - -Thu Jan 24 16:00:53 CET 2002 Daniel Veillard <daniel@veillard.com> - - * valid.c tree.c entities.c: another set of patches from - Anthony Jones for copy operations cleanup and robustness - -Wed Jan 23 18:53:55 CET 2002 Daniel Veillard <daniel@veillard.com> - - * doc/APIchunk*.html doc/parsedecl.py doc/api.xsl: generated - an alphabetic index based on comments content - * doc/*: rebuilt the web site with the new references - -Wed Jan 23 15:14:22 CET 2002 Daniel Veillard <daniel@veillard.com> - - * parserInternals.h: Greg Sjaardema suggested to use an - exponential buffer growth policy in xmlParserAddNodeInfo() - -Wed Jan 23 13:32:40 CET 2002 Daniel Veillard <daniel@veillard.com> - - * doc/api.xsl doc/APIconstructors.html doc/APIfiles.html - doc/APIfunctions.html doc/APIsymbols.html doc/libxml2-refs.xml - doc/parsedecl.py doc/Makefile.am: updated the python extractor - to generate cross-references, and added/updated the stylesheets - to generate and link API indexes. The generic keyword index - is not done yet. - * doc/*.html: regenerated all the usual docs too - -Tue Jan 22 23:11:26 CET 2002 Daniel Veillard <daniel@veillard.com> - - * debugXML.c: added an xpath function to the shell for T. V. Raman - -Tue Jan 22 22:42:23 CET 2002 Daniel Veillard <daniel@veillard.com> - - * debugXML.c: patch from Anthony Jones to catch NULL nodes in - debug routines. - -Tue Jan 22 22:38:42 CET 2002 Daniel Veillard <daniel@veillard.com> - - * tree.c: apply an patch from Petr Kozelka for unlink and replace - support of attribute nodes - -Tue Jan 22 19:12:06 CET 2002 Daniel Veillard <daniel@veillard.com> - - * doc/libxml2-api.xml doc/parsedecl.py: Build a new version - hopefully near complete and fully documented of the API in XML - * HTMLtree.c SAX.c debugXML.c error.c globals.c parser.c tree.c - xmlIO.c xmlmemory.c include/libxml/catalog.h include/libxml/hash.h - include/libxml/list.h include/libxml/parser.h include/libxml/tree.h - include/libxml/parserInternals.h include/libxml/valid.hi - include/libxml/xmlIO.h include/libxml/xmlerror.hi - include/libxml/xmlmemory.h include/libxml/xmlversion.h.ini - include/libxml/xpath.h include/libxml/xpathInternals.h: - Cleaned up the doc comments a lot in the process, the interface - coverage is now 100% - -Tue Jan 22 00:12:58 CET 2002 Daniel Veillard <daniel@veillard.com> - - * doc/libxml2-api.xml doc/parsedecl.py: improved the script to - extracts comments from the gtk-doc DocBook output (a bit - convoluted but seems to work). - -Mon Jan 21 18:29:19 CET 2002 Daniel Veillard <daniel@veillard.com> - - * Makefile.am doc/Makefile.am doc/libxml2-api.xml doc/parsedecl.py: - added an XML description of the API, moved the script generating - it here. Added a "make api" target - -Mon Jan 21 14:34:37 CET 2002 Daniel Veillard <daniel@veillard.com> - - * tree.c: Adam Lounds pointed out a bug in xmlSearchNs() - -Mon Jan 21 09:55:21 CET 2002 Daniel Veillard <daniel@veillard.com> - - * xpath.c include/libxml/xpathInternals.h: the change made to - xmlXPathFuncLookupFunc was incompatible roll it back - -Sun Jan 20 23:03:41 CET 2002 Daniel Veillard <daniel@veillard.com> - - * SAX.c: cleanup patch from Anthony Jones - * doc/Makefile.am: fix the headers to avoid in make scan - * parserInternals.c xpath.c include/libxml/*.h: cleanup of the - includes, * vs Ptr and general cleanup - * parsedecl.py: first version of a script to extract the - module interfaces, the goal will be to provide .decl or XML - specification of the interfaces to build wrappers. - -Sun Jan 20 13:38:22 CET 2002 Daniel Veillard <daniel@veillard.com> - - * doc/xmlcatalog_man.xml xmlcatalog.c: Fixed bug #68830, xmlcatalog - now provides return codes in case of errors - -Sat Jan 19 16:36:21 CET 2002 Bjorn Reese <breese@users.sourceforge.net> - - * trio.h trio.c triodef.h triop.h trionan.h trionan.c Makefile.am: - Upgraded to trio baseline 1.6 - * strio.h strio.c: Replaced by triostr.h and triostr.c - -Fri Jan 18 17:22:50 CET 2002 Daniel Veillard <daniel@veillard.com> - - * globals.c xmlIO.c xmlcatalog.c: removed the last occurrences - of strdup usage in the code - -Fri Jan 18 12:47:15 CET 2002 Daniel Veillard <daniel@veillard.com> - - * parser.c error.c: Keith Isdale complained rightly that - xmlInitParser() did not preserve value set by xmlSetGenericErrorFunc - -Thu Jan 17 09:44:44 CET 2002 Daniel Veillard <daniel@veillard.com> - - * tree.c: fixed the funxtion to set the xml: attributes - * debugXML.c: added "setbase" to test it. - -Wed Jan 16 16:36:08 CET 2002 Daniel Veillard <daniel@veillard.com> - - * tree.c: update xmlNodeSetContent() and xmlNodeSetContentLen() - to allow updating an attribute content - -Tue Jan 15 18:09:23 CET 2002 Daniel Veillard <daniel@veillard.com> - - * libxml.h: try to avoid problems when compiling on Windows - -Mon Jan 14 18:56:25 CET 2002 Daniel Veillard <daniel@veillard.com> - - * hash.c: patch from Anthony Jones for hash.c allocation size - * Makefile.am: trying to work around Yet Another Libtool Madness - and build the 2.4.13 release finally ... - -Mon Jan 14 18:27:19 CET 2002 Daniel Veillard <daniel@veillard.com> - - * configure.in include/libxml/xmlwin32version.h: updated to 2.4.13 - * doc/* : update of the documentation - -Mon Jan 14 17:53:41 CET 2002 Daniel Veillard <daniel@veillard.com> - - * debugXML.c tree.c: some cleanup after an unsuccessful attempt - at fixing #61290 :-( - -Sun Jan 13 21:30:54 CET 2002 Daniel Veillard <daniel@veillard.com> - - * tree.c: fixed xmlSaveFormatFileEnc() when encoding == NULL - Fixes bug #67229 - -Sun Jan 13 17:14:06 CET 2002 Daniel Veillard <daniel@veillard.com> - - * tree.c: trying to avoid troubles when a subtree is copied - and coalesced in part with the target tree. Should fix - bug #67407 - -Sun Jan 13 16:37:15 CET 2002 Daniel Veillard <daniel@veillard.com> - - * valid.c: fixed validation of attributes content of type - NAME NAMES NMTOKEN and NMTOKENS to accept internationalized - values, very old bug. Fixes #67671 - -Sun Jan 13 15:07:49 CET 2002 Daniel Veillard <daniel@veillard.com> - - * parser.c include/libxml/parserInternals.h tree.c: integrated - a couple of fixes and a new API function xmlSetEntityReferenceFunc() - from Keith Isdale and dedicated to xsldbg the XSLT debugger. - -Sun Jan 13 14:23:21 CET 2002 Daniel Veillard <daniel@veillard.com> - - * threads.c: applied Serguei Narojnyi's patch to add native - thread support on the Win32 platform - * testThreadsWin32.c Makefile.am: added the test program also - from Serguei, Win32 specific - * include/win32config.h include/libxml/xmlwin32version.h.in: - added patch from Igor for the Windows thread specific defines. - -Wed Jan 9 12:50:39 CET 2002 Daniel Veillard <daniel@veillard.com> - - * entities.c: Anthony Jones pointed a bug in xmlCopyEntity() - -Tue Jan 8 14:23:22 CET 2002 Daniel Veillard <daniel@veillard.com> - - * doc/*.html doc/site.xsl doc/Makefile: renamed XML.html - output page into XMLinfo.html. Close bug #66951 and - raised by Robert Collins too. - -Tue Jan 8 14:13:18 CET 2002 Daniel Veillard <daniel@veillard.com> - - * encoding.c: Paul Keogh pointed out a possibility of segfault - on repeted xmlAddEncodingAlias() / xmlCleanupEncodingAlias(). - Closes bug # 68238 - -Tue Jan 8 12:48:27 CET 2002 Daniel Veillard <daniel@veillard.com> - - * doc/*.html: updated the Gdome2 links - -Tue Jan 8 11:32:30 CET 2002 Daniel Veillard <daniel@veillard.com> - - * libxml.h: Applied following patches from Robert Collins - and make sure IN_LIBXML is defined when compiling it - ------- - * include/libxml/xmlversion.h.in (LIBXML_DLL_IMPORT): Use on Cygwin - as well as Visual C. - * parser.c (XML_DIR_SEP): Don't use '\\' for Cygwin. - * parserInternals.c (XML_DIR_SEP): Don't use '\\' for Cygwin. - * strio.c (PLATFORM_UNIX): Define for Cygwin. - * triodef.h (TRIO_PLATFORM_UNIX): Define for Cygwin. - * xmlIO.c (xmlFileOpen): Use unix behaviour for Cygwin. - Use binary mode opens for Cygwin (xmlFileOpenW xmlParserGetDirectory - xmlSysIDExists xmlNoNetExists). - * xmllint.c: Don't include winsock2.h for Cygwin. - -Mon Jan 7 17:52:48 CET 2002 Daniel Veillard <daniel@veillard.com> - - * parser.c: Jirka Kosek pointer out a bug in xmlParseTextDecl() - when the version info is not present. - -Mon Jan 7 00:03:58 CET 2002 Daniel Veillard <daniel@veillard.com> - - * tree.c: Anthony Jones pointed out a problem in - xmlStringGetNodeList() and provided a fix for it - -Sun Jan 6 13:45:49 CET 2002 Daniel Veillard <daniel@veillard.com> - - * parser.c: patch from Frank J Franklin to remove a bug in - xmlCreatePushParserCtxt() when the initial buffer passed - is large. - -Sat Jan 5 19:24:23 CET 2002 Daniel Veillard <daniel@veillard.com> - - * win32/*: big cleanup of the Windows/MSVC project files - from Igor Zlatkovic - -Wed Jan 2 14:11:35 CET 2002 Daniel Veillard <daniel@veillard.com> - - * doc/Makefile.am: should fix #67674 and avoid troubles if - xsltproc is not available or fails in the prefix provided - -Tue Jan 1 17:48:56 CET 2002 Daniel Veillard <daniel@veillard.com> - - * xmlmemory.c: one more doc patch from Charlie Bozeman. - -Mon Dec 31 17:35:40 CET 2001 Daniel Veillard <daniel@veillard.com> - - * DOCBparser.c parser.c valid.c include/libxml/parserInternals.h - include/libxml/xmlerror.h include/libxml/xpathInternals.h: - Fixed a few other problems raised by Charlie Bozeman. - * result/VC/ElementValid[5-7]: fixed the output - -Mon Dec 31 17:13:34 CET 2001 Daniel Veillard <daniel@veillard.com> - - * *.c include/libxml/*.h doc/html/*: applied 42 documentation - patches from Charlie Bozeman. Regenerated the HTML docs. - -Thu Dec 20 14:59:52 CET 2001 Daniel Veillard <daniel@veillard.com> - - * include/libxml/debugXML.h win32/dsp/libxml2.def.src: fixes - for Windows from Igor - -Tue Dec 18 12:13:33 CET 2001 Daniel Veillard <daniel@veillard.com> - - * xmllint.c: applied Justin Fletcher patch for --output or -o - -Tue Dec 18 08:52:32 CET 2001 Daniel Veillard <daniel@veillard.com> - - * win32/libxml2/libxml2.def.src: close #67019 - -Tue Dec 18 08:08:51 CET 2001 Daniel Veillard <daniel@veillard.com> - - * xmllint.c: applied Justin Fletcher generic timing patch - similar to the one already applied to xsltproc. - -Mon Dec 17 16:29:08 CET 2001 Daniel Veillard <daniel@veillard.com> - - * include/libxml/tree.h tree.c: applied documentation patches - from Charlie Bozeman - -Thu Dec 13 21:24:16 MST 2001 John Fleck <jfleck@inkstain.net> - - *doc/xmllint.xml, xmllint.1 - document --dropdtd - -Thu Dec 13 23:19:50 CET 2001 Daniel Veillard <daniel@veillard.com> - - * valid.c: fix the xmlStrdup() used in the previous patch. - * valid.c: added --dropdtd - * tree.c: fixed xmlUnlinkNode so it also removes the references - from the document if the node is a DTD - -Thu Dec 13 15:54:35 CET 2001 Daniel Veillard <daniel@veillard.com> - - * HTMLtree.c valid.c: cleanup some static declarations - -Thu Dec 13 15:23:04 CET 2001 Daniel Veillard <daniel@veillard.com> - - * xmllint.c: removed another strdup() - * doc/FAQ: removed the HP/UX entry - -Thu Dec 13 09:44:58 CET 2001 Daniel Veillard <daniel@veillard.com> - - * valid.c: fix bug #66816 when validating. - * xmllint.c: don't use sys/time.h if configure did not found it - -Mon Dec 10 21:39:55 MST 2001 John Fleck <jfleck@inkstain.net> - - * docs/xmllint.1, xmllint.xml, xmlcatalog.1, xmlcatalog_man.html, - xmlcatalog_man.xml - -Mon Dec 10 22:06:16 CET 2001 Daniel Veillard <daniel@veillard.com> - - * include/libxml/xmlmemory.h: Hietaniemi Jarkko pointed out that - xmlInitMemory() was declared twice - -Sun Dec 9 14:59:23 CET 2001 Daniel Veillard <daniel@veillard.com> - - * globals.c: do not reference strdup() ! - * configure.in libxml-2.0.pc.in: trying to fix the libs - of the various config extraction modules - -Fri Dec 7 15:21:33 CET 2001 Daniel Veillard <daniel@veillard.com> - - * configure.in : preparing 2.4.12 - * doc/* : updated and rebuilt the docs - -Fri Dec 7 12:32:00 CET 2001 Daniel Veillard <daniel@veillard.com> - - * uri.c: closed bug #66159 - * testURI.c: added --escape option - * configure.in: some cleanup for xml2-config --cflags - -Thu Dec 6 15:31:30 CET 2001 Daniel Veillard <daniel@veillard.com> - - * globals.c testThreads.c: removed some misplaced includes - of xmlversion.h - -Thu Dec 6 09:06:08 EST 2001 Daniel Veillard <daniel@veillard.com> - - * threads.c: patch from Gary Pennington fixing a possible - problem at initialization time. - -Wed Dec 5 13:01:37 CET 2001 Daniel Veillard <daniel@veillard.com> - - * configure.in libxml.h parser.c testThreads.c macos/: integrated - Eric Lavigne contribution to build libxml2 on MacOS using - CodeWarrior. - -Tue Dec 4 14:13:44 CET 2001 Daniel Veillard <daniel@veillard.com> - - * xmllint.c: applied Geert Kloosterman's patch to fix - --repeat --timing output - -Thu Nov 29 17:10:22 CET 2001 Daniel Veillard <daniel@veillard.com> - - * parser.c: Robin Berjon <robin@knowscape.com> found a case - where non-wellformed XML declaractions were not detected. - -Wed Nov 28 15:41:40 CET 2001 Daniel Veillard <daniel@veillard.com> - - * xpointer.c: fixed a compilation bug pointed by Danny Jamshy - -Wed Nov 28 10:09:51 CET 2001 Daniel Veillard <daniel@veillard.com> - - * xmlIO.c: as robert pointed again, xmlInputCallbackInitialized - gets reset by xmlCleanupInputCallbacks() and this makes the - function useless. Same for output. - -Tue Nov 27 17:22:36 CET 2001 Daniel Veillard <daniel@veillard.com> - - * xmlIO.c: robert pointed out a loop error in callback cleanups - -Mon Nov 26 16:56:00 CET 2001 Daniel Veillard <daniel@veillard.com> - - * tree.c debugXML.c include/libxml/tree.h include/libxml/debugXML.h: - moved xmlGetLineNo() and xmlGetNodePath() into the main tree module, - they are not really tied to debugging - -Mon Nov 26 11:31:36 CET 2001 Daniel Veillard <daniel@veillard.com> - - * configure.in include/libxml/xmlwin32version.h: preparing 2.4.11 - * xmllint.c: better --catalogs description - -Sun Nov 25 11:34:24 CET 2001 Daniel Veillard <daniel@veillard.com> - - * tree.c: fixed a couple of problems in xmlSetProp() - -Thu Nov 22 19:19:10 CET 2001 Daniel Veillard <daniel@veillard.com> - - * debugXML.c tree.c xmlIO.c xmlmemory.c: some cleanups when chasing - unappropriate stdout output. - -Thu Nov 22 13:58:14 CET 2001 Daniel Veillard <daniel@veillard.com> - - * include/libxml/tree.h: Fixed a couple of macro errors pointed out - by Denis Beurive, closes #65111 - -Tue Nov 20 10:34:01 CET 2001 Daniel Veillard <daniel@veillard.com> - - * valid.c: in case of content model validity error, don't - print it if validity warnings were not requested. - -Tue Nov 20 09:30:02 CET 2001 Daniel Veillard <daniel@veillard.com> - - * nanoftp.c: applied a couple of patches from Brian D Ripley. - * parserInternals.c: removed the last exit() call. Print an - unmaskable error on stderr instead (library mismatch detection) - -Sat Nov 17 17:16:51 MST 2001 John Fleck <jfleck@inkstain.net> - - * doc/xmllint.xml, doc/xmllint.1 - update xmllint man page with - shell instructions from Heiko Rupp - -Thu Nov 15 14:53:42 CET 2001 Daniel Veillard <daniel@veillard.com> - - * catalog.c: use the URL notation file:// for default catalog paths - -Wed Nov 14 16:03:02 CET 2001 Daniel Veillard <daniel@veillard.com> - - * include/libxml/tree.h: better comments for _private fields - * tree.c: removed a problem when copying an entity reference. - -Tue Nov 13 16:23:04 CET 2001 Daniel Veillard <daniel@veillard.com> - - * vms/*: updated instructions and diffs from John A Fotheringham - -Mon Nov 12 23:43:22 CET 2001 Daniel Veillard <daniel@veillard.com> - - * include/libxml/xmlerror.h: avoid an include problem if - #include <libxml/xmlerror.h> happens first in code - seems to be the case in KDE libs - -Mon Nov 12 22:32:41 CET 2001 Daniel Veillard <daniel@veillard.com> - - * win32/dsp/* include/libxml/xmlwin32version.h.in: update - from Igor for Windows - -Mon Nov 12 10:19:41 CET 2001 Daniel Veillard <daniel@veillard.com> - - * Makefile.am: Gary Pennington pointed out a missing prefix - -Sat Nov 10 12:55:42 CET 2001 Daniel Veillard <daniel@veillard.com> - - * configure.in include/libxml/xmlwin32version.h: preparing 2.4.10 - * doc/*: upgraded and rebuilt the docs - -Sat Nov 10 12:33:38 CET 2001 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: fix comment in scripts element parsing. - * result/HTML/doc3*: updated the results. - -Sat Nov 10 11:18:18 CET 2001 Daniel Veillard <daniel@veillard.com> - - * uri.c: another URI bug fix #63336, using Joel Young patch. - -Sat Nov 10 11:07:26 CET 2001 Daniel Veillard <daniel@veillard.com> - - * debugXML.c include/libxml/debugXML.h: add xmlGetNodePath() - a cleaned up version of the Pwd shell string generation. - -Fri Nov 9 00:34:13 CET 2001 Daniel Veillard <daniel@veillard.com> - - * valid.c include/libxml/tree.h: trying to fix namespaces + - validation problems for good, closing #63619 in the process - * result/valid/dia.xml test/valid/dia.xml: the Dia test was - wrong in this respect, fixed it. - -Thu Nov 8 18:31:40 CET 2001 Daniel Veillard <daniel@veillard.com> - - * xmllint.c: Morus Walter patch to allow --format and --encode - -Thu Nov 8 14:52:18 CET 2001 Daniel Veillard <daniel@veillard.com> - - * debugXML.c: Stefan Kost provided an help command for the shell - -Wed Nov 7 14:32:55 CET 2001 Daniel Veillard <daniel@veillard.com> - - * debugXML.c: Heiko Rupp pointed that the shell would crash - on empty nodesets returns. - -Wed Nov 7 13:52:36 CET 2001 Daniel Veillard <daniel@veillard.com> - - * Makefile.am: Weiqi Gao pointed out that xmlcatalog - migh need the history libraries - -Tue Nov 6 23:49:09 CET 2001 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c test/HTML/lt.html result/HTML/lt.html*: - handle the case of < in quoted attributes, Bastian Kleineidam - -Tue Nov 6 16:21:33 CET 2001 Daniel Veillard <daniel@veillard.com> - - * configure.in include/libxml/xmlwin32version.h: releasing 2.4.9 - fixing catalog breakages - * Makefile.am catalog.c result/catalogs/catal - result/catalogs/mycatalog.* test/catalogs/catal*: - fixed more problems in catalog support, added more regression tests - for both XML and SGML catalog handling - -Mon Nov 5 20:26:41 CET 2001 Daniel Veillard <daniel@veillard.com> - - * debugXML.c: applied an improvement to xmlGetLineNo() from - Keith Isdale - -Mon Nov 5 15:20:16 CET 2001 Daniel Veillard <daniel@veillard.com> - - * catalog.c: dohhhh XML catalog add and remove ops were broken too. - Side effect of the progressive catalog loading - -Mon Nov 5 12:40:54 CET 2001 Daniel Veillard <daniel@veillard.com> - - * Makefile.am: confexecdir and confexec_DATA were defined twice - pointed out by Karl Eichwalder - -Sun Nov 4 23:18:34 CET 2001 Daniel Veillard <daniel@veillard.com> - - * xmlcatalog.c: avoid unlink() and use remove() instead. - -Sun Nov 4 23:12:38 CET 2001 Daniel Veillard <daniel@veillard.com> - - * libxml.spec.in: cleanup - * include/libxml/xmlwin32version.h: updated with 2.4.8 - -Sun Nov 4 21:17:24 CET 2001 Daniel Veillard <daniel@veillard.com> - - * encoding.c global.data globals.c testThreads.c: fix bug #63752 - of compiling libxml with a non standard set of options - -Sun Nov 4 13:11:41 MST 2001 John Fleck <jfleck@inkstain.net - - * doc/xmllint.xml, xmllint.1 - updating xmllint man page to - document --sgml option, fixing gnome bugzilla #63382 - -Sun Nov 4 20:56:53 CET 2001 Daniel Veillard <daniel@veillard.com> - - * include/libxml/catalog.h catalog.c: Fixed SGML catalogs - breakage of 2.4.7, added a couple of really needed APIs - like xmlCatalogIsEmpty() and xmlNewCatalog() - * xmlcatalog.c: updated --sgml --noout to be a suitable replacement - for install-catalog - * configure.in: preparing 2.4.8 - -Thu Nov 1 15:29:31 CET 2001 Daniel Veillard <daniel@veillard.com> - - * HTMLtree.c tree.c include/libxml/HTMLtree.h - include/libxml/tree.h include/libxml/xmlIO.h: more include - cleanups, export cleanly one html output + format function. - -Thu Nov 1 14:12:12 CET 2001 Daniel Veillard <daniel@veillard.com> - - * parser.c: removed initGenericErrorDefaultFunc call from - xmlInitParser() since it could destroy previous calls to - xsltSetGenericErrorFunc() effects - -Thu Nov 1 09:37:13 CET 2001 Daniel Veillard <daniel@veillard.com> - - * debugXML.c include/libxml/debugXML.h: bool can be a reserved - keyword. - -Wed Oct 31 18:50:08 CET 2001 Daniel Veillard <daniel@veillard.com> - - * Makefile.am: cleanup - * threads.c: cleanup too - * xmlIO.c include/libxml/xmlIO.h: added xmlNoNetExternalEntityLoader() - from xsltproc - * include/libxml/tree.h include/libxml/parser.h: trying to break a - dependency loop. - -Tue Oct 30 18:38:53 CET 2001 Daniel Veillard <daniel@veillard.com> - - * catalog.c: Justin Fletcher pointed out that xmlParseXMLCatalog - was not used anymore ! - -Tue Oct 30 13:33:13 CET 2001 Daniel Veillard <daniel@veillard.com> - - * configure.in: preparing 2.4.7 - * Makefile.am doc/Makefile.am: switched to the latest xmllint - manual page from John - * doc/*: updated the doc and rebuilt the generated pages - -Tue Oct 30 11:31:19 CET 2001 Daniel Veillard <daniel@veillard.com> - - * xmlIO.c: closing bug #62711, the library should never - close stdin or stdout. - -Tue Oct 30 10:46:12 CET 2001 Daniel Veillard <daniel@veillard.com> - - * uri.c: second pass at fixing #63336, using Joel Young - final patch. looks okay. - -Tue Oct 30 00:56:05 CET 2001 Daniel Veillard <daniel@veillard.com> - - * uri.c include/libxml/uri.h: trying to clear #63336 - allowing the escaping routine to parse unconformant - URI-References. - -Mon Oct 29 19:09:46 CET 2001 Daniel Veillard <daniel@veillard.com> - - * vms/readme.vms vms/build_libxml.com nanoftp.c - include/libxml/xmlversion.h.in: a few VMS updates from - John A Fotheringham - * include/libxml/xmlIO.h xmlIO.c: added xmlCleanupInputCallbacks() - and xmlCleanupOutputCallbacks() for the Perl binding people. - -Mon Oct 29 12:44:17 CET 2001 Daniel Veillard <daniel@veillard.com> - - * parser.c globals.c DOCBparser.c HTMLparser.c error.c: - apply fixes to close #63271 and avoid segfaults when - the error routine gets callbed before xmlInitParser() - get called. - * nanoftp.c error.c: Applied patches from Justin Fletcher - correcting some xmlGenericError misuses. - -Sat Oct 27 14:04:45 MDT 2001 John Fleck <jfleck@inkstain.net> - - *doc/xmllint.xml, doc/xmllint.1 - New and improved man page for xmllint - .xml is the original, .1 - is the generated man page - -Wed Oct 24 14:34:25 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * doc/site.xsl doc/*.html doc/Makefile.am: now autogenerate - the web site from the main HTML document. - -Tue Oct 23 14:32:04 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * parser.c: fixed an erroneous validation bug when PE refs - occurs in external parsed entities referenced from the - internals subset - * test/valid/index.xml test/valid/dtds/nitf-2-5.dtd - test/valid/dtds/NewsMLv1.0.dtd result/valid/index.xml*: - added the associated testcase, it's a nice one. - * HTMLparser.c: generate the DTD node as HTML still ... - * HTMLtree.c: fixed errors in Set/GetMetaEncoding - -Mon Oct 22 14:20:17 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: fixed a bug in htmlNewDoc() - -Mon Oct 22 11:32:36 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * test/threads/*: added entities testing to the Thread test - * testThreads.c: make the test reasonable - * DOCBparser.c: fix the DTD public and system ID - * xmllint.c: added --sgml for SGML DocBook importing - * Makefile.am: added Docbtests target - -Fri Oct 19 11:47:13 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * nanoftp.c: use only "anonymous@" string for anonymous passwds - * testThreads.c: removed bogus include - -Thu Oct 18 16:56:23 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * parser.c valid.c result/valid/rss.xml result/valid/rss.xml.err: - fixed a very serious (looping) validation bug - -Wed Oct 17 11:56:25 EDT 2001 Daniel Veillard <daniel@veillard.com> - - * include/libxml/globals.h include/libxml/threads.h threads.c - testThreads.c: far more testing, cleaning up bugs - * *.c : make sure globals.h is always included. - -Wed Oct 17 17:41:41 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c: try to get rid of parser loops for good. - -Wed Oct 17 13:29:02 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * configure.in: fixed some bugs in CFLAGS passing. - * test/threads Makefile.am testThreads.c: added a specific - threaded test case (really nasty, guaranteed). - -Tue Oct 16 23:01:49 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * catalog.c: serious cleanup on the management of the - XML catalog tree, more tests done, especially with - the catalog PI. - -Tue Oct 16 08:43:43 EDT 2001 Daniel Veillard <daniel@veillard.com> - - * catalog.c: avoid a problem in catalog cleanup on SMP if - catalogs were not initialized. - -Tue Oct 16 14:33:19 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * catalog.c xpath.c: trying to cleanup the not thread safe - parts of the library. - -Mon Oct 15 14:30:11 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * include/libxml/globals.h configure.in global.data: make - the allocation be per-thread a configure option - * encoding.c include/libxml/parser.h: fixed compilation - errors - -Mon Oct 15 12:45:03 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * include/libxml/parser.h: Norm reported that a few lines - added were breaking libxslt compile, removed them for now - -Sun Oct 14 05:55:01 EDT 2001 Daniel Veillard <daniel@veillard.com> - - * parser.c parserInternals.c threads.c: debugged and fixed - initialization problems which were giving troubles on SMP - boxes. - -Sat Oct 13 16:17:13 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * include/libxml/Makefile.am: missing globals.h - -Sat Oct 13 14:15:00 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * globals.c: added a couple of standard includes. - -Sat Oct 13 11:08:20 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * include/libxml/SAX.h include/libxml/globals.h include/libxml/parser.h - include/libxml/parserInternals.h include/libxml/tree.h - include/libxml/xmlerror.h HTMLparser.c SAX.c error.c globals.c - nanoftp.c nanohttp.c parser.c parserInternals.c testDocbook.c - testHTML.c testSAX.c tree.c uri.c xlink.c xmlmemory.c: - Applied the last patches from Gary, cleanup, activated threading - all user accessible global variables are now handled in globals.[ch] - Still a bit rought but make tests passes with either - --with-threads defined at configure time or not. - * Makefile.am example/Makefile.am: added globals.[ch] and threads - linking options - -Fri Oct 12 19:25:55 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * Makefile.am include/libxml/Makefile.am - include/libxml/globals.h globals.c include/libxml/threads.h - threads.c build_glob.py global.data xmlcatalog.c acconfig.h - configure.in: started integrating the core of the thread support - not activated yet but half integrated. The code should still - compile and work anyway. - -Fri Oct 12 00:53:03 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * HTMLtree.c catalog.c debugXML.c entities.c nanoftp.c - parser.c valid.c xmlmemory.c xpath.c xpointer.c: started - integrating the non-controversial parts of Gary Pennington - multithread patches - * catalog.c: corrected a small bug introduced - -Thu Oct 11 20:58:15 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * catalog.c include/libxml/catalog.h: very serious cleanup, - isolating unportable code and as much as possible the accesses - to the global shared catalog. May need more testing ! - -Thu Oct 11 11:10:31 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * include/libxml/debugXML.h debugXML.c tree.c: integrating - Keith Isdale patches for the XSLT debugger interfaces. Some - cleanup - -Thu Oct 11 08:44:01 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * win32/Makefile.mingw: update from Tobias Peters for 2.4.5 - * DOCBparser.c: generate line nubers in elements - -Wed Oct 10 11:35:45 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * configure.in: preparing 2.4.6 release - * doc/xml.html doc/html/*: updated and rebuilt the docs - * include/libxml/*.h *.c: fixed a number of teh/the widht/width typos - -Mon Oct 8 20:38:27 MDT 2001 John Fleck <jfleck@inkstain.net> - - * doc/xmlcatalog_man.xml, xmlcatalog.1, xmlcatalog_man.html - adding documentation for DV's supercatalog support - -Mon Oct 8 17:00:16 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * include/libxml/catalog.h catalog.c xmlcatalog.c: adding SGML - super catalog support adding one API and one flag --sgml to - xmlcatalog - -Sun Oct 7 16:43:57 MDT 2001 John Fleck <jfleck@inkstain.net> - - * doc/xmlcatalog_man.xml, xmlcatalog.1 - One more crack at - https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=54392 - -Sun Oct 7 18:47:02 CEST 2001 Thomas Broyer <tbroyer@ltgt.net> - - * xpath.c: implemented xmlXPathObjectCopy for external objects - * include/libxml/xpathInternals.h: added xmlXPathStackIsExternal - -Sat Oct 6 16:25:52 MDT 2001 John Fleck <jfleck@inkstain.net> - - *doc/xmlcatalog_man.xml, xmlcatalog_man.html, xmlcatalog.1 - finishing up fix to - https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=54392, making - the xmlcatalog man page display more elegantly - -Sat Oct 6 15:27:12 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * configure.in: closing bug #61832 - * HTMLparser.c: removed a warning - -Sat Oct 6 15:07:14 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * xpath.c: fixing #61673 part I, do not lose doc information - when copying result value trees. - -Sat Oct 6 11:58:58 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * xpath.c: trying to harden the XPath interpreter - -Fri Oct 5 20:37:51 MDT 2001 John Fleck <jfleck@inkstain.net> - - * doc/xmlcatalog.1 updated using a new stylesheet to address, in - part, https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=54392 - -Fri Oct 5 23:35:00 HKT 2001 William Brack <wbrack@mmm.com.hk> - - * HTMLparser: repaired another loop problem - -Fri Oct 5 11:16:21 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * uri.c: applied fix from Mathias Hasselmann about a bug in URI - parsing. - * xpath.c: fix bug #61291 the default XML namespace node is - missing from the namespace axis. - * tree.c: refuse to create namespaces nodes with prefix "xml" - -Thu Oct 4 16:47:44 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * SAX.c: ouch a non-defined namespace could lead to a crash, - fixed #61215 - -Thu Oct 4 16:24:26 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * parserInternals.c: closed bug #61054 - -Wed Oct 3 15:19:04 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * include/libxml/Makefile.am: closing #60708 - -Tue Oct 2 15:52:05 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * win32/dsp/libxml2.def.src include/libxml/parser.h parser.c: - adding xmlSAXParseFileWithData following Marco Stipek suggestion - -Tue Oct 2 11:27:58 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * valid.c: close bug #61550 when xml: wasn't considered a namespace - -Tue Oct 2 11:18:32 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * win32/dsp/libxml2.def.src: Igor Zlatkovic patches - * DOCBparser.c HTMLparser.c parser.c: fixed typos - -Mon Oct 1 09:34:51 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * catalog.c: Justin Fletcher provided cleaup code in case - HAVE_STAT is not defined - * include/win32config.h: Igor Zlatkovic suggested to have - HAVE_STAT defined there - -Sat Sep 29 00:15:00 HKT 2001 William Brack <wbrack@mmm.com.hk> - - * catalog.c - fixed typing error reported by M. Barros - -Sun Sep 23 21:02:39 MDT 2001 John Fleck <jfleck@inkstain.net> - - * xmllint.c - fixing typo - -Sat Sep 22 10:00:00 HKT 2001 William Brack <wbrack@mmm.com.hk> - - * HTMLparser.c: small enhancement to prevent loop on - unrecognizable data - -Fri Sep 21 11:45:53 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * parserInternals.c: applying patch from bug #60757 this - should close it - -Thu Sep 20 15:54:29 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * catalog.c xmlcatalog.c: removed a couple of warning - * xpath.c: try to solve the linking problem on platforms - needing trio to compile - -Wed Sep 19 10:01:37 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * Makefile.am libxml.spec.in: backing up non-documented changes - committed without review or approval by Jens Finke <jens@gnome.org> - * HACKING: made 100% clear that no commit should be done directly - -Mon Sep 17 18:52:37 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * configure.in: Joe Orton provided a patch fixing a problem - when iconv is specified to be in a non-standard directory - but wasn't exported in xml2-config --cflags - -Fri Sep 14 19:32:43 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * configure.in: let's ship 2.4.5 before getting too much - troubles with 2.4.4 errors. - -Fri Sep 14 12:26:58 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * encoding.c entities.c: do not output hexadecimal charrefs - when serializing HTML since some version of Netscape can't - grok it, generate decimal ones. - * result/HTML/doc3.htm: output changed due to previous test - * parserInternals.c: repair xmlKeepBlanksDefault() broken in 2.4.4 - -Thu Sep 13 13:34:27 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * libxml-2.0.pc.in: dohh generated the wrong include path :-( - * doc/Makefile.am libxml.spec.in: re-dohh forgot the new manpage :-( - -Wed Sep 12 22:14:55 CEST 2001 Daniel Veillard <daniel@veillard.com> - Released 2.4.4 - - * config.h.in configure.in libxml.spec.in include/libxml/Makefile.am - libxml-2.0.pc.in: moved includes to includedir/libxml2/libxml, - updated the configuration scripts systems accordingly - -Wed Sep 12 20:49:32 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * configure.in: preparing for 2.4.4 - * doc/xml.html doc/html/*: updated and rebuilt the docs - -Wed Sep 12 16:58:16 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * win32/dsp/libxml2.def.src: tried to incorporate comments - from bug #59220 - -Tue Sep 11 11:25:36 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * parser.c result/noent/wml.xml: fixed bug #59981 related - to handling of '&' in attributes when entities are substituted - -Mon Sep 10 22:14:42 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * libxml.h include/libxml/xmlversion.h.in - include/libxml/xmlwin32version.h include/libxml/xmlwin32version.h.in: - Tried to close bug #60131 - -Mon Sep 10 20:46:03 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * SAX.c: fixed a bug in the HTML parser introduced Sep 9 - -Mon Sep 10 20:13:09 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * SAX.c: fixing bug #59946 on xmlns="" - -Mon Sep 10 16:39:42 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * include/libxml/xmlerror.h SAX.c: fixing bug 59732, simple - but allocates a new error code. - -Sun Sep 9 10:33:15 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * xmllint.c: John Fleck fixed typos in the options output - * parser.c SAX.c: fix ignorable white space SAX selection - -Sat Sep 8 11:43:53 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * entities.c: Steve Underwood found the possibility of an - ininite loop in case of error. - -Fri Sep 7 11:35:00 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * Makefile.am: Need $(ICONV_LIBS) in libxml2_la_LIBADD - -Wed Sep 5 17:47:43 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * parser.c: warn if version is not 1.0 but it's not - strictly speaking an error after analyzing the spec - -Mon Sep 3 10:07:03 MDT 2001 John Fleck <jfleck@inkstain.net> - - *doc/catalog.html - add link to the html version of the - man page, other linguistic cleanups - -Mon Sep 3 09:10:08 MDT 2001 John Fleck <jfleck@inkstain.net> - - * doc/xmlcatalog_man.xml, xmlcatalog_man.html, xmlcatalog.1 - adding documentation for xmlcatalog. Note: xmlcatalog.1, the man - file, has not yet been included in the build. - -Sat Sep 1 18:17:47 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * catalog.c: removed a duplicate affectation Justin Fletcher - -Fri Aug 31 22:02:10 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * tree.c: Armin Sander pointed a possible text coalescing - problem, completed his patch. - -Fri Aug 31 18:30:28 CEST 2001 Bjorn Reese <breese@users.sourceforge.net> - - * trionan.c: Fixed const and volatile re-definition problem - -Fri Aug 31 16:51:28 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * libxml.4 parser.c: doc updates from Heiko Rupp - * parserInternals.c: 2 sanity checks from Heiko Rupp - -Tue Aug 28 22:38:45 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * tree.c: applied patch from Armin Sander to make some pointers - const in xmlCopyNode() - * include/libxml/tree.h: added fix to the header - -Mon Aug 27 16:24:47 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * xpath.c: hum, restrict the integer usage gcc bug workaround - to only gcc compilers so that other architecture don't get - penalized by this limitation. - * include/libxml/xpath.h: small typo fix from Heiko W. Rupp - -Sun Aug 26 20:45:04 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * valid.c: fixed a Windows compiler warning (Chris Poblete) - * xpath.c: fix for mod when dividend is 0 (Chris Poblete) - -Sat Aug 25 15:30:17 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * include/libxml/catalog.h catalog.c xmlcatalog.c: added a - --convert option to xmlcatalog to convert SGML ones to - the XML syntax. - * xmllint.c: small cleanup for $SGML_CATALOG_FILES support. - - 2.4.3 got released at that point -Thu Aug 23 23:16:32 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * catalog.c xmlIO.c: started some serious testing and fixed - a few bug and optimization needs. - -Thu Aug 23 17:26:58 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * Makefile.am configure.in include/libxml/xmlwin32version.h: - preparing for a 2.4.3 release even if it may not be ready yet - * catalog.c parser.c xmlIO.c include/libxml/catalog.h: redirected - all file parsing lookup to go through the entity resolver, add - to add an API to bypass it (needed to load catalogs themselves), - some cleanup on the catalog code too. - * nanoftp.c: small cleanup - * doc/catalog.html: small update - -Thu Aug 23 12:22:26 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * catalog.c: fixed bugi #59406 in SGML catalog parsing reported by - Jun Kuriyama - -Thu Aug 23 02:51:29 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * doc/catalog.html: finished the catalog documentation - -Thu Aug 23 01:38:42 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * doc/catalog.html doc/xml.html: added documentation about - Catalog support, misses an API description - * doc/html/*: reextracted the API pages - -Wed Aug 22 18:27:47 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * include/libxml/catalog.h catalog.c xmlIO.c HTMLparser.c: - Added the part about section 7.2 on URI resolution, - fixed a side effect in the HTML parser, look complete - and ready to rock except the URI/SystemID part! - -Wed Aug 22 16:27:03 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * include/libxml/catalog.h include/libxml/parser.h - include/libxml/xmlerror.h catalog.c parser.c parserInternals.c - xmlIO.c: added support and APIs needed for the catalog PI - * include/libxml/xmlIO.h: cleanup - -Wed Aug 22 02:03:31 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * catalog.c parser.c xmlIO.c xmlcatalog.c xmllint.c - include/libxml/catalog.h: starts to look okay, really - plugged the new framework, cleaned a lot of stuff, - added some APIs, except the PI's support missing this - should be mostly complete - * result/catalogs/* test/catalogs/*: added new test, enriched - the existing one with URN ID tests - -Tue Aug 21 14:56:18 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * catalog.c: fixed nextCatalog - * result/catalogs/docbook test/catalogs/*: started adding - a small regression test - -Tue Aug 21 12:52:38 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * Makefile.am catalog.c xmlcatalog.c include/libxml/catalog.h: - more work on the XML catalog support. - * parser.c include/libxml/parser.h: small cleanup seems using - list as a public parameter name can give portability troubles - * trionan.c trionan.h xpath.c include/libxml/trionan.h - include/libxml/xpath.h include/libxml/Makefile.am: removed - trionan from the libxml API, added xmlXPathIsInf and xmlXPathIsNaN - wrappers - -Tue Aug 21 11:18:45 CEST 2001 Bjorn Reese <breese@users.sourceforge.net> - - * Makefile.am trio.c triodef.h trionan.c xpath.c - include/libxml/Makefile.am include/libxml/trionan.h: - Re-worked Not-A-Number and Infinity support. - * xmlcatalog.c: added readline include files - -Mon Aug 20 02:04:13 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * Makefile.am xmlcatalog.c libxml.spec.in: renaming - testCatalog as xmlcatalog, making it an installed app - adding a shell, and preparing it to be a /etc/xml/catalog - management tool, though not ready yet - * catalog.c include/libxml/catalog.h: adding support for - XML Catalogs http://www.oasis-open.org/committees/entity/ - not finished, there is some interesting tradeoffs and a - few open questions left. - -Sun Aug 19 14:59:56 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * xmllint.c: fixed a line formatting problem - -Fri Aug 17 11:35:31 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * SAX.c: removed a couple of unused variable (Albert Chin) - -Fri Aug 17 01:25:21 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * HTMLparser.c HTMLtree.c include/libxml/HTMLparser.h: - trying to fix some troubles w.r.t. function returning - const xxxPtr. - -Thu Aug 16 21:33:20 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * win32/dsp/libxml2.def.src: another set of symbols conditionally - defined - -Thu Aug 16 21:31:14 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * xpointer.c: removed unused var - -Thu Aug 16 18:26:40 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * testXPath.c: another small cleanup closing bug #59110 - -Thu Aug 16 17:59:18 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * win32/dsp/libxml2.def.src: small cleanup closing bug - #59108 - -Wed Aug 15 22:46:01 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * example/gjobread.c: add xmlCleanupParser() before leaving - -Wed Aug 15 14:57:08 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * config.h.in configure.in include/libxml/xmlwin32version.h: - released 2.4.2 - -Wed Aug 15 13:56:22 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * include/libxml/valid.h debugXML.c valid.c: deprecate - the non-boundchecking Sprintf functions, add Snprintf - this should close bug #57984 - -Wed Aug 15 10:46:07 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * xmlIO.c: xmlOutputBufferCreateFilename() didn't unescaped - URIs before doing the lookups (pointed by Mark Vakoc) - -Tue Aug 14 18:37:23 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * xpath.c: serious changes on Result Value Trees and NodeSets - w.r.t. deallocation and collect operations. Probably not - 100% clean (merge of allocated trees smells like a problem). - Seems sufficient to close #58943 - -Tue Aug 14 16:12:00 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * xmllint.c: adding a --format option - -Tue Aug 14 14:16:24 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * xpath.c: count() was broken on Result Value Tree - * xmlIO.c: fixed file:/// accesses on _WIN32 - -Mon Aug 13 13:22:53 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * libxml.m4: s/LIBXML_VERSION_NUMBER/LIBXML_VERSION/ seems the - macro was renamed, this should close bug #58683 - -Mon Aug 13 12:33:40 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * SAX.c: small fix fixing bug #58539 reported by coolo, in - entity substitution mode text at the end of the entity might - be added due to text coalescing. - * nanoftp.c parser.c: small cleanup - -Wed Aug 8 22:57:05 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * HACKING: added John Fleck right to commit in the doc subdir - -Tue Aug 7 03:05:58 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * SAX.c testXPath.c valid.c xmllint.c include/libxml/valid.h: - allow to inherit attributes from the DTD directly in the - tree, this is needed for XPath and can be a useful feature. - Inherited namespaces are always provided at the tree level now - * test/defattr* result/defattr* result/noent/defattr*: added a couple - of tests for this feature (XSLT being the prime user). - -Fri Aug 3 14:02:20 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * DOCBparser.c Makefile.am nanohttp.c parser.c testHTML.c - testSAX.c xmlIO.c xmllint.c include/win32config.h - include/libxml/xmlversion.h.in include/libxml/xmlwin32version.h - include/libxml/xmlwin32version.h.in win32/README.MSDev - win32/dsp/*: applied Win32 Facelift No.2 patches from - Igor Zlatkovic for Windows/MSC - -Wed Aug 1 23:21:06 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * SAX.c: unparsedEntityDecl() the URI computation of the - entity wasn't done breaking XSLT unparsed-entity-uri() - -Wed Aug 1 17:44:57 CEST 2001 Daniel Veillard <daniel@veillard.com> - - * xpath.c: fixed a bug when walking the descendants and - the current node has no children - * debugXML.c: show up when a text node is supposed to not be escaped - -Wed Aug 1 01:33:35 CEST 2001 Thomas Broyer <tbroyer@ltgt.net> - - * xpath.c: fixed a bug in xmlXPathNodeTrailingSorted (for now it - worked like the set:leading() function) - * include/libxml/xpathInternals.h: added xmlXPathNodeSetContains - -Tue Jul 31 18:24:34 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * nanohttp.c: protected an use of EAGAIN, Brian Stafford - -Tue Jul 31 17:48:44 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * include/libxml/xmlIO.h: apply change to close #58141 - * win32/libxml2/*: update of the MSC projects from Igor Zlatkovic - -Tue Jul 31 17:09:31 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * parser.c: when the internal subset uses a PE, then the - included entity can use conditional sections. - -Mon Jul 30 12:58:39 EDT 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.c include/libxml/xpath.h: fixed a serious memory problen - when walking the namespace axis showing up in - libxst/tests/general/bug-12 - * xmlmemory.c: added the possibility to trace a given block - defined by its address - -Sun Jul 29 07:18:53 EDT 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * parser.c: don't override existing encoding specified before - starting xmlParseDocument() - -Sat Jul 28 13:33:10 EDT 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * include/libxml/xmlwin32version.h: reinserted, needed for - Windows users of CVS - -2001-07-27 Darin Adler <darin@bentspoon.com> - - * encoding.c: (xmlIconvWrapper): Add cast to fix warning. - * testCatalog.c: Add include of <libxml/parser.h>. - -2001-07-27 Darin Adler <darin@bentspoon.com> - - * include/libxml/.cvsignore: - * include/libxml/xmlwin32version.h: - Remove this file from CVS because it's generated. - -Fri Jul 27 10:03:56 EDT 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * parser.c include/libxml/parser.h: applied const patches from - Tom Moog #58002 - -Thu Jul 26 18:55:52 CEST 2001 Thomas Broyer <tbroyer@ltgt.net> - - * xpath.c include/libxml/xpath{,Internals}.h: added a function - lookup framework - -Fri Jul 27 01:50:20 EDT 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * tree.c: fixed xmlCopyNode() for documents - -Thu Jul 26 12:40:35 EDT 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * parser.c: fixed bugs #58073 reported by Greg Shtilman - -Thu Jul 26 11:38:37 EDT 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * parser.c: fixes bug #57652 reported by Morus Walter - -Thu Jul 26 10:24:34 EDT 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * nanohttp.c: John Kroll provided a small fix to xmlNanoHTTPSave - -Thu Jul 26 07:16:04 EDT 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * parser.c parserInternals.c: fixed the xmlLineNumbersDefault() - errors, lesson don't add new functions at 1am before a release - * xpath.c: integrated fix from Bjorn to avoid divide by zero - from XPath initialization when possible. - -Tue Jul 24 15:39:11 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * result/scripts/base*: removing history/readline changed - this slightly - * include/libxml/parser.h SAX.c parser.c parserInternals.c - xmllint.c: make element content line number generation - optional to avoid breaking old apps added interface to switch - -Tue Jul 24 15:06:58 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * configure.in: get rid of the readline and libhistory - dependencies by default, release 2.4.1 with IA64 fix - * nanohttp.c tree.c xmlIO.c include/libxml/nanohttp.h - include/libxml/tree.h include/libxml/xmlIO.h: incorporated - John Kroll fixes to allow saving to HTTP via PUT (or - POST of needed). - * doc/html/*.html: regenerated the docs - -Sun Jul 22 05:56:16 CEST 2001 Thomas Broyer <tbroyer@ltgt.net> - - * hash.c include/libxml/hash.h: added xmlHashScannerFull, - xmlHashScanFull and xmlHashScannFull3 to get passed the - three keys as arguments to the callback function - -Thu Jul 19 15:29:26 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * configure.in Makefile.am: removed libxml softlink for good - * include/libxml/*.h *.c doc/Makefile.am: cleanup to get - 100% coverage by gtk-doc - -Tue Jul 17 17:36:46 EDT 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xmlmemory.c include/libxml/xmlmemory.h: debugging on IA64, - fixed serious troubles due to size_t vs. int mismatch - -Tue Jul 17 16:04:36 EDT 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * SAX.c xmlIO.c: cleaned up some warning on the Alpha - -Mon Jul 16 06:32:44 CEST 2001 Thomas Broyer <tbroyer@ltgt.net> - - * include/libxml/xpath{,Internals}.h xpath.c: added a more - convenient extension API for value and context managing - Now handles external objects through xmlXPathPopExternal, - xmlXPathWrapExternal and xmlXPathReturnExternal. - Added functions for sets operations (intersection, etc.) - -Mon Jul 16 20:05:27 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * include/libxml/parserInternals.h include/libxml/HTMLparser.h - xmlIO.c tree.c parserInternals.c entities.c encoding.c - HTMLparser.c: cleanup of global variables, marking some - const or private. - -Mon Jul 16 00:17:15 CEST 2001 Thomas Broyer <tbroyer@ltgt.net> - - * include/libxml/xpath.h: exported xmlXPath{NAN,PINF,NINF} - fixed xmlXPathNodeSetItem when passing index=0 - -Sun Jul 15 17:58:44 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * include/libxml/xmlwin32version.h.in: added xmlCheckVersion() - -Sat Jul 14 19:31:21 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xmllint.c: fixed compilation under Cygwin #57503 - * TODO: update - -2001-07-13 Peter Williams <peterw@ximian.com> - - * config.h.in: add #undef HAVE_DLFCN_H - - * example/Makefile.am (INCLUDES): Compile fix when srcdir != - builddir. - -Fri Jul 13 11:09:56 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * win32/libxml2/libxml2.def.src: added a couple of exported entries - raised by #57348 and #57381 - -Thu Jul 12 21:20:17 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * DOCBparser.c HTMLparser.c HTMLtree.c SAX.c debugXML.c parser.c - tree.c xpointer.c: store the line numbder in element->content, - may break some software, need a configuration mechanism - -2001-07-10 Darin Adler <darin@bentspoon.com> - - * .cvsignore: - * example/.cvsignore: - * include/.cvsignore: - * include/libxml/.cvsignore: - Various things that are generated and should be ignored. - -Tue Jul 10 17:47:09 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * configure.in include/libxml/xmlwin32version.h: release of 2.4.0 - * doc/xml.html doc/html/*: updated the docs - -Mon Jul 9 22:06:53 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * valid.c: fixed "Internal: MIXED struct bad" when #CDATA elements - validation occurred on content with element child - -Mon Jul 9 17:59:08 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * tree.c: fixed XML Base computation which was broken - * debugXML.c: added a base function to the shell - * Makefile.am result/scripts/* test/scripts/*: added scripts - based regression tests, and adding 2 XML Base tests - -Mon Jul 9 12:31:05 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * tree.c: set properties doc and call xmlSetListDoc for properties - content when grafting them in a different tree. - * aclocal.m4: remove from CVS - -Sun Jul 8 23:09:07 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * win32/libxml2/libxml2.def.src: added some missing entry point - for XPath (Mark Vakoc) - -Sun Jul 8 20:34:35 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xmlIO.c: fixed an old bug raised by Bernhard Zwisch, the I/O - layer should URI-Unescape before trying to open resources. - -Sun Jul 8 16:26:00 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.c: fix the name() bug for elements in the default - namespace reported by Charlie Bozeman - -Sun Jul 8 15:11:05 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * SAX.c parser.c testXPath.c xpath.c: trying to fix #56948, this - led to an XPath fix, improvements of SAX initialization, and - an added option --nocdata to testXPath - -Sat Jul 7 21:09:55 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * doc/libxml-doc.el: Felix Natter provided anew version working - with XEmacs too - -Sat Jul 7 02:16:00 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * include/libxml/xpath.h: small cleanup - * doc/xml.html: update - -Fri Jul 6 01:40:23 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * Makefile.am configure.in include/libxml/xmlwin32version.h: - released 2.3.14 - -Fri Jul 6 00:47:41 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * doc/html/*: rebuilt the docs for the release - * doc/xml.html: added 2.3.14 release. - -Thu Jul 5 22:01:31 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.c: a bug reported by Stephan Kulow empty nodesets - were not equal to empty strings - -Thu Jul 5 00:52:25 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * SAX.c: fixed a URI-Reference computation problem when validating - * xmlIO.c: small cleanup - -Thu Jul 5 00:04:58 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * parser.c: improved the description of a couple of interfaces - upon Larry Stamper suggestion - -Wed Jul 4 21:42:24 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * SAX.c entities.c parser.c: changed completely the way entities - are handled when running the parser in entity substitution mode. - This fixes a bug reported by Stephan Kulow and nearly divides - by 3 the amount of memory required by libxslt to load and process - DocBook TDG. - -Wed Jul 4 18:02:58 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * HTMLparser.c: fixing a too early root closing problem raised - byt Prashanth Naidu - -Wed Jul 4 01:42:01 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.c: fixed a missing copy in xmlXPathVariableLookupNS() - raised by Mark Vakoc. - -Tue Jul 3 18:35:48 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * example/Makefile.am: fixed the include path to add srcdir/include - * Makefile.am configure.in: fix from Albert Chin for iconv detection - and some cleanup - -Tue Jul 3 10:12:03 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.c include/libxml/xpath.h include/libxml/xpathInternals.h: - lot of optimization work, results in significant improvements - when handling really complex XPath queries. Add a small optimizer - for unions, improve [n] and [last()], avoid some costly ops. - -Fri Jun 29 23:26:54 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * include/libxml/parser.h parser.c: xmlStrstr args are both const - * xpath.c: small cleanup - * xmlGetNsList: reformated, fixed problems if used on Entities - -Thu Jun 28 18:19:44 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * doc/xml.html: added 1.8.14 and 2.3.13 releases - -Thu Jun 28 18:16:28 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * configure.in include/libxml/xmlwin32version.h: released 2.3.13 - * Makefile.am example/Makefile.am: workaround automake generating - erroneous deps - -Thu Jun 28 15:08:22 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * include/win32config.h: bug #56801 Yon Derek provided a patch - to the windows config file. - -Thu Jun 28 14:51:44 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpointer.c include/win32config.h win32/libxml2/libxml2.def.src - libxml.h : Yon Derek provided a set of changes to compile from - CVS on Windows/MSC - -Thu Jun 28 14:11:28 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * parser.c: fixed UTF8 BOM support in push mode - * test/utf8bom.xml result/utf8bom.xml result/noent/utf8bom.xml: - added a specific testcase - -Wed Jun 27 18:33:13 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * Makefile.am: added --push regression tests - * parserInternals.c: the XML parser segfaulted in --push mode - -Wed Jun 27 13:09:51 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * configure.in: moved the symlinks detection within a CVS - check, this is not portable and will be removed soon. - * xpath.c: small cleanup/speedup - -Tue Jun 26 18:05:26 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * configure.in doc/xml.html include/libxml/xmlwin32version.h: - release of 2.3.12 - * parser.c: make an error message if unknown entities in all cases - -Tue Jun 26 09:46:29 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * uri.c: fixed 2 uri normalization bugs on '//' reduction - -Mon Jun 25 18:06:23 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * include/libxml/Makefile.am: Laszlo Peter pointed out that - includes were installed in the wrong dir - -Mon Jun 25 17:07:37 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * doc/html.xml: warn against sending code to exhibit bugs. - -Sun Jun 24 23:31:56 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.c: patch to xmlXPathFormatNumber for the optimizer on - Tru64 from Thomas Leitner - -Sun Jun 24 14:05:54 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * AUTHORS: added William and Bjorn - * include/libxml/*.h *.c README doc/*.html etc.: changed old email to - daniel@veillard.com hopefully I won't have to do this again - * doc/Makefile.am doc/html/*.html: cleanup makefile, checked that - docs can be rebuilt cleanly now - * include/libxml/xml*version.h*: removed include/libxml/xmlversion.h - from CVs it's generated, added include/libxml/xmlwin32version.h - also generated but which should change far less frequently. - * catalog.c nanoftp.c: made sure to include libxml.h not - libxml/xmlversion.h directly - * include/libxml/*.h: include xmlwin32version.h instead of xmlversion.h - when compiling on WIN32 and MSC - -Sat Jun 23 23:54:12 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * include/Makefile.am include/libxml/Makefile.am configure.in: - fixed make distcheck and rebuilding the rpms - -Sat Jun 23 20:50:53 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * configure.in: should finish the migration of exported includes - into a real include/libxml in CVS, at least for CVS users. - * removed the exported headers, added in include/libxml (as well - as xmlversion.h.in). - -Sat Jun 23 20:37:19 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * configure.in: fixed the way to detect symlink - -Sat Jun 23 20:30:11 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * configure.in: updated, include/libxml is now a real CVS dir - -Sat Jun 23 19:36:31 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * doc/libxml-doc.el: a new version of libxml-doc.el. This new - version works with both libxml1 and libxml2 (it autodetects - the prefix of the html-files) from Felix Natter. - * doc/xml.html: updated doc accordingly - -Sat Jun 23 18:30:28 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.c: fixed the bug generating a template loop in libxslt - when using docbook-xsl-1.4, * should filter out document nodes - * HACKING: added William - * TODO: updated - -Fri Jun 22 18:02:37 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * doc/FAQ.html: added a warning about gcc-3.0 - * doc/xml.html: added reference to gdome2 and removed a confusing - sentence - -Fri Jun 22 17:02:16 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xmlversion.h: okay this is a generated file, but Windows - users need it and they can't generate it, and I want CVS - Windows users ... - * win32/libxml2/libxml2_so.dsp: Windows project file for - the shared lib version of libxml2 - * win32/libxml2/libxml2.def.src: bug #56527 set of exported - resources needed for libxslt/xsltproc by Yon Derek - -Fri Jun 22 16:39:36 CEST 2001 Bjorn Reese <breese@users.sourceforge.net> - - * trio.c: MSVC fix (provided by Igor Zlatkovic) - -Fri Jun 22 12:42:16 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * include/win32config.h: another small fix for ATTRIBUTE_UNUSED - -Fri Jun 22 12:42:16 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * include/win32config.h: Yon Derek provided a first fix - to be able to compile libxslt/xsltproc on Windows - -Fri Jun 22 00:04:36 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.c: attempt to work around what seemed a gcc optimizer - bug when handling floats on i386 http://veillard.com/gcc.bug - * tree.c entities.c encoding.c: doing some cleanups while - chasing it - -Thu Jun 21 13:13:36 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * Makefile.am: cleanup when --without-debug is specified - * xinclude.c xpath.c xpathInternals.h xpointer.c: cleanup - w.r.t. --without-debug and other include points - * catalog.h testCatalog.c: a bit of cleanup and prepare for XML - Catalogs - * configure.in entities.h tree.h HTMLparser.c: removed - --without-corba, made the _private field mandatory - -Wed Jun 20 19:37:25 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * parser.c parserInternals.c encoding.c: Since Notepad on Win2k - outputs a BOM in UTF8, an errata has been issued to avoid the - problem, that was the most reasonable solution... Add support - for a leading UTF8 BOM in entities. - -Wed Jun 20 15:38:59 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * valid.c: fixed a bug found when post validating an entity ref - * xmllint.c: added --loaddtd and sligly changed --postvalid to - activate it too - -Tue Jun 19 20:03:40 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * tree.c xinclude.c xpointer.c: bug #56402 exposed a number of - weakness in the node copy the XPointer and the XInclude - implementations. Serious cleanup. - -Tue Jun 19 14:50:18 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * Makefile.am: Kjartan Maraas provided a small patch to - add xml2-config.in to EXTRA_DIST - -Tue Jun 19 13:04:10 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * valid.c tree.c parserInternals.c parser.c: Stephan Kulow - provided another failing case found in KDE, the way the - ctxt->vctxt.nodeTab was allocated and freed changed over - time but it wasn't completely cleaned up. This should fix it. - -Sun Jun 17 19:56:33 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * parser.c: Stephan Kulow also raised the fact that line number - could get miscounted making debug harder, fixed the problem - in xmlParseCharData() - -Sun Jun 17 19:17:26 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * valid.c: Stephan Kulow pointed out a problem when validating - and using an empty entity, forgot a 'break' in a case. - -Sun Jun 17 16:47:40 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * tree.c: fixed xmlHasNsProp() accordingly to bug #55683 - * doc/xml.html: updated with 2.3.11 - -Sun Jun 17 12:24:11 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * TODO: updated adding cleanup of generated doc - * configure.in: prepared to release 2.3.11 - * xmllint.c: added --version for bug reporting - * doc/html/*.html: rebuilt the doc - -Sat Jun 16 23:23:33 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.c: first part of the work on selecting namespace to - fix bug #56115 - -Sat Jun 16 00:20:46 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * Makefile.am example/Makefile.am: Laszlo PETER provided a fix - when using -liconv - * TODO: updated - -Fri Jun 15 07:08:57 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * HTMLtree.[ch]: more work on the HTML serialization routnes, - cleanup, encoding support. - -Thu Jun 14 10:31:17 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.c: Thomas Broyer suggested a better patch for the / arg - -Thu Jun 14 01:01:30 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.c: bug detected by Ankh when / is used as a function arg - -Wed Jun 13 23:08:46 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * HTMLparser.[ch] HTMLtree.c: stored the inline/block property - of element and use it to avoid outputting formatting spaces at - the wrong place. Implemented the format parameter for HTML save. - * result/HTML/doc2.htm result/HTML/doc3.htm result/HTML/fp40.htm - result/HTML/script.html result/HTML/test2.html result/HTML/test3.html - result/HTML/wired.html: of course this impact the result of a - number of HTML tests - -Thu Jun 14 09:49:09 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * HTMLtree.[ch]: started augmenting the HTML save API with - encoding and formatting parameters - -Wed Jun 13 09:44:15 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * HTMLtree.h: cleanup and started evaluating the work needed on - revamping the HTML output code - -Mon Jun 11 19:29:40 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * DOCBparser.c: handling of PIs and <?sgml-declaration in entities. - -Tue Jun 12 08:46:28 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * valid.c: fixed bug #56049, forgot one check in the - validation routine - -Tue Jun 12 08:09:46 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * tree.[ch]: grrr ... namespace is a C++ reserved keyword - -Tue Jun 12 06:29:39 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * libxml.h: fixed an error in last commit - * doc/FAQ.html: added an entry for compilation from CVS - -Mon Jun 11 10:07:29 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xmlversion.h.in libxml.h: Cygwin patches - * tree.c: xmlFreeNodeList patch similar to xmlFreeNode one - * tree.h: cleanup - -Sat Jun 9 19:16:00 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * tree.c: patched xmlFreeNode() to avoid freeing() a static - memory block in a strange case where libxml is linked twice - in the binary. - -Sat Jun 9 18:39:03 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * valid.c: (a? , b? , c? , ... , z?) was storing/restauring - state far too often, simple fix used to avoid it. - -Sat Jun 9 16:10:36 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xinclude.c: Raphael Hertzog had a trouble with DTD nodes - being processed, applied his patch - * tree.c: fixed a bug raised in xmlStaticCopyNodeList() - -Sat Jun 9 15:50:11 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * nanoftp.c nanohttp.c uri.c include/win32config.h: Igor Zlatkovic - provided fixes to compile on MSCC again - * win32/libxml2/libxml2.def.src win32/libxml2/libxml2*.dsp: he - also provided an update for the project files. - -Thu Jun 7 21:52:10 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * tree.c: applied Steve Tinney patch to xmlNewNsProp to fix - bug #55810 - -Thu Jun 7 21:29:39 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * tree.c: fixed xmlGetNsProp() to close bug #55683 - Note this requires libxslt to use it's own function instead. - -Thu Jun 7 18:06:34 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * HTMLtree.c: when in a pre element no formatting space should - be added. - * test/HTML/pre.html result/HTML/pre.html*: added a regression test - -Thu Jun 7 17:29:38 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * configure.in: added tests for signal() and signal.h - -Fri Jun 8 10:17:15 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.c: robert pointed out xmlXPathNINF was not initialized - -Fri Jun 8 10:01:45 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * doc/libxml-doc.el: Felix Natter provided a new version for - libxml2 - -Fri Jun 8 07:20:46 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * HTMLtree.c: when in a pre element no formatting space should - be added. - -Wed Jun 6 18:07:36 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * configure.in: add -mieee to CFLAGS when compiling on Linux/alpha - -Thu Jun 7 06:44:01 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * DOCBparser.c: implemented the <?sgml-declaration encoding="xxx"?> - hack - * tree.[ch]: added xmlHasNsProp as suggested in bug report #55653 - * uri.c: fixed a warning - -Tue Jun 5 22:54:21 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * HTMLtree.c: trying to close bug #55772 escaping in script - elements - * doc/xml.html: suggest to send mail to the list - -Tue Jun 5 19:11:02 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * error.c: attempt to fix the xmlGetVarStr breakage once and for - good. Use a macro and based on the solution provided in - vsnprintf manual page from GNU. - -Tue Jun 5 14:46:10 CEST 2001 Bjorn Reese <breese@users.sourceforge.net> - - * error.c: Workaround for non-preserving variadic list. - * trio.c trio.h triop.h strio.c strio.h: Upgraded to trio baseline 1.4 - -Sat Jun 2 06:12:33 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * doc/xml.html: added 2.3.10 release - -Fri Jun 1 11:27:11 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * configure.in: releasing 2.3.10 - -Thu May 31 20:42:39 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xmlIO.c: Gary Pennington spotted a few troubles with file:/// - -Thu May 31 20:18:59 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * encoding.c: Robert Collins provided a patch to add the - "US-ASCII" encoding alias - -Wed May 30 21:12:45 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.c encoding.[ch]: William M. Brack provided a set of UTF8 - string oriented functions and started cleaning the related areas - in xpath.c which needed fixing in this respect - -Wed May 30 20:30:47 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * HTMLtree.c: applied patch from Jaroslaw Kolakowski to close bug - #55380 - * tree.c: patch to xmlNodeGetContent() to get CDATA section content - -Mon May 28 12:56:29 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * TODO: updated - * nanohttp.[ch] : started adding APIs to get the redirected URL - when this occurs (needed for further base computation - * tree.h: cleanup - * encoding.c: cleanup - * SAX.c: minor change around ctxt->loadsubset - -Fri May 25 09:36:26 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * Makefile.am include/Makefile.am: small change to have - include/libxml rebuilt if working from CVS. - * uri.c: applied another patch from Carl Douglas for URI escaping, - this should close bug #51876 - -Wed May 23 15:40:27 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xinclude.c: fixed XInclude recursive behaviour bug #54678 - * result/XInclude/recursive.xml test/XInclude/docs/recursive.xml - test/XInclude/ents/inc.txt test/XInclude/ents/sub-inc.ent: - added specific regression test - * parser.h: preparing for the XSLT mode where DTD inherited - attributes are added to the tree. - -Wed May 23 13:59:19 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xinclude.[ch]: Updated the namespace for the Last Call version - * result/XInclude/include test/XInclude/include: updated the - testsuite accordingly - -Wed May 23 12:27:44 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * uri.[ch]: applied a patch from Carl Douglas for URI escaping, - related to bug #51876 - -Tue May 22 18:46:56 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * tree.c: fixed a gross mistake in base computation, xml:base is - not completely correct yet (need cascade). - * xpath.[ch]: added the few things needed to find a function name - and URI from the XPath context when it is called. - -Tue May 22 17:00:36 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * catalog.[ch]: fixes and add xmlLoadCatalogs() - * DOCBparser.c: small cleanup - * xmllint.c: added a --catalogs option to load catalogs from - $SGML_CATALOG_FILES - * tree.c: cleanup - * configure.in: iconv library fixup, ICONV_LIBS - -Mon May 21 16:05:22 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * catalog.c: handling of CATALOG entries. detection of recursion, - and a few bugfixes - * xpath.c: fixing bug #54951 QNAME with no prefix should not match - against the default namespace - -Mon May 21 10:14:07 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.c: Joe Orton reported a bug found with IRIx compiler. - -Sun May 20 15:15:46 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * parser.c: fixed propagation context info when parsing an - external entity. - * doc/html/*.html: regenerated a couple of docs - -Sat May 19 17:11:15 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * doc/xml.html: update with 2.3.9 information - -Sat May 19 16:50:47 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * HTMLtree.h debugXML.h parserInternals.h tree.h valid.c - xmlversion.h.in xpathInternals.h xpath.h: some cleanup for gtk-doc - * doc/html/* : rebuilt the docs - * valid.c: small patch which may improve some case when - validating. - -Sat May 19 15:20:03 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * HTMLparser.c: Closed bug #54891 - * result/HTML/cf_128.html* test/HTML/cf_128.html: added the test - to the suite - -Thu May 17 14:15:07 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * encoding.h hash.c nanoftp.h parser.h tree.h uri.h xlink.h xpointer.c: - applied a documentation patch from LotR and filled in a few missing - descriptions - -Wed May 16 23:02:41 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.c tree.c parser.c: speed optimizations at the parser level - document tree freeing and xpath evaluation - -Wed May 16 12:55:48 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * parser.c parser.h parserInternals.h: fixed a couple of - interfaces for handling memory buffer input to const char * - upon suggestion of JamesH. - -Tue May 15 17:22:27 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * configure.in: LoTR sent a patch fixing the previous commit - -Tue May 15 14:40:04 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * configure.in: trying to deal again with the stoopid -R linking - flag of Solaris - -Tue May 15 12:49:50 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.h: two nodeset access macros from Thomas Broyer - -Tue May 15 11:42:39 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.c xpath.h xpathInternals.h: apply an XPath API cleanup - patch from Thomas Broyer - -Tue May 15 10:52:19 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * valid.c test/VCM/v2[34].xml: Fixed bug #54631 added specific test - case - * INSTALL: was empty added stuff from the FAQ - -Fri May 11 19:37:30 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * tree.[ch]: fixing bug #54446, by cleaning some bugs in the - attributes handling and #54433 by adding xmlUnsetProp() - and xmlUnsetNsProp() - -Fri May 11 16:07:13 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * HTMLparser.c: Patch from Jonas Borgström - (htmlGetEndPriority): New function, returns - the priority of a certain element. - (htmlAutoCloseOnClose): Only close inline elements if they - all have lower or equal priority. - * result/HTML: this of course changed a number of tests results. - -Thu May 10 17:30:22 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xmlIO.c catalog.c: plugged in the default catalog resolution - * doc/gnome-xml.sgml: linked in the Docbook parser and catalog - documentations - * doc/html/libxml-*.html: rebuild added the missing ones to CVS - -Thu May 10 16:14:36 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * Makefile.am xmlversion.h.in configure.in include/Makefile.am: - integrating catalogs - * catalog.[ch] testCatalog.c: adding a small catalo API - (only SGML catalog support). - * parser.c: restaured xmlKeepBlanksDefault(0) API - -Wed May 9 12:50:15 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * tree.c: zb@bisp.com reported an error in xmlNodeGetLang() - -Tue May 8 12:31:40 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * parser.c: added xmlParseExternalEntityPrivate() to allow - propagation of ctxt->_private when parsing external entities - -Tue May 8 10:26:22 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * HTMLtree.c: fixed the bug reported by Bjorn in htmlNodeDump - -Tue May 8 09:30:12 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * configure.in: fixed a small portability problem with AM_CONDITIONAL - -Mon May 7 22:44:45 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * valid.c: warn when indeterminist content model is detected - * result/VC/ElementValid8: this adds a message - * Makefile.am: add --novalid for VCM tests - * parserInternals.c: added a call to Init memory - -Fri May 4 19:51:15 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * HTMLparser.c: fixed htmlNewDoc SYSTEM and PUBLIC ID inversion - when both parameters are NULL. - -Fri May 4 17:19:39 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * valid.c: applied small patch from Gary Pennington, reindented - some part of the code. - -Thu May 3 13:10:43 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * configure.in doc/xml.html doc/html/*: preparing for 2.3.8 - release, updated and regenerated the docs - -Thu May 3 12:47:46 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.c result/XPath/expr/floats : clarified and cleanup - printing of abnormal floats in tests. - -Thu May 3 10:25:19 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * HTMLparser.c: trying to fix the problem reported by Jonas Borgström - * results/HTML/ : a few changes in the output of the HTML tests as - a result. - * configure.in: tying to fix -liconv where needed - -Wed May 2 19:10:26 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * Makefile.am: fixed a stupid error - -Wed May 2 18:39:39 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * configure.in Makefile.am: make the inclusion of the trio - modules in the library conditional - -Wed May 2 14:39:57 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * DOCBparser.c: patche from László Kovács, fixed entities refs - in attributes handling - -Wed May 2 12:56:04 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xmlIO.c: Bjorn Reese provided a fix for a problem on buffer - flushing - -Mon Apr 30 22:29:34 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.c: fix of an XSLT namespace bug reported on the list - general/bug-8- - -Mon Apr 30 19:42:58 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * strio.h trio.c: Dan McNichol suggested a couple of small - fixes for AIX 4.3.3 using Visual Age 5.0.2 compiler - -Mon Apr 30 13:44:48 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * tree.c parser.c encoding.c: spent a bit more time looking - at the parsing speed and DOM handling. Added a few more - speedups. - -Sun Apr 29 21:53:47 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * parser.c: small but effective parsing speed improvement - -Sun Apr 29 19:02:13 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * configure.in: default on the DocBook parser inclusion (for Gnome) - * DOCBparser.h: fixed a header reference - -Sat Apr 28 19:00:39 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * configure.in xpath.c: applied Bjorn patches for FPE on the - alpha - -Sat Apr 28 18:54:28 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * tree.[ch] xmlIO.h: applied patch from Joe McAlerney to add - xmlSaveFormatFileTo() - -Sat Apr 28 16:33:05 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.c: simple and efficient optimization, XPath functions - always bind to the same code, cache this - * TODO: updated (by saying some is obsolete) - -Sat Apr 28 14:23:30 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.c: more cleanup work on XPath name parsing routines - -Fri Apr 27 19:06:13 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * parserInternals.c xpath.[ch]: some UTF8 cleanup on - xmlXPathParseName - * xpath.c: Igor Zlatkovic suggested a change for NAN and MSC - * debugXML.c: avoid compilation problems if compiling without - HTML support, Igor Zlatkovic - * win32/libxml2/libxml2.def.src: being able to compile without - XPath on Windows - -Thu Apr 26 22:53:03 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * libxml.m4: yet another patch from Toshio Kuratomi - -Thu Apr 26 21:27:43 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * libxml.m4 libxml2-spec.in: new patches from Toshio Kuratomi - -Thu Apr 26 20:53:48 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * tree.[ch]: added xmlSaveFormatFile interface for saving - and indenting a file. - -Thu Apr 26 16:35:53 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.c: fixed bug #53689 related to processing-instruction() - -Thu Apr 26 12:57:58 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * DOCBparser.c: patche from László Kovács - -Thu Apr 26 11:31:54 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * parser.c: applied fixes from Christian Glahn bug report #53391 - -Thu Apr 26 11:14:56 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * error.c: Jean François Lecomte provided a complete description - and a fix to bug #53537 - -Thu Apr 26 09:42:58 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * libxml.m4: added AM_PATH_XML2 provided by Toshio Kuratomi - -Wed Apr 25 21:05:31 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * DOCBparser.c SAX.c: a bit more work on entities processing. - Still Need to cleanup XML output and references in attributes - -Wed Apr 25 17:52:27 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * DOCBparser.c include/Makefile.am: two patches from László Kovács - -Wed Apr 25 14:56:26 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * tree.c: trying to fix #53574, not completely complete, - I would like xmllint --copy --debug test/ent1 and - xmllint --debug test/ent1 to show the same result. - * xpath.c: fix a bug when trying to sort namespace nodes - -Wed Apr 25 12:28:57 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * HTMLtree.c: real fix for #53402 - -Tue Apr 24 17:36:35 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * HTMLtree.c HTMLtree.h : closing #53402 i.e. output of - PIs when using xsl:output - * valid.c: closing #53537 some case generate segfaults if there - is validity errors - -Tue Apr 24 15:19:53 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * SAX.c testDocbook.c DOCBparser.c: more work on the support - of external parsed entities, added --noent to testDocbook - * valid.c: Garry Pennington found an uninitialized variable - access in xmlValidateElementContent() - -Tue Apr 24 14:41:25 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * HTMLparser.c : HTML parsing still sucks ... trying to deal - with madness - * result/HTML/ : this modified the result of the regression tests - a lot. - -Tue Apr 24 14:10:38 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * entities.c: xmlEncodeEntitiesReentrant fixed a few accesses - to doc where it wasn't checked against NULL reported by - Jens Laas - -Tue Apr 24 13:21:36 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * HTMLparser.c: Jonas Borgström patch, the <td>, and <th> elements - now means the end of any open <span>,<font>,<a>,<b>,<i>,<u>. - -Mon Apr 23 15:40:04 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * DOCBparser.c DOCBparser.h testDocbook.c configure.in Makefile.am - xmlversion.h.in: started (re)integrating the DocBook SGML parser. - * SAX.[ch]: cleanup and updates for DocBook - * debugXML.c parser.h tree.[ch] valid.c xpath.c: small macro or - ex SGML identifier changes - * valid.c: removed a static unused function. - -Mon Apr 23 11:05:56 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * HTMLtree.c: applied change for Paul Sponagl on script saving - * Makefile.am: the warning about entity title.xml are normal. - -Sun Apr 22 22:09:35 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * configure.in: release of 2.3.7 - * Makefile.am: fixing make distcheck - -Sun Apr 22 21:29:52 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * doc/html/* doc/xml.html: updated and regenerated the docs - -Sun Apr 22 21:11:45 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.c: fixed the XPointer problem introduced in 2.3.6 - -Sun Apr 22 14:11:58 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * tree.c: fixed #53388 with the provided patch - -Sun Apr 22 12:34:41 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * valid.c: Bjorn detected an invalid memory access. Fixed - vstateVPush() - -Sun Apr 22 10:49:23 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.c: fixed xmlXPathCompile to detected unproperly ended expr - -Sat Apr 21 18:27:51 CEST 2001 Bjorn Reese <breese@users.sourceforge.net> - - * libxml.h: new header used only for the compilation of libxml - * HTMLparser.c HTMLtree.c SAX.c debugXML.c encoding.c entities.c - error.c hash.c list.c nanoftp.c nanohttp.c parser.c - parserInternals.c testHTML.c testSAX.c testURI.c testXPath.c - tree.c uri.c valid.c xinclude.c xlink.c xmlIO.c xmllint.c - xmlmemory.c xpath.c xpointer.c: libxml.h integration - * trio.[ch] triop.h strio.[ch]: upgraded to the latest trio - baseline (version 1.2 plus a single patch). - * xpath.c result/XPath/expr/floats test/XPath/expr/floats: parses - scientific notation for numbers. Tests added. - * xpath.c: formatting of numbers changed to use sprintf - (contribution from William Brack) - -Sat Apr 21 16:12:59 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * valid.c: cleanup, more useful debugging - * parserInternals.c: cleanup vctxt.nodeTab (de)allocation - * xmlIO.c: entity loading is printed as an error when validating - -Sat Apr 21 12:25:49 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * valid.c: fixed to validate within entities - * test/VCM/v22.xml: added a specific testcase - -Fri Apr 20 17:45:47 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * valid.c: forgot an epsilon transition in for ()+ - * test/VCM/v21.xml : added a specific test case - -Fri Apr 20 15:46:04 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * valid.c: removed a state explosion exhibited by RSS - * test/valid/rss.xml result/valid/rss.xml*: added the testcase - from bug #51872 - -Fri Apr 20 14:52:44 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * valid.[ch] tree.h: worked *hard* to get non-determinist content - validation without using an ugly NFA -> DFA algo in the source. - Made a specific algorithm easier to maintain, using a single - stack and without recursion. - * Makefile.am test/VCM/*.xml: added more tests to "make Validtests" - * hash.c: made the growing routine static - * tree.h parser.c: added the parent information to an - xmlElementContent node. - -Wed Apr 18 23:33:11 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * SAX.c parser.c xpath.c: generating IDs when not validating - from an external parsed entity was poisoning the ID has table - with removed values. This was killing XSLT on the KDE help - browser. - -Wed Apr 18 17:09:15 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * entities.h: andrew@ugh.net.au detected a double declaration - -Wed Apr 18 15:06:30 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * debugXML.c hash.c tree.h valid.c : some changes related to - the validation support to improve speed with DocBook - * result/VC/OneID2 result/VC/OneID3 : this slightly changes - the way validation errors get reported - -Wed Apr 18 11:42:47 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * HTMLparser.c HTMLtree.c: applied part of the patches provided - by P C Chow and William M. Brack for XSLT HTML output - -Mon Apr 16 19:44:36 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xmlversion.h.in win32config.h win32/libxml2/*: applied - Igor Zlatkovic patches for MSC compilation and added his - updates - -Tue Apr 17 10:08:19 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.c: fixed xmlXPathNodeCollectAndTest() to do proper - prefix lookup. - * parserInternals.c: fixed the bug reported by Morus Walter - due to an off by one typo in xmlStringCurrentChar() - -Thu Apr 12 17:41:09 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * HTMLparser.c result/HTML/*: revamped the way the HTML - parser handles end of tags or end of input - -Thu Apr 12 10:50:34 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * tree.[ch] : added xmlDocCopyNode for gdome2 support - -Wed Apr 11 16:37:50 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * tree.h: include xmlmemory.h this seems to havoid a nasty glibc - bug where the linktime versions of free() won't work ... - -Wed Apr 11 14:21:31 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * config.h.in configure.in xmlversion.h.in: added ansidecl.h test - -Wed Apr 11 13:50:42 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * doc/xml.html: added 2.3.6 release - -Wed Apr 11 13:26:34 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * tree.c: fixed xmlStringGetNodeList() to handle charrefs - * result/wml.xml: resulted in a small output change - -Wed Apr 11 09:47:55 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * tree.c: xmlNewDoc was missing the charset initialization - * xmllint.c: added --auto to autogenerate a doc, allow to - reproduce the problem fixed on xmlNewDoc - -Tue Apr 10 18:13:10 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.c: trying to get 52979 solved - * tree.c result/ result/noent/: trying to get 52712 solved, this - also made me clean up the fact that XML output in general should - not add formatting blanks by default, this changed the output of - a few tests - -Tue Apr 10 16:30:20 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.c: Bill Brack pointer an error in detecting a null nodeset - -Sun Apr 8 15:07:16 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * configure.in: finally released 2.3.6 - -Sun Apr 8 11:39:21 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.c: checking for null pointer generated by new code - -Fri Apr 6 12:53:05 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.c: fixed a [] evaluation problem reported - * test/XPath/tests/simpleaddr: extended test - * result/XPath/simpleaddr: updated result - -Wed Apr 4 02:07:53 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xmllint.c: Dan Timis reported a portability problem - on Macs without mmap, fixed it. - -Tue Apr 3 20:20:51 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * testXPath.c : added a --tree option allowing to display the - tree dump of the XPath expression - -Mon Apr 2 17:13:51 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.c: fixed a memleak when comparing nodesets - * HTMLtree.c: don't invent the HTML doctype if not available (XSLT) - * tree.c: added a TODO - -Tue Mar 27 14:32:06 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * configure.in Makefile.am config.h.in xmlversion.h.in: detect if - we need string functions - * trio.[ch] strio.[ch]: embedded the Trio-0.23 string functions - to be able to use them where needed. Applied some changes - to reduce name linking pollution and compile in only what's - needed. - * HTMLtree.c debugXML.c entities.c error.c nanoftp.c valid.c - xlink.c xmlversion.h.in xpath.c: got rid of the #ifdef - for the string manipulation functions - * xmlmemory.[ch]: removed DEBUG_MEMORY_FREED and added it automatically - to the free() function of xmlmemory.c - * entities.c HTMLtree.c parserInternals.c tree.c uri.c valid.c - xinclude.c xmlIO.c xpath.c xpointer.c: removed the MEM_CLEANUP - usage. - -Tue Mar 27 02:30:23 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * error.c: applied the context output patch of the error - handling submitted by Chuck Griffith - * error/VC/*: this slightly change some error logs - -Tue Mar 27 00:51:27 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * parser.c: fixed line number reporting on error - -Mon Mar 26 23:21:41 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * parser.c: Sullivan and Darin found a parser bug, - applied the patch. - -Mon Mar 26 18:24:52 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * HTMLparser.c HTMLtree.c SAX.c debugXML.c error.c parserInternals.c - testHTML.c testSAX.c tree.c valid.c xmlIO.c xmlmemory.c - xmlversion.h.in xpointer.c: of course the way I defined - UNUSED breaks on old gcc version. Try to be smart and - also define it directly in xmlversion.h - * configure.in: removed -ansi flag from the pedantic set - -Sat Mar 24 17:45:36 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - Huge cleanup, I switched to compile with - -Wall -g -O -ansi -pedantic -W -Wunused -Wimplicit - -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat - -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow - -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return - -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline - * HTMLparser.[ch] HTMLtree.c SAX.c debugXML.c encoding.[ch] - encoding.h entities.c error.c list.[ch] nanoftp.c - nanohttp.c parser.[ch] parserInternals.[ch] testHTML.c - testSAX.c testURI.c testXPath.c tree.[ch] uri.c - valid.[ch] xinclude.c xmlIO.[ch] xmllint.c xmlmemory.c - xpath.c xpathInternals.h xpointer.[ch] example/gjobread.c: - Cleanup, staticfied a number of non-exported functions, - detected and cleaned up a dozen of problem found this way, - avoided a lot of public function name/typedef/system names clashes - * doc/xml.html: updated - * configure.in: switched private flags to the really pedantic ones. - -Thu Mar 22 22:44:15 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * configure.in: 2.3.5 - * doc/html/*: rebuilt the docs - -Thu Mar 22 15:36:45 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * parser.c: fixed a reported bug in NOTATION parsing - * uri.c: accepted but not fixed bug 51876, added TODO - * Makefile.am: fixed bug 51876 - -Thu Mar 22 13:41:22 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * config.h.in configure.in error.c: fix a compilation problem - on platforms without vsnprintf (xml@thewrittenword.com) - -Wed Mar 21 19:04:34 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * parser.c: fixed a function name header typo - * SAX.c: notations can also occur in external subset. - -Tue Mar 20 14:21:28 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * error.c: removed a C++ like comment - -Tue Mar 20 12:22:36 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * parser.c: fixing bug 52299 strange condition leading - to a parser crash due to a buffer overflow - * result/noent/attrib.xml result/attrib.xml test/attrib.xml: - added the specific test case - -Mon Mar 19 16:50:52 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.[ch]: still a lot of cleanup based on XSLT, added - xmlXPathConvert{String,Number,Boolean} to be able to make - type casts without a context stack, fixed some implementation - problems related to the absence of context at parse-time, - added xmlXPathEvalPredicate() and xmlXPathFreeCompExpr() - in the public API too - * xpointer.c xpathInternals.h: we need to know at parse time - whether we are compiling an XPointer - -Mon Mar 19 11:54:31 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.[ch] xpointer.c: restaured the Binary and API compatibility - cleaned up the parser internals, refactored XPath code, added - new compilation based APIs and cleanly separated public and - private APIs. - -Mon Mar 19 00:59:25 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.h: the comp field must be added at the end to avoid - killing binary compat. - -Mon Mar 19 00:11:18 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * Makefile.am: detect XPath memleaks in regreson tests - * error.c: fixed and error w.r.t. error reporting still using - stderr - * hash.c: added new line at end of file - * tree.h: minor cleanup - * xpath.[ch] xpointer.[ch]: Major changes ! Separated XPath - expression parsing from evaluation, resulted in a number of - changes internally, and in XPointer. Likely to break stuff - using xpathInternals.h but should remain binary compatible, - new interfaces will be added. - -Wed Mar 14 20:34:02 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * configure.in: fixed a couple of problems reported by - okiddle@yahoo.co.uk and allanc@chickenandporn.com when compiling - without gcc on non linux platforms. - -Wed Mar 14 20:13:54 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * doc/Makefile.am configure.in: yearke@eng.buffalo.edu suggested - a fix for --with-html-dir= configure support. I hope it won't - break rpm generation - -Wed Mar 14 17:28:49 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xmlIO.c: one function comment cleanup. - -Wed Mar 14 14:55:46 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * SAX.c: external subset notations were improperly registered - in the internal subset. - -Tue Mar 13 10:28:49 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * README.cvs-commits: added, pointing to HACKING - * HACKING: updated - -Mon Mar 12 22:09:40 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * parser.c: and Matt Sergeant found one in the XML push - parser (erroneous check I forgot to remove when I fixed the - main parser). - -Mon Mar 12 19:19:04 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.c: ptittom found a small bug in UnaryExpr - -Sat Mar 10 13:09:53 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * configure.in: bumped to 2.3.4 - * error.c: fixed bug #51860 - * tree.c: fixed bug #51861 - * valid.c: cleanup, more debug, failed to fix one bug crap ... - * tree.[ch] : added xmlDefaultBufferSize - * nanoftp.c: typo in function name header block - * doc/xml.html : updated, added link to XML::LibXSLT - * doc/html/* : rebuilt the docs - -Wed Mar 7 20:43:47 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * parser.c SAX.c: the new content parsing code raised an - ugly bug in the characters() SAX callback. Found it - just because of strangeness in XSLT XML Rec output :-( - -Wed Mar 7 16:50:22 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * Makefile.am: Martin Baulig suggested to add -lm - * tree.c: found another bug in xmlNodeGetContent() - -Tue Mar 6 09:21:30 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.c: Bjorn found the error related to strictness of comparison. - -Mon Mar 5 21:47:31 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * parser.c: trying to fix the Dtd parsing problem reported - by Gary, side effect of last week speed optimizations. - -Sat Mar 3 19:45:59 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xml2Conf.sh.in: fixes pointed out by Fredrik Hallenberg - * parserInternals.c: removed unneeded test raised by Stric - -Sat Mar 3 13:04:37 CET 2001 Bjorn Reese <breese@users.sourceforge.net> - - * xpath.c: Fixed xmlXPathNodeCollectAndTest (problem reported - and fixed by William Brack). Added xmlXPathFormatNumber. - Changed the sorting slightly. - * configure.in Makefile.am example/Makefile.am: Added -lm. - Please note that applications linking with libxml2, must - also like with the math library from now on. - -Sat Mar 3 07:38:58 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * HTMLparser.c: fixed loop reported by Marc Sanfacon - -Sat Mar 3 02:10:24 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * parser.c: one must report spaces even if the Dtd element - content proves that this is not part of the element content. - * result/valid/*.xml: this changed the ouptu slightly - -Thu Mar 1 17:53:39 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * configure.in: bumped to 2.3.3 - * doc/xml.html: updated - -Wed Feb 28 00:43:58 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * tree.c: minor doc fix - * xpath.c: deallocation issues when a result tree has been - converted to a node-set - -Mon Feb 26 22:09:45 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * doc/xml.html: oops corrected dates s/2000/2001 - -Mon Feb 26 12:48:35 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * valid.c: new patch from Gary Pennington - -Mon Feb 26 09:30:23 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * doc/xml.html: applied patch from Ankh - -Mon Feb 26 03:34:43 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xinclude.c: fixed a problem building on Mac - -Sun Feb 25 21:52:30 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * parser.c: more work on increasing parsing ferformances - -Sun Feb 25 18:03:42 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xmlmemory.h HTMLparser.c HTMLtree.c entities.c parser.c - xpath.c xpointer.c tree.c uri.c valid.c xinclude.c xmlIO.c: - avoiding memcpy in production builds MEM_CLEANUP macro use - * parser.[ch] parserInternals.c: optimizations of the tightest - internal loops inside the parser. Better checking of I/O - flushing/loading conditions - * xmllint.c : added --timing - -Sun Feb 25 05:48:51 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * configure.in: bumped to 2.3.2 - * doc/xml.html: updated for release - -Sat Feb 24 14:07:52 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.c: found a memleak and fixed a nasty bug - -Sat Feb 24 03:35:48 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xmllint.[c1] : added return code errors for xmllint - * xpath.c: specific debug dump function for result value trees - -Thu Feb 22 07:52:27 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.c: finally implemented xmlXPathCompareNodeSets - * test/XPath/expr/floats results/XPath/expr/floats: added - a test for float expressions - -Tue Feb 20 18:57:54 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * tree.c: fixed xmlNodeGetContent, it was not recursing on child - * parserInternals.[ch]: trying to speed up parsing - * xpath.c : speeded up node set equality op - -Mon Feb 19 19:01:57 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * Makefile.am valid.c list.[ch]: Gary Pennington provided a - better handling of ID/IDREF and the list modules associated - * configure.in: small CFLAGS cleanup - -Mon Feb 19 16:13:22 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * configure.in: fixed iconv detection on AIX (stric) - -Mon Feb 19 10:59:41 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.c: fixed "*" (unbelievable !) and a couple of warnings - -Sun Feb 18 17:52:37 MET 2001 Bjorn Reese <breese@users.sourceforge.net> - - * xpath.c: fixed whitespace handling in xmlXPathStringEvalNumber, - and optimized xmlXPathNodeSetSort - -Sat Feb 17 14:18:42 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.c: bug fix when context size is 0 - * parser.c: I like Norm's Dtd because they still manage to break - the parser occasionally - -Fri Feb 16 14:20:35 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.c: xmlXPathEqualNodeSetFloat the arg is really a double now - -Fri Feb 16 01:10:06 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * tree.[ch] parser.c xpath.c: fixed the problem of addressing - attributes within the XML-1.0 namespace - -Thu Feb 15 16:53:20 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpathInternals.h: exported a few axis functions - * doc/xml.html: updated the doc - -Thu Feb 15 15:57:14 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * configure.in: applied patch from Daniel van Balen for OpenBSD - and bumped version to 2.3.1 - * HTMLtree.c result/HTML/doc3.htm result/HTML/wired.html: the - attempt to find autoclosing was simply broken, removed it, - updated the examples, this is better - -Wed Feb 14 11:35:39 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * hash.[ch]: added Paolo Casarini patch to provide Delete from - hash functionalities. - * doc/html/* : rebuild the doc - -Tue Feb 13 18:01:48 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.c result/XPath/tests/chaptersprefol: bugfixes on order and - on predicate - * HTMLparser.[ch] HTMLtree.c result/HTML/doc3.htm.err - result/HTML/doc3.htm.sax result/HTML/wired.html: sometimes one - really want to have tags closed on output even if we accept - unclosed ones on input - -Mon Feb 12 18:33:20 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.c: ouch don't free NULL, rare case fixed - * tree.c: don't coalesce text nodes if they don't have the - same behaviour wrt escaping on output - -Sun Feb 11 21:15:41 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.c: small fixup - * SAX.c: don't warn on empty namespaces. - -Thu Feb 8 11:28:58 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * README: a bit of cleanup - * configure.in: preparing for 2.3.0 release - -Thu Feb 8 10:37:00 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * hash.[ch]: added a first version of xmlHashSize() - * valid.c: another bug fix from Gary Pennington - -Wed Feb 7 19:22:37 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * valid.c: couple of bug fixes pointed by Gary Pennington - * HTMLtree.c: #if 0 cleanup - -Tue Feb 6 14:02:56 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.c: started profiling XSLT, added xmlXPathNodeSetAddUnique() - which removes a time consuming check of xmlXPathNodeSetAdd() - and use it in places where we are sure to not break unicity - -Mon Feb 5 18:51:36 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.c: bug fixes found from XSLT - * tree.c: preserve node->name special values when copying nodes. - * parserInternals.[ch] parser.[ch] SAX.c : added a mode where - external subset are fetched when available but without full - validation. Added xmlLoadExtDtdDefaultValue, need a function. - * HTMLtree.c: add support for xmlStringTextNoenc for XSLt HTML - output with encoding disabled. - -Sat Feb 3 09:50:29 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xmliO.c: Harry Blundell pointed out that xmlCheckFilename - xmlCheckFilename should not be called from xmlFileOpenW - and xmlGzfileOpenW - -Fri Feb 2 18:04:35 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * uri.c: rewrite of xmlNormalizeURIPath from Paul D. Smith - * test/URI/smith.uri result/URI/smith.uri Makefile.am: - added the new tests for URI normalization - * testURI.c: fixed stoopid bugs - * result/VC/OneID3 result/VC/UniqueElementTypeDeclaration: - the URI in the error messages are now properly normalized - -Fri Feb 2 09:18:53 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * uri.c: applied Marc Sanfacon's patch for xmlNormalizeURIPath - -Thu Feb 1 05:28:55 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.c: fixed a number of problems in XPATH_XSLT_TREE processing - -Wed Jan 31 21:45:37 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.c: fixed mod operator - -Wed Jan 31 16:50:42 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * parser.c: fixed xmlStrcat doc - * tree.c: 2 fixes form Anders Carlson for copying nodes and - trees. - -Wed Jan 31 14:19:16 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.c result/XPath/tests/chaptersbase - result/XPath/tests/simplebase: fixed XPath node() - * tree.c: small fix in xmlNewNs() - * Makefile.am: removed extraneous xml2Conf.sh rule - -Sun Jan 28 08:37:03 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * Makefile.am configure.in libxml.spec.in example/Makefile.am: - Changed the library name, in order to get libxml-devel and - libxml2-devel to coexist on a single system - * xml-config.1 xml-config.in xmlConf.sh.in: renamed - * xml2-config.1 xml2-config.in xml2Conf.sh.in: new files - -Sat Jan 27 19:58:22 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * Makefile.am configure.in libxml-2.0.pc.in: started working on getting - libxml2-devel installable in // as libxml-devel. - -Sat Jan 27 18:49:02 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * doc/Makefile.am: fixed make rebuild in doc - * doc/html/*.html: rebuilt the docs - -Fri Jan 26 10:30:58 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * tree.c: patch from Bjorn Reese on xmlBufferCCat - -Thu Jan 25 19:22:25 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * Makefile.am doc/Makefile.am libxml.spec.in: painful work to get - the HTML doc to go into the -devel RPM ... - * aclocal.m4 config.h.in: some updates due to auto* magic - -Thu Jan 25 19:11:49 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.h: added a hook in the context structure allowing to - link to extra support, needed for XSLT - -Thu Jan 25 13:34:11 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.[ch] xpointer.c: added xmlXPathCmpNodes, changed - xmlXPtrCmpPoints to use it. - * propagated the following patch from Alejandro Forero - * include/win32config.h xmlIO.c: applied further suggestions - from Igor Zlatkovic <igorz@dialup.nacamar.de> and cleanup - * example/gjobread.c: fixed warnings, now that it builds - -Wed Jan 24 20:27:28 COT 2001 Alejandro Forero <bachue@bachue.com> - - * xmlIO.c (xmlFileOpen, xmlFileOpenW): Removed unnecessary checks. - - * xmlIO.c (xmlCheckFilename): Function added to know whether a given - filename points to a valid file (not a directory). - * xmlIO.c (xmlFileOpen, xmlFileOpenW, xmlGzfileOpen, xmlGzfileOpenW): - Added calls to xmlCheckFilenameDir. - - * xmlIO.c (xmlGzfileOpen, xmlGzfileOpenW, xmlFdOpen, xmlFdOpenW): Pass - `path' (rather than `filename') as the parameter to gzopen and open. - -Tue Jan 23 16:26:30 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * Makefile.am: fixed a problem with EXTRA_DIST - -Mon Jan 22 23:42:17 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * Makefile.am example/Makefile.am: finally found the trick - to build the example, i.e. add "." in SUBDIRS before example - in the list <grin/> - -Mon Jan 22 16:30:37 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * doc/xml.html: updated with an XSLT section, removed pointer to - W3C CVS base. - -Mon Jan 22 11:43:21 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.c: when copying a XSLT tree object the tree need to be copied - too, and deallocation need to occur the same way. - -Mon Jan 22 10:35:40 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpathInternals.h xpath.[ch] debugXML.c: added the XPATH_XSLT_TREE - type corresponding to an XSLT result tree fragment. Share most - of the data format with node set, as well as operators. - * HTMLtree.c: added a newline at the end of the doctype output - whe this one is not present initially. - * tree.c: make sure that the parent and doc pointers are properly - set when copying attributes (lists). - -Sun Jan 21 10:47:38 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * htmlTree.[ch] xmlIO.h: exported htmlDocContentDumpOutput - -Fri Jan 19 18:15:50 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.c: seems I finally killed that ugly path evaluation - context bug (tagged 9999 in case is is wrong) - -Fri Jan 19 06:30:38 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.[ch] xpathInternals.h: added xmlXPathRegisterVariableLookup() - for XSLT - -Thu Jan 18 16:19:47 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xmlIO.c: Gary Pennington <Gary.Pennington@uk.sun.com> fix - for xmlGzfileOpen() bug - -Thu Jan 18 13:11:50 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.c: removed an error found by XSLT usage - * tree.c parserInternals.h: use a predefined static string - for text and comment nodes, avoid freeing them in xmlFreeNode, - exported the string name in parserInternals.h and added - another value to disable encoding at output (for XSLT), - gain memory, time. - -Wed Jan 17 09:15:16 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * win32/README.MSDev win32/libxml2/libxml2_a.dsp - win32/libxml2/libxml2_so.dsp: new makefiles and update - provided by Igor Zlatkovic <igor@stud.fh-frankfurt.de> - -Tue Jan 16 18:24:46 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * tree.c : xmlSaveFile, xmlSaveFileEnc, applied patch from - Gary Pennington - -Mon Jan 15 20:24:18 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xpath.c: fixed the comaprision of values and nodelists, - need to compare nodelist still ... - * debugXML.c: avoided a possible core dump - * HTMLparser.c: cleanup - * nanohttp.c: contributed fix. - * tree.c: fixes in properties handling added xmlSetNsProp - needed by libxslt - * xpathInternals.h: exported xmlXPathBooleanFunction, added a - comment - * TODO: updated - -Sat Jan 6 22:05:09 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * parser.c parserInternals.c: applied Bjorn Reese optimization - patch - -Sat Jan 6 19:13:27 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * Makefile.am: applied patch for make check from Martin Vidner - -Thu Jan 4 19:07:49 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * configure.in: preparing 2.2.11 - * doc/html/*: rebuild the HTML files - * doc/xml.html : updated - -Thu Jan 4 14:09:58 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * tree.c: fixed a stupid bug - * valid.c: applied "Paul D. Smith" <pausmith@nortelnetworks.com> - patches related to validation of an XInclude processing result - * TODO: updated - -Thu Jan 4 11:46:40 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * encoding.c xmlIO.c: Fixing the problem reported by Marc Sanfacon - on large files - -Wed Jan 3 21:51:13 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xmlIO.c: fixed xmlParserInputBufferCreateMem doc - -Wed Jan 3 18:56:00 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * HTMLparser.c: htmlCheckParagraph to check htmlOmittedDefaultValue, - reported by Jonas Borgström - * nanohttp.c: Applied Bjorn Reese' IPV6 first patch - -Wed Jan 3 16:19:39 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * testXPath.c xpath.c: fixing the XPath union expressions problem - reported by Martin Vidner <martin@artax.karlin.mff.cuni.cz> - -Wed Jan 3 14:22:33 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> - - * xmllint.c: Made is so if the file name is "-" is will read form - standard input. Sven Heinicke <sven@zen.org> - * tree.c: fixed a problem when growing buffer - * tree.h: fixed the comment of the node types following andersca - comment - * TODO: updated - -Wed Dec 27 12:35:49 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * HTMLparser.[ch]: added a way to avoid adding automatically - omitted tags. htmlHandleOmittedElem() allows to change the - default handling. - * tree.[ch] xmllint.c: added xmlDocDumpFormatMemory() and - xmlDocDumpFormatMemoryEnc(), uses memory functions for output - of xmllint too when using --memory flag, added a memory test - suite at the Makefile level. - * xpathInternals.h xpath.[ch] xpointer.c: fixed problems - with namespace use when encountering QNames in XPath evaluation, - added xmlns() scheme in XPointer. - * nanoftp.c : incorporated a fix - * parser.c xmlIO.c: fixed problems raised with encoding when using - the memory I/O - * parserInternals.c: closed bug 25934 reported by - torsten.landschoff@innominate.de - * TODO: updated - -Sat Nov 25 11:46:27 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * configure.in doc/html/* doc/xml.html: made a 2.2.9 release - on a non-updated tree :-(, made a 2.2.10 release to correct the - situation - -Sat Nov 25 10:41:37 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * nanohttp.c parser.[ch] tree.[ch] xmlIO.[ch] xmllint.c xpath.c - parserInternals.h vms/build_libxml.com vms/config.vms Makefile.am: - integrated a set of OpenVMS changes from Howard Taylor - <Howard.Taylor@pacoast.com> - -Sat Nov 25 01:21:01 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * tree.[ch] xmlIO.c: added xmlDocDumpMemoryEnc() from John Kroll - * error.c: applied fix suggested by "Leo Davidson" <leo@ox.compsoc.net> - -Sat Nov 25 00:24:49 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * HTMLparser.c: some fixes on auto-open of html/head/body - * encoding.c: fixed a compilation error on some gcc env - * xpath.c xpointer.[ch] xpathInternals.h: improved the - XPointer implementation - * test/XPath/xptr/strpoint test/XPath/xptr/strrange3: added - related XPointer tests and associated results - -Fri Nov 24 14:01:44 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * doc/xmldtd.html doc/xml.html: following a short step by step - guidance on IRC to help maciej with DTDs I started a small - page on the subject. - -Fri Nov 17 17:28:06 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * HTMLparser.c: fixed handling of broken charrefs - * xmlmemory.h libxml2.dsp include/win32config.h: reporting Windows - patches - -Mon Nov 13 19:17:20 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * doc/xml.html doc/html/* : rebuilt the docs after adding - xinclude and updated page for 2.2.7 and 2.2.8 - * configure.in: releasing 2.2.8 - -Mon Nov 13 12:39:38 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * parser.[ch] parserInternals.c: applied the conditional - section processing fix from Jonathan P Springer - <jonathan.springer2@gte.net> - * xmlversion.h.in win32/libxml2/libxml2.dsp : Updated MS - project file, fixed iconv default non support - * xpath.c: fixed the problem of evaluating relative expressions - when a node context is provided. - -Sun Nov 12 16:31:19 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * nanoftp.c: fixed gcc 2.95 new warnings - * SAX.c: fixed a stupid bug - * tree.c: fixed a formatting problem when round-tripping - from/to memory - * xinclude.c: chased memleak, fixed a base problem - * xpointer.c: added xmlXPtrBuildRangeNodeList(), finished ? - xmlXPtrBuildNodeList() - * TODO: updated - * Makefile.am test/XInclude/docs test/XInclude/ents result/XInclude: - adding a first small set of regression tests for XInclude - -Tue Nov 7 15:11:34 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * nanohttp.[ch]: applied Wayne Davison patches to access - the WWW-Authorization header. - * parser.c: Closed Bug#30847: Problems when switching encoding - in short files by applying Simon Berg's patch. - * valid.c: fixed a validation problem - * hash.c parser.h parserInternals.h testHTML.c testSAX.c tree.h - xmlerror.h xmlmemory.h xmlversion.h.in: applied a DLL patch from - Wayne Davison - * xpointer.[ch]: added first version of xmlXPtrBuildNodeList() - need to be extended to non full nodes selections. - * xinclude.c: starts to work decently - -Mon Nov 6 17:22:46 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * tree.[ch] xinclude.[ch] xmllint.c configure.in valid.c - debugXML.c xmlversion.h.in: Started adding XInclude support, - this is a new xmllint option - * tree.c xpath.c: applied TOM patches for XPath - * xpointer.c: fixed a couple of errors. - * uri.c: added an escaping function needed for xinclude - * testXPath.c hash.c HTMLtree.c: minor cleanups raised by - new warning from RH70 gcc's version - -Tue Oct 31 14:14:13 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * HTMLparser.c: fixed loop on invalid char in scripts - * parser.c: update to description of xmlIOParseDTD() - * libxml.m4 xmlversion.h.in: changes contributed by - Michael Schmeing <m.schmeing@internet-factory.de> - * configure.in: preparing for 2.2.7 - * Makefile.am: trying to avoid config.h and acconfig.h - being included in the distrib - * configure.in: released 2.2.7 - -Mon Oct 30 17:08:10 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * tree.[ch] debugXML.c parserInternals.c xpath.c: Deprecated Pi's - like namespaces for good. Unified xmlNs and xmlNode somewhat. - -Mon Oct 30 16:26:49 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * parser.[ch]: added xmlIOParseDTD() - * xpointer.c: added support for the 2 extra parameters of - string-range, fixed a stoopid error when '0' was present - in XPointer expressions - * test/XPath/xptr/strrange2 result/XPath/xptr/strrange2: added - testsuite for the above - -Mon Oct 30 10:26:43 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * libxml.spec.in: improved package descriptions - -Sun Oct 29 19:03:11 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * xpath.c xpathInternals.h: applied a large cleaning patch - from TOM <ptittom@free.fr>, it also add namespace support - for function and variables registration. - -Sun Oct 29 18:51:46 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * uri.c: Wayne Davison's patch fixing xmlBuildURI() - * Makefile.mingw: Wayne Davison's update adding hash.c - -Sun Oct 29 18:38:12 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * xpath.c: fixed the root evaluation problems - * HTMLparser.c result/HTML/doc3.htm: fixed the problem of non - ignorable spaces with <b> <bold> <em> - * tree.c: fixed a loop in xmlSearchNsByHref() - -Fri Oct 27 18:57:32 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * xpath.c: applied another XPath patch from TOM - * xpath.c include/makefile.am: applied another patch from - china@thewrittenword.com (cleanup on IRIX). - -Fri Oct 27 13:45:28 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * xml-config.1: received a fixed version from Fredrik Hallenberg - <hallon@lysator.liu.se> - -Thu Oct 26 16:05:25 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * xpath.c textXPath.c xpathInternals.h: applied TOM <ptittom@free.fr> - cleanup patch for XPath - -Wed Oct 25 21:31:10 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * patched to redirrect all "out of context" error messages to - a reconfigurable routine. The changes are: - * xmlerror.h : added the export of an error context type (void *) - an error handler type xmlGenericErrorFunc there is an interface - xmlSetGenericErrorFunc(void *ctx, xmlGenericErrorFunc handler); - to reset the error handling routine and its argument - (by default it's equivalent to respectively fprintf and stderr. - * all the c files: all wild accesses to stderr or stdout within - the library have been replaced to calls to the handler. - -Wed Oct 25 15:27:19 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * configure.in: release 2.2.6 - * xpath.[ch] xpointer.c xpathInternals.h: added xpathInternals.h - exporting the inner functions of xpath for extension modules - * doc/*: updated and rebuilt the doc - -Wed Oct 25 12:48:55 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * nanohttp.c : applied Wayne HTTP cleanup patch - * tree.[ch]: applied TOM <ptittom@free.fr> for xmlNodeSetBase() - and xmlNodeSetSpacePreserve() - -Wed Oct 25 12:11:03 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * xpath.c: closing bug #29260 - -Tue Oct 24 18:49:34 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * hash.[ch] debugXML.c: expanded/enhanced the API, added - multikey tuples, made hash structure opaque - * valid.[ch]: moved elements, attributes, notations decalarations - as well as ID and refs to hash tables. - * entities.c: hash cleanup - * xmlmemory.c: fixed a dump problem in debug mode - * include/Makefile.am: problem passing in DESTDIR= values patch - from Marc Christensen <marc@calderasystems.com> - * nanohttp.c: removed debugging remains - * HTMLparser.c: the bogus tag should be ignored (Wayne) - * HTMLparser.c parser.c: fixing a number of problems with the - macros in the *parser.c files (Wayne). - * HTMLparser.c: close the previous option when opening a new one - (Marc Sanfacon). - * result/HTML/*: updated the HTML results accordingly - -Sun Oct 22 18:39:19 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * entities.[ch] xpath.[ch] hash.[ch] debugXML.c tree.h: added/hacked - hash tables from Bjorn Reese <breese@mail1.stofanet.dk>. Switched - XPath functions and XML entities table to them. More to come... - * xmlIO.c: fixed libxml closing FILEs it didn't open. - -Sun Oct 22 13:59:50 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * tree.c: coalesce adjacent text nodes - * valid.c: handling of blank nodes in DTd validation (raised - by problems with a posteriori validation). - * nanohttp.c: changing behaviour on HTTP write stuff. - * HTMLtree.c: forced body and html to be explicitly closed. - * xpath.h: exported more XPath functions. - -Sun Oct 15 22:28:32 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * Release of 2.2.5 - * xpointer.c: range() range-inside and other helper functions - * parserInternals.c: fixed perf problem raised by rolf@pointsman.de - -Sun Oct 15 16:21:27 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * SAX.c: HTML attributes need normalization too (Bjorn Reese) - * HTMLparser.[ch]: added htmlIsScriptAttribute() - -Sun Oct 15 13:18:36 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * doc/*: rebuilt docs preparing for 2.2.5 release, added URI - and XPointer modules - -Sun Oct 15 12:13:30 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * SAX.h: closed #25107 - -Sun Oct 15 12:06:16 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * testSAX.c: fixed problem with cdata reporting - * SAXresult/* : updated - -Sun Oct 15 12:00:24 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * parser.c test/wap.xml result/noent/wap.xml result/wap.xml: - Closed bug #27499, added to regression tests - * TODO: updated - -Sun Oct 15 01:34:37 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * HTMLparser.c HTMLtree.[ch] SAX.c testHTML.c tree.c: fixed HTML - support for SCRIPT and STYLE with help from Bjorn Reese - * test/HTML/* result/HTML/*: added simple testcase and updated - the existing ones. - -Fri Oct 13 18:24:31 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * xpath.c xpointer.c: XPointer reorder of ranges start/end and - string-range for empty strings - * test/XPath/docs/str test/XPath/xptr/chaptersrange - test/XPath/xptr/strrange: augmented the XPointer testsuite - -Fri Oct 13 12:21:48 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * doc/xml.html doc/xmlmem.html: added a module describing memory - interfaces and use, updated the main page. - -Fri Oct 13 01:23:48 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * nanoftp.c nanohttp.c xmlIO.c: Wayne Davison Win32 patch - nanoftp code work on Windows too now - -Fri Oct 13 00:54:37 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * testXPath.c xpath.[ch]: moved some debug functions to xpath core - * xpointer.c: implemented string-range() at least a good first version - * test/XPath/docs/str test/XPath/xptr/strrange - result/XPath/xptr/strrange: the string-range() tests - -Thu Oct 12 10:02:59 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * Makefile.am include/Makefile.am include/win32config.h - win32/Makefile.mingw: fixed problems reported by Wayne Davison - and make distcheck - -Thu Oct 12 01:44:08 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * nanohttp.c: added xmlNanoHTTPTimeout(int delay), removed a bug - xmlNanoHTTPMethod on input MimeType Tony Lam <Tony.Lam@eng.sun.com> - * xpointer.c: slight extension of xmlXPtrLocationSetMerge - -Thu Oct 12 01:37:53 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * config.h.in configure.in nanoftp.c nanohttp.c xmlversion.h.in : - patch for socklen_t detection by - Albert Chin-A-Young <china@thewrittenword.com> - -Wed Oct 11 17:53:57 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * tree.c valid.c xmllint.c: Fixed a few postvalidation bugs - and added a --dtdvalid option to xmllint used to test it - -Wed Oct 11 15:01:29 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * xml-config.1 Makefile.am libxml.spec.in: adding a man page for - xml-config by Fredrik Hallenberg <hallon@lysator.liu.se> - -Wed Oct 11 12:41:30 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * xpath.[ch] xpointer.[ch]: worked on XPath functions and variable - handlings (registration, lookup, cleanup) - -Wed Oct 11 01:46:44 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * configure.in Makefile.am include/makefile.am: adding XPointer - and XPtrtests target - * xpointer.[ch] : new files for XPointer support - * test/XPath/xptr result/XPath/xptr: added XPointer testsuite and - more XPath tests - -Wed Oct 11 01:23:25 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * configure.in: fixed, very broken, make distcheck works again - -Wed Oct 11 02:53:10 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * More work toward 2.2.5, integrated a number of patches - * configure.in Makefile.am win32config.h.in: trying to cleanup - make distcheck .... huh ... - * include/Makefile.am include/win32config.h: new directory - for includes - * win32/Makefile.mingw win32/README.MSDev win32/libxml2/libxml2.dsp - updated the makefiles and instructions for WIN32 - * xpath.c: small fixes - * test/XPath/ results/XPath: updated the testcases and results - * HTMLparser.c nanohttp.c testXPath.c: incorporated provided or - suggested patches - * valid.c: fixed an ID bug - -Mon Oct 9 14:28:56 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * moved xml-error.h to xmlerror.h: seems this allowed to bypass - the automake bug where wrong dependencies were generated. - * xpath.[ch]: worked on XPointer - -Fri Oct 6 12:58:04 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * configure.in Makefile.am: 2.2.5, ship the include in an - include/libxml subdirectory, use symlinks when using CVS - * testSAX.c: fixed small bug - * testXPath.c: changed the way testfiles are parsed - * debugXML.c: same kind of cleanup when parsing an argument expression - XPath/XPointers can have blanks embedded - * xpath.[ch]: more cleanup, reorgs for XPointer work - * parserInternals.c parser.c HTMLparser.c: fixed wrong include - * win32/README.MSDev win32/libxml2/libxml2.dsp: Windows stuff - -Thu Oct 5 18:13:15 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * debugXML.c testXPath.c xpath.[ch]: got pissed by some nastiness - in the XPath engine, rewrote large parts of it, now it's far - cleaner and in sync with the REC not an old WD. Fixed a parsing - problem in the interactive XML shell found when testing XPath. - -Wed Oct 4 15:25:53 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * debugXML.c testXPath.c xpath.[ch]: More work on XPath/Xpointer, - incorporated "(TOM)" <ptittom@free.fr> patches rebuilt the XPath - examples with the extra test - -Wed Oct 4 14:39:01 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * parser.c xmlIO.c xmlIO.h: fixed bug 26650, and improved - the global init function. - -Tue Oct 3 11:28:52 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * HTMLparser.c: Doohhh, attribute name parsing was still case - sensitive ! Fixed this ... - * result/HTML/* : updated the tests results accordingly - -Mon Oct 2 23:47:32 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * xpath.[ch] debugXML.c testXPath.c: fixed the XPath evaluation - engine, should be far more stable, incorporated a new version of - preceding/following axis, need testing - * uri.c: fixed file:///c:/a/b/c problem - * test/XPath/tests/idsimple: augmented the XPath tests - -Sun Oct 1 22:33:00 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * doc/* rebuilding docs for 2.2.4 release - -Sun Oct 1 22:16:33 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * configure.in: releasing 2.2.4 - * parser.[ch]: added xmlStrEqual() - * HTMLparser.c HTMLtree.c SAX.c debugXML.c entities.c parser.c - tree.c valid.c xlink.c xpath.c: converted all !xmlStrcmp to - use xmlStrEqual instead - * TODO: updated - * added an XPath test - -Sun Oct 1 20:19:39 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * HTMLparser.c: fixed htmlStartCloseIndexinitialized init - * entities.h: exported xmlInitializePredefinedEntities - * parser.[ch] : added xmlInitParser() - * parserInternals.h : had to export htmlInitAutoClose() - -Sun Oct 1 16:28:22 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * xpath.[ch] : fixed some serious XPath Predicate evaluation - problems - * Makefile.am : added XPath regression tests to normal tests - * uri.c: fixed a problem with local paths, cleanup - * parser.c: fixed a problem with large CData sections - -Sat Sep 30 16:35:54 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * configure.in xml-config.in: patch from "Ben Taylor" - <sol7x86@hotmail.com> for solaris shared libs lookup - -2000-09-30 Martin Baulig <baulig@suse.de> - - * libxml-2.0.pc.in: Provide pkg-config script. - - * configure.in: Create the libxml-2.0.pc script from the - libxml-2.0.pc.in templates. - * Makefile.am (pkgconfig_DATA): Install the libxml-2.0.pc - script in `$(libdir)/pkgconfig'. - -Mon Sep 25 16:23:41 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * HTMLparser.c parser.c tree.c tree.h: Avoiding a few warning - when compiling with MSC - -Sun Sep 24 20:32:52 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * xpath.c: patch for normalize-string() substring-before(), - substring-after() and translate() functions from Bjorn Reese - <breese@mail1.stofanet.dk> - * libxml.m4 Makefile.am: added libxml.m4 from Debian ? - Fredrik Hallenberg <hallon@lysator.liu.se> - * TODO: updated - -Sun Sep 24 10:00:49 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * xmlversion.h.in nanoftp.c nanohttp.c: traying to work out the - problem of socklen_t being undefined on a number of platforms - * debugXML.c: fixed a compilation problem when without snprintf - -Sat Sep 23 12:19:45 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * HTMLparser.c uri.c: Another patch from Wayne Davison, correcting - an URI bug and a fix for the control-character-induced infinite loop - * nanohttp.c: preventive fix for compiling on WIN32 - -Fri Sep 22 18:06:08 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * xmlint.c: closing bug #25000 - -Fri Sep 22 14:17:53 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * xmlIO.h tree.h: made xmlNodeDump() and xmlNodeDumpOutput() public - * parser.[ch] nanohttp.c HTMLtree.c HTMLparser.c tree.c: applied and - modified slightly Wayne Davison patch adding xmlStrcasecmp and - related function, fixing xmlStrncmp(), and associated cleanup - * result/HTML/entities.html.sax: updating result - -Tue Sep 19 14:20:10 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * uri.c: applied patch for URI escaping from Wayne Davison - <wayned@blorf.net> - * tree.c parserInternals.c HTMLparser.c: memset checks patches - from Denis Barbier <barbier@imacs.polytechnique.fr> - * HTMLparser.c: UTF8 characters in HTML tag-attribute values - patch from Wayne Davison - -Sun Sep 17 18:37:03 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * doc/xml.html : updated with new releases, adding "how to help" - -Sun Sep 17 17:58:37 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * SAX.c debugXML.c parser.c parserInternals.c tree.c valid.c xpath.c: - removed a few warnings in pedantic mode ... - * parserInternals.c parser.c: moved encoding switching function - to parserInternals.c - * configure.in, doc/Makefile.am libxml.spec.in: released 2.2.3 - -Sat Sep 16 20:12:41 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * HTMLparser.c parser.c: set ctxt->errNo before calling the - error or warning handlers - -Wed Sep 13 22:03:18 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * parserInternals.c parserInternals.h parser.c Makefile.am: - created a new module parserInternals.c, moved most of the - code shared by the various parsers there, as well as - deprecated code from parser.c. More cleanup of parser.c - * uri.c: fixed a problem when URI is NULL - * valid.c: speedup when looking for an attribute declaration - -Sun Sep 10 17:53:48 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * uri.c tree.c SAX.c parser.c entities.c debugXML.c: finished - the cleanup of the computation of URI references when seeking - external entities. The URI reference string and the resulting - URI are both stored now. - * parser.c HTMLparser.c valid.c nanoftp.c nanohttp.c xpath.c: - large s(n)printf checks and cleanup from Denis Barbier - <barbier@imacs.polytechnique.fr> - * xmlversion.h.in tree.h: couple of SGML declarations for a - possible docbook module. - * result/VC/ : a couple of test output changed due to the change - of the entities URI - -Sun Sep 10 15:59:58 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * parser.h: added a _private field for linking user's data - -Sun Sep 10 15:14:43 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * parser.c parserInternals.h: demacroified most of the IS_XXX - the gain in size is significant so ... - -Fri Sep 8 20:48:29 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * entities.c: cases where looking up entities with doc==NULL - covered - -Tue Sep 5 12:41:15 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * uri.c: applied Wayne Davison patch - * Makefile.in test/URI/uri.data result/URI/uri.data: updated URI tests - -Mon Sep 4 13:01:45 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * uri.c testUri.c: applied Wayne Davison patches - * test/URI/uri.data result/URI/uri.data: first set of tests/results - * Makefile.in: added URItest and included thenin "make tests" - -Sun Sep 3 19:19:29 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * xmlversion.h.in: closed bug 22941 - -Thu Aug 31 16:55:55 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * doc/xmlio.html: added doc and example for entity loader - redefinition. - -Thu Aug 31 14:59:28 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * doc/xmlio.html doc/xml.html: added a doc on the I/O mechanism - used by libxml - -Tue Aug 29 20:22:53 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * parser.c: Fixed bug on invalid ontent characters and when using - push. - * xmllint.c: fixed xmllint endling of errors in push mode - -Tue Aug 29 11:24:48 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * HTMLparser.c testHTML.c: applied two new patches from - Wayne Davison <wayned@users.sourceforge.net> - * result/HTML/*.sax: regenerated HTML SAX output - * parser.c: more cleanup. - -Mon Aug 28 11:58:12 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * HTMLparser.[ch] testHTML.c: applied the second set of - patches from Wayne Davison <wayned@users.sourceforge.net>, - adding htmlEncodeEntities() - * HTMLparser.c: fixed an ignorable white space detection bug - occurring when parsing with SAX only - * result/HTML/*.sax: updated since the output is now HTML - encoded... - -Mon Aug 28 00:38:31 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * HTMLparser.[ch]: applied some of Wayne Davison - <wayned@users.sourceforge.net> patches - -Sun Aug 27 22:14:01 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * SAX.c tree.c debugXML.c: fixed bogus behaviour when an - undeclared namespace prefix was used, added a warning. - Cleaned up support w.r.t. entities, spilling out a warning - and being pedantic on lookups. - * test/warning/ent9 : added testcase for previous example. - * TODO: updated - * parserInternals.h parser.c: changed the way names are parsed - now allow infinite size and decrease penalty for normal use - * parser.c: Started a big cleanup/check of the parser code, - fixed some of the most tortuous entity code, spotted code - unused anymore - * test/*: added tests for very long names and related nasty - things. - -Sat Aug 26 23:31:04 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * doc/encoding.html: added encoding aliases doc - * doc/xml.html: updates - * encoding.[ch]: added EncodingAliases functions - * entities.[ch] valid.[ch] debugXML.c: removed two serious - bottleneck affecting large DTDs like Docbook - * parser.[ch] xmllint.c: added a pedantic option, will be - useful - * SAX.c: redefinition of entities is reported in pedantic mode - * testHTML.c: uninitialized warning from gcc - * uri.c: fixed a couple of bugs - * TODO: added issue raised by Michael - -Wed Aug 23 01:50:51 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * doc/encoding.html: propagated Martin Duerst suggestions - -Wed Aug 23 00:23:41 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * parser.c: Fixed Bug#21552: libxml fails to decode & - * uri.c testUri.c patches, by Marc Sanfacon (1 left) - * parser.c HTMLparser.c: HTML/encoding push problems reportedi - by Wayne Davison - -Sun Aug 20 17:03:38 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * nanoftp.c nanohttp.c: small cleanup - * TODO: updated - -Sat Aug 19 22:57:02 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * added an old VC testcase and updated title.xml entity - -Sat Aug 19 21:02:08 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * HTMLparser.c SAX.c tree.c HTMLtree.h result/HTML/*: work - done on auto-opening of <p> tags and cleanup of SAX output - -Sat Aug 19 18:45:40 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * libxml.4 xmllint.1 Makefile.am libxml.spec.in: added man pages - -Sat Aug 19 18:38:53 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * doc/xml.html libxml.* structure.*: updated the doc a bit - -Thu Aug 17 15:50:00 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * testSAX.c testHTML.c result/HTML/: cleanup of the output - of SAX tests - -Mon Aug 14 13:56:33 EDT 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * Patch from Albert Chin-A-Young <china@thewrittenword.com>: - * xmllint.c: workaround a MAP_FAILEd definition bug in DU-4.0 - -Mon Aug 14 11:10:20 EDT 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * Patch from Dave Yearke <yearke@eng.buffalo.edu>: - * testHTML.c: fix core dump on Solaris 2.x systems - * HTMLparser.c: fix segfault if ctxt->sax->characters() is NULL - * result/HTML/*.sax: previous bug fix lead to new results - -Mon Aug 14 10:26:09 EDT 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * Patch from Albert Chin-A-Young <china@thewrittenword.com>: - * configure.in: added --with-readline=DIR to accept alternate - path for readline include/library - * configure.in: added AM_C_PROTOTYPES to add -Aa -D_HPUX_SOURCE - for ANSI under HP-UX - * config.in: Removed @LIBS@ from xml-config because @XML_LIBS@ - includes @LIBS@ - -Sat Aug 12 23:19:42 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * doc/* : rebuilt the docs - * getting ready for 2.2.2 release - -Sat Aug 12 16:42:37 EDT 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * parser.[ch]: added xmlGetFeaturesList() xmlGetFeature() - and xmlAddFeature() - * tree.[ch]: added xmlAddChildList() - * xmllint.c: MAP_FAILED macro test - * parser.h: added xmlParseCtxtExternalEntity() - * valid.c: applied bug fixes removed warning - * tree.c: added CDATA block to elements content - * testSAX.c: cleanup of output - * testHTML.c: added SAX testing - * encoding.c: better error recovery - * SAX.c, parser.c: fixed one of the external entity processing - of the OASis testsuite - * Makefile.am: added HTML SAX regression tests - * configure.in: bumped to 2.2.2 - * test/HTML/ result/HTML: added a few of HTML tests, and added the - SAX results - -Fri Aug 4 11:21:50 PDT 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * configure.in: patch for HP compiler - -2000-08-04 Sven Heinicke <sven@zen.org> - - * xmllint.c: Was coredumping sometimes when the file given didn't - exist. - -Sat Jul 22 05:59:05 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * parser.c xmlIO.[ch]: fixed the problem of encoding support - - when using in memory parsing. Need some cleanup. - * xmllint.c configure.in: added a --memory flag to test memory - parsing - -Fri Jul 21 17:09:57 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * nanohttp.c: fixed socklen_t replacement to unsigned int - * parser.c: fixed a space handdling missing at the end of - production 28 DOCTYPE. - * xmlmemory.c: fixed a stupid bug on the routine to override - allocation functions - * TODO: updated - -Fri Jul 14 17:01:14 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * doc/ regenerated the docs - -Fri Jul 14 16:12:20 MEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * doc/encoding.html doc/xml.html: added I18N doc - * encoding.[ch] HTMLtree.[ch] parser.c HTMLparser.c: I18N encoding - improvements, both parser and filters, added ASCII & HTML, - fixed the ISO-Latin-1 one - * xmllint.c testHTML.c: added/made visible --encode - * debugXML.c : cleanup - * most .c files: applied patches due to warning on Windows and - when using Sun Pro cc compiler - * xpath.c : cleanup memleaks - * nanoftp.c : added a TESTING preprocessor flag for standalong - compile so that people can report bugs more easily - * nanohttp.c : ditched socklen_t which was a portability mess - and replaced it with unsigned int. - * tree.[ch]: added xmlHasProp() - * TODO: updated - * test/ : added more test for entities, NS, encoding, HTML, wap - * configure.in: preparing for 2.2.0 release - -Mon Jul 10 16:17:18 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * nanoftp.c: fixed the way the control connection is handled - * libxml.spec.in: fixed the dependencies and cleanup - -Mon Jul 3 14:37:07 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * doc/xml.html: changed the xmlsoft.org structure, updated the - examples w.r.t. root and childs - -Sun Jul 2 20:51:43 MEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * libxml.spec.in: fixed bug #7419, dependencies fouled for libxml-devel - -Sun Jul 2 09:52:45 MEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * HTMLparser.c: Work on character encoding support for the HTML parser - * HTMLparser.c: Fixed some autoopen/autoclose probs for the HTML parser - * encoding.c: Fixed a potential memleak in the encoding stuff - -Sat Jul 1 13:44:22 MEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * doc/FAQ.html doc/Makefile.am : added a FAQ - -Fri Jun 30 20:29:08 MEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * HTMLparser.c HTMLtree.c SAX.c valid.c tree.h : more cleanup - of the HTML parser to force it to not bypass SAX - -Fri Jun 30 11:19:59 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * win32config.h.in: updated - * xmlversion.h.in: crap forgot to update this, this mean 2.1.0 - lacks iconv support :-( need to release 2.1.1 - * configure.in: release 2.1.1 - * HTMLparser: fixed bug #14784 - * xpath.c HTMLparser.c encoding.c parser.c: fix warning raised - by Windows compiler - * HTMLparser.c SAX.c HTMLtree.h tree.h: create HTML document in - the SAX startDocument() callback. - * TODO: updated - -Thu Jun 29 12:06:48 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * added xmlStopParser() - -Wed Jun 28 23:10:26 MEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * configure.in: 2.1.0 prerelease - * Large resync between W3C and Gnome tree - * nanoftp, nanohttp.c: fixed stalled connections probs - * HTMLtree.c SAX.c : support for attribute without values in - HTML for andersca - * valid.c: Fixed most validation + namespace problems - * HTMLparser.c: start document callback for andersca - * debugXML.c xpath.c: lots of XPath fixups from Picdar Technology - * parser.h, SAX.c: serious speed improvement for large - CDATA blocks - * encoding.[ch] xmlIO.[ch]: Improved seriously saving to - different encoding - * example/Makefile.am example/gjobread.c tree.h: work on - libxml1 libxml2 convergence. - * config.h.in parser.c xmllint.c: added xmlCheckVersion() - and the LIBXML_TEST_VERSION macro - -Fri Jun 23 22:26:07 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * doc/xml.html: various patches and improvements typo fixed by - Felix Natter - * doc/libxml-doc.el: Emacs module to lookup the libxml documentation - from Felix Natter <fnatter@gmx.net> - -Sat May 6 10:09:45 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * doc/upgrade.html: updated with instructions for support of both - libxml-1.x and libxml-2.x - * doc/gjobread.c : applied Todd Dukes <tdukes@ibmoto.com> patch - for 2.x support and also fixed includes - -Wed May 3 14:21:25 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * encoding.[ch], xmlIO.[ch], parser.c, configure.in : revamped - the encoding support, added iconv support, so now libxml if - compiled with iconv automatically support japanese encodings - among others. Work based on initial patch from Yuan-Chen Cheng - I may have broken binary compat in the encoding handler - registration scheme, but that was so utterly broken I don't - expect anybody to have used this feature until now. - * parserInternals.h: fixup on the CHAR range macro - * xml-error.h, parser.c: catch URL/URI errors using the uri.c - code. - * tree.[ch]: added xmlBufferGrow(), was needed for iconv - * uri.c: added xmlParseURI() I can't believe I forgot to - implement this one in 2.0 !!! - * SAX.c: moved doc->encoding update in the endDocument() call. - * TODO: updated. - -Mon Apr 24 13:30:13 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * tree.h: removed extraneous xmlRemoveProp definition - * TODO: added item about --disable-corba configure switch - * tree.c parser.c: fixed problems for xmlCopyDoc and postvalidation - * nanoftp.c: fixed include problems giving troubles on AIX and - slowlaris - * xmlIO.[ch] valid.h tree.[ch] xlink.c xmlmemory.c uri.c - parser.c nanoftp.c nanohttp.c SAX.c testSAX.c : - comment and headers changes to lower gtk-doc number of warnings - * doc/html/*: rebuilt docs - -Sun Apr 16 11:23:29 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * HACKING: documented the tag for 1.x and instructions - -Wed Apr 12 15:47:22 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * xmlIO.[ch] parser.[ch]: More interfaces for new I/O functions - xmlNewIOInputStream, xmlParserInputBufferCreateIO, - xmlCreateIOParserCtxt - * parser.c parserInternals.h: speedup of IS_CHAR like macros, - significant overall improvement - * xmllint.c: added I/O test to xmllint - * testSAX.c: added a speed test - * doc/* : updated/regenerated - -Sat Apr 8 14:54:54 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * xpath.c uri.h parserInternals.h: cosmetic changes from - "Timur I. Bakeyev" <timur@bat.ru>, including making - xmlCreateURI() public - -Fri Apr 7 18:35:02 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * xmlIO.[ch] parser.c: cleane up the xmlParserInputBuffer mess - and the code at the same time. Added a clean mechanism for - overload or added input methods: xmlRegisterInputCallbacks() - * tree.c: fixed xmlPrevSibling and xmlNextSibling per - Christophe Le Gal (Christophe.Le-Gal@imag.fr) input - * TODO: updated - * doc/* : updated/regenerated - * doc/Makefile.am: tweaks to avoid problem with libxml link in the - source dir - -Wed Apr 5 21:11:35 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * testURI.c: yet another forgotten commit, I should get some sleep ! - -Wed Apr 5 20:36:46 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * xmllint.c: forgot to commit this too ? - -Wed Apr 5 16:22:44 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * xmlversion.h.in : forgot to commit this previously - -Mon Apr 3 21:47:10 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * configure.in: preparing libxml-2.0.0 version looks Ok so far - * README TODO: updated for release - * uri.c uri.h: added authority parsing/saving - * uri.c testURI.c Makefile.am: moved the testing code to testURI.c - * xmlversion.h.in configure.in nanoftp.[ch] nanohttp.[ch] encoding.h - debugXML.[ch] xpath.[ch] xmlIO.c tester.c testXPath.c testHTML.c - tree.c HTMLtree.c HTMLparser.c tree.c tree.h parser.c - Makefile.am : added compile-time customization of libxml - --with-ftp --with-http --with-html --with-xpath --with-debug - --with-mem-debug - * *.[ch] autoconf.sh : moved to an absolute addressing of includes : - #include <libxml/xxx.h> I hope it won't break too much stuff - and will be manageable in the future... - * xmllint.c Makefile.am libxml.spec.in : renamed tester.c to xmllint.c - and added xmllint to the installed programs - * uri.h: added xmlFreeURI() - -Fri Mar 24 14:35:21 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * uri.c uri.h: finished the escaping handling, the base support - and the URI path normalization. Looks good just lacks the - authority content parsing code. - * Makefile.am: added instructions to generate testURI - * TODO: updated - * doc/xml.html, doc/smallfootonly.gif doc/w3c.png: updated, - added links and icons for W3C and Gnome - -Mon Mar 20 14:05:26 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * xmlmemory.[ch] : seems I forgot to actually update the files in - the last commit :-) - * doc/xml.html doc/html/* : updated and uploaded the docs - -Mon Mar 20 12:33:51 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * test/valid/dtds/xhtml*: removed RCS infos (pain with CVS) - * TODO: updated - * xmlmemory.[ch] : added xmlMemSetup() and xmlMemGet() to override - libxml default allocation function with another set (like gmalloc/ - gfree). - * Makefile.am, uri.c, uri.h: added a set of functions to do - exact (literally copied from the RFC 2396 productions) parsing - and handling of URI. Will be needed for XLink, one XML WFC, - XML Base and reused in the nano[ftp/http] modules. Still work - to be done. - -Tue Mar 14 20:52:35 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * configure.in, libxml.spec.in : libxml2 - * doc/* : updated the doc page, rebuilt the docs - -Tue Mar 14 19:11:29 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * all: tagged LIB_XML_1_X - * *.c *.h : updated from W3C CVS tree - * configure.in : 2.0.0-beta - * libxml.spec.in : libxml2 package nam - * result/* : new version of the tests output - -Mon Mar 6 09:34:52 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * doc/xml.html, doc/update.html: updated docs, 1.8.7 - -Sat Mar 4 16:14:42 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * doc/* : rebuilt the docs - * parser.c: final patch on #6766 - * valid.c: small patch on validity checks. - -Sat Mar 4 12:38:41 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * doc/upgrade.html: instruction on how to upgrade from 1.x to 2.x - added - * parser.c: adding xmlKeepBlanksDefault() as a way to manage - compatibility w.r.t. XML spec and existing code. - -Thu Mar 2 04:45:15 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * parser.c: seems a better solution to <a> </a> exists, - will try it for a while - -Thu Mar 2 02:26:13 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * parser.c: tried to remove the <a> </a> generating <a/> - this is hard. Left a flag for that purpose. Fixed bug #6766 - * configure.in: prepared 1.8.7 not released, due to previous - problem - -Thu Mar 2 03:03:50 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * doc/xml.html : applied second patch from Paul DuBois - -Tue Feb 29 23:55:13 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * doc/xml.html : applied patch from Paul DuBois - -Thu Feb 3 16:36:39 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * parser.c HTMLparser.c: do a bit of bufferization in push mode. - -Thu Feb 3 15:59:37 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * nanoftp.c nanohttp.c tree.c HTMLtree.[ch] debugXML.c xpath.c: Fixed - compilation warnings on various platforms. - * parser.c: Fixed #5281 validity error callbacks are now deactivated - by default if not validating. - -Thu Feb 3 13:46:14 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * nanoftp.c, win32config.h.in: patches to compile on WIN32 - -Wed Feb 2 22:51:16 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * nanoftp.c: snprintf/sprintf patch courtesy George Katsirelos - <gkatsi@cs.toronto.edu> - -Mon Jan 31 18:58:21 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * nanoftp.c nanohttp.c: Fixed '#' and '?' stripping when - processing URLs - -Mon Jan 31 14:25:57 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * nanoftp.[ch]: cleanup, bug fixes, integration in rpmfind, added - xmlNanoFTPUpdateURL for persistent control connections. - * configure.in: 1.8.6 - -Thu Jan 27 17:52:29 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * nanohttp.[ch], nanoftp.[ch]: cleanup, added proxy support - * tree.[ch] : added xmlSaveNoEmptyTags - -2000-01-29 James Henstridge <james@daa.com.au> - - * nanoftp.c: include <netinet/in.h> for IPPROTO_TCP. - - * Makefile.am: added nanoftp.[ch] to the build. - -Wed Jan 26 18:14:55 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * nanoftp.[ch]: cleanup, comments, API - * debugXML.c : fixed a bug in the cat command - * doc/*: regenerated the docs - -Wed Jan 26 16:52:50 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * nanoftp.[ch] parser.c xmlIO.[ch]: added a Nano FTP implementation - * debugXML.c : fixed a bug in the cat command - * valid.c: fixing some small probs - * libxml.spec.in: get rid of the SNAP suffix - * doc/xml.html: updated the status - -Mon Jan 24 14:31:09 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * xml-config.in: xml-config --version to just return the - version number - * xpath.c: some cleanup w.r.t. axis when the current node is - an attribute. - * TODO: updated - -Tue Jan 18 18:46:06 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * configure.in: prepared for libxml-1.8.5 - * doc/* recompiled the documentation - -2000-01-17 Jody Goldberg <jgoldberg@home.com> - - * configure.in : WARNING autoconf subtlety alert : - Use AC_CHECK_HEADERS rather than AC_CHECK_HEADER - when looking for zlib.h so that HAVE_ZLIB_H is defined. - * config.h.in : Have a #undef for HAVE_ZLIB_H so that it will - get defined by AC_CHECK_HEADERS. - -Mon Jan 17 17:04:12 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * tree.c: fixed a hideous bug in xmlGetProp() thanks to - Rune.Djurhuus@fast.no - -Sat Jan 15 15:09:06 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * TODO: updated - * tree.c, parser.c: made sure that only memory alloc problems - and internal parser errors are allowed to write to stdout or - stderr. - -Thu Jan 13 11:49:11 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * tree.c : restored xmlNewGlobalNs since this seems used by - a lot of existing code :-(, fixed a bug in xmlNewNs - * nanohttp.c: fixed a problem with INCLUDE_WINSOCK - * HTMLparser.c, parser.c, entities.c, valid.c : removed all calls - to exit() from the library code. - * xpath.c, parser.c: removed bugs or unused code detected by - Windows compilers - * parser.c: started adding interfaces for parsing well balanced - XML fragments - * configure.in: releasing 1.8.4 - * doc/* : rebuilt the docs - -Sun Jan 9 23:03:20 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * tree.[ch] : added xmlNewDocFragment() for DOM - * testHTML.c: uninitialized variable. - -Wed Jan 5 17:29:17 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * doc/* : rebuild the docs - -Wed Jan 5 17:08:43 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * acconfig.h: readline and history patch - * valid.[ch]: added xmlRemoveID() and xmlRemoveRef() - * tree.c: added check and handling when possibly removing an ID - * tree.c, HTMLparser.h, HTMLtree.h: fixed entities parsing - and saving. - * test/HTML/entities.html result/HTML/entities.html* : test for - various entities reference cases - * result/HTML/* : as a result output of some testcase have - changed - * HTMLparser.c, parser.c: fixed a bug in the push mode triggered - by previous example. added xmlParseTryOrFinish(). - * xpath.h tree.h parser.h valid.h xmlIO.h xlink.h encoding.h - entities.h debugXML.h HTMLparser.h: changed the way struct are - declared to allow gtk-doc to expose those - * parser.c: closed bug #4960 - * Makefile.am configure.in: Applied patch from - Albert Chin-A-Young <china@thewrittenword.com> for better zlib - and math/socket libs detection - -Mon Jan 3 18:29:43 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * configure.in, Makefile.am: link tester against readline - * doc/xml.html doc/*/*: updated and rebuilt the documentation pages - -Mon Jan 3 11:58:05 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org> - - * tree.[ch]: added xmlRemoveProp - * win32config.h.in nanohttp.c: avoid including the Windows - socket stuff in every C files - * parser.c: removed an indetermination xmLDecl/PI(xml...) in - the XmL parser(s) - * test/ns4 result/ns4 etc...: added test case for previous prob - * tree.c: xmlNewNs wasn't checking for double definition - * Makefile.in: fixed a problem with dist-hook duplicates - * parser.[hc], xmlIO.c: fixed the loading of external entities - APIs, now xmlLoadExternalEntity() is used everywhere and - setting up an app specific front-end using the - * SAX.c parser.c: some fixes, now the xhtml spec validates - with the xhtml DTD. - * error.c: fixed crashes in case of no input stream - * test/valid/[dtds/]/xhtml* : added the xhtml spec and dtds - to the validation tests and results - -Wed Dec 29 15:29:52 CET 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * HTMLparser.[ch] testHTML.c: added push mode for the HTML parser - too htmlCreatePushParserCtxt() and htmlParseChunk() - * parser.c: a bit of cleanup. - * SAX.c, HTMLparser.c: some attributes may not have values (contrary - to XML) removed the last mem leak known - * HTMLtree.c: output message cleanup - * xmlmemory.c: display content info about memory blocks - * result/HTML/wired.* : missing att value warning change - -Tue Dec 28 17:42:41 CET 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * doc/* : rebuilt the documentation - -Tue Dec 28 18:44:22 CET 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * parser.[ch] parserInternals.h: Push parser for XML, - seems to work fine now - * tester.c debugXML.[ch]: Added an XML shell debug facility and - --push for push testing - * xpath.[ch] : cleaned up for Shell usage, added missing APIs - * testSAX.c: added --push - * HTMLtree.[ch] tree.[ch]: new functions for dumping parts of the - subtree - * xmlIO.[ch] : enriched API + fixes for push mode - * entities.[ch]: added the entity content length to the struct. - * xmlmemory.[ch]: new API to show the last entries for the shell - * valid.c: added required attribute testing - * SAX.c: the cdata callback now merge contiguous fragments - * HTMLparser.c: cleanup of some macros - -Wed Dec 22 12:20:53 CET 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * parser.c: fix for PIs name starting with xml - * tree.c: fixed a potential problem with || and && ops - * *.c, configure.in win32config.h.in : generate win32config.h for - those on the Other Side ! - -Tue Dec 21 17:22:17 CET 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * parser.c: fixed a stupid = vs. == bug :-( - * doc/gnome-xml.sgml: s/glade/xml/ - -Tue Dec 21 14:29:34 CET 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * configure.in, doc/xml.html : bug fix release 1.8.2 - * debugXML.h nanohttp.h xml-error.h xmlmemory.h xpath.h : - Hopefully the end of that silly C++ include problem - * tree.[ch]: Added a few functions: xmlReplaceNode, xmlAddPrevSibling, - xmlAddNextSibling, xmlNodeSetName and xmlDocSetRootElement - * HTMLparser.c HTMLparser.h HTMLtree.c: When saving HTML try to avoid - troubles with autoclosed elements when the stree shape doesn't - follow the DtD specs. Added htmlIsAutoClosed() and - htmlAutoCloseTag() - * result/HTML/*.htm*: Updated the HTML examples regression tests output - * SAX.c tree.c: fixed bug on defaulting namespaces on attributes - * debugXML.c: fixed a bug on printing default namespaces. - * HTMLtree.c: fixed a problem when outputting XML parsed docs as HTML - -Mon Dec 20 16:20:55 CET 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * result/HTML/*.htm[l] : updated the HTML regression tests according - to the new output - * xpath.h xml-error.h valid.h tree.h parser.h entities.h SAX.h - HTMLtree.h tree.c entities.c: headers tweakings to avoid a nasty - problem due to intermix of extern "C" { ... } declarations for C++ - and recursive includes in the headers - -1999-12-20 Chris Lahey <clahey@umich.edu> - - * HTMLtree.c: Made it so that html nodes with a single child do - not insert a carriage return before or after the child node. - -Sat Dec 18 16:07:03 CET 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * configure.in, doc/xml.html : bug fix release 1.8.1 - * parser.c: fixed bug #4344 - * xpath.h xml-error.h xlink.h nanohttp.h debugXML.h SAX.h HTMLparser.h - added the glue to avoid C++ problems - * doc/* : regenerated the documentation - -Thu Dec 16 16:19:29 CET 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * tree.c: fixed a bug introduced in 1.8.0 and breaking default - namespace recognition, and Dia as a result :-( - * encoding.c: closed bug #3950 - -Wed Dec 15 19:22:23 CET 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * valid.c: debugging a posteriori validation, except URI expansion - stuff this should be fixed now - * parserInternals.h: fixed a bug in IS_BASECHAR reported by - Carl Nygard <cnygard@bellatlantic.net> - * tester.c: added --postvalid, cleaning of the code - * tree.[ch]: added xmlDocGetRootElement() - -Tue Dec 14 20:30:34 PST 1999 Ramiro Estrugo <ramiro@eazel.com> - - * SAX.h, tree.h : changed 'namespace' to 'nameSpace' to workaround - c++ losage. - -Sun Dec 12 13:08:15 CET 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * configure.in, doc/xml.html : bumped to 1.8.0 - * xlink.[ch], Makefile.am : added framework for link detection - * parser.h: added nbChars to parser context, needed for cleanup. - * xmlmemory.c: removed a nasty bug when out of mem - * valid.[ch]: adding namespace support for attribute decl - * tester.c: added --debugent option - * debugXML.[ch]: added xmlDebugDumpEntities() - * parser.c: cleanup, avoiding use of CUR_PTR like plague, using - buffers instead, this was really needed, validation was breaking - in strange ways due to that. Added xmlParseStringPEReference() - and other parsing from strings functions. Entities processing - modified again, but PERef are still not handled correctly but - unless you're Eve Maller you won't notice :-) - * HTMLparser.c: large changes toward reliability, and switched to - lowercase internal tags, XHTML is lowercase, so it will help - that output is closer to next version. - * doc/* : regenerated the documentation, it is now hosted at - http://xmlsoft.org/ (same bits I just bought the domain :-) - -Fri Dec 3 13:46:32 CET 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * SAX.h, SAX.c, makefile.am: added SAX.h mostly useful for the - doc generation - * parser.c: fixed bugs #3908 and #3937 and a memory leak - in the SAX API - * doc/*: rebuilt the doc making sure everything appears in the - HTML files - -Wed Dec 1 10:27:47 CET 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * tree.[ch] HTMLtree.c, debugXML.c, configure.in, xml-config.in: - added the patch from Carl Nygard <cnygard@bellatlantic.net> - which allow impressive speed improvement on dataset with - large text pieces, but at the cost of broken binary - compatibility and slightly bigger memory usage. - Configure with --with-buffers to activate them, they - are protected with XML_USE_BUFFER_CONTENT define. - * entities.[ch], parser.c: added xmlCleanupPredefinedEntities(), - goal is 0 memory left allocated once parser is no more used - * testDAV.c, testHTML.c, testSAX.c, testXPath.c: make sure we - call xmlCleanupParser() and xmlMemoryDump() - -Wed Nov 24 19:00:06 CET 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * tree.[ch] xmlIO.[ch] parser.c valid.c: code cleanup with -pedantic - * parser.[ch] encoding.[ch]: added memory cleanup routines - * parser.c: closing bug #3788 - * doc/*: rebuilt the doc - -Tue Nov 23 11:23:55 CET 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * tree.[ch]: closing bug 3748, added xmlNewDocRawNode(), - xmlNewTextChild() and xmlSetCompressMode() behaviour. - * tester.c: added --compress option - * doc/*: rebuilt the documentation - -Fri Nov 19 18:41:28 CET 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * HTMLparser.c: bugfixing, the damn thing MUST not crash even - if given /proc/kcore as input ! - * doc/xml.html doc/*: updated and rebuilt the documentation - -Thu Nov 18 14:57:18 CET 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * parser.c: Fixed some wrongly space collapsing code due to - a misreading of the spec. - * result/*: fixed the output accordingly - -Wed Nov 17 18:28:06 CET 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * encoding.c: bug fix and typos - * xmlIO.[ch] parser.c: first bits toward real progressive parsing - * parser.c: added attribute normalization closing bug #3597 - * test/att* result/att* SAXresult/att*: testcase for attribute - normalization - -Mon Nov 15 18:50:56 CET 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * configure.in: closing bug #3163 by adding extra flags for the - cc compiler on HP-UX - -Fri Nov 12 17:41:20 CET 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * valid.[ch] : removed a typo and an enumerated type bug in the - xmlAddElementDecl() function - * tree.c : I changed xmlSetProp() and xmlNewProp() to do the - call to xmlEncodeEntitiesReentrant() so that the functions - New, Set and Get are at the same level. - * parser.c HTMLparser.c: extra memory allocation bug for - attributes detected by someone using libxml in embedded systems :-) - -Thu Oct 28 17:49:26 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * xmlmemory.h: turned off mem debug :-\ - -Mon Oct 25 12:13:25 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * parser.c: closed bug #2784 a one line fix, but worth pushing - a new release out - * HTMLparser.c: fixed auto-close bugs on list items, zeroing - some structures, comments before and after the - main element, and other nastiness - * HTMLtree.c tree.c: accommodate the extended HTML supported - * configure.in: pushing 1.7.4 - * test/ent8 and related outputs : added a new test for bug #2784 - * test/HTML/wired.html and related output: a nasty HTML example - * Makefile.am: improved the test scripts - * docs/* : reran the documentation extractor, updated xml.html - -Thu Oct 14 10:29:56 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * HTMLparser.c, HTMLtree.c, tree.h: completely revamped the - HTMLparser and debugged the HTML related code. HTML documents - now have their own type - * entities.c: do not dump ' for HTML output - * xmlmemory.c: improvement, breakpoint mechanism - * testHTML.c: added --sax --repeat ... - * Makefile.am: improved the HTML tests - * valid.[ch]: added xmlValidGetValidElements and - xmlValidGetPotentialChildren - * tester.c: added --insert to test the 2 new functions - * test//* result//* SAXresult//* : regression test cleanup - and extension. - * doc/html : added doc for new modules gnome-xml-xmlmemory.html and - gnome-xml-nanohttp.html - -Mon Oct 11 14:31:58 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * HTMLparser.c: fixed problems with some autoclose tags - * tree.c: fixed XML output problems. - * result/* SAXresult/*: update of the tests output - -Sat Oct 9 11:02:57 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * Makefile.am: Arturo patch for xmlConf.sh version info - * parser.c: Tim Josling patch for single quoted items - * tester.c: Tim Josling patch for tester options usage - * tree.h: indent cleanup - -Fri Oct 8 16:35:37 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * HTMLparser.c parser.h : Fixed problems with HTML parsing - reported by Kristian Hogsberg Kristensen <hogsberg@daimi.au.dk> - -Fri Oct 8 11:37:11 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * tree.c : Raph patch for initialization of CORBA fields - * parser.c, xpath.c, ...: modification of doc comments - * xpath.c : allow spaces in xpath expressions - -Mon Sep 27 10:16:43 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * xmlmemory.h: turning off memory debug :-( - -Sun Sep 26 13:16:54 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * parser.[ch] : added xmlSAXUserParseFile() and xmlSAXUserParseMemory() - better SAX interfaces. - * testSAX.c: uses the new SAX routine, avoid fetching any remote - entity. - * configure.in: 1.7.2 - -Fri Sep 24 16:01:01 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * libxml.spec.in: fixed the URL - * doc/xml.html: improved the documentation front-end - -Fri Sep 24 01:06:36 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * nanohttp.c: conditionned references to snprintf with HAVE_SNPRINTF - -Fri Sep 24 00:15:58 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * libxml.spec.in: fixed the alpha compile problem - * parser.[ch]: changed errno to errNo in the parser context :-( - * *.[ch]: changed CHAR to xmlChar to avoid problem on WIN32 - * doc/xml.html: changed CHAR to xmlChar - * doc/html/*: recompiled the documentation - * configure.in: 1.7.1 - -Wed Sep 22 11:40:31 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * parser.h: modified the parser context struct to regain 1.4.0 - binary compatibility - * parser.c, xml-error.h: added errno to the context and defined - a set of errors values with update of errno - * nanohttp.[ch]: minimalist HTTP front-end for fetching remote - DTDs and entities - * *.h, *.c: complete cleanup of the use of config.h and include - protection depending on the current setup. - * overalll debugging, maintenance and bug-fixing on all modules - * updated the documentation - * ready for 1.7.0 - -Wed Sep 8 22:46:14 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * HTMLparser.c : cleanup - * SAX.c valid.c valid.h: added ID/IDREF checking - * tree.c tree.h: extended doc structure for refs - * configure.in: 1.6.2 - * parser.c: patched bug in SAX user arg call - * parserInternals.h: patched missing close in C++ wrapping - * testXPath.c xpath.c xpath.h: prepared for extensibility, - especially upcoming XPointer implementation. - * doc/xml.html: augmented, typo - -Sat Sep 4 22:48:05 CEST 1999 Timur Bakeyev <mc@bat.ru> - - * doc/Makefile.am: replaced "install -d " with "mkinstalldirs" - - not all invocations of install understand -d. - -Sat Sep 4 22:20:07 CEST 1999 Timur Bakeyev <mc@bat.ru> - - * Makefile.am: prepend all the test* calls with $(top_builddir) - - to make 'check' works, when builddir != srcdir. - -Sat Sep 4 20:25:46 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * doc/xml.html : updated the documentation - -Fri Sep 3 00:01:08 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * xmlmemory.[ch] Makefile.am :added a memory wrapper to chase - not deallocated memory blocks - * *.c : replaces all calls to malloc() free() and realloc() to - the wrapper functions/macros - * tree.c : removed memory leaks dues to calling xmlFreeNode() - instead of xmlFreeNodeList() - -Wed Sep 1 14:15:09 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * HTMLparser.c: corrected a stupid bug leading to core dump at - tree deallocation. Removed warnings indicated by - Stephane.Conversy@lri.fr - * entities.c: Fixes Yet Another Stupid Bug, entities were not - looked for in the external subset - -Mon Aug 30 13:22:26 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * parser.c valid.[ch] xpath.c: patched compilation warnings reported - on SGI by Stephane.Conversy@lri.fr - -Sun Aug 29 22:27:29 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * all .h : changed the prototype declaration indent as in gtk - * most .c : working on reducing the TODOs in the code - * most .c : cleanup though -pedantic and Insure++ - * improvements on validation ID checkings. - * tree.[ch] SAX.c: added support for namespace on attributes #2022 - * xml-config.in: closed #1810 - -Mon Aug 16 03:27:38 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * tree.h, valid.c, valid.h: more work on validity, IDs - * xpath.c: added/fixed comparidon and equlity, added a new isinf - definition for AIX - -Sun Aug 15 21:15:17 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * Makefile.am libxml.spec.in: corrected missing xmlConf.sh in - the distribution due to a cut'n paste error at last commit - -Tue Aug 10 20:28:09 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * configure.in: upgraded to version 1.4.0 - * valid.[ch], SAX.c, parser.[ch] parserInternals.h ... - Big update, added a large part of the validation process, - it should be usable, but some parts are missing - * xpath.c: improved the implementation w.r.t. root. - * Makefile.am: added more tests - * test and result trees: added a lot of tests - * libxml.spec.in: export libxml.so.0 and libxml.so.1 - -Tue Aug 10 11:33:41 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * Added an HACKING file - -Tue Jul 27 21:43:00 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * xpath.[ch] : improvements and debug of the XPath implementation - * parser.c, HTMLparser.c : modified the parsers to be progressive - * tree.[ch] : extended the Buffer promitives - * xmlIO.[ch] : added basic I/O routines providing progressive - parsing and ready for I18N conversion plugins - * SAXresult/* : the SAX callback sequence maybe slightly different - now - * test*.c : improved/updated the tests programs - * doc/* : recompiled the docs. - -1999-07-26 Michael Meeks <michael@edenproject.org> - - * tree.h: Add const to 'content' in xmlNewDocNode, xmlNewChild - - * tree.c: Ditto. - -Thu Jul 15 16:17:16 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * configure.in: upgraded to version 1.4.0 - * xpath.c, xpath.h, testXPath.c, makefile.am: added code for the XPath - draft from W3C. Will be used by XPointer, Xlink, XSL, and possibly - XML query language, see http://www.w3.org/TR/xpath for more details. - * parser.c, parser.h: added CHAR* related string functions for XPath - * HTMLparser.[ch], HTMLtree.c: a bit of cleanup on entities. - * doc/gnome-xml.sgml, doc/html/* : added XPath and HTML documentation, - rebuild the docs. - * Makefile.am, test/XPath/*, result/XPath/*: added an XPathtests target - and regression testing capabilities for XPath. - -Mon Jul 12 12:36:39 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * parser.c, HTMLparser.c: applied patch from John Ellson <ellson@lucent.com> - closing bug #1646 - -Mon Jul 12 11:04:44 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * Makefile.am, example/Makefile.am: closed bug #1683 - -Sun Jul 11 18:16:34 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * example/Makefile.am, configure.in: added the makefile for the - gjobread example - -Sat Jul 10 14:19:11 CEST 1999 Tomasz Kłoczko <kloczek@pld.org.pl> - - * doc/Makefile.am: - - fix which allow "make install DESTDIR=</install/prefix>". - -Fri Jul 9 12:10:24 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * HTMLparser.c parser.c: applied patch from John Ellson <ellson@lucent.com> - which fixed a problem on the file reading-code. - -Wed Jul 7 09:28:43 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * HTMLparser.[ch], HTMLtree.[ch]: more work for HTML parsing and - output. - * Makefile.am, test/HTML/*, result/HTML/*: added HTMLtests targetestHTMLt - -Wed Jul 7 00:25:42 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * parser.h : Oops removed the binary compatibility problem - * HTMLparser.[ch], HTMLtree.h : More work on the HTML parse/dump - * parser.c, HTMLparser.c: applied patches for reading from stdin - -Mon Jul 5 18:45:31 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * parser.c, entities.c, valid.c: cleanup bug #1591 - * configure.in: cleanup bug #1592 - * HTMLparser.[ch], testHTML.c: started adding an HTML parser using - the same tree back-end. Hence gdome will be available for it. - * doc/Makefile.am: close bug #617 - -Sat Jun 26 23:36:38 EDT 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * parser.c: alloctate a per parser context SAX interface block - -Tue Jun 22 23:46:32 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * released 1.3.0 with xmlEncodeEntities restoring old behaviour - and xmlEncodeEntitiesReentrant with the correct one :-\ - -Mon Jun 21 14:07:53 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * commit of my internal XML base changes, quite a lot of - changes, cleanups, better entities support, framework for - new I/O and charset detection and handling - * Fixed the configure/Makefile stuff to generate shared libs - with the proper version info, so we jumped on rev from - 0.0.0 to 1.2.0 ! The binary interfaces have been broken, - xmlEncodeEntities() result need to be freed now, and a string - xmlParserVersion provide the current library version. - -Tue Jun 15 14:24:19 1999 Raph Levien <raph@acm.org> - - * parser.c: fixed a buffer overrun for when you have a very long - attribute with no entities in it. - -Mon Jun 14 00:17:50 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * added example directory - * added example/gjobs.xml gjobread.c, still need a Makefile.in - -Wed Jun 2 19:40:58 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * Release of libxml-1.1, nearly everything has been touched for - this. - * Added more regression tests - * Updated the documentation - -Sat May 29 13:34:42 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * tree.[ch]: unified the XML_NO_CORBA defines. - * parser.c encoding.[ch]: started plugging in char encoding detection - -Fri May 28 22:58:42 EDT 1999 Manish Vachharajani <mvachhar@vger.rutgers.edu> - - * tree.c: (xmlSaveFile) - removed double call of xmlContentDump. - Also freed allocated buffer. - -Wed Apr 21 22:07:35 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org> - * parser.[ch] tree.[ch] entities.[ch] valid.[ch] : removed the main - reentrancy problem at printing. One is left in entities.c, to - remove ASAP - * testSAX.c : added a test example showing the use of the SAX - interface if one doesn't want to build the DOM tree. - * html/gnome-xml-*.html html/index.sgml: regenerated the documentation - -Mon Apr 5 14:14:40 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * parser.[ch] tree.[ch] SAX.c, parserInternals.h valid.[ch]: - large revamping of the parser to use SAX callbacks - http://www.megginson.com/SAX/ (or at least a C like interface - a la Expat). It's now possible to set up your own callbacks - and the parser will not build a DOM tree. - * test/* result/*: updated the test suite, I finally removed - the old Namespace draft support (PI based). - -Fri Apr 2 17:57:32 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * Makefile.am: added test result to EXTRA_DIST for make tests - -Wed Mar 24 21:37:02 CET 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * parser.c, parserInternals.h: moved the chars macro definitions - to parserInternals.h - * parser.c, error.c: applied patches from "Knut Åkesson" - <ka@s2.chalmers.se> for clean compilation under MSVC 6 :-o - -Tue Mar 23 11:10:15 CET 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * xml-config.in : applied patch to make --version work - -1999-03-05 Raja R Harinath <harinath@cs.umn.edu> - - * Makefile.am (check-local): Alias for `tests' target. This will - cause `make check' to do the right thing. - (tests): Don't run tests in srcdir. Also, replaced calls to - basename with a `sed' "equivalent". - -Fri Mar 5 07:23:53 CET 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * Renamed error.h to xml-error.h, corrected Makefile.am to list - it in the header and not the sources, updated the doc. - Thanks to Tim Mooney <mooney@dogbert.cc.ndsu.nodak.edu> for - pointing this out. - -Mon Mar 1 13:27:17 CET 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * parser.c, parser.h, parserInternals.h: memory leak hunting, - exported the inputStream routines. - * doc/html/* : updated accordingly - -Sun Feb 28 22:51:33 CET 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * parser.c, parser.h, parserInternals.h: added a few extra - internal calls to allocate and free parser contexts ... - * doc/html/* : updated accordingly - -Thu Feb 25 11:52:24 CET 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * configure.in, Makefile.am, doc/makefile.am : General changes for - 1.0.0 release and including the generated HTML documentation. - -Thu Feb 25 09:44:52 CET 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * makefile.am : added parserInternals.h, oops. - -Mon Feb 22 11:24:56 CET 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * parserInternals.h: added this header giving access to the parser - internal functions. - * doc/Makefile.am : added a rebuild target which rebuilds the full - set of documentations - * parser.[ch] tree.[ch] valid.[ch]: serious updates w.r.t. parsing - the internal subset. - * *.c *.h: modifications needed to generate the documentation using - gtk-doc, cleanup of functions blocks, reorganisation of struct - declarations. - -Tue Feb 16 17:27:29 CET 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * Makefile.am, spec, doc/Makefile.am : upgrading to 0.99.8, fixing - the tar and spec file to include the beginning of the doc. - -1999-02-13 Nuno Ferreira <nmrf@rnl.ist.utl.pt> - - * doc/.cvsignore: Added this file. - -Mon Feb 8 19:27:56 CET 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * tree.c: fixed xmlGetProp to return "" when the attribute - exists, even if the node-list is NULL. - -Mon Feb 8 16:10:15 CET 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * tree.c: patched an error outputting empty attribute values. - * Makefile.am and doc/makefile.am: have been updated during the - week-end. Sorry for an empty CVS log, I got a shell problem. - -Mon Feb 1 12:10:13 CET 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * tree.h: cleaned up using enums instead of defines - * parser.c, valid.[ch]: more work on parsing/output of element - declarations - -Sun Jan 31 22:06:48 CET 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * valid.[ch], tree.c, parser.c : more work toward full parsing - of XML DTDs. - * README: added information about mailing-list and on-line - documentation - -1999-01-27 Raja R Harinath <harinath@cs.umn.edu> - - * configure.in (XML_INCLUDEDIR): Use -I not -L for includes. - -Sun Jan 17 20:06:36 CET 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * parser.c, tree.[ch] : more work toward conformance testing, - added a last element to accelerate parsing of very flat structures - started working on internal subset Element content declaration. - * valid.[ch] : first cut at adding code toward validation. - * previous changes had also small impact on most files, especially - the conformance testing using James Clark test suite. - -Sun Jan 17 14:45:06 CET 1999 Daniel Veillard <Daniel.Veillard@w3.org> - - * test/* : updated the examples, most of them were not well - formed (humm), and added rdf2. - * result/* : resulting changes in the output. - -Sun Dec 6 13:06:58 EST 1998 Daniel Veillard <Daniel.Veillard@w3.org> - - * tree.c: changed the behaviour of xmlGetProp on NULL values. - -Sat Dec 5 12:25:09 EST 1998 Daniel Veillard <Daniel.Veillard@w3.org> - - * tree.c: patched a bug in the generation of empty attributes - -Fri Nov 27 01:36:54 EST 1998 Daniel Veillard <Daniel.Veillard@w3.org> - - * entities.[ch], tree.[ch], tester.c: added copy interfaces - for node/trees/documents/... Biggest problem is namespace - support when copying subtrees. - -Sun Nov 15 19:59:47 EST 1998 Daniel Veillard <Daniel.Veillard@w3.org> - - * parser.c, entities.c: improve entities and char ref encoding, - and cleanups of error messages. - -Fri Nov 13 13:03:10 EST 1998 Daniel Veillard <Daniel.Veillard@w3.org> - - * parser.c, entities.c: simple bug hunting done during rpm2html and - rpmfind integration. - -Sun Nov 8 13:11:07 EST 1998 Daniel Veillard <Daniel.Veillard@w3.org> - - * parser.[ch]: Added interfaces allowing to specify a SAX - handler before parsing. - -Sun Nov 8 09:39:17 EST 1998 Daniel Veillard <Daniel.Veillard@w3.org> - - * parser.c: redirrect all errors reporting through the SAX - error function - -Wed Nov 4 14:21:54 EST 1998 Daniel Veillard <Daniel.Veillard@w3.org> - - * entities.c: rather use HAVE_SNPRINTF and not depend on glib - * libtool, tlmain ...: update of the libtool files - -1998-11-04 Miguel de Icaza <miguel@nuclecu.unam.mx> - - * entities.c: Use g_snprintf insteda of snprintf. - -Sun Nov 1 14:31:06 EST 1998 Daniel Veillard <Daniel.Veillard@w3.org> - - * entities.c, parser.c: debug and cleanup of CharRef handling/saving. - added ent5 test for this purpose. - * parser.c, parser.h: formatting, comments and UTF-8 planning. - -Fri Oct 30 01:36:52 EST 1998 Daniel Veillard <Daniel.Veillard@w3.org> - - * parser.c: fixed? a strange error due to compression on a GWP - document. - -Thu Oct 29 00:48:45 EST 1998 Daniel Veillard <Daniel.Veillard@w3.org> - - * tree.[ch]: bug fixing - * entities.[ch]: defined a specific type for predefined entities - * doc/xml.html: more documentation on the library, how to use it, - overview of the interfaces. - -Wed Oct 28 17:56:35 EST 1998 Daniel Veillard <Daniel.Veillard@w3.org> - - * tree.[ch]: more cleanup on the API, made the tree more conformant. - -Tue Oct 27 17:54:00 EST 1998 Daniel Veillard <Daniel.Veillard@w3.org> - - * tree.c: corrected a small bug - * doc/xml.html: continuing writing documentation. - -Tue Oct 27 17:54:00 EST 1998 Daniel Veillard <Daniel.Veillard@w3.org> - - * debugXML.h debugXML.c: added debugging utilities. - * tester.c: added --debug switch. - * tree.c: patched an incorrect node->type assignment. - * parser.c: formatting, ensure that node->doc != NULL in attributes - -Tue Oct 27 01:15:39 EST 1998 Daniel Veillard <Daniel.Veillard@w3.org> - - * parser.[ch] SAX.c tree.[ch]: large amount of changes to improve - entity support and provide an internal representation close to - DOM one (entity ref nodes, and attribute value as tree). I tried - to preserve the interface but this will surely break some apps - (I have to change rpm2html/rpmfind for example). I had to change - two interfaces, and the generated tree is somewhat different. - * doc/* : started documenting the XML library, the tree and - DOM/Corba. This is a first step. - -Sat Oct 24 14:23:51 EDT 1998 Daniel Veillard <Daniel.Veillard@w3.org> - - * parser.c: Set up the functions comment block, boring but useful. - * parser.h, SAX.c, parser.c: now attributes are processed through - the SAX interface. The problem is that my SAX interface diverged - quite a bit from the original one, well this is not an official - spec, and translating it from Java to C is hairy anyway... - -Tue Oct 20 02:11:21 EDT 1998 Daniel Veillard <Daniel.Veillard@w3.org> - - * SAX.c, entities.c, tree.c, encoding.c, error.c: Set up the - functions comment block, boring but useful. - -Sun Oct 18 20:40:58 EDT 1998 Daniel Veillard <Daniel.Veillard@w3.org> - - * encoding.[ch], Makefile.am: Added the UTF-8, UTF-16 and ISO Latin 1 - conversion routines. However they are not yet used to convert the - inputs. The core will run with UTF-8. - -Sun Oct 18 15:08:19 EDT 1998 Daniel Veillard <Daniel.Veillard@w3.org> - - * tree.c : make sure that the type id is properly set-up when - a new object is allocated, needed for DOM. - -Sat Oct 17 02:43:21 EDT 1998 Daniel Veillard <Daniel.Veillard@w3.org> - - * tree.h, tree.c: Ok, the main objects in the tree will be native - corba objects, it costs 8 bytes per Node, Attribute and Document - but it simplifies the Corba integration a lot (no extra interface - objects to allocate/free). - -Tue Oct 13 21:46:57 EDT 1998 Daniel Veillard <Daniel.Veillard@w3.org> - - * tree.h, tree.c, parser.c: added prev and doc pointers to Node, - and changed NODEs constants for conformity with DOM Level 1 - -Wed Oct 7 23:42:46 EDT 1998 Daniel Veillard <Daniel.Veillard@w3.org> - - * added hooks to keep track of servants when creating objects - xmlDoc and xmlNode (for Corba export). - -Sun Oct 4 03:18:09 EDT 1998 Daniel Veillard <Daniel.Veillard@w3.org> - - * added xml-config script. - -Thu Oct 1 16:22:37 EDT 1998 Daniel Veillard <Daniel.Veillard@w3.org> - - * autogen.sh : applied patch from Frederic Devernay <devernay@istar.fr> - to autoupdate libtool and automake conf files. - -1998-09-30 Miguel de Icaza <miguel@nuclecu.unam.mx> - - * Makefile.am: Use '?' to separate the sed - commands as ',' is used when people pass -Wl,something. - -Thu Sep 24 15:13:29 EDT 1998 Daniel Veillard <Daniel.Veillard@w3.org> - - * tree.c, tree.h: added a per-document compression interface. - -Tue Sep 22 20:47:38 EDT 1998 - - * tree.c, tree.h: added saving with compression and added interfaces - to control the compression level (xmlGetCompressMode, - xmlSetCompressMode) and a new save to filename function (xmlSaveFile). - -Mon Sep 21 20:11:13 EDT 1998 Daniel Veillard <Daniel.Veillard@w3.org> - - * parser.c: corrected a loop for files of size 0 - -1998-08-20 Raja R Harinath <harinath@cs.umn.edu> - - * error.h: New file. Contains prototypes from `error.c'. - -Thu Aug 13 19:02:34 1998 Tom Tromey <tromey@cygnus.com> - - * Makefile.am (xmlincdir): New macro. - (xmlinc_HEADERS): Renamed from include_HEADERS. - -Thu Aug 13 00:40:14 EDT 1998 Daniel Veillard <Daniel.Veillard@w3.org> - - * applied small patch on numeric entities from - Christopher Blizzard <blizzard@appliedtheory.com> - -Wed Aug 12 23:12:58 EDT 1998 Daniel Veillard <Daniel.Veillard@w3.org> - - * New release 0.2, removed the old xml_* files so that it's - coherent with the other CVS base (W3C), far better conformance - to standard, new namespaces, decent entities support, beginning - of a SAX-like interface. Nearly nothing left intact, even the - test examples ... - -1998-07-30 Christopher Blizzard <blizzard@appliedtheory.com> - - * .cvsignore: Add .deps dir - -Sun Jul 26 17:29:52 EDT 1998 Daniel Veillard <Daniel.Veillard@w3.org> - - * xml_tree: changed the memory allocation scheme for name in xmlNewNode - -Sun Jul 26 00:17:51 EDT 1998 Daniel Veillard <Daniel.Veillard@w3.org> - - * configure.in: added test for CPP - * AUTHORS, Changelog: the original ones didn't get committed but the - glib ones instead, fixed. - * Makefile.am: corrected an error in library naming - -Fri Jul 24 16:47:14 1998 Daniel Veillard <Daniel.Veillard@w3.org> - - * integrated code developed at W3C - * changed the original Copyright - * migrated to automake - * prefixed the filenames by xml_ to avoid filename clashes - -# -# vim: set enc=utf-8 -#
diff --git a/third_party/libxml/src/HTMLparser.c b/third_party/libxml/src/HTMLparser.c index 82859b0..4b9b4e4f 100644 --- a/third_party/libxml/src/HTMLparser.c +++ b/third_party/libxml/src/HTMLparser.c
@@ -11,12 +11,9 @@ #ifdef LIBXML_HTML_ENABLED #include <string.h> -#ifdef HAVE_CTYPE_H #include <ctype.h> -#endif -#ifdef HAVE_STDLIB_H #include <stdlib.h> -#endif + #ifdef HAVE_SYS_STAT_H #include <sys/stat.h> #endif @@ -2517,6 +2514,8 @@ if ((ExternalID != NULL) || (URI != NULL)) xmlCreateIntSubset(cur, BAD_CAST "html", ExternalID, URI); + if ((__xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue)) + xmlRegisterNodeDefaultValue((xmlNodePtr)cur); return(cur); } @@ -3485,10 +3484,20 @@ q = CUR_CHAR(ql); if (q == 0) goto unfinished; + if (q == '>') { + htmlParseErr(ctxt, XML_ERR_COMMENT_ABRUPTLY_ENDED, "Comment abruptly ended", NULL, NULL); + cur = '>'; + goto finished; + } NEXTL(ql); r = CUR_CHAR(rl); if (r == 0) goto unfinished; + if (q == '-' && r == '>') { + htmlParseErr(ctxt, XML_ERR_COMMENT_ABRUPTLY_ENDED, "Comment abruptly ended", NULL, NULL); + cur = '>'; + goto finished; + } NEXTL(rl); cur = CUR_CHAR(l); while ((cur != 0) && @@ -3536,6 +3545,7 @@ cur = next; l = nl; } +finished: buf[len] = 0; if (cur == '>') { NEXT; @@ -3958,26 +3968,6 @@ htmlParseErr(ctxt, XML_ERR_NAME_REQUIRED, "htmlParseStartTag: invalid element name\n", NULL, NULL); - /* - * The recovery code is disabled for now as it can result in - * quadratic behavior with the push parser. htmlParseStartTag - * must consume all content up to the final '>' in order to avoid - * rescanning for this terminator. - * - * For a proper fix in line with HTML5, htmlParseStartTag and - * htmlParseElement should only be called when there's an ASCII - * alpha character following the initial '<'. Otherwise, the '<' - * should be emitted as text (unless followed by '!', '/' or '?'). - */ -#if 0 - /* if recover preserve text on classic misconstructs */ - if ((ctxt->recovery) && ((IS_BLANK_CH(CUR)) || (CUR == '<') || - (CUR == '=') || (CUR == '>') || (((CUR >= '0') && (CUR <= '9'))))) { - htmlParseCharDataInternal(ctxt, '<'); - return(-1); - } -#endif - /* Dump the bogus tag like browsers do */ while ((CUR != 0) && (CUR != '>') && (ctxt->instate != XML_PARSER_EOF)) @@ -4430,9 +4420,15 @@ /* * Third case : a sub-element. */ - else if (CUR == '<') { + else if ((CUR == '<') && IS_ASCII_LETTER(NXT(1))) { htmlParseElement(ctxt); } + else if (CUR == '<') { + if ((ctxt->sax != NULL) && (!ctxt->disableSAX) && + (ctxt->sax->characters != NULL)) + ctxt->sax->characters(ctxt->userData, BAD_CAST "<", 1); + NEXT; + } /* * Fourth case : a reference. If if has not been resolved, @@ -4829,13 +4825,19 @@ /* * Third case : a sub-element. */ - else if (CUR == '<') { + else if ((CUR == '<') && IS_ASCII_LETTER(NXT(1))) { htmlParseElementInternal(ctxt); if (currentNode != NULL) xmlFree(currentNode); currentNode = xmlStrdup(ctxt->name); depth = ctxt->nameNr; } + else if (CUR == '<') { + if ((ctxt->sax != NULL) && (!ctxt->disableSAX) && + (ctxt->sax->characters != NULL)) + ctxt->sax->characters(ctxt->userData, BAD_CAST "<", 1); + NEXT; + } /* * Fourth case : a reference. If if has not been resolved, @@ -5116,7 +5118,7 @@ ctxt->linenumbers = xmlLineNumbersDefaultValue; ctxt->keepBlanks = xmlKeepBlanksDefaultValue; ctxt->html = 1; - ctxt->vctxt.finishDtd = XML_CTXT_FINISH_DTD_0; + ctxt->vctxt.flags = XML_VCTXT_USE_PCTXT; ctxt->vctxt.userData = ctxt; ctxt->vctxt.error = xmlParserValidityError; ctxt->vctxt.warning = xmlParserValidityWarning; @@ -6002,7 +6004,7 @@ "HPP: entering END_TAG\n"); #endif break; - } else if (cur == '<') { + } else if ((cur == '<') && IS_ASCII_LETTER(next)) { if ((!terminate) && (next == 0)) goto done; ctxt->instate = XML_PARSER_START_TAG; @@ -6012,6 +6014,12 @@ "HPP: entering START_TAG\n"); #endif break; + } else if (cur == '<') { + if ((ctxt->sax != NULL) && (!ctxt->disableSAX) && + (ctxt->sax->characters != NULL)) + ctxt->sax->characters(ctxt->userData, + BAD_CAST "<", 1); + NEXT; } else { /* * check that the text sequence is complete @@ -7277,6 +7285,4 @@ return (htmlDoRead(ctxt, URL, encoding, options, 1)); } -#define bottom_HTMLparser -#include "elfgcchack.h" #endif /* LIBXML_HTML_ENABLED */
diff --git a/third_party/libxml/src/HTMLtree.c b/third_party/libxml/src/HTMLtree.c index 7a2b855..c6ca8358 100644 --- a/third_party/libxml/src/HTMLtree.c +++ b/third_party/libxml/src/HTMLtree.c
@@ -12,13 +12,8 @@ #ifdef LIBXML_HTML_ENABLED #include <string.h> /* for memset() only ! */ - -#ifdef HAVE_CTYPE_H #include <ctype.h> -#endif -#ifdef HAVE_STDLIB_H #include <stdlib.h> -#endif #include <libxml/xmlmemory.h> #include <libxml/HTMLparser.h> @@ -1195,6 +1190,4 @@ #endif /* LIBXML_OUTPUT_ENABLED */ -#define bottom_HTMLtree -#include "elfgcchack.h" #endif /* LIBXML_HTML_ENABLED */
diff --git a/third_party/libxml/src/Makefile.am b/third_party/libxml/src/Makefile.am index eb906b07..fdbbc403 100644 --- a/third_party/libxml/src/Makefile.am +++ b/third_party/libxml/src/Makefile.am
@@ -58,7 +58,7 @@ xmlmodule.c schematron.c xzlib.c DEPS = $(top_builddir)/libxml2.la -LDADDS = $(STATIC_BINARIES) $(top_builddir)/libxml2.la $(THREAD_LIBS) $(Z_LIBS) $(LZMA_LIBS) $(ICONV_LIBS) $(M_LIBS) $(WIN32_EXTRA_LIBADD) +LDADDS = $(top_builddir)/libxml2.la $(THREAD_LIBS) $(Z_LIBS) $(LZMA_LIBS) $(ICONV_LIBS) $(M_LIBS) $(WIN32_EXTRA_LIBADD) man_MANS = xml2-config.1 libxml.3 @@ -1209,15 +1209,15 @@ dist-hook: cleanup libxml2.spec -cp libxml2.spec $(distdir) - (cd $(srcdir) ; tar -cf - --exclude CVS --exclude .svn --exclude .git win32 macos os400 vms VxWorks bakefile test result) | (cd $(distdir); tar xf -) + (cd $(srcdir) ; tar -cf - --exclude .git win32 os400 vms test result) | (cd $(distdir); tar xf -) dist-source: distdir $(AMTAR) -chof - --exclude Tests --exclude test --exclude result $(distdir) | GZIP=$(GZIP_ENV) gzip -c >`echo "$(distdir)" | sed "s+libxml2+libxml2-sources+"`.tar.gz dist-test: distdir (mkdir -p $(distdir)) - (cd $(srcdir) ; tar -cf - --exclude CVS --exclude .svn --exclude .git xstc/Tests) | (cd $(distdir); tar xf -) - tar -cf - $(distdir)/test $(distdir)/result $(distdir)/xstc/Tests $(distdir)/Makefile.tests $(distdir)/README $(distdir)/README.tests $(distdir)/AUTHORS $(distdir)/testapi.c $(distdir)/runtest.c $(distdir)/runsuite.c | GZIP=$(GZIP_ENV) gzip -c >`echo "$(distdir)" | sed "s+libxml2+libxml2-tests+"`.tar.gz + (cd $(srcdir) ; tar -cf - --exclude .git xstc/Tests) | (cd $(distdir); tar xf -) + tar -cf - $(distdir)/test $(distdir)/result $(distdir)/xstc/Tests $(distdir)/Makefile.tests $(distdir)/README.md $(distdir)/README.tests $(distdir)/testapi.c $(distdir)/runtest.c $(distdir)/runsuite.c | GZIP=$(GZIP_ENV) gzip -c >`echo "$(distdir)" | sed "s+libxml2+libxml2-tests+"`.tar.gz @(rm -rf $(distdir)/xstc/Test) cleantar: @@ -1246,7 +1246,6 @@ confexecdir=$(libdir) confexec_DATA = xml2Conf.sh -CVS_EXTRA_DIST= EXTRA_DIST = xml2-config.in xml2Conf.sh.in libxml.spec.in libxml2.spec \ libxml.m4 Copyright check-xml-test-suite.py gentest.py \ check-relaxng-test-suite.py check-relaxng-test-suite2.py \ @@ -1255,13 +1254,12 @@ $(man_MANS) libxml-2.0.pc.in libxml-2.0-uninstalled.pc.in \ libxml2-config.cmake.in autogen.sh \ trionan.c trionan.h triostr.c triostr.h trio.c trio.h \ - triop.h triodef.h libxml.h elfgcchack.h xzlib.h buf.h \ + triop.h triodef.h libxml.h xzlib.h buf.h \ enc.h save.h genUnicode.py TODO_SCHEMAS \ dbgen.pl dbgenattr.pl regressions.py regressions.xml \ README.tests Makefile.tests libxml2.syms timsort.h \ - README.zOS \ - CMakeLists.txt config.h.cmake.in libxml2-config.cmake.cmake.in \ - $(CVS_EXTRA_DIST) + README.zOS README.md \ + CMakeLists.txt config.h.cmake.in libxml2-config.cmake.cmake.in pkgconfigdir = $(libdir)/pkgconfig
diff --git a/third_party/libxml/src/NEWS b/third_party/libxml/src/NEWS index b55c63b..2ccdc10 100644 --- a/third_party/libxml/src/NEWS +++ b/third_party/libxml/src/NEWS
@@ -1,15 +1,498 @@ NEWS file for libxml2 - Note that this is automatically generated from the news webpage at: - http://xmlsoft.org/news.html - The change log at ChangeLog.html describes the recents commits to the GIT at https://gitlab.gnome.org/GNOME/libxml2 code base.Here is the list of public releases: +v2.9.13: Feb 19 2022: + - Security: + [CVE-2022-23308] Use-after-free of ID and IDREF attributes + (Thanks to Shinji Sato for the report) + Use-after-free in xmlXIncludeCopyRange (David Kilzer) + Fix Null-deref-in-xmlSchemaGetComponentTargetNs (huangduirong) + Fix memory leak in xmlXPathCompNodeTest + Fix null pointer deref in xmlStringGetNodeList + Fix several memory leaks found by Coverity (David King) + + - Fixed regressions: + Fix regression in RelaxNG pattern matching + Properly handle nested documents in xmlFreeNode + Fix regression with PEs in external DTD + Fix random dropping of characters on dumping ASCII encoded XML (Mohammad Razavi) + Revert "Make schema validation fail with multiple top-level elements" + Fix regression when parsing invalid HTML tags in push mode + Fix regression parsing public IDs literals in HTML + Fix buffering in xmlOutputBufferWrite + Fix whitespace when serializing empty HTML documents + Fix XPath recursion limit + Fix regression in xmlNodeDumpOutputInternal + Work around lxml API abuse + + - Bug fixes: + Fix xmlSetTreeDoc with entity references + Fix double counting of CRLF in comments + Make sure to grow input buffer in xmlParseMisc + Don't ignore xmllint options after "-" + Don't normalize namespace URIs in XPointer xmlns() scheme + Fix handling of XSD with empty namespace + Also register HTML document nodes + Make xmllint return an error if arguments are missing + Fix handling of ctxt->base in xmlXPtrEvalXPtrPart + Fix xmllint --maxmem + Fix htmlReadFd, which was using a mix of xml and html context functions (Finn Barber) + Move current position before possible calling of ctxt->sax->characters (Yulin Li) + Fix parse failure when 4-byte character in UTF-16 BE is split across a chunk (David Kilzer) + Patch to forbid epsilon-reduction of final states (Arne Becker) + Avoid segfault at exit when using custom memory functions (Mike Dalessio) + + - Tests, code quality, fuzzing: + Remove .travis.yml + Make xmlFuzzReadString return a zero size in error case + Fix unused function warning in testapi.c + Update NewsML DTD in test suite + Add more checks for malloc failures in xmllint.c + Avoid potential integer overflow in xmlstring.c + Run CI tests with UBSan implicit-conversion checks + Fix casting of line numbers in SAX2.c + Fix integer conversion warnings in hash.c + Add explicit casts in runtest.c + Fix integer conversion warning in xmlIconvWrapper + Add suffix to unsigned constant in xmlmemory.c + Add explicit casts in testchar.c + Fix integer conversion warnings in xmlstring.c + Add explicit cast in xmlURIUnescapeString + Remove unused variable in xmlCharEncOutFunc (David King) + + - Build system, portability: + Remove xmlwin32version.h + Fix fuzzer test with VPATH build + Support custom prefix when installing Python module + Remove Makefile.win + Remove CVS and SVN-related code + Port python 3.x module to Windows and improve distutils (Chun-wei Fan) + Correctly install the HTML examples into their subdirectory (Mattia Rizzolo) + Refactor the settings of $docdir (Mattia Rizzolo) + Remove unused configure checks (Ben Boeckel) + python/Makefile.am: use *_LIBADD, not *_LDFLAGS for LIBS (Sam James) + Fix check for libtool in autogen.sh + Use version in configure.ac for CMake (Timothy Lyanguzov) + Add CMake alias targets for embedded projects (Markus Rickert) + + - Documentation: + Remove SVN keyword anchors + Rework README + Remove README.cvs-commits + Remove old ChangeLog + Update hyperlinks + Remove README.docs + Remove MAINTAINERS + Remove xmltutorial.pdf + Upload documentation to GitLab pages + Document how to escape XML_CATALOG_FILES + Fix libxml2.doap + Update URL for libxml++ C++ binding (Kjell Ahlstedt) + Generate devhelp2 index file (Emmanuele Bassi) + Mention XML_CATALOG_FILES is space-separated (Jan Tojnar) + Add documentaiton for xmllint exit code 10 (Rainer Canavan) + Fix some validation errors in the FAQ (David King) + Add instructions on how to use CMake to compile libxml (Markus Rickert) + + + +v2.9.12: May 13 2021: + - Build system: + Add fuzz.h and seed/regexp to EXTRA_DIST + + + +v2.9.11: May 13 2021: + - Security: + Patch for security issue CVE-2021-3541 (Daniel Veillard) + + - Documentation: + Clarify xmlNewDocProp documentation (Nick Wellnhofer) + + - Portability: + CMake: Only add postfixes if MSVC (Christopher Degawa), + Fix XPath NaN/Inf for older GCC versions (Nick Wellnhofer), + Use CMake PROJECT_VERSION (Markus Rickert), + Fix warnings in libxml.m4 with autoconf 2.70+. (Simon Josefsson), + Add CI for CMake on MSVC (Markus Rickert), + Update minimum required CMake version (Markus Rickert), + Add variables for configured options to CMake config files (Markus Rickert), + Check if variables exist when defining targets (Markus Rickert), + Check if target exists when reading target properties (Markus Rickert), + Add xmlcatalog target and definition to config files (Markus Rickert), + Remove include directories for link-only dependencies (Markus Rickert), + Fix ICU build in CMake (Markus Rickert), + Configure pkgconfig, xml2-config, and xml2Conf.sh file (Markus Rickert), + Update CMake config files (Markus Rickert), + Add xmlcatalog and xmllint to CMake export (Markus Rickert), + Simplify xmlexports.h (Nick Wellnhofer), + Require dependencies based on enabled CMake options (Markus Rickert), + Use NAMELINK_COMPONENT in CMake install (Markus Rickert), + Add CMake files to EXTRA_DIST (Markus Rickert), + Add missing compile definition for static builds to CMake (Markus Rickert), + Add CI for CMake on Linux and MinGW (Markus Rickert), + Fix variable name in win32/configure.js (Nick Wellnhofer), + Fix version parsing in win32/configure.js (Nick Wellnhofer), + Fix autotools warnings (Nick Wellnhofer), + Update config.h.cmake.in (Markus Rickert), + win32: allow passing *FLAGS on command line (Michael Stahl), + Configure file xmlwin32version.h.in on MSVC (Markus Rickert), + List headers individually (Markus Rickert), + Add CMake build files (Markus Rickert), + Parenthesize Py<type>_Check() in ifs (Miro Hrončok), + Minor fixes to configure.js (Nick Wellnhofer) + + - Bug Fixes: + Fix null deref in legacy SAX1 parser (Nick Wellnhofer), + Fix handling of unexpected EOF in xmlParseContent (Nick Wellnhofer), + Fix line numbers in error messages for mismatched tags (Nick Wellnhofer), + Fix htmlTagLookup (Nick Wellnhofer), + Propagate error in xmlParseElementChildrenContentDeclPriv (Nick Wellnhofer), + Fix user-after-free with `xmllint --xinclude --dropdtd` (Nick Wellnhofer), + Fix dangling pointer with `xmllint --dropdtd` (Nick Wellnhofer), + Validate UTF8 in xmlEncodeEntities (Joel Hockey), + Fix use-after-free with `xmllint --html --push` (Nick Wellnhofer), + Allow FP division by zero in xmlXPathInit (Nick Wellnhofer), + Fix xmlGetNodePath with invalid node types (Nick Wellnhofer), + Fix exponential behavior with recursive entities (Nick Wellnhofer), + Fix quadratic behavior when looking up xml:* attributes (Nick Wellnhofer), + Fix slow parsing of HTML with encoding errors (Nick Wellnhofer), + Fix null deref introduced with previous commit (Nick Wellnhofer), + Check for invalid redeclarations of predefined entities (Nick Wellnhofer), + Add the copy of type from original xmlDoc in xmlCopyDoc() (SVGAnimate), + parser.c: shrink the input buffer when appropriate (Mike Dalessio), + Fix infinite loop in HTML parser introduced with recent commits (Nick Wellnhofer), + Fix quadratic runtime when parsing CDATA sections (Nick Wellnhofer), + Fix timeout when handling recursive entities (Nick Wellnhofer), + Fix memory leak in xmlParseElementMixedContentDecl (Nick Wellnhofer), + Fix null deref in xmlStringGetNodeList (Nick Wellnhofer), + use new htmlParseLookupCommentEnd to find comment ends (Mike Dalessio), + htmlParseComment: treat `--!>` as if it closed the comment (Mike Dalessio), + Fix integer overflow in xmlSchemaGetParticleTotalRangeMin (Nick Wellnhofer), + encoding: fix memleak in xmlRegisterCharEncodingHandler() (Xiaoming Ni), + xmlschemastypes.c: xmlSchemaGetFacetValueAsULong add, check "facet->val" (Xiaoming Ni), + Fix null pointer deref in xmlXPtrRangeInsideFunction (Nick Wellnhofer), + Fix quadratic runtime in HTML push parser with null bytes (Nick Wellnhofer), + Avoid quadratic checking of identity-constraints (Michael Matz), + Fix building with ICU 68. (Frederik Seiffert), + Convert python/libxml.c to PY_SSIZE_T_CLEAN (Victor Stinner), + Fix xmlURIEscape memory leaks. (Elliott Hughes), + Avoid call stack overflow with XML reader and recursive XIncludes (Nick Wellnhofer), + Fix caret in regexp character group (Nick Wellnhofer), + parser.c: xmlParseCharData peek behavior fixed wrt newlines (Mike Dalessio), + Fix memory leaks in XPointer string-range function (Nick Wellnhofer), + Fix use-after-free when XIncluding text from Reader (Nick Wellnhofer), + Fix SEGV in xmlSAXParseFileWithData (yanjinjq), + Fix null deref in XPointer expression error path (Nick Wellnhofer), + Don't call xmlXPathInit directly (Nick Wellnhofer), + Fix cleanup of attributes in XML reader (Nick Wellnhofer), + Fix double free in XML reader with XIncludes (Nick Wellnhofer), + Fix memory leak in xmlXIncludeAddNode error paths (Nick Wellnhofer), + Revert "Fix quadratic runtime in xi:fallback processing" (Nick Wellnhofer), + Fix error reporting with xi:fallback (Nick Wellnhofer), + Fix quadratic runtime in xi:fallback processing (Nick Wellnhofer), + Fix corner case with empty xi:fallback (Nick Wellnhofer), + Fix XInclude regression introduced with recent commit (Nick Wellnhofer), + Fix memory leak in runtest.c (Nick Wellnhofer), + Make "xmllint --push --recovery" work (Nick Wellnhofer), + Revert "Do not URI escape in server side includes" (Nick Wellnhofer), + Fix column number accounting in xmlParse*NameAndCompare (Nick Wellnhofer), + Stop counting nbChars in parser context (Nick Wellnhofer), + Fix out-of-bounds read with 'xmllint --htmlout' (Nick Wellnhofer), + Fix exponential runtime and memory in xi:fallback processing (Nick Wellnhofer), + Don't process siblings of root in xmlXIncludeProcess (Nick Wellnhofer), + Don't recurse into xi:include children in xmlXIncludeDoProcess (Nick Wellnhofer), + Fix memory leak in xmlXIncludeIncludeNode error paths (Nick Wellnhofer), + Check for custom free function in global destructor (Nick Wellnhofer), + Fix integer overflow when comparing schema dates (Nick Wellnhofer), + Fix exponential runtime in xmlFARecurseDeterminism (Nick Wellnhofer), + Don't try to handle namespaces when building HTML documents (Nick Wellnhofer), + Fix several quadratic runtime issues in HTML push parser (Nick Wellnhofer), + Fix quadratic runtime when push parsing HTML start tags (Nick Wellnhofer), + Reset XML parser input before reporting errors (David Kilzer), + Fix quadratic runtime when push parsing HTML entity refs (Nick Wellnhofer), + Fix HTML push parser lookahead (Nick Wellnhofer), + Make htmlCurrentChar always translate U+0000 (Nick Wellnhofer), + Fix UTF-8 decoder in HTML parser (Nick Wellnhofer), + Fix quadratic runtime when parsing HTML script content (Nick Wellnhofer), + Reset HTML parser input before reporting error (Nick Wellnhofer), + Fix more quadratic runtime issues in HTML push parser (Nick Wellnhofer), + Fix regression introduced with 477c7f6a (Nick Wellnhofer), + Fix quadratic runtime in HTML parser (Nick Wellnhofer), + Reset HTML parser input before reporting encoding error (Nick Wellnhofer), + Fix integer overflow in xmlFAParseQuantExact (Nick Wellnhofer), + Fix return value of xmlC14NDocDumpMemory (Nick Wellnhofer), + Don't follow next pointer on documents in xmlXPathRunStreamEval (Nick Wellnhofer), + Fix integer overflow in _xmlSchemaParseGYear (Nick Wellnhofer), + Fix integer overflow when parsing {min,max}Occurs (Nick Wellnhofer), + Fix another memory leak in xmlSchemaValAtomicType (Nick Wellnhofer), + Fix unsigned integer overflow in htmlParseTryOrFinish (Nick Wellnhofer), + Fix integer overflow in htmlParseCharRef (Nick Wellnhofer), + Fix undefined behavior in UTF16LEToUTF8 (Nick Wellnhofer), + Fix return value of xmlCharEncOutput (Nick Wellnhofer), + Never expand parameter entities in text declaration (Nick Wellnhofer), + Fix undefined behavior in xmlXPathTryStreamCompile (Nick Wellnhofer), + Fix use-after-free with validating reader (Nick Wellnhofer), + xmlParseBalancedChunkMemory must not be called with NULL doc (Nick Wellnhofer), + Revert "Fix memory leak in xmlParseBalancedChunkMemoryRecover" (Nick Wellnhofer), + Fix memory leak in xmlXIncludeLoadDoc error path (Nick Wellnhofer), + Make schema validation fail with multiple top-level elements (Nick Wellnhofer), + Call xmlCleanupParser on ELF destruction (Samuel Thibault), + Fix copying of entities in xmlParseReference (Nick Wellnhofer), + Fix memory leak in xmlSchemaValidateStream (Zhipeng Xie), + Fix xmlSchemaGetCanonValue formatting for date and dateTime (Kevin Puetz), + Fix memory leak when shared libxml.dll is unloaded (Kevin Puetz), + Fix potentially-uninitialized critical section in Win32 DLL builds (Kevin Puetz), + Fix integer overflow in xmlBufferResize (Nick Wellnhofer), + Check for overflow when allocating two-dimensional arrays (Nick Wellnhofer), + Remove useless comparisons (Nick Wellnhofer), + Fix overflow check in xmlNodeDump (Nick Wellnhofer), + Fix infinite loop in xmlStringLenDecodeEntities (Zhipeng Xie), + Fix freeing of nested documents (Nick Wellnhofer), + Fix more memory leaks in error paths of XPath parser (Nick Wellnhofer), + Fix memory leaks of encoding handlers in xmlsave.c (Nick Wellnhofer), + Fix xml2-config error code (Nick Wellnhofer), + Fix memory leak in error path of XPath expr parser (Nick Wellnhofer), + Fix overflow handling in xmlBufBackToBuffer (Nick Wellnhofer), + Null pointer handling in catalog.c (raniervf), + xml2-config.in: fix regressions introduced by commit 2f2bf4b2c (Dmitry V. Levin) + + - Improvements: + Store per-element parser state in a struct (Nick Wellnhofer), + update for xsd:language type check (PaulHiggs), + Update INSTALL.libxml2 (Nick Wellnhofer), + Fix include order in c14n.h (Nick Wellnhofer), + Fix duplicate xmlStrEqual calls in htmlParseEndTag (Nick Wellnhofer), + Speed up htmlCheckAutoClose (Nick Wellnhofer), + Speed up htmlTagLookup (Nick Wellnhofer), + Stop checking attributes for UTF-8 validity (Nick Wellnhofer), + Reduce some fuzzer timeouts (Nick Wellnhofer), + Only run a few CI tests unless scheduled (Nick Wellnhofer), + Improve fuzzer stability (Nick Wellnhofer), + Check for feature flags in fuzzer tests (Nick Wellnhofer), + Another attempt at improving fuzzer stability (Nick Wellnhofer), + Revert "Improve HTML fuzzer stability" (Nick Wellnhofer), + Add charset names to fuzzing dictionaries (Nick Wellnhofer), + Improve HTML fuzzer stability (Nick Wellnhofer), + Add CI for MSVC x86 (Markus Rickert), + Add a flag to not output anything when xmllint succeeded (hhb), + Speed up HTML fuzzer (Nick Wellnhofer), + Remove unused encoding parameter of HTML output functions (Nick Wellnhofer), + Handle malloc failures in fuzzing code (Nick Wellnhofer), + add test coverage for incorrectly-closed comments (Mike Dalessio), + Enforce maximum length of fuzz input (Nick Wellnhofer), + Remove temporary members from struct _xmlXPathContext (Nick Wellnhofer), + Build the Python extension with PY_SSIZE_T_CLEAN (Victor Stinner), + Add CI test for Python 3 (Nick Wellnhofer), + Add fuzzing dictionaries to EXTRA_DIST (Nick Wellnhofer), + Add 'fuzz' subdirectory to DIST_SUBDIRS (Nick Wellnhofer), + Allow port numbers up to INT_MAX (Nick Wellnhofer), + Handle dumps of corrupted documents more gracefully (Nick Wellnhofer), + Limit size of free lists in XML reader when fuzzing (Nick Wellnhofer), + Hardcode maximum XPath recursion depth (Nick Wellnhofer), + Pass URL of main entity in XML fuzzer (Nick Wellnhofer), + Consolidate seed corpus generation (Nick Wellnhofer), + Test fuzz targets with dummy driver (Nick Wellnhofer), + Fix regression introduced with commit d88df4b (Nick Wellnhofer), + Fix regression introduced with commit 74dcc10b (Nick Wellnhofer), + Add TODO comment in xinclude.c (Nick Wellnhofer), + Stop using maxParserDepth in xpath.c (Nick Wellnhofer), + Remove dead code in xinclude.c (Nick Wellnhofer), + Don't add formatting newlines to XInclude nodes (Nick Wellnhofer), + Don't use SAX1 if all element handlers are NULL (Nick Wellnhofer), + Remove unneeded progress checks in HTML parser (Nick Wellnhofer), + Use strcmp when fuzzing (Nick Wellnhofer), + Fix XPath fuzzer (Nick Wellnhofer), + Fuzz XInclude engine (Nick Wellnhofer), + Add XPath and XPointer fuzzer (Nick Wellnhofer), + Update fuzzing code (Nick Wellnhofer), + More *NodeDumpOutput fixes (Nick Wellnhofer), + Fix *NodeDumpOutput functions (Nick Wellnhofer), + Make xmlNodeDumpOutputInternal non-recursive (Nick Wellnhofer), + Make xhtmlNodeDumpOutput non-recursive (Nick Wellnhofer), + Make htmlNodeDumpFormatOutput non-recursive (Nick Wellnhofer), + Fix .gitattributes (Nick Wellnhofer), + Rework control flow in htmlCurrentChar (Nick Wellnhofer), + Make 'xmllint --html --push -' read from stdin (Nick Wellnhofer), + Remove misleading comments in xpath.c (Nick Wellnhofer), + Update to Devhelp index file format version 2 (Andre Klapper), + Set project language to C (Markus Rickert), + Add variable for working directory of XML Conformance Test Suite (Markus Rickert), + Add additional tests and XML Conformance Test Suite (Markus Rickert), + Add command line option for temp directory in runtest (Markus Rickert), + Ensure LF line endings for test files (Markus Rickert), + Enable runtests and testThreads (Markus Rickert), + Limit regexp nesting depth (Nick Wellnhofer), + Fix return values and documentation in encoding.c (Nick Wellnhofer), + Add regexp regression tests (David Kilzer), + Report error for invalid regexp quantifiers (Nick Wellnhofer), + Fix rebuilding docs, by hiding __attribute__((...)) behind a macro. (Martin Vidner), + Copy xs:duration parser from libexslt (Nick Wellnhofer), + Fuzz target for XML Schemas (Nick Wellnhofer), + Move entity recorder to fuzz.c (Nick Wellnhofer), + Fuzz target for HTML parser (Nick Wellnhofer), + Update GitLab CI container (Nick Wellnhofer), + Add options file for xml fuzzer (Nick Wellnhofer), + Add a couple of libFuzzer targets (Nick Wellnhofer), + Guard new calls to xmlValidatePopElement in xml_reader.c (Daniel Cheng), + Add LIBXML_VALID_ENABLED to xmlreader (Łukasz Wojniłowicz), + Fix typos (Nick Wellnhofer), + Disable LeakSanitizer (Nick Wellnhofer), + Stop calling SAX getEntity handler from XMLReader (Nick Wellnhofer), + Add test case for recursive external parsed entities (Nick Wellnhofer), + Enable error tests with entity substitution (Nick Wellnhofer), + Don't load external entity from xmlSAX2GetEntity (Nick Wellnhofer), + Merge code paths loading external entities (Nick Wellnhofer), + Copy some XMLReader option flags to parser context (Nick Wellnhofer), + Add xmlPopOutputCallbacks (Nick Wellnhofer), + Updated Python test reader2.py (Pieter van Oostrum), + Updated python/tests/tstLastError.py (Pieter van Oostrum), + Use random seed in xmlDictComputeFastKey (Ranier Vilela), + Enable more undefined behavior sanitizers (Nick Wellnhofer) + + + +v2.9.10: Oct 30 2019: + - Documentation: + Fix a few more typos ("fonction") (Nick Wellnhofer), + Large batch of typo fixes (Jared Yanovich), + Fix typos: tree: move{ -> s}, reconcil{i -> }ed, h{o -> e}ld by... (Jan Pokorný), + Fix typo: xpath: simpli{ -> fi}ed (Jan Pokorný), + Doc: do not mislead towards "infeasible" scenario wrt. xmlBufNodeDump (Jan Pokorný), + Fix comments in test code (zhouzhongyuan), + fix comment in testReader.c (zhouzhongyuan) + + - Portability: + Fix some release issues on Fedora 30 (Daniel Veillard), + Fix exponent digits when running tests under old MSVC (Daniel Richard G), + Work around buggy ceil() function on AIX (Daniel Richard G), + Don't call printf with NULL string in runtest.c (Daniel Richard G), + Switched from unsigned long to ptrdiff_t in parser.c (Stephen Chenney), + timsort.h: support older GCCs (Jérôme Duval), + Make configure.ac work with older pkg-config (Nick Wellnhofer), + Stop defining _REENTRANT on some Win32 platforms (Nick Wellnhofer), + Fix nanohttp.c on MinGW (Nick Wellnhofer), + Fix Windows compiler warning in testC14N.c (Nick Wellnhofer), + Merge testThreadsWin32.c into testThreads.c (Nick Wellnhofer), + Fix Python bindings under Windows (Nick Wellnhofer) + + - Bug Fixes: + Another fix for conditional sections at end of document (Nick Wellnhofer), + Fix for conditional sections at end of document (Nick Wellnhofer), + Make sure that Python tests exit with error code (Nick Wellnhofer), + Audit memory error handling in xpath.c (Nick Wellnhofer), + Fix error code in xmlTextWriterStartDocument (Nick Wellnhofer), + Fix integer overflow when counting written bytes (Nick Wellnhofer), + Fix uninitialized memory access in HTML parser (Nick Wellnhofer), + Fix memory leak in xmlSchemaValAtomicType (Nick Wellnhofer), + Disallow conditional sections in internal subset (Nick Wellnhofer), + Fix use-after-free in xmlTextReaderFreeNodeList (Nick Wellnhofer), + Fix Regextests (Nick Wellnhofer), + Fix empty branch in regex (Nick Wellnhofer), + Fix integer overflow in entity recursion check (Nick Wellnhofer), + Don't read external entities or XIncludes from stdin (Nick Wellnhofer), + Fix Schema determinism check of ##other namespaces (Nick Wellnhofer), + Fix potential null deref in xmlSchemaIDCFillNodeTables (zhouzhongyuan), + Fix potential memory leak in xmlBufBackToBuffer (Nick Wellnhofer), + Fix error message when processing XIncludes with fallbacks (Nick Wellnhofer), + Fix memory leak in xmlRegEpxFromParse (zhouzhongyuan), + 14:00 is a valid timezone for xs:dateTime (Nick Wellnhofer), + Fix memory leak in xmlParseBalancedChunkMemoryRecover (Zhipeng Xie), + Fix potential null deref in xmlRelaxNGParsePatterns (Nick Wellnhofer), + Misleading error message with xs:{min|max}Inclusive (bettermanzzy), + Fix memory leak in xmlXIncludeLoadTxt (Wang Kirin), + Partial fix for comparison of xs:durations (Nick Wellnhofer), + Fix null deref in xmlreader buffer (zhouzhongyuan), + Fix unability to RelaxNG-validate grammar with choice-based name class (Jan Pokorný), + Fix unability to validate ambiguously constructed interleave for RelaxNG (Jan Pokorný), + Fix possible null dereference in xmlXPathIdFunction (zhouzhongyuan), + fix memory leak in xmlAllocOutputBuffer (zhouzhongyuan), + Fix unsigned int overflow (Jens Eggerstedt), + dict.h: gcc 2.95 doesn't allow multiple storage classes (Nick Wellnhofer), + Fix another code path in xmlParseQName (Nick Wellnhofer), + Make sure that xmlParseQName returns NULL in error case (Nick Wellnhofer), + Fix build without reader but with pattern (Nick Wellnhofer), + Fix memory leak in xmlAllocOutputBufferInternal error path (Nick Wellnhofer), + Fix unsigned integer overflow (Nick Wellnhofer), + Fix return value of xmlOutputBufferWrite (Nick Wellnhofer), + Fix parser termination from "Double hyphen within comment" error (David Warring), + Fix call stack overflow in xmlFreePattern (Nick Wellnhofer), + Fix null deref in previous commit (Nick Wellnhofer), + Fix memory leaks in xmlXPathParseNameComplex error paths (Nick Wellnhofer), + Check for integer overflow in xmlXPtrEvalChildSeq (Nick Wellnhofer), + Fix xmllint dump of XPath namespace nodes (Nick Wellnhofer), + Fix float casts in xmlXPathSubstringFunction (Nick Wellnhofer), + Fix null deref in xmlregexp error path (Nick Wellnhofer), + Fix null pointer dereference in xmlTextReaderReadOuterXml (Nick Wellnhofer), + Fix memory leaks in xmlParseStartTag2 error paths (Nick Wellnhofer), + Fix memory leak in xmlSAX2StartElement (Nick Wellnhofer), + Fix commit "Memory leak in xmlFreeID (xmlreader.c)" (Nick Wellnhofer), + Fix NULL pointer deref in xmlTextReaderValidateEntity (Nick Wellnhofer), + Memory leak in xmlFreeTextReader (Nick Wellnhofer), + Memory leak in xmlFreeID (xmlreader.c) (Nick Wellnhofer) + + - Improvements: + Run XML conformance tests under CI (Nick Wellnhofer), + Update GitLab CI config (Nick Wellnhofer), + Propagate memory errors in valuePush (Nick Wellnhofer), + Propagate memory errors in xmlXPathCompExprAdd (Nick Wellnhofer), + Make xmlFreeDocElementContent non-recursive (Nick Wellnhofer), + Enable continuous integration via GitLab CI (Nick Wellnhofer), + Avoid ignored attribute warnings under GCC (Nick Wellnhofer), + Make xmlDumpElementContent non-recursive (Nick Wellnhofer), + Make apibuild.py ignore ATTRIBUTE_NO_SANITIZE (Nick Wellnhofer), + Mark xmlExp* symbols as removed (Nick Wellnhofer), + Make xmlParseConditionalSections non-recursive (Nick Wellnhofer), + Adjust expected error in Python tests (Nick Wellnhofer), + Make xmlTextReaderFreeNodeList non-recursive (Nick Wellnhofer), + Make xmlFreeNodeList non-recursive (Nick Wellnhofer), + Make xmlParseContent and xmlParseElement non-recursive (Nick Wellnhofer), + Remove executable bit from non-executable files (Nick Wellnhofer), + Fix expected output of test/schemas/any4 (Nick Wellnhofer), + Optimize build instructions in README (zhouzhongyuan), + xml2-config.in: Output CFLAGS and LIBS on the same line (Hugh McMaster), + xml2-config: Add a --dynamic switch to print only shared libraries (Hugh McMaster), + Annotate functions with __attribute__((no_sanitize)) (Nick Wellnhofer), + Fix warnings when compiling without reader or push parser (Nick Wellnhofer), + Remove unused member `doc` in xmlSaveCtxt (Nick Wellnhofer), + Limit recursion depth in xmlXPathCompOpEvalPredicate (Nick Wellnhofer), + Remove -Wno-array-bounds (Nick Wellnhofer), + Remove unreachable code in xmlXPathCountFunction (Nick Wellnhofer), + Improve XPath predicate and filter evaluation (Nick Wellnhofer), + Limit recursion depth in xmlXPathOptimizeExpression (Nick Wellnhofer), + Disable hash randomization when fuzzing (Nick Wellnhofer), + Optional recursion limit when parsing XPath expressions (Nick Wellnhofer), + Optional recursion limit when evaluating XPath expressions (Nick Wellnhofer), + Use break statements in xmlXPathCompOpEval (Nick Wellnhofer), + Optional XPath operation limit (Nick Wellnhofer), + Fix compilation with --with-minimum (Nick Wellnhofer), + Check XPath stack after calling functions (Nick Wellnhofer), + Remove debug printf in xmlreader.c (Nick Wellnhofer), + Always define LIBXML_THREAD_ENABLED when enabled (Michael Haubenwallner), + Regenerate NEWS (Nick Wellnhofer), + Change git repo URL (Nick Wellnhofer), + Change bug tracker URL (Nick Wellnhofer), + Remove outdated HTML file (Nick Wellnhofer), + Fix unused function warning in testapi.c (Nick Wellnhofer), + Add some generated test files to .gitignore (Nick Wellnhofer), + Remove unneeded function pointer casts (Nick Wellnhofer), + Fix -Wcast-function-type warnings (GCC 8) (Nick Wellnhofer), + Fix -Wformat-truncation warnings (GCC 8) (Nick Wellnhofer) + + - Cleanups: + Rebuild docs (Nick Wellnhofer), + Disable xmlExp regex code (Nick Wellnhofer), + Remove redundant code in xmlRelaxNGValidateState (Nick Wellnhofer), + Remove redundant code in xmlXPathCompRelationalExpr (Nick Wellnhofer) + + + v2.9.9: Jan 03 2019: - Security: CVE-2018-9251 CVE-2018-14567 Fix infinite loop in LZMA decompression (Nick Wellnhofer), @@ -120,7 +603,7 @@ 2.9.7: Nov 02 2017: - Documentation: - xmlcatalog: refresh man page wrt. quering system catalog easily (Jan Pokorný) + xmlcatalog: refresh man page wrt. querying system catalog easily (Jan Pokorný) - Portability: Fix deprecated Travis compiler flag (Nick Wellnhofer), @@ -440,7 +923,7 @@ - Improvements: Reuse xmlHaltParser() where it makes sense (Daniel Veillard), xmlStopParser reset errNo (Daniel Veillard), - Reenable xz support by default (Daniel Veillard), + Re-enable xz support by default (Daniel Veillard), Recover unescaped less-than character in HTML recovery parsing (Daniel Veillard), Allow HTML serializer to output HTML5 DOCTYPE (Shaun McCance), Regression test for bug #695699 (Nick Wellnhofer), @@ -814,7 +1297,7 @@ Harden the buffer code and make it more compatible (Daniel Veillard), More cleanups for input/buffers code (Daniel Veillard), Cleanup function xmlBufResetInput(), to set input from Buffer (Daniel Veillard) - Swicth the test program for characters to new input buffers (Daniel Veillard), + Switch the test program for characters to new input buffers (Daniel Veillard), Convert the HTML tree module to the new buffers (Daniel Veillard), Convert of the HTML parser to new input buffers (Daniel Veillard), Convert the writer to new output buffer and save APIs (Daniel Veillard), @@ -909,7 +1392,7 @@ Avoid memory leak if xmlParserInputBufferCreateIO fails (Lin Yi-Li), Prevent an infinite loop when dumping a node with encoding problems (Timothy Elliott), xmlParseNodeInContext problems with an empty document (Tim Elliott), - HTML element position is not detected propperly (Pavel Andrejs), + HTML element position is not detected properly (Pavel Andrejs), Fix an off by one pointer access (Jüri Aedla), Try to fix a problem with entities in SAX mode (Daniel Veillard), Fix a crash with xmllint --path on empty results (Daniel Veillard), @@ -937,7 +1420,7 @@ Small fix for previous commit (Daniel Veillard), Fix a potential freeing error in XPath (Daniel Veillard), Fix a potential memory access error (Daniel Veillard), - Reactivate the shared library versionning script (Daniel Veillard) + Reactivate the shared library versioning script (Daniel Veillard) - Improvements: use mingw C99 compatible functions {v}snprintf instead those from MSVC runtime (Roumen Petrov), @@ -1124,7 +1607,7 @@ Problem with extern extern in header (Daniel Veillard), Add -lnetwork for compiling on Haiku (Scott McCreary), Runtest portability patch for Solaris (Tim Rice), - Small patch to accomodate the Haiku OS (Scott McCreary), + Small patch to accommodate the Haiku OS (Scott McCreary), 584605 package VxWorks folder in the distribution (Daniel Veillard), 574017 Realloc too expensive on most platform (Daniel Veillard), Fix windows build (Rob Richards), @@ -1154,7 +1637,7 @@ 558452 RNG compilation of optional multiple child (Daniel Veillard), 579746 XSD validation not correct / nilable groups (Daniel Veillard), 502960 provide namespace stack when parsing entity (Daniel Veillard), - 566012 part 2 fix regresion tests and push mode (Daniel Veillard), + 566012 part 2 fix regression tests and push mode (Daniel Veillard), 566012 autodetected encoding and encoding conflict (Daniel Veillard), 584220 xpointer(/) and xinclude problems (Daniel Veillard), 587663 Incorrect Attribute-Value Normalization (Daniel Veillard), @@ -1281,14 +1764,14 @@ parsing and validation fixes based on the W3C regression tests, reader tree skipping function fix (Ashwin), Schemas regexps escaping fix (Volker Grabsch), handling of entity push errors (Ashwin), fix a slowdown - when encoder cant serialize characters on output + when encoder can't serialize characters on output - Code cleanup: compilation fix without the reader, without the output (Robert Schwebel), python whitespace (Martin), many space/tabs cleanups, serious cleanup of the entity handling code - Improvement: switch parser to XML-1.0 5th edition, add parsing flags for old versions, switch URI parsing to RFC 3986, add xmlSchemaValidCtxtGetParserCtxt (Holger Kaelberer), - new hashing functions for dictionnaries (based on Stefan Behnel work), + new hashing functions for dictionaries (based on Stefan Behnel work), improve handling of misplaced html/head/body in HTML parser, better regression test tools and code coverage display, better algorithms to detect various versions of the billion laughts attacks, make @@ -1346,7 +1829,7 @@ - Code cleanup: fix open() call third argument, regexp cut'n paste copy error, unused variable in __xmlGlobalInitMutexLock (Hannes Eder), - some make distcheck realted fixes (John Carr) + some make distcheck related fixes (John Carr) - Improvements: HTTP Header: includes port number (William Brack), testURI --debug option, @@ -1441,13 +1924,13 @@ - bug fix: xmlGetNodePath fix (Kasimier), xmlDOMWrapAdoptNode and attribute (Kasimier), crash when using the recover mode, xmlXPathEvalExpr problem (Kasimier), xmlXPathCompExprAdd bug (Kasimier), - missing destry in xmlFreeRMutex (Andrew Nosenko), XML Schemas fixes + missing destroy in xmlFreeRMutex (Andrew Nosenko), XML Schemas fixes (Kasimier), warning on entities processing, XHTML script and style serialization (Kasimier), python generator for long types, bug in xmlSchemaClearValidCtxt (Bertrand Fritsch), xmlSchemaXPathEvaluate allocation bug (Marton Illes), error message end of line (Rob Richards), fix attribute serialization in writer (Rob Richards), PHP4 DTD validation - crasher, parser safety patch (Ben Darnell), _private context propagation + crash, parser safety patch (Ben Darnell), _private context propagation when parsing entities (with Michael Day), fix entities behaviour when using SAX, URI to file path fix (Mikhail Zabaluev), disappearing validity context, arg error in SAX callback (Mike Hommey), fix mixed-content @@ -1588,7 +2071,7 @@ Anatolij), xmlSchemaPSimpleTypeErr error report (Kasimier Buchcik), xml: namespace ahndling in Schemas (Kasimier), empty model group in Schemas (Kasimier), wildcard in Schemas (Kasimier), URI composition (William), - xs:anyType in Schemas (Kasimier), Python resolver emmitting error + xs:anyType in Schemas (Kasimier), Python resolver emitting error messages directly, Python xmlAttr.parent (Jakub Piotr Clapa), trying to fix the file path/URI conversion, xmlTextReaderGetAttribute fix (Rob Richards), xmlSchemaFreeAnnot memleak (Kasimier), HTML UTF-8 @@ -1614,7 +2097,7 @@ - build fixes: Windows build (Rob Richards), Mingw compilation (Igor Zlatkovic), Windows Makefile (Igor), gcc warnings (Kasimier and andriy@google.com), use gcc weak references to pthread to avoid the - pthread dependancy on Linux, compilation problem (Steve Nairn), compiling + pthread dependency on Linux, compilation problem (Steve Nairn), compiling of subset (Morten Welinder), IPv6/ss_family compilation (William Brack), compilation when disabling parts of the library, standalone test distribution. @@ -1655,7 +2138,7 @@ Linux/ELF/gcc4 - bug fixes: schemas type decimal fixups (William Brack), xmmlint return code (Gerry Murphy), small schemas fixes (Matthew Burgess and GUY - Fabrice), workaround "DAV:" namespace brokeness in c14n (Aleksey Sanin), + Fabrice), workaround "DAV:" namespace brokenness in c14n (Aleksey Sanin), segfault in Schemas (Kasimier Buchcik), Schemas attribute validation (Kasimier), Prop related functions and xmlNewNodeEatName (Rob Richards), HTML serialization of name attribute on a elements, Python error handlers @@ -1674,7 +2157,7 @@ Bakefile support (Francesco Montorsi), Windows compilation (Joel Reed), some gcc4 fixes, HP-UX portability fixes (Rick Jones). - bug fixes: xmlSchemaElementDump namespace (Kasimier Buchcik), push and - xmlreader stopping on non-fatal errors, thread support for dictionnaries + xmlreader stopping on non-fatal errors, thread support for dictionaries reference counting (Gary Coady), internal subset and push problem, URL saved in xmlCopyDoc, various schemas bug fixes (Kasimier), Python paths fixup (Stephane Bidoul), xmlGetNodePath and namespaces, xmlSetNsProp fix @@ -1729,7 +2212,7 @@ - bug fixes: problem with XML::Libxml reported by Petr Pajas, encoding conversion functions return values, UTF-8 bug affecting XPath reported by Markus Bertheau, catalog problem with NULL entries (William Brack) - - documentation: fix to xmllint man page, some API function descritpion + - documentation: fix to xmllint man page, some API function description were updated. - improvements: DTD validation APIs provided at the Python level (Brent Hendricks) @@ -1869,12 +2352,12 @@ William), xmlUriEscape (Mark Vakoc), a Relax-NG notAllowed problem (with William), Relax-NG name classes compares (William), XInclude duplicate fallback (William), external DTD encoding detection (William), a DTD - validation bug (William), xmlReader Close() fix, recusive extention + validation bug (William), xmlReader Close() fix, recursive extension schemas - improvements: use xmlRead* APIs in test tools (Mark Vakoc), indenting save optimization, better handle IIS broken HTTP redirect behaviour (Ian Hummel), HTML parser frameset (James Bursa), libxml2-python RPM - dependancy, XML Schemas union support (Kasimier Buchcik), warning removal + dependency, XML Schemas union support (Kasimier Buchcik), warning removal clanup (William), keep ChangeLog compressed when installing from RPMs - documentation: examples and xmlDocDumpMemory docs (John Fleck), new example (load, xpath, modify, save), xmlCatalogDump() comments, @@ -1925,7 +2408,7 @@ William) reported by Yuuichi Teranishi - bugfixes: make test and path issues, xmlWriter attribute serialization (William Brack), xmlWriter indentation (William), schemas validation - (Eric Haszlakiewicz), XInclude dictionnaries issues (William and Oleg + (Eric Haszlakiewicz), XInclude dictionaries issues (William and Oleg Paraschenko), XInclude empty fallback (William), HTML warnings (William), XPointer in XInclude (William), Python namespace serialization, isolat1ToUTF8 bound error (Alfred Mickautsch), output of parameter @@ -1941,12 +2424,12 @@ - Windows compilation: mingw, msys (Mikhail Grushinskiy), function prototype (Cameron Johnson), MSVC6 compiler warnings, _WINSOCKAPI_ patch - - Parsers: added xmlByteConsumed(ctxt) API to get the byte offest in + - Parsers: added xmlByteConsumed(ctxt) API to get the byte offset in input. 2.6.5: Jan 25 2004: - - Bugfixes: dictionnaries for schemas (William Brack), regexp segfault + - Bugfixes: dictionaries for schemas (William Brack), regexp segfault (William), xs:all problem (William), a number of XPointer bugfixes (William), xmllint error go to stderr, DTD validation problem with namespace, memory leak (William), SAX1 cleanup and minimal options fixes @@ -2886,7 +3369,7 @@ also contains numerous fixes and enhancements: added xmlStopParser() to stop parsing - improved a lot parsing speed when there is large CDATA blocs + improved a lot parsing speed when there is large CDATA blocks includes XPath patches provided by Picdar Technology tried to fix as much as possible DTD validation and namespace related problems @@ -2895,7 +3378,7 @@ - added xmlStopParser() to stop parsing - - improved a lot parsing speed when there is large CDATA blocs + - improved a lot parsing speed when there is large CDATA blocks - includes XPath patches provided by Picdar Technology - tried to fix as much as possible DTD validation and namespace related problems
diff --git a/third_party/libxml/src/README b/third_party/libxml/src/README deleted file mode 100644 index 4957517..0000000 --- a/third_party/libxml/src/README +++ /dev/null
@@ -1,40 +0,0 @@ - - XML toolkit from the GNOME project - -Full documentation is available on-line at - http://xmlsoft.org/ - -This code is released under the MIT Licence see the Copyright file. - -To build on an Unixised setup: - ./configure ; make ; make install - if the ./configure file does not exist, run ./autogen.sh instead. -To build on Windows: - see instructions on win32/Readme.txt - -To assert build quality: - on an Unixised setup: - run make tests - otherwise: - There is 3 standalone tools runtest.c runsuite.c testapi.c, which - should compile as part of the build or as any application would. - Launch them from this directory to get results, runtest checks - the proper functioning of libxml2 main APIs while testapi does - a full coverage check. Report failures to the list. - -To report bugs, follow the instructions at: - http://xmlsoft.org/bugs.html - -A mailing-list xml@gnome.org is available, to subscribe: - http://mail.gnome.org/mailman/listinfo/xml - -The list archive is at: - http://mail.gnome.org/archives/xml/ - -All technical answers asked privately will be automatically answered on -the list and archived for public access unless privacy is explicitly -required and justified. - -Daniel Veillard - -$Id$
diff --git a/third_party/libxml/src/README.md b/third_party/libxml/src/README.md new file mode 100644 index 0000000..ad423e6 --- /dev/null +++ b/third_party/libxml/src/README.md
@@ -0,0 +1,126 @@ +# libxml2 + +libxml2 is an XML toolkit implemented in C, originally developed for +the GNOME Project. + +Full documentation is available at +<https://gitlab.gnome.org/GNOME/libxml2/-/wikis>. + +Bugs should be reported at +<https://gitlab.gnome.org/GNOME/libxml2/-/issues>. + +A mailing list xml@gnome.org is available. You can subscribe at +<https://mail.gnome.org/mailman/listinfo/xml>. The list archive is at +<https://mail.gnome.org/archives/xml/>. + +## License + +This code is released under the MIT License, see the Copyright file. + +## Build instructions + +libxml2 can be built with GNU Autotools, CMake, or several other build +systems in platform-specific subdirectories. + +### Autotools (for POSIX systems like Linux, BSD, macOS) + +If you build from a Git tree, you have to install Autotools and start +by generating the configuration files with: + + ./autogen.sh + +If you build from a source tarball, extract the archive with: + + tar xf libxml2-xxx.tar.gz + cd libxml2-xxx + +To see a list of build options: + + ./configure --help + +Also see the INSTALL file for additional instructions. Then you can +configure and build the library: + + ./configure [possible options] + make + +Note that by default, no optimization options are used. You have to +enable them manually, for example with: + + CFLAGS='-O2 -fno-semantic-interposition' ./configure + +Now you can run the test suite with: + + make check + +Please report test failures to the mailing list or bug tracker. + +Then you can install the library: + + make install + +At that point you may have to rerun ldconfig or a similar utility to +update your list of installed shared libs. + +### CMake (mainly for Windows) + +Another option for compiling libxml is using CMake: + + cmake -E tar xf libxml2-xxx.tar.gz + cmake -S libxml2-xxx -B libxml2-xxx-build [possible options] + cmake --build libxml2-xxx-build + cmake --install libxml2-xxx-build + +Common CMake options include: + + -D BUILD_SHARED_LIBS=OFF # build static libraries + -D CMAKE_BUILD_TYPE=Release # specify build type + -D CMAKE_INSTALL_PREFIX=/usr/local # specify the install path + -D LIBXML2_WITH_ICONV=OFF # disable iconv + -D LIBXML2_WITH_LZMA=OFF # disable liblzma + -D LIBXML2_WITH_PYTHON=OFF # disable Python + -D LIBXML2_WITH_ZLIB=OFF # disable libz + +You can also open the libxml source directory with its CMakeLists.txt +directly in various IDEs such as CLion, QtCreator, or Visual Studio. + +## Dependencies + +Libxml does not require any other libraries. A platform with somewhat +recent POSIX support should be sufficient (please report any violation +to this rule you may find). + +However, if found at configuration time, libxml will detect and use +the following libraries: + +- [libz](https://zlib.net/), a highly portable and widely available + compression library. +- [liblzma](https://tukaani.org/xz/), another compression library. +- [libiconv](https://www.gnu.org/software/libiconv/), a character encoding + conversion library. The iconv function is part of POSIX.1-2001, so + libiconv isn't required on modern UNIX-like systems like Linux, BSD or + macOS. +- [ICU](https://icu.unicode.org/), a Unicode library. Mainly useful as an + alternative to iconv on Windows. Unnecessary on most other systems. + +## Contributing + +The current version of the code can be found in GNOME's GitLab at +at <https://gitlab.gnome.org/GNOME/libxml2>. The best way to get involved +is by creating issues and merge requests on GitLab. Alternatively, you can +start discussions and send patches to the mailing list. If you want to +work with patches, please format them with git-format-patch and use plain +text attachments. + +All code must conform to C89 and pass the GitLab CI tests. Add regression +tests if possible. + +## Authors + +- Daniel Veillard +- Bjorn Reese +- William Brack +- Igor Zlatkovic for the Windows port +- Aleksey Sanin +- Nick Wellnhofer +
diff --git a/third_party/libxml/src/SAX2.c b/third_party/libxml/src/SAX2.c index 0319246..9a093bc 100644 --- a/third_party/libxml/src/SAX2.c +++ b/third_party/libxml/src/SAX2.c
@@ -181,31 +181,6 @@ } /** - * xmlNsErrMsg: - * @ctxt: an XML parser context - * @error: the error number - * @msg: the error message - * @str1: an error string - * @str2: an error string - * - * Handle a namespace error - */ -static void LIBXML_ATTR_FORMAT(3,0) -xmlNsErrMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error, - const char *msg, const xmlChar *str1, const xmlChar *str2) -{ - if ((ctxt != NULL) && (ctxt->disableSAX != 0) && - (ctxt->instate == XML_PARSER_EOF)) - return; - if (ctxt != NULL) - ctxt->errNo = error; - __xmlRaiseError(NULL, NULL, NULL, ctxt, NULL, XML_FROM_NAMESPACE, error, - XML_ERR_ERROR, NULL, 0, - (const char *) str1, (const char *) str2, - NULL, 0, 0, msg, str1, str2); -} - -/** * xmlNsWarnMsg: * @ctxt: an XML parser context * @error: the error number @@ -709,6 +684,9 @@ xmlAttributePtr attr; xmlChar *name = NULL, *prefix = NULL; + /* Avoid unused variable warning if features are disabled. */ + (void) attr; + if ((ctxt == NULL) || (ctxt->myDoc == NULL)) return; @@ -776,6 +754,9 @@ xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; xmlElementPtr elem = NULL; + /* Avoid unused variable warning if features are disabled. */ + (void) elem; + if ((ctxt == NULL) || (ctxt->myDoc == NULL)) return; @@ -822,6 +803,9 @@ xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; xmlNotationPtr nota = NULL; + /* Avoid unused variable warning if features are disabled. */ + (void) nota; + if ((ctxt == NULL) || (ctxt->myDoc == NULL)) return; @@ -1052,6 +1036,31 @@ #if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) || defined(LIBXML_LEGACY_ENABLED) /** + * xmlNsErrMsg: + * @ctxt: an XML parser context + * @error: the error number + * @msg: the error message + * @str1: an error string + * @str2: an error string + * + * Handle a namespace error + */ +static void LIBXML_ATTR_FORMAT(3,0) +xmlNsErrMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error, + const char *msg, const xmlChar *str1, const xmlChar *str2) +{ + if ((ctxt != NULL) && (ctxt->disableSAX != 0) && + (ctxt->instate == XML_PARSER_EOF)) + return; + if (ctxt != NULL) + ctxt->errNo = error; + __xmlRaiseError(NULL, NULL, NULL, ctxt, NULL, XML_FROM_NAMESPACE, error, + XML_ERR_ERROR, NULL, 0, + (const char *) str1, (const char *) str2, + NULL, 0, 0, msg, str1, str2); +} + +/** * xmlSAX2AttributeInternal: * @ctx: the user data (XML parser context) * @fullname: The attribute name, including namespace prefix @@ -1144,6 +1153,9 @@ xmlNsPtr nsret; xmlChar *val; + /* Avoid unused variable warning if features are disabled. */ + (void) nsret; + if (!ctxt->replaceEntities) { ctxt->depth++; val = xmlStringDecodeEntities(ctxt, value, XML_SUBSTITUTE_REF, @@ -1206,6 +1218,9 @@ xmlNsPtr nsret; xmlChar *val; + /* Avoid unused variable warning if features are disabled. */ + (void) nsret; + if (!ctxt->replaceEntities) { ctxt->depth++; val = xmlStringDecodeEntities(ctxt, value, XML_SUBSTITUTE_REF, @@ -1368,7 +1383,12 @@ #endif /* LIBXML_VALID_ENABLED */ if (((ctxt->loadsubset & XML_SKIP_IDS) == 0) && (((ctxt->replaceEntities == 0) && (ctxt->external != 2)) || - ((ctxt->replaceEntities != 0) && (ctxt->inSubset == 0)))) { + ((ctxt->replaceEntities != 0) && (ctxt->inSubset == 0))) && + /* Don't create IDs containing entity references */ + (ret->children != NULL) && + (ret->children->type == XML_TEXT_NODE) && + (ret->children->next == NULL)) { + xmlChar *content = ret->children->content; /* * when validating, the ID registration is done at the attribute * validation level. Otherwise we have to do specific handling here. @@ -1379,16 +1399,16 @@ * * Open issue: normalization of the value. */ - if (xmlValidateNCName(value, 1) != 0) { + if (xmlValidateNCName(content, 1) != 0) { xmlErrValid(ctxt, XML_DTD_XMLID_VALUE, "xml:id : attribute value %s is not an NCName\n", - (const char *) value, NULL); + (const char *) content, NULL); } - xmlAddID(&ctxt->vctxt, ctxt->myDoc, value, ret); + xmlAddID(&ctxt->vctxt, ctxt->myDoc, content, ret); } else if (xmlIsID(ctxt->myDoc, ctxt->node, ret)) - xmlAddID(&ctxt->vctxt, ctxt->myDoc, value, ret); + xmlAddID(&ctxt->vctxt, ctxt->myDoc, content, ret); else if (xmlIsRef(ctxt->myDoc, ctxt->node, ret)) - xmlAddRef(&ctxt->vctxt, ctxt->myDoc, value, ret); + xmlAddRef(&ctxt->vctxt, ctxt->myDoc, content, ret); } error: @@ -1747,7 +1767,8 @@ * If it's the Document root, finish the DTD validation and * check the document root element for validity */ - if ((ctxt->validate) && (ctxt->vctxt.finishDtd == XML_CTXT_FINISH_DTD_0)) { + if ((ctxt->validate) && + ((ctxt->vctxt.flags & XML_VCTXT_DTD_VALIDATED) == 0)) { int chk; chk = xmlValidateDtdFinal(&ctxt->vctxt, ctxt->myDoc); @@ -1756,7 +1777,7 @@ if (chk < 0) ctxt->wellFormed = 0; ctxt->valid &= xmlValidateRoot(&ctxt->vctxt, ctxt->myDoc); - ctxt->vctxt.finishDtd = XML_CTXT_FINISH_DTD_1; + ctxt->vctxt.flags |= XML_VCTXT_DTD_VALIDATED; } #endif /* LIBXML_VALID_ENABLED */ @@ -2120,7 +2141,12 @@ #endif /* LIBXML_VALID_ENABLED */ if (((ctxt->loadsubset & XML_SKIP_IDS) == 0) && (((ctxt->replaceEntities == 0) && (ctxt->external != 2)) || - ((ctxt->replaceEntities != 0) && (ctxt->inSubset == 0)))) { + ((ctxt->replaceEntities != 0) && (ctxt->inSubset == 0))) && + /* Don't create IDs containing entity references */ + (ret->children != NULL) && + (ret->children->type == XML_TEXT_NODE) && + (ret->children->next == NULL)) { + xmlChar *content = ret->children->content; /* * when validating, the ID registration is done at the attribute * validation level. Otherwise we have to do specific handling here. @@ -2133,27 +2159,20 @@ * * Open issue: normalization of the value. */ - if (dup == NULL) - dup = xmlStrndup(value, valueend - value); #if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) || defined(LIBXML_LEGACY_ENABLED) #ifdef LIBXML_VALID_ENABLED - if (xmlValidateNCName(dup, 1) != 0) { + if (xmlValidateNCName(content, 1) != 0) { xmlErrValid(ctxt, XML_DTD_XMLID_VALUE, "xml:id : attribute value %s is not an NCName\n", - (const char *) dup, NULL); + (const char *) content, NULL); } #endif #endif - xmlAddID(&ctxt->vctxt, ctxt->myDoc, dup, ret); + xmlAddID(&ctxt->vctxt, ctxt->myDoc, content, ret); } else if (xmlIsID(ctxt->myDoc, ctxt->node, ret)) { - /* might be worth duplicate entry points and not copy */ - if (dup == NULL) - dup = xmlStrndup(value, valueend - value); - xmlAddID(&ctxt->vctxt, ctxt->myDoc, dup, ret); + xmlAddID(&ctxt->vctxt, ctxt->myDoc, content, ret); } else if (xmlIsRef(ctxt->myDoc, ctxt->node, ret)) { - if (dup == NULL) - dup = xmlStrndup(value, valueend - value); - xmlAddRef(&ctxt->vctxt, ctxt->myDoc, dup, ret); + xmlAddRef(&ctxt->vctxt, ctxt->myDoc, content, ret); } } if (dup != NULL) @@ -2405,7 +2424,8 @@ * If it's the Document root, finish the DTD validation and * check the document root element for validity */ - if ((ctxt->validate) && (ctxt->vctxt.finishDtd == XML_CTXT_FINISH_DTD_0)) { + if ((ctxt->validate) && + ((ctxt->vctxt.flags & XML_VCTXT_DTD_VALIDATED) == 0)) { int chk; chk = xmlValidateDtdFinal(&ctxt->vctxt, ctxt->myDoc); @@ -2414,7 +2434,7 @@ if (chk < 0) ctxt->wellFormed = 0; ctxt->valid &= xmlValidateRoot(&ctxt->vctxt, ctxt->myDoc); - ctxt->vctxt.finishDtd = XML_CTXT_FINISH_DTD_1; + ctxt->vctxt.flags |= XML_VCTXT_DTD_VALIDATED; } #endif /* LIBXML_VALID_ENABLED */ } @@ -3033,5 +3053,3 @@ } #endif /* LIBXML_DOCB_ENABLED */ -#define bottom_SAX2 -#include "elfgcchack.h"
diff --git a/third_party/libxml/src/TODO b/third_party/libxml/src/TODO index 94d34c8..95e1c34 100644 --- a/third_party/libxml/src/TODO +++ b/third_party/libxml/src/TODO
@@ -5,8 +5,6 @@ TODO for the XML parser and stuff: ================================== - $Id$ - this tend to be outdated :-\ ... DOCS:
diff --git a/third_party/libxml/src/buf.c b/third_party/libxml/src/buf.c index 24368d37..f4356540 100644 --- a/third_party/libxml/src/buf.c +++ b/third_party/libxml/src/buf.c
@@ -17,12 +17,8 @@ #include <string.h> /* for memset() only ! */ #include <limits.h> -#ifdef HAVE_CTYPE_H #include <ctype.h> -#endif -#ifdef HAVE_STDLIB_H #include <stdlib.h> -#endif #include <libxml/tree.h> #include <libxml/globals.h> @@ -1347,5 +1343,3 @@ return(0); } -#define bottom_buf -#include "elfgcchack.h"
diff --git a/third_party/libxml/src/chvalid.c b/third_party/libxml/src/chvalid.c index 06e8db0..f4fa44a 100644 --- a/third_party/libxml/src/chvalid.c +++ b/third_party/libxml/src/chvalid.c
@@ -332,5 +332,3 @@ return(xmlIsPubidCharQ(ch)); } -#define bottom_chvalid -#include "elfgcchack.h"
diff --git a/third_party/libxml/src/config.h.cmake.in b/third_party/libxml/src/config.h.cmake.in index e093563..bb9d340d 100644 --- a/third_party/libxml/src/config.h.cmake.in +++ b/third_party/libxml/src/config.h.cmake.in
@@ -16,9 +16,6 @@ /* Whether struct sockaddr::__ss_family exists */ #cmakedefine HAVE_BROKEN_SS_FAMILY 1 -/* Define to 1 if you have the <ctype.h> header file. */ -#cmakedefine HAVE_CTYPE_H 1 - /* Define to 1 if you have the <dlfcn.h> header file. */ #cmakedefine HAVE_DLFCN_H 1 @@ -28,18 +25,9 @@ /* Define to 1 if you have the <dl.h> header file. */ #cmakedefine HAVE_DL_H 1 -/* Define to 1 if you have the <errno.h> header file. */ -#cmakedefine HAVE_ERRNO_H 1 - /* Define to 1 if you have the <fcntl.h> header file. */ #cmakedefine HAVE_FCNTL_H 1 -/* Define to 1 if you have the <float.h> header file. */ -#cmakedefine HAVE_FLOAT_H 1 - -/* Define to 1 if you have the `fprintf' function. */ -#cmakedefine HAVE_FPRINTF 1 - /* Define to 1 if you have the `ftime' function. */ #cmakedefine HAVE_FTIME 1 @@ -61,18 +49,6 @@ /* Define if readline library is there (-lreadline) */ #cmakedefine HAVE_LIBREADLINE 1 -/* Define to 1 if you have the <limits.h> header file. */ -#cmakedefine HAVE_LIMITS_H 1 - -/* Define to 1 if you have the `localtime' function. */ -#cmakedefine HAVE_LOCALTIME 1 - -/* Define to 1 if you have the <malloc.h> header file. */ -#cmakedefine HAVE_MALLOC_H 1 - -/* Define to 1 if you have the <math.h> header file. */ -#cmakedefine HAVE_MATH_H 1 - /* Define to 1 if you have the `mmap' function. */ #cmakedefine HAVE_MMAP 1 @@ -93,18 +69,12 @@ /* Define to 1 if you have the <poll.h> header file. */ #cmakedefine HAVE_POLL_H 1 -/* Define to 1 if you have the `printf' function. */ -#cmakedefine HAVE_PRINTF 1 - /* Define if <pthread.h> is there */ #cmakedefine HAVE_PTHREAD_H 1 /* Define to 1 if you have the `putenv' function. */ #cmakedefine HAVE_PUTENV 1 -/* Define to 1 if you have the `rand' function. */ -#cmakedefine HAVE_RAND 1 - /* Define to 1 if you have the `rand_r' function. */ #cmakedefine HAVE_RAND_R 1 @@ -114,42 +84,12 @@ /* Have shl_load based dso */ #cmakedefine HAVE_SHLLOAD 1 -/* Define to 1 if you have the <signal.h> header file. */ -#cmakedefine HAVE_SIGNAL_H 1 - -/* Define to 1 if you have the `snprintf' function. */ -#cmakedefine HAVE_SNPRINTF 1 - -/* Define to 1 if you have the `sprintf' function. */ -#cmakedefine HAVE_SPRINTF 1 - -/* Define to 1 if you have the `srand' function. */ -#cmakedefine HAVE_SRAND 1 - -/* Define to 1 if you have the `sscanf' function. */ -#cmakedefine HAVE_SSCANF 1 - /* Define to 1 if you have the `stat' function. */ #cmakedefine HAVE_STAT 1 -/* Define to 1 if you have the <stdarg.h> header file. */ -#cmakedefine HAVE_STDARG_H 1 - /* Define to 1 if you have the <stdint.h> header file. */ #cmakedefine HAVE_STDINT_H 1 -/* Define to 1 if you have the <stdlib.h> header file. */ -#cmakedefine HAVE_STDLIB_H 1 - -/* Define to 1 if you have the `strftime' function. */ -#cmakedefine HAVE_STRFTIME 1 - -/* Define to 1 if you have the <strings.h> header file. */ -#cmakedefine HAVE_STRINGS_H 1 - -/* Define to 1 if you have the <string.h> header file. */ -#cmakedefine HAVE_STRING_H 1 - /* Define to 1 if you have the <sys/mman.h> header file. */ #cmakedefine HAVE_SYS_MMAN_H 1 @@ -171,27 +111,12 @@ /* Define to 1 if you have the <sys/types.h> header file. */ #cmakedefine HAVE_SYS_TYPES_H 1 -/* Define to 1 if you have the `time' function. */ -#cmakedefine HAVE_TIME 1 - -/* Define to 1 if you have the <time.h> header file. */ -#cmakedefine HAVE_TIME_H 1 - /* Define to 1 if you have the <unistd.h> header file. */ #cmakedefine HAVE_UNISTD_H 1 /* Whether va_copy() is available */ #cmakedefine HAVE_VA_COPY 1 -/* Define to 1 if you have the `vfprintf' function. */ -#cmakedefine HAVE_VFPRINTF 1 - -/* Define to 1 if you have the `vsnprintf' function. */ -#cmakedefine HAVE_VSNPRINTF 1 - -/* Define to 1 if you have the `vsprintf' function. */ -#cmakedefine HAVE_VSPRINTF 1 - /* Define to 1 if you have the <zlib.h> header file. */ #cmakedefine HAVE_ZLIB_H 1
diff --git a/third_party/libxml/src/config.h.in b/third_party/libxml/src/config.h.in index ed6ddec..20feceb 100644 --- a/third_party/libxml/src/config.h.in +++ b/third_party/libxml/src/config.h.in
@@ -18,13 +18,6 @@ /* Whether struct sockaddr::__ss_family exists */ #undef HAVE_BROKEN_SS_FAMILY -/* Define to 1 if you have the <ctype.h> header file. */ -#undef HAVE_CTYPE_H - -/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'. - */ -#undef HAVE_DIRENT_H - /* Define to 1 if you have the <dlfcn.h> header file. */ #undef HAVE_DLFCN_H @@ -34,18 +27,9 @@ /* Define to 1 if you have the <dl.h> header file. */ #undef HAVE_DL_H -/* Define to 1 if you have the <errno.h> header file. */ -#undef HAVE_ERRNO_H - /* Define to 1 if you have the <fcntl.h> header file. */ #undef HAVE_FCNTL_H -/* Define to 1 if you have the <float.h> header file. */ -#undef HAVE_FLOAT_H - -/* Define to 1 if you have the `fprintf' function. */ -#undef HAVE_FPRINTF - /* Define to 1 if you have the `ftime' function. */ #undef HAVE_FTIME @@ -67,21 +51,9 @@ /* Define if readline library is there (-lreadline) */ #undef HAVE_LIBREADLINE -/* Define to 1 if you have the <limits.h> header file. */ -#undef HAVE_LIMITS_H - -/* Define to 1 if you have the `localtime' function. */ -#undef HAVE_LOCALTIME - /* Define to 1 if you have the <lzma.h> header file. */ #undef HAVE_LZMA_H -/* Define to 1 if you have the <malloc.h> header file. */ -#undef HAVE_MALLOC_H - -/* Define to 1 if you have the <math.h> header file. */ -#undef HAVE_MATH_H - /* Define to 1 if you have the `mmap' function. */ #undef HAVE_MMAP @@ -93,9 +65,6 @@ # undef /**/ HAVE_MMAP #endif -/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */ -#undef HAVE_NDIR_H - /* Define to 1 if you have the <netdb.h> header file. */ #undef HAVE_NETDB_H @@ -105,18 +74,12 @@ /* Define to 1 if you have the <poll.h> header file. */ #undef HAVE_POLL_H -/* Define to 1 if you have the `printf' function. */ -#undef HAVE_PRINTF - /* Define if <pthread.h> is there */ #undef HAVE_PTHREAD_H /* Define to 1 if you have the `putenv' function. */ #undef HAVE_PUTENV -/* Define to 1 if you have the `rand' function. */ -#undef HAVE_RAND - /* Define to 1 if you have the `rand_r' function. */ #undef HAVE_RAND_R @@ -126,30 +89,12 @@ /* Have shl_load based dso */ #undef HAVE_SHLLOAD -/* Define to 1 if you have the `signal' function. */ -#undef HAVE_SIGNAL - -/* Define to 1 if you have the <signal.h> header file. */ -#undef HAVE_SIGNAL_H - /* Define to 1 if you have the `snprintf' function. */ #undef HAVE_SNPRINTF -/* Define to 1 if you have the `sprintf' function. */ -#undef HAVE_SPRINTF - -/* Define to 1 if you have the `srand' function. */ -#undef HAVE_SRAND - -/* Define to 1 if you have the `sscanf' function. */ -#undef HAVE_SSCANF - /* Define to 1 if you have the `stat' function. */ #undef HAVE_STAT -/* Define to 1 if you have the <stdarg.h> header file. */ -#undef HAVE_STDARG_H - /* Define to 1 if you have the <stdint.h> header file. */ #undef HAVE_STDINT_H @@ -159,26 +104,15 @@ /* Define to 1 if you have the <stdlib.h> header file. */ #undef HAVE_STDLIB_H -/* Define to 1 if you have the `strftime' function. */ -#undef HAVE_STRFTIME - /* Define to 1 if you have the <strings.h> header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the <string.h> header file. */ #undef HAVE_STRING_H -/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'. - */ -#undef HAVE_SYS_DIR_H - /* Define to 1 if you have the <sys/mman.h> header file. */ #undef HAVE_SYS_MMAN_H -/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'. - */ -#undef HAVE_SYS_NDIR_H - /* Define to 1 if you have the <sys/select.h> header file. */ #undef HAVE_SYS_SELECT_H @@ -197,27 +131,15 @@ /* Define to 1 if you have the <sys/types.h> header file. */ #undef HAVE_SYS_TYPES_H -/* Define to 1 if you have the `time' function. */ -#undef HAVE_TIME - -/* Define to 1 if you have the <time.h> header file. */ -#undef HAVE_TIME_H - /* Define to 1 if you have the <unistd.h> header file. */ #undef HAVE_UNISTD_H /* Whether va_copy() is available */ #undef HAVE_VA_COPY -/* Define to 1 if you have the `vfprintf' function. */ -#undef HAVE_VFPRINTF - /* Define to 1 if you have the `vsnprintf' function. */ #undef HAVE_VSNPRINTF -/* Define to 1 if you have the `vsprintf' function. */ -#undef HAVE_VSPRINTF - /* Define to 1 if you have the <zlib.h> header file. */ #undef HAVE_ZLIB_H
diff --git a/third_party/libxml/src/configure.ac b/third_party/libxml/src/configure.ac index 45e1df4..5f9dfa7 100644 --- a/third_party/libxml/src/configure.ac +++ b/third_party/libxml/src/configure.ac
@@ -3,7 +3,7 @@ m4_define([MAJOR_VERSION], 2) m4_define([MINOR_VERSION], 9) -m4_define([MICRO_VERSION], 12) +m4_define([MICRO_VERSION], 13) AC_INIT([libxml2],[MAJOR_VERSION.MINOR_VERSION.MICRO_VERSION]) AC_CONFIG_SRCDIR([entities.c]) @@ -21,21 +21,7 @@ LIBXML_VERSION_NUMBER=`expr $LIBXML_MAJOR_VERSION \* 10000 + $LIBXML_MINOR_VERSION \* 100 + $LIBXML_MICRO_VERSION` -if test -f CVS/Entries ; then - extra=`grep ChangeLog CVS/Entries | grep -v LIBXML | sed -e s\%/ChangeLog/1\.%% -e s\%/.*$%%` - echo extra=$extra - if test "$extra" != "" - then - LIBXML_VERSION_EXTRA="-CVS$extra" - fi -else if test -d .svn ; then - extra=`svn info | grep Revision | sed 's+Revision: ++'` - echo extra=$extra - if test "$extra" != "" - then - LIBXML_VERSION_EXTRA="-SVN$extra" - fi -else if test -d .git ; then +if test -d .git ; then extra=`git describe 2>/dev/null | sed 's+LIBXML[[0-9.]]*-++'` echo extra=$extra if test "$extra" != "" @@ -43,8 +29,7 @@ LIBXML_VERSION_EXTRA="-GIT$extra" fi fi -fi -fi + AC_SUBST(LIBXML_MAJOR_VERSION) AC_SUBST(LIBXML_MINOR_VERSION) AC_SUBST(LIBXML_MICRO_VERSION) @@ -113,11 +98,11 @@ AC_ARG_WITH(debug, [ --with-debug add the debugging module (on)]) AC_ARG_WITH(docbook, -[ --with-docbook add Docbook SGML support (on)]) +[ --with-docbook add Docbook SGML support (off)]) AC_ARG_WITH(fexceptions, [ --with-fexceptions add GCC flag -fexceptions for C++ exceptions (off)]) AC_ARG_WITH(ftp, -[ --with-ftp add the FTP support (on)]) +[ --with-ftp add the FTP support (off)]) AC_ARG_WITH(history, [ --with-history add history support to xmllint shell(off)]) AC_ARG_WITH(html, @@ -140,7 +125,7 @@ AC_ARG_WITH(iso8859x, [ --with-iso8859x add ISO8859X support if no iconv (on)]) AC_ARG_WITH(legacy, -[ --with-legacy add deprecated APIs for compatibility (on)]) +[ --with-legacy add deprecated APIs for compatibility (off)]) AC_ARG_WITH(mem_debug, [ --with-mem-debug add the memory debugging module (off)]) AC_ARG_WITH(minimum, @@ -218,7 +203,7 @@ if test "$enable_rebuild_docs" = "yes" -a "$srcdir" != "."; then AC_MSG_ERROR([cannot rebuild docs when builddir != srcdir]) fi -AM_CONDITIONAL([REBUILD_DOCS], [test "$enable_rebuild_docs" = "yes" -o "$USER" = "veillard"]) +AM_CONDITIONAL([REBUILD_DOCS], [test "$enable_rebuild_docs" = "yes"]) dnl dnl hard dependencies on options @@ -261,18 +246,10 @@ then with_debug=no fi - if test "$with_docbook" = "" - then - with_docbook=no - fi if test "$with_fexceptions" = "" then with_fexceptions=no fi - if test "$with_ftp" = "" - then - with_ftp=no - fi if test "$with_history" = "" then with_history=no @@ -293,10 +270,6 @@ then with_iso8859x=no fi - if test "$with_legacy" = "" - then - with_legacy=no - fi if test "$with_mem_debug" = "" then with_mem_debug=no @@ -469,23 +442,12 @@ echo Checking headers dnl Checks for header files. -AC_HEADER_DIRENT -AC_HEADER_STDC AC_CHECK_HEADERS([fcntl.h]) AC_CHECK_HEADERS([unistd.h]) -AC_CHECK_HEADERS([ctype.h]) -AC_CHECK_HEADERS([errno.h]) -AC_CHECK_HEADERS([malloc.h]) -AC_CHECK_HEADERS([stdarg.h]) AC_CHECK_HEADERS([sys/stat.h]) AC_CHECK_HEADERS([sys/types.h]) AC_CHECK_HEADERS([stdint.h]) AC_CHECK_HEADERS([inttypes.h]) -AC_CHECK_HEADERS([time.h]) -AC_CHECK_HEADERS([math.h]) -AC_CHECK_HEADERS([limits.h]) -AC_CHECK_HEADERS([float.h]) -AC_CHECK_HEADERS([stdlib.h]) AC_CHECK_HEADERS([sys/socket.h], [], [], [#if HAVE_SYS_TYPES_H # include <sys/types.h> @@ -510,7 +472,6 @@ AC_CHECK_HEADERS([poll.h]) AC_CHECK_HEADERS([sys/mman.h]) AC_CHECK_HEADERS([sys/timeb.h]) -AC_CHECK_HEADERS([signal.h]) AC_CHECK_HEADERS([arpa/nameser.h], [], [], [#if HAVE_SYS_TYPES_H # include <sys/types.h> @@ -539,10 +500,9 @@ echo Checking libraries dnl Checks for library functions. -AC_FUNC_STRFTIME -AC_CHECK_FUNCS(strftime localtime gettimeofday ftime) -AC_CHECK_FUNCS(stat signal) -AC_CHECK_FUNCS(rand rand_r srand time) +AC_CHECK_FUNCS(gettimeofday ftime) +AC_CHECK_FUNCS(stat) +AC_CHECK_FUNCS(rand_r) AC_CHECK_FUNCS(isascii mmap munmap putenv) AH_VERBATIM([HAVE_MUNMAP_AFTER],[/* mmap() is no good without munmap() */ @@ -891,7 +851,7 @@ then PYTHON_SITE_PACKAGES=$with_python/lib/site-packages else - PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print(sysconfig.get_python_lib())"` + PYTHON_SITE_PACKAGES=$($PYTHON -c 'from distutils import sysconfig; print(sysconfig.get_python_lib(True,False,"${exec_prefix}"))') fi fi fi @@ -972,39 +932,6 @@ AC_SUBST(TEST_MODULES) dnl -dnl Tester makes use of readline if present -dnl - -dnl -dnl specific tests to setup DV and Bill's devel environments with debug etc ... -dnl (-Wunreachable-code) -dnl -if [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XML" ]] || \ - [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/home/veillard/libxml2" ]] || \ - [[ "${LOGNAME}" = "bill" -a "`pwd`" = "/home/bill/gnomesvn/libxml2" ]] - then - if test "$with_minimum" != "yes" - then - if test "${with_mem_debug}" = "" ; then - echo Activating memory debugging - with_mem_debug="yes" - with_run_debug="yes" - fi - if test "${with_docbook}" = "" ; then - with_docbook="yes" - fi - fi - if test "${GCC}" = "yes" ; then - EXTRA_CFLAGS="-g -O -pedantic -W -Wformat -Wno-format-extra-args -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls -Wall" - fi - STATIC_BINARIES="-static" -dnl -Wcast-qual -ansi -else - STATIC_BINARIES= -fi -AC_SUBST(STATIC_BINARIES) - -dnl dnl Check for trio string functions dnl @@ -1143,7 +1070,7 @@ fi AC_SUBST(WITH_TREE) -if test "$with_ftp" = "no" ; then +if test "$with_ftp" != "yes" ; then echo Disabling FTP support WITH_FTP=0 FTP_OBJ= @@ -1165,7 +1092,7 @@ AC_SUBST(WITH_HTTP) AC_SUBST(HTTP_OBJ) -if test "$with_legacy" = "no" ; then +if test "$with_legacy" != "yes" ; then echo Disabling deprecated APIs WITH_LEGACY=0 else @@ -1289,7 +1216,7 @@ AC_SUBST(CATALOG_OBJ) AC_SUBST(TEST_CATALOG) -if test "$with_docbook" = "no" ; then +if test "$with_docbook" != "yes" ; then echo Disabling Docbook support WITH_DOCB=0 DOCB_OBJ= @@ -1503,8 +1430,6 @@ else if test "$with_icu" != "yes" -a "$with_iconv" != "" ; then CPPFLAGS="${CPPFLAGS} -I$with_icu" - # Export this since our headers include icu.h - XML_INCLUDEDIR="${XML_INCLUDEDIR} -I$with_icu" fi AC_CHECK_HEADER(unicode/ucnv.h, @@ -1666,7 +1591,7 @@ dnl AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around]) dnl and do not redefine those functions is C-source files. dnl -AC_CHECK_FUNCS(printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf,, +AC_CHECK_FUNCS(snprintf vsnprintf,, NEED_TRIO=1) if test "$with_coverage" = "yes" -a "${GCC}" = "yes"
diff --git a/third_party/libxml/src/dict.c b/third_party/libxml/src/dict.c index 90e4d814..ecc90e0f 100644 --- a/third_party/libxml/src/dict.c +++ b/third_party/libxml/src/dict.c
@@ -20,12 +20,8 @@ #include "libxml.h" #include <limits.h> -#ifdef HAVE_STDLIB_H #include <stdlib.h> -#endif -#ifdef HAVE_TIME_H #include <time.h> -#endif /* * Following http://www.ocert.org/advisories/ocert-2011-003.html @@ -38,8 +34,7 @@ * list we will use the BigKey algo as soon as the hash size grows * over MIN_DICT_SIZE so this actually works */ -#if defined(HAVE_RAND) && defined(HAVE_SRAND) && defined(HAVE_TIME) && \ - !defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) +#if !defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) #define DICT_RANDOMIZATION #endif @@ -1294,5 +1289,3 @@ return(limit); } -#define bottom_dict -#include "elfgcchack.h"
diff --git a/third_party/libxml/src/elfgcchack.h b/third_party/libxml/src/elfgcchack.h deleted file mode 100644 index af8ad114..0000000 --- a/third_party/libxml/src/elfgcchack.h +++ /dev/null
@@ -1,17818 +0,0 @@ -/* - * elfgcchack.h: hack by Arjan van de Ven <arjanv@redhat.com> to speed - * up the code when using gcc for call within the library. - * - * Based on the analysis http://people.redhat.com/drepper/dsohowto.pdf - * from Ulrich drepper. Rewritten to be generated from the XML description - * file for libxml2 API - * autogenerated with xsltproc doc/elfgcchack.xsl doc/libxml2-api.xml - */ - -#ifdef IN_LIBXML -#ifdef __GNUC__ -#ifdef PIC -#ifdef __linux__ -#if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (__GNUC__ > 3) - -#include "libxml/c14n.h" -#include "libxml/catalog.h" -#include "libxml/chvalid.h" -#include "libxml/debugXML.h" -#include "libxml/dict.h" -#include "libxml/DOCBparser.h" -#include "libxml/encoding.h" -#include "libxml/entities.h" -#include "libxml/globals.h" -#include "libxml/hash.h" -#include "libxml/HTMLparser.h" -#include "libxml/HTMLtree.h" -#include "libxml/list.h" -#include "libxml/nanoftp.h" -#include "libxml/nanohttp.h" -#include "libxml/parser.h" -#include "libxml/parserInternals.h" -#include "libxml/pattern.h" -#include "libxml/relaxng.h" -#include "libxml/SAX2.h" -#include "libxml/SAX.h" -#include "libxml/schemasInternals.h" -#include "libxml/schematron.h" -#include "libxml/threads.h" -#include "libxml/tree.h" -#include "libxml/uri.h" -#include "libxml/valid.h" -#include "libxml/xinclude.h" -#include "libxml/xlink.h" -#include "libxml/xmlautomata.h" -#include "libxml/xmlerror.h" -#include "libxml/xmlexports.h" -#include "libxml/xmlIO.h" -#include "libxml/xmlmemory.h" -#include "libxml/xmlreader.h" -#include "libxml/xmlregexp.h" -#include "libxml/xmlsave.h" -#include "libxml/xmlschemas.h" -#include "libxml/xmlschemastypes.h" -#include "libxml/xmlstring.h" -#include "libxml/xmlunicode.h" -#include "libxml/xmlversion.h" -#include "libxml/xmlwriter.h" -#include "libxml/xpath.h" -#include "libxml/xpathInternals.h" -#include "libxml/xpointer.h" -#include "libxml/xmlmodule.h" - -/* special hot spot not exported ones */ - -#ifdef bottom_globals -#undef __xmlGenericError -extern __typeof (__xmlGenericError) __xmlGenericError __attribute((alias("__xmlGenericError__internal_alias"))); -#else -#ifndef __xmlGenericError -extern __typeof (__xmlGenericError) __xmlGenericError__internal_alias __attribute((visibility("hidden"))); -#define __xmlGenericError __xmlGenericError__internal_alias -#endif -#endif - -#ifdef bottom_globals -#undef __xmlGenericErrorContext -extern __typeof (__xmlGenericErrorContext) __xmlGenericErrorContext __attribute((alias("__xmlGenericErrorContext__internal_alias"))); -#else -#ifndef __xmlGenericErrorContext -extern __typeof (__xmlGenericErrorContext) __xmlGenericErrorContext__internal_alias __attribute((visibility("hidden"))); -#define __xmlGenericErrorContext __xmlGenericErrorContext__internal_alias -#endif -#endif - -/* list generated from libxml2-api.xml */ -#if defined(LIBXML_DOCB_ENABLED) -#ifdef bottom_DOCBparser -#undef docbCreatePushParserCtxt -extern __typeof (docbCreatePushParserCtxt) docbCreatePushParserCtxt __attribute((alias("docbCreatePushParserCtxt__internal_alias"))); -#else -#ifndef docbCreatePushParserCtxt -extern __typeof (docbCreatePushParserCtxt) docbCreatePushParserCtxt__internal_alias __attribute((visibility("hidden"))); -#define docbCreatePushParserCtxt docbCreatePushParserCtxt__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) -#ifdef bottom_HTMLparser -#undef htmlAttrAllowed -extern __typeof (htmlAttrAllowed) htmlAttrAllowed __attribute((alias("htmlAttrAllowed__internal_alias"))); -#else -#ifndef htmlAttrAllowed -extern __typeof (htmlAttrAllowed) htmlAttrAllowed__internal_alias __attribute((visibility("hidden"))); -#define htmlAttrAllowed htmlAttrAllowed__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) -#ifdef bottom_HTMLparser -#undef htmlAutoCloseTag -extern __typeof (htmlAutoCloseTag) htmlAutoCloseTag __attribute((alias("htmlAutoCloseTag__internal_alias"))); -#else -#ifndef htmlAutoCloseTag -extern __typeof (htmlAutoCloseTag) htmlAutoCloseTag__internal_alias __attribute((visibility("hidden"))); -#define htmlAutoCloseTag htmlAutoCloseTag__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) -#ifdef bottom_HTMLparser -#undef htmlCreateFileParserCtxt -extern __typeof (htmlCreateFileParserCtxt) htmlCreateFileParserCtxt __attribute((alias("htmlCreateFileParserCtxt__internal_alias"))); -#else -#ifndef htmlCreateFileParserCtxt -extern __typeof (htmlCreateFileParserCtxt) htmlCreateFileParserCtxt__internal_alias __attribute((visibility("hidden"))); -#define htmlCreateFileParserCtxt htmlCreateFileParserCtxt__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) -#ifdef bottom_HTMLparser -#undef htmlCreateMemoryParserCtxt -extern __typeof (htmlCreateMemoryParserCtxt) htmlCreateMemoryParserCtxt __attribute((alias("htmlCreateMemoryParserCtxt__internal_alias"))); -#else -#ifndef htmlCreateMemoryParserCtxt -extern __typeof (htmlCreateMemoryParserCtxt) htmlCreateMemoryParserCtxt__internal_alias __attribute((visibility("hidden"))); -#define htmlCreateMemoryParserCtxt htmlCreateMemoryParserCtxt__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_PUSH_ENABLED) -#ifdef bottom_HTMLparser -#undef htmlCreatePushParserCtxt -extern __typeof (htmlCreatePushParserCtxt) htmlCreatePushParserCtxt __attribute((alias("htmlCreatePushParserCtxt__internal_alias"))); -#else -#ifndef htmlCreatePushParserCtxt -extern __typeof (htmlCreatePushParserCtxt) htmlCreatePushParserCtxt__internal_alias __attribute((visibility("hidden"))); -#define htmlCreatePushParserCtxt htmlCreatePushParserCtxt__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) -#ifdef bottom_HTMLparser -#undef htmlCtxtReadDoc -extern __typeof (htmlCtxtReadDoc) htmlCtxtReadDoc __attribute((alias("htmlCtxtReadDoc__internal_alias"))); -#else -#ifndef htmlCtxtReadDoc -extern __typeof (htmlCtxtReadDoc) htmlCtxtReadDoc__internal_alias __attribute((visibility("hidden"))); -#define htmlCtxtReadDoc htmlCtxtReadDoc__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) -#ifdef bottom_HTMLparser -#undef htmlCtxtReadFd -extern __typeof (htmlCtxtReadFd) htmlCtxtReadFd __attribute((alias("htmlCtxtReadFd__internal_alias"))); -#else -#ifndef htmlCtxtReadFd -extern __typeof (htmlCtxtReadFd) htmlCtxtReadFd__internal_alias __attribute((visibility("hidden"))); -#define htmlCtxtReadFd htmlCtxtReadFd__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) -#ifdef bottom_HTMLparser -#undef htmlCtxtReadFile -extern __typeof (htmlCtxtReadFile) htmlCtxtReadFile __attribute((alias("htmlCtxtReadFile__internal_alias"))); -#else -#ifndef htmlCtxtReadFile -extern __typeof (htmlCtxtReadFile) htmlCtxtReadFile__internal_alias __attribute((visibility("hidden"))); -#define htmlCtxtReadFile htmlCtxtReadFile__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) -#ifdef bottom_HTMLparser -#undef htmlCtxtReadIO -extern __typeof (htmlCtxtReadIO) htmlCtxtReadIO __attribute((alias("htmlCtxtReadIO__internal_alias"))); -#else -#ifndef htmlCtxtReadIO -extern __typeof (htmlCtxtReadIO) htmlCtxtReadIO__internal_alias __attribute((visibility("hidden"))); -#define htmlCtxtReadIO htmlCtxtReadIO__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) -#ifdef bottom_HTMLparser -#undef htmlCtxtReadMemory -extern __typeof (htmlCtxtReadMemory) htmlCtxtReadMemory __attribute((alias("htmlCtxtReadMemory__internal_alias"))); -#else -#ifndef htmlCtxtReadMemory -extern __typeof (htmlCtxtReadMemory) htmlCtxtReadMemory__internal_alias __attribute((visibility("hidden"))); -#define htmlCtxtReadMemory htmlCtxtReadMemory__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) -#ifdef bottom_HTMLparser -#undef htmlCtxtReset -extern __typeof (htmlCtxtReset) htmlCtxtReset __attribute((alias("htmlCtxtReset__internal_alias"))); -#else -#ifndef htmlCtxtReset -extern __typeof (htmlCtxtReset) htmlCtxtReset__internal_alias __attribute((visibility("hidden"))); -#define htmlCtxtReset htmlCtxtReset__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) -#ifdef bottom_HTMLparser -#undef htmlCtxtUseOptions -extern __typeof (htmlCtxtUseOptions) htmlCtxtUseOptions __attribute((alias("htmlCtxtUseOptions__internal_alias"))); -#else -#ifndef htmlCtxtUseOptions -extern __typeof (htmlCtxtUseOptions) htmlCtxtUseOptions__internal_alias __attribute((visibility("hidden"))); -#define htmlCtxtUseOptions htmlCtxtUseOptions__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) -#ifdef bottom_SAX2 -#undef htmlDefaultSAXHandlerInit -extern __typeof (htmlDefaultSAXHandlerInit) htmlDefaultSAXHandlerInit __attribute((alias("htmlDefaultSAXHandlerInit__internal_alias"))); -#else -#ifndef htmlDefaultSAXHandlerInit -extern __typeof (htmlDefaultSAXHandlerInit) htmlDefaultSAXHandlerInit__internal_alias __attribute((visibility("hidden"))); -#define htmlDefaultSAXHandlerInit htmlDefaultSAXHandlerInit__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_HTMLtree -#undef htmlDocContentDumpFormatOutput -extern __typeof (htmlDocContentDumpFormatOutput) htmlDocContentDumpFormatOutput __attribute((alias("htmlDocContentDumpFormatOutput__internal_alias"))); -#else -#ifndef htmlDocContentDumpFormatOutput -extern __typeof (htmlDocContentDumpFormatOutput) htmlDocContentDumpFormatOutput__internal_alias __attribute((visibility("hidden"))); -#define htmlDocContentDumpFormatOutput htmlDocContentDumpFormatOutput__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_HTMLtree -#undef htmlDocContentDumpOutput -extern __typeof (htmlDocContentDumpOutput) htmlDocContentDumpOutput __attribute((alias("htmlDocContentDumpOutput__internal_alias"))); -#else -#ifndef htmlDocContentDumpOutput -extern __typeof (htmlDocContentDumpOutput) htmlDocContentDumpOutput__internal_alias __attribute((visibility("hidden"))); -#define htmlDocContentDumpOutput htmlDocContentDumpOutput__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_HTMLtree -#undef htmlDocDump -extern __typeof (htmlDocDump) htmlDocDump __attribute((alias("htmlDocDump__internal_alias"))); -#else -#ifndef htmlDocDump -extern __typeof (htmlDocDump) htmlDocDump__internal_alias __attribute((visibility("hidden"))); -#define htmlDocDump htmlDocDump__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_HTMLtree -#undef htmlDocDumpMemory -extern __typeof (htmlDocDumpMemory) htmlDocDumpMemory __attribute((alias("htmlDocDumpMemory__internal_alias"))); -#else -#ifndef htmlDocDumpMemory -extern __typeof (htmlDocDumpMemory) htmlDocDumpMemory__internal_alias __attribute((visibility("hidden"))); -#define htmlDocDumpMemory htmlDocDumpMemory__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_HTMLtree -#undef htmlDocDumpMemoryFormat -extern __typeof (htmlDocDumpMemoryFormat) htmlDocDumpMemoryFormat __attribute((alias("htmlDocDumpMemoryFormat__internal_alias"))); -#else -#ifndef htmlDocDumpMemoryFormat -extern __typeof (htmlDocDumpMemoryFormat) htmlDocDumpMemoryFormat__internal_alias __attribute((visibility("hidden"))); -#define htmlDocDumpMemoryFormat htmlDocDumpMemoryFormat__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) -#ifdef bottom_HTMLparser -#undef htmlElementAllowedHere -extern __typeof (htmlElementAllowedHere) htmlElementAllowedHere __attribute((alias("htmlElementAllowedHere__internal_alias"))); -#else -#ifndef htmlElementAllowedHere -extern __typeof (htmlElementAllowedHere) htmlElementAllowedHere__internal_alias __attribute((visibility("hidden"))); -#define htmlElementAllowedHere htmlElementAllowedHere__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) -#ifdef bottom_HTMLparser -#undef htmlElementStatusHere -extern __typeof (htmlElementStatusHere) htmlElementStatusHere __attribute((alias("htmlElementStatusHere__internal_alias"))); -#else -#ifndef htmlElementStatusHere -extern __typeof (htmlElementStatusHere) htmlElementStatusHere__internal_alias __attribute((visibility("hidden"))); -#define htmlElementStatusHere htmlElementStatusHere__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) -#ifdef bottom_HTMLparser -#undef htmlEncodeEntities -extern __typeof (htmlEncodeEntities) htmlEncodeEntities __attribute((alias("htmlEncodeEntities__internal_alias"))); -#else -#ifndef htmlEncodeEntities -extern __typeof (htmlEncodeEntities) htmlEncodeEntities__internal_alias __attribute((visibility("hidden"))); -#define htmlEncodeEntities htmlEncodeEntities__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) -#ifdef bottom_HTMLparser -#undef htmlEntityLookup -extern __typeof (htmlEntityLookup) htmlEntityLookup __attribute((alias("htmlEntityLookup__internal_alias"))); -#else -#ifndef htmlEntityLookup -extern __typeof (htmlEntityLookup) htmlEntityLookup__internal_alias __attribute((visibility("hidden"))); -#define htmlEntityLookup htmlEntityLookup__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) -#ifdef bottom_HTMLparser -#undef htmlEntityValueLookup -extern __typeof (htmlEntityValueLookup) htmlEntityValueLookup __attribute((alias("htmlEntityValueLookup__internal_alias"))); -#else -#ifndef htmlEntityValueLookup -extern __typeof (htmlEntityValueLookup) htmlEntityValueLookup__internal_alias __attribute((visibility("hidden"))); -#define htmlEntityValueLookup htmlEntityValueLookup__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) -#ifdef bottom_HTMLparser -#undef htmlFreeParserCtxt -extern __typeof (htmlFreeParserCtxt) htmlFreeParserCtxt __attribute((alias("htmlFreeParserCtxt__internal_alias"))); -#else -#ifndef htmlFreeParserCtxt -extern __typeof (htmlFreeParserCtxt) htmlFreeParserCtxt__internal_alias __attribute((visibility("hidden"))); -#define htmlFreeParserCtxt htmlFreeParserCtxt__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) -#ifdef bottom_HTMLtree -#undef htmlGetMetaEncoding -extern __typeof (htmlGetMetaEncoding) htmlGetMetaEncoding __attribute((alias("htmlGetMetaEncoding__internal_alias"))); -#else -#ifndef htmlGetMetaEncoding -extern __typeof (htmlGetMetaEncoding) htmlGetMetaEncoding__internal_alias __attribute((visibility("hidden"))); -#define htmlGetMetaEncoding htmlGetMetaEncoding__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) -#ifdef bottom_HTMLparser -#undef htmlHandleOmittedElem -extern __typeof (htmlHandleOmittedElem) htmlHandleOmittedElem __attribute((alias("htmlHandleOmittedElem__internal_alias"))); -#else -#ifndef htmlHandleOmittedElem -extern __typeof (htmlHandleOmittedElem) htmlHandleOmittedElem__internal_alias __attribute((visibility("hidden"))); -#define htmlHandleOmittedElem htmlHandleOmittedElem__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) -#ifdef bottom_HTMLparser -#undef htmlInitAutoClose -extern __typeof (htmlInitAutoClose) htmlInitAutoClose __attribute((alias("htmlInitAutoClose__internal_alias"))); -#else -#ifndef htmlInitAutoClose -extern __typeof (htmlInitAutoClose) htmlInitAutoClose__internal_alias __attribute((visibility("hidden"))); -#define htmlInitAutoClose htmlInitAutoClose__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) -#ifdef bottom_HTMLparser -#undef htmlIsAutoClosed -extern __typeof (htmlIsAutoClosed) htmlIsAutoClosed __attribute((alias("htmlIsAutoClosed__internal_alias"))); -#else -#ifndef htmlIsAutoClosed -extern __typeof (htmlIsAutoClosed) htmlIsAutoClosed__internal_alias __attribute((visibility("hidden"))); -#define htmlIsAutoClosed htmlIsAutoClosed__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) -#ifdef bottom_HTMLtree -#undef htmlIsBooleanAttr -extern __typeof (htmlIsBooleanAttr) htmlIsBooleanAttr __attribute((alias("htmlIsBooleanAttr__internal_alias"))); -#else -#ifndef htmlIsBooleanAttr -extern __typeof (htmlIsBooleanAttr) htmlIsBooleanAttr__internal_alias __attribute((visibility("hidden"))); -#define htmlIsBooleanAttr htmlIsBooleanAttr__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) -#ifdef bottom_HTMLparser -#undef htmlIsScriptAttribute -extern __typeof (htmlIsScriptAttribute) htmlIsScriptAttribute __attribute((alias("htmlIsScriptAttribute__internal_alias"))); -#else -#ifndef htmlIsScriptAttribute -extern __typeof (htmlIsScriptAttribute) htmlIsScriptAttribute__internal_alias __attribute((visibility("hidden"))); -#define htmlIsScriptAttribute htmlIsScriptAttribute__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) -#ifdef bottom_HTMLparser -#undef htmlNewDoc -extern __typeof (htmlNewDoc) htmlNewDoc __attribute((alias("htmlNewDoc__internal_alias"))); -#else -#ifndef htmlNewDoc -extern __typeof (htmlNewDoc) htmlNewDoc__internal_alias __attribute((visibility("hidden"))); -#define htmlNewDoc htmlNewDoc__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) -#ifdef bottom_HTMLparser -#undef htmlNewDocNoDtD -extern __typeof (htmlNewDocNoDtD) htmlNewDocNoDtD __attribute((alias("htmlNewDocNoDtD__internal_alias"))); -#else -#ifndef htmlNewDocNoDtD -extern __typeof (htmlNewDocNoDtD) htmlNewDocNoDtD__internal_alias __attribute((visibility("hidden"))); -#define htmlNewDocNoDtD htmlNewDocNoDtD__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) -#ifdef bottom_HTMLparser -#undef htmlNewParserCtxt -extern __typeof (htmlNewParserCtxt) htmlNewParserCtxt __attribute((alias("htmlNewParserCtxt__internal_alias"))); -#else -#ifndef htmlNewParserCtxt -extern __typeof (htmlNewParserCtxt) htmlNewParserCtxt__internal_alias __attribute((visibility("hidden"))); -#define htmlNewParserCtxt htmlNewParserCtxt__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_HTMLtree -#undef htmlNodeDump -extern __typeof (htmlNodeDump) htmlNodeDump __attribute((alias("htmlNodeDump__internal_alias"))); -#else -#ifndef htmlNodeDump -extern __typeof (htmlNodeDump) htmlNodeDump__internal_alias __attribute((visibility("hidden"))); -#define htmlNodeDump htmlNodeDump__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_HTMLtree -#undef htmlNodeDumpFile -extern __typeof (htmlNodeDumpFile) htmlNodeDumpFile __attribute((alias("htmlNodeDumpFile__internal_alias"))); -#else -#ifndef htmlNodeDumpFile -extern __typeof (htmlNodeDumpFile) htmlNodeDumpFile__internal_alias __attribute((visibility("hidden"))); -#define htmlNodeDumpFile htmlNodeDumpFile__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_HTMLtree -#undef htmlNodeDumpFileFormat -extern __typeof (htmlNodeDumpFileFormat) htmlNodeDumpFileFormat __attribute((alias("htmlNodeDumpFileFormat__internal_alias"))); -#else -#ifndef htmlNodeDumpFileFormat -extern __typeof (htmlNodeDumpFileFormat) htmlNodeDumpFileFormat__internal_alias __attribute((visibility("hidden"))); -#define htmlNodeDumpFileFormat htmlNodeDumpFileFormat__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_HTMLtree -#undef htmlNodeDumpFormatOutput -extern __typeof (htmlNodeDumpFormatOutput) htmlNodeDumpFormatOutput __attribute((alias("htmlNodeDumpFormatOutput__internal_alias"))); -#else -#ifndef htmlNodeDumpFormatOutput -extern __typeof (htmlNodeDumpFormatOutput) htmlNodeDumpFormatOutput__internal_alias __attribute((visibility("hidden"))); -#define htmlNodeDumpFormatOutput htmlNodeDumpFormatOutput__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_HTMLtree -#undef htmlNodeDumpOutput -extern __typeof (htmlNodeDumpOutput) htmlNodeDumpOutput __attribute((alias("htmlNodeDumpOutput__internal_alias"))); -#else -#ifndef htmlNodeDumpOutput -extern __typeof (htmlNodeDumpOutput) htmlNodeDumpOutput__internal_alias __attribute((visibility("hidden"))); -#define htmlNodeDumpOutput htmlNodeDumpOutput__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) -#ifdef bottom_HTMLparser -#undef htmlNodeStatus -extern __typeof (htmlNodeStatus) htmlNodeStatus __attribute((alias("htmlNodeStatus__internal_alias"))); -#else -#ifndef htmlNodeStatus -extern __typeof (htmlNodeStatus) htmlNodeStatus__internal_alias __attribute((visibility("hidden"))); -#define htmlNodeStatus htmlNodeStatus__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) -#ifdef bottom_HTMLparser -#undef htmlParseCharRef -extern __typeof (htmlParseCharRef) htmlParseCharRef __attribute((alias("htmlParseCharRef__internal_alias"))); -#else -#ifndef htmlParseCharRef -extern __typeof (htmlParseCharRef) htmlParseCharRef__internal_alias __attribute((visibility("hidden"))); -#define htmlParseCharRef htmlParseCharRef__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_PUSH_ENABLED) -#ifdef bottom_HTMLparser -#undef htmlParseChunk -extern __typeof (htmlParseChunk) htmlParseChunk __attribute((alias("htmlParseChunk__internal_alias"))); -#else -#ifndef htmlParseChunk -extern __typeof (htmlParseChunk) htmlParseChunk__internal_alias __attribute((visibility("hidden"))); -#define htmlParseChunk htmlParseChunk__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) -#ifdef bottom_HTMLparser -#undef htmlParseDoc -extern __typeof (htmlParseDoc) htmlParseDoc __attribute((alias("htmlParseDoc__internal_alias"))); -#else -#ifndef htmlParseDoc -extern __typeof (htmlParseDoc) htmlParseDoc__internal_alias __attribute((visibility("hidden"))); -#define htmlParseDoc htmlParseDoc__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) -#ifdef bottom_HTMLparser -#undef htmlParseDocument -extern __typeof (htmlParseDocument) htmlParseDocument __attribute((alias("htmlParseDocument__internal_alias"))); -#else -#ifndef htmlParseDocument -extern __typeof (htmlParseDocument) htmlParseDocument__internal_alias __attribute((visibility("hidden"))); -#define htmlParseDocument htmlParseDocument__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) -#ifdef bottom_HTMLparser -#undef htmlParseElement -extern __typeof (htmlParseElement) htmlParseElement __attribute((alias("htmlParseElement__internal_alias"))); -#else -#ifndef htmlParseElement -extern __typeof (htmlParseElement) htmlParseElement__internal_alias __attribute((visibility("hidden"))); -#define htmlParseElement htmlParseElement__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) -#ifdef bottom_HTMLparser -#undef htmlParseEntityRef -extern __typeof (htmlParseEntityRef) htmlParseEntityRef __attribute((alias("htmlParseEntityRef__internal_alias"))); -#else -#ifndef htmlParseEntityRef -extern __typeof (htmlParseEntityRef) htmlParseEntityRef__internal_alias __attribute((visibility("hidden"))); -#define htmlParseEntityRef htmlParseEntityRef__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) -#ifdef bottom_HTMLparser -#undef htmlParseFile -extern __typeof (htmlParseFile) htmlParseFile __attribute((alias("htmlParseFile__internal_alias"))); -#else -#ifndef htmlParseFile -extern __typeof (htmlParseFile) htmlParseFile__internal_alias __attribute((visibility("hidden"))); -#define htmlParseFile htmlParseFile__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) -#ifdef bottom_HTMLparser -#undef htmlReadDoc -extern __typeof (htmlReadDoc) htmlReadDoc __attribute((alias("htmlReadDoc__internal_alias"))); -#else -#ifndef htmlReadDoc -extern __typeof (htmlReadDoc) htmlReadDoc__internal_alias __attribute((visibility("hidden"))); -#define htmlReadDoc htmlReadDoc__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) -#ifdef bottom_HTMLparser -#undef htmlReadFd -extern __typeof (htmlReadFd) htmlReadFd __attribute((alias("htmlReadFd__internal_alias"))); -#else -#ifndef htmlReadFd -extern __typeof (htmlReadFd) htmlReadFd__internal_alias __attribute((visibility("hidden"))); -#define htmlReadFd htmlReadFd__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) -#ifdef bottom_HTMLparser -#undef htmlReadFile -extern __typeof (htmlReadFile) htmlReadFile __attribute((alias("htmlReadFile__internal_alias"))); -#else -#ifndef htmlReadFile -extern __typeof (htmlReadFile) htmlReadFile__internal_alias __attribute((visibility("hidden"))); -#define htmlReadFile htmlReadFile__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) -#ifdef bottom_HTMLparser -#undef htmlReadIO -extern __typeof (htmlReadIO) htmlReadIO __attribute((alias("htmlReadIO__internal_alias"))); -#else -#ifndef htmlReadIO -extern __typeof (htmlReadIO) htmlReadIO__internal_alias __attribute((visibility("hidden"))); -#define htmlReadIO htmlReadIO__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) -#ifdef bottom_HTMLparser -#undef htmlReadMemory -extern __typeof (htmlReadMemory) htmlReadMemory __attribute((alias("htmlReadMemory__internal_alias"))); -#else -#ifndef htmlReadMemory -extern __typeof (htmlReadMemory) htmlReadMemory__internal_alias __attribute((visibility("hidden"))); -#define htmlReadMemory htmlReadMemory__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) -#ifdef bottom_HTMLparser -#undef htmlSAXParseDoc -extern __typeof (htmlSAXParseDoc) htmlSAXParseDoc __attribute((alias("htmlSAXParseDoc__internal_alias"))); -#else -#ifndef htmlSAXParseDoc -extern __typeof (htmlSAXParseDoc) htmlSAXParseDoc__internal_alias __attribute((visibility("hidden"))); -#define htmlSAXParseDoc htmlSAXParseDoc__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) -#ifdef bottom_HTMLparser -#undef htmlSAXParseFile -extern __typeof (htmlSAXParseFile) htmlSAXParseFile __attribute((alias("htmlSAXParseFile__internal_alias"))); -#else -#ifndef htmlSAXParseFile -extern __typeof (htmlSAXParseFile) htmlSAXParseFile__internal_alias __attribute((visibility("hidden"))); -#define htmlSAXParseFile htmlSAXParseFile__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_HTMLtree -#undef htmlSaveFile -extern __typeof (htmlSaveFile) htmlSaveFile __attribute((alias("htmlSaveFile__internal_alias"))); -#else -#ifndef htmlSaveFile -extern __typeof (htmlSaveFile) htmlSaveFile__internal_alias __attribute((visibility("hidden"))); -#define htmlSaveFile htmlSaveFile__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_HTMLtree -#undef htmlSaveFileEnc -extern __typeof (htmlSaveFileEnc) htmlSaveFileEnc __attribute((alias("htmlSaveFileEnc__internal_alias"))); -#else -#ifndef htmlSaveFileEnc -extern __typeof (htmlSaveFileEnc) htmlSaveFileEnc__internal_alias __attribute((visibility("hidden"))); -#define htmlSaveFileEnc htmlSaveFileEnc__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_HTMLtree -#undef htmlSaveFileFormat -extern __typeof (htmlSaveFileFormat) htmlSaveFileFormat __attribute((alias("htmlSaveFileFormat__internal_alias"))); -#else -#ifndef htmlSaveFileFormat -extern __typeof (htmlSaveFileFormat) htmlSaveFileFormat__internal_alias __attribute((visibility("hidden"))); -#define htmlSaveFileFormat htmlSaveFileFormat__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) -#ifdef bottom_HTMLtree -#undef htmlSetMetaEncoding -extern __typeof (htmlSetMetaEncoding) htmlSetMetaEncoding __attribute((alias("htmlSetMetaEncoding__internal_alias"))); -#else -#ifndef htmlSetMetaEncoding -extern __typeof (htmlSetMetaEncoding) htmlSetMetaEncoding__internal_alias __attribute((visibility("hidden"))); -#define htmlSetMetaEncoding htmlSetMetaEncoding__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) -#ifdef bottom_HTMLparser -#undef htmlTagLookup -extern __typeof (htmlTagLookup) htmlTagLookup __attribute((alias("htmlTagLookup__internal_alias"))); -#else -#ifndef htmlTagLookup -extern __typeof (htmlTagLookup) htmlTagLookup__internal_alias __attribute((visibility("hidden"))); -#define htmlTagLookup htmlTagLookup__internal_alias -#endif -#endif -#endif - -#ifdef bottom_parser -#undef inputPop -extern __typeof (inputPop) inputPop __attribute((alias("inputPop__internal_alias"))); -#else -#ifndef inputPop -extern __typeof (inputPop) inputPop__internal_alias __attribute((visibility("hidden"))); -#define inputPop inputPop__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef inputPush -extern __typeof (inputPush) inputPush __attribute((alias("inputPush__internal_alias"))); -#else -#ifndef inputPush -extern __typeof (inputPush) inputPush__internal_alias __attribute((visibility("hidden"))); -#define inputPush inputPush__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef namePop -extern __typeof (namePop) namePop __attribute((alias("namePop__internal_alias"))); -#else -#ifndef namePop -extern __typeof (namePop) namePop__internal_alias __attribute((visibility("hidden"))); -#define namePop namePop__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef namePush -extern __typeof (namePush) namePush __attribute((alias("namePush__internal_alias"))); -#else -#ifndef namePush -extern __typeof (namePush) namePush__internal_alias __attribute((visibility("hidden"))); -#define namePush namePush__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef nodePop -extern __typeof (nodePop) nodePop __attribute((alias("nodePop__internal_alias"))); -#else -#ifndef nodePop -extern __typeof (nodePop) nodePop__internal_alias __attribute((visibility("hidden"))); -#define nodePop nodePop__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef nodePush -extern __typeof (nodePush) nodePush __attribute((alias("nodePush__internal_alias"))); -#else -#ifndef nodePush -extern __typeof (nodePush) nodePush__internal_alias __attribute((visibility("hidden"))); -#define nodePush nodePush__internal_alias -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef valuePop -extern __typeof (valuePop) valuePop __attribute((alias("valuePop__internal_alias"))); -#else -#ifndef valuePop -extern __typeof (valuePop) valuePop__internal_alias __attribute((visibility("hidden"))); -#define valuePop valuePop__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef valuePush -extern __typeof (valuePush) valuePush __attribute((alias("valuePush__internal_alias"))); -#else -#ifndef valuePush -extern __typeof (valuePush) valuePush__internal_alias __attribute((visibility("hidden"))); -#define valuePush valuePush__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_CATALOG_ENABLED) -#ifdef bottom_catalog -#undef xmlACatalogAdd -extern __typeof (xmlACatalogAdd) xmlACatalogAdd __attribute((alias("xmlACatalogAdd__internal_alias"))); -#else -#ifndef xmlACatalogAdd -extern __typeof (xmlACatalogAdd) xmlACatalogAdd__internal_alias __attribute((visibility("hidden"))); -#define xmlACatalogAdd xmlACatalogAdd__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_catalog -#undef xmlACatalogDump -extern __typeof (xmlACatalogDump) xmlACatalogDump __attribute((alias("xmlACatalogDump__internal_alias"))); -#else -#ifndef xmlACatalogDump -extern __typeof (xmlACatalogDump) xmlACatalogDump__internal_alias __attribute((visibility("hidden"))); -#define xmlACatalogDump xmlACatalogDump__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_CATALOG_ENABLED) -#ifdef bottom_catalog -#undef xmlACatalogRemove -extern __typeof (xmlACatalogRemove) xmlACatalogRemove __attribute((alias("xmlACatalogRemove__internal_alias"))); -#else -#ifndef xmlACatalogRemove -extern __typeof (xmlACatalogRemove) xmlACatalogRemove__internal_alias __attribute((visibility("hidden"))); -#define xmlACatalogRemove xmlACatalogRemove__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_CATALOG_ENABLED) -#ifdef bottom_catalog -#undef xmlACatalogResolve -extern __typeof (xmlACatalogResolve) xmlACatalogResolve __attribute((alias("xmlACatalogResolve__internal_alias"))); -#else -#ifndef xmlACatalogResolve -extern __typeof (xmlACatalogResolve) xmlACatalogResolve__internal_alias __attribute((visibility("hidden"))); -#define xmlACatalogResolve xmlACatalogResolve__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_CATALOG_ENABLED) -#ifdef bottom_catalog -#undef xmlACatalogResolvePublic -extern __typeof (xmlACatalogResolvePublic) xmlACatalogResolvePublic __attribute((alias("xmlACatalogResolvePublic__internal_alias"))); -#else -#ifndef xmlACatalogResolvePublic -extern __typeof (xmlACatalogResolvePublic) xmlACatalogResolvePublic__internal_alias __attribute((visibility("hidden"))); -#define xmlACatalogResolvePublic xmlACatalogResolvePublic__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_CATALOG_ENABLED) -#ifdef bottom_catalog -#undef xmlACatalogResolveSystem -extern __typeof (xmlACatalogResolveSystem) xmlACatalogResolveSystem __attribute((alias("xmlACatalogResolveSystem__internal_alias"))); -#else -#ifndef xmlACatalogResolveSystem -extern __typeof (xmlACatalogResolveSystem) xmlACatalogResolveSystem__internal_alias __attribute((visibility("hidden"))); -#define xmlACatalogResolveSystem xmlACatalogResolveSystem__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_CATALOG_ENABLED) -#ifdef bottom_catalog -#undef xmlACatalogResolveURI -extern __typeof (xmlACatalogResolveURI) xmlACatalogResolveURI __attribute((alias("xmlACatalogResolveURI__internal_alias"))); -#else -#ifndef xmlACatalogResolveURI -extern __typeof (xmlACatalogResolveURI) xmlACatalogResolveURI__internal_alias __attribute((visibility("hidden"))); -#define xmlACatalogResolveURI xmlACatalogResolveURI__internal_alias -#endif -#endif -#endif - -#ifdef bottom_valid -#undef xmlAddAttributeDecl -extern __typeof (xmlAddAttributeDecl) xmlAddAttributeDecl __attribute((alias("xmlAddAttributeDecl__internal_alias"))); -#else -#ifndef xmlAddAttributeDecl -extern __typeof (xmlAddAttributeDecl) xmlAddAttributeDecl__internal_alias __attribute((visibility("hidden"))); -#define xmlAddAttributeDecl xmlAddAttributeDecl__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlAddChild -extern __typeof (xmlAddChild) xmlAddChild __attribute((alias("xmlAddChild__internal_alias"))); -#else -#ifndef xmlAddChild -extern __typeof (xmlAddChild) xmlAddChild__internal_alias __attribute((visibility("hidden"))); -#define xmlAddChild xmlAddChild__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlAddChildList -extern __typeof (xmlAddChildList) xmlAddChildList __attribute((alias("xmlAddChildList__internal_alias"))); -#else -#ifndef xmlAddChildList -extern __typeof (xmlAddChildList) xmlAddChildList__internal_alias __attribute((visibility("hidden"))); -#define xmlAddChildList xmlAddChildList__internal_alias -#endif -#endif - -#ifdef bottom_entities -#undef xmlAddDocEntity -extern __typeof (xmlAddDocEntity) xmlAddDocEntity __attribute((alias("xmlAddDocEntity__internal_alias"))); -#else -#ifndef xmlAddDocEntity -extern __typeof (xmlAddDocEntity) xmlAddDocEntity__internal_alias __attribute((visibility("hidden"))); -#define xmlAddDocEntity xmlAddDocEntity__internal_alias -#endif -#endif - -#ifdef bottom_entities -#undef xmlAddDtdEntity -extern __typeof (xmlAddDtdEntity) xmlAddDtdEntity __attribute((alias("xmlAddDtdEntity__internal_alias"))); -#else -#ifndef xmlAddDtdEntity -extern __typeof (xmlAddDtdEntity) xmlAddDtdEntity__internal_alias __attribute((visibility("hidden"))); -#define xmlAddDtdEntity xmlAddDtdEntity__internal_alias -#endif -#endif - -#ifdef bottom_valid -#undef xmlAddElementDecl -extern __typeof (xmlAddElementDecl) xmlAddElementDecl __attribute((alias("xmlAddElementDecl__internal_alias"))); -#else -#ifndef xmlAddElementDecl -extern __typeof (xmlAddElementDecl) xmlAddElementDecl__internal_alias __attribute((visibility("hidden"))); -#define xmlAddElementDecl xmlAddElementDecl__internal_alias -#endif -#endif - -#ifdef bottom_encoding -#undef xmlAddEncodingAlias -extern __typeof (xmlAddEncodingAlias) xmlAddEncodingAlias __attribute((alias("xmlAddEncodingAlias__internal_alias"))); -#else -#ifndef xmlAddEncodingAlias -extern __typeof (xmlAddEncodingAlias) xmlAddEncodingAlias__internal_alias __attribute((visibility("hidden"))); -#define xmlAddEncodingAlias xmlAddEncodingAlias__internal_alias -#endif -#endif - -#ifdef bottom_valid -#undef xmlAddID -extern __typeof (xmlAddID) xmlAddID __attribute((alias("xmlAddID__internal_alias"))); -#else -#ifndef xmlAddID -extern __typeof (xmlAddID) xmlAddID__internal_alias __attribute((visibility("hidden"))); -#define xmlAddID xmlAddID__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlAddNextSibling -extern __typeof (xmlAddNextSibling) xmlAddNextSibling __attribute((alias("xmlAddNextSibling__internal_alias"))); -#else -#ifndef xmlAddNextSibling -extern __typeof (xmlAddNextSibling) xmlAddNextSibling__internal_alias __attribute((visibility("hidden"))); -#define xmlAddNextSibling xmlAddNextSibling__internal_alias -#endif -#endif - -#ifdef bottom_valid -#undef xmlAddNotationDecl -extern __typeof (xmlAddNotationDecl) xmlAddNotationDecl __attribute((alias("xmlAddNotationDecl__internal_alias"))); -#else -#ifndef xmlAddNotationDecl -extern __typeof (xmlAddNotationDecl) xmlAddNotationDecl__internal_alias __attribute((visibility("hidden"))); -#define xmlAddNotationDecl xmlAddNotationDecl__internal_alias -#endif -#endif - -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) -#ifdef bottom_tree -#undef xmlAddPrevSibling -extern __typeof (xmlAddPrevSibling) xmlAddPrevSibling __attribute((alias("xmlAddPrevSibling__internal_alias"))); -#else -#ifndef xmlAddPrevSibling -extern __typeof (xmlAddPrevSibling) xmlAddPrevSibling__internal_alias __attribute((visibility("hidden"))); -#define xmlAddPrevSibling xmlAddPrevSibling__internal_alias -#endif -#endif -#endif - -#ifdef bottom_valid -#undef xmlAddRef -extern __typeof (xmlAddRef) xmlAddRef __attribute((alias("xmlAddRef__internal_alias"))); -#else -#ifndef xmlAddRef -extern __typeof (xmlAddRef) xmlAddRef__internal_alias __attribute((visibility("hidden"))); -#define xmlAddRef xmlAddRef__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlAddSibling -extern __typeof (xmlAddSibling) xmlAddSibling __attribute((alias("xmlAddSibling__internal_alias"))); -#else -#ifndef xmlAddSibling -extern __typeof (xmlAddSibling) xmlAddSibling__internal_alias __attribute((visibility("hidden"))); -#define xmlAddSibling xmlAddSibling__internal_alias -#endif -#endif - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_xmlIO -#undef xmlAllocOutputBuffer -extern __typeof (xmlAllocOutputBuffer) xmlAllocOutputBuffer __attribute((alias("xmlAllocOutputBuffer__internal_alias"))); -#else -#ifndef xmlAllocOutputBuffer -extern __typeof (xmlAllocOutputBuffer) xmlAllocOutputBuffer__internal_alias __attribute((visibility("hidden"))); -#define xmlAllocOutputBuffer xmlAllocOutputBuffer__internal_alias -#endif -#endif -#endif - -#ifdef bottom_xmlIO -#undef xmlAllocParserInputBuffer -extern __typeof (xmlAllocParserInputBuffer) xmlAllocParserInputBuffer __attribute((alias("xmlAllocParserInputBuffer__internal_alias"))); -#else -#ifndef xmlAllocParserInputBuffer -extern __typeof (xmlAllocParserInputBuffer) xmlAllocParserInputBuffer__internal_alias __attribute((visibility("hidden"))); -#define xmlAllocParserInputBuffer xmlAllocParserInputBuffer__internal_alias -#endif -#endif - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_xmlsave -#undef xmlAttrSerializeTxtContent -extern __typeof (xmlAttrSerializeTxtContent) xmlAttrSerializeTxtContent __attribute((alias("xmlAttrSerializeTxtContent__internal_alias"))); -#else -#ifndef xmlAttrSerializeTxtContent -extern __typeof (xmlAttrSerializeTxtContent) xmlAttrSerializeTxtContent__internal_alias __attribute((visibility("hidden"))); -#define xmlAttrSerializeTxtContent xmlAttrSerializeTxtContent__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED) -#ifdef bottom_xmlregexp -#undef xmlAutomataCompile -extern __typeof (xmlAutomataCompile) xmlAutomataCompile __attribute((alias("xmlAutomataCompile__internal_alias"))); -#else -#ifndef xmlAutomataCompile -extern __typeof (xmlAutomataCompile) xmlAutomataCompile__internal_alias __attribute((visibility("hidden"))); -#define xmlAutomataCompile xmlAutomataCompile__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED) -#ifdef bottom_xmlregexp -#undef xmlAutomataGetInitState -extern __typeof (xmlAutomataGetInitState) xmlAutomataGetInitState __attribute((alias("xmlAutomataGetInitState__internal_alias"))); -#else -#ifndef xmlAutomataGetInitState -extern __typeof (xmlAutomataGetInitState) xmlAutomataGetInitState__internal_alias __attribute((visibility("hidden"))); -#define xmlAutomataGetInitState xmlAutomataGetInitState__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED) -#ifdef bottom_xmlregexp -#undef xmlAutomataIsDeterminist -extern __typeof (xmlAutomataIsDeterminist) xmlAutomataIsDeterminist __attribute((alias("xmlAutomataIsDeterminist__internal_alias"))); -#else -#ifndef xmlAutomataIsDeterminist -extern __typeof (xmlAutomataIsDeterminist) xmlAutomataIsDeterminist__internal_alias __attribute((visibility("hidden"))); -#define xmlAutomataIsDeterminist xmlAutomataIsDeterminist__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED) -#ifdef bottom_xmlregexp -#undef xmlAutomataNewAllTrans -extern __typeof (xmlAutomataNewAllTrans) xmlAutomataNewAllTrans __attribute((alias("xmlAutomataNewAllTrans__internal_alias"))); -#else -#ifndef xmlAutomataNewAllTrans -extern __typeof (xmlAutomataNewAllTrans) xmlAutomataNewAllTrans__internal_alias __attribute((visibility("hidden"))); -#define xmlAutomataNewAllTrans xmlAutomataNewAllTrans__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED) -#ifdef bottom_xmlregexp -#undef xmlAutomataNewCountTrans -extern __typeof (xmlAutomataNewCountTrans) xmlAutomataNewCountTrans __attribute((alias("xmlAutomataNewCountTrans__internal_alias"))); -#else -#ifndef xmlAutomataNewCountTrans -extern __typeof (xmlAutomataNewCountTrans) xmlAutomataNewCountTrans__internal_alias __attribute((visibility("hidden"))); -#define xmlAutomataNewCountTrans xmlAutomataNewCountTrans__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED) -#ifdef bottom_xmlregexp -#undef xmlAutomataNewCountTrans2 -extern __typeof (xmlAutomataNewCountTrans2) xmlAutomataNewCountTrans2 __attribute((alias("xmlAutomataNewCountTrans2__internal_alias"))); -#else -#ifndef xmlAutomataNewCountTrans2 -extern __typeof (xmlAutomataNewCountTrans2) xmlAutomataNewCountTrans2__internal_alias __attribute((visibility("hidden"))); -#define xmlAutomataNewCountTrans2 xmlAutomataNewCountTrans2__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED) -#ifdef bottom_xmlregexp -#undef xmlAutomataNewCountedTrans -extern __typeof (xmlAutomataNewCountedTrans) xmlAutomataNewCountedTrans __attribute((alias("xmlAutomataNewCountedTrans__internal_alias"))); -#else -#ifndef xmlAutomataNewCountedTrans -extern __typeof (xmlAutomataNewCountedTrans) xmlAutomataNewCountedTrans__internal_alias __attribute((visibility("hidden"))); -#define xmlAutomataNewCountedTrans xmlAutomataNewCountedTrans__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED) -#ifdef bottom_xmlregexp -#undef xmlAutomataNewCounter -extern __typeof (xmlAutomataNewCounter) xmlAutomataNewCounter __attribute((alias("xmlAutomataNewCounter__internal_alias"))); -#else -#ifndef xmlAutomataNewCounter -extern __typeof (xmlAutomataNewCounter) xmlAutomataNewCounter__internal_alias __attribute((visibility("hidden"))); -#define xmlAutomataNewCounter xmlAutomataNewCounter__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED) -#ifdef bottom_xmlregexp -#undef xmlAutomataNewCounterTrans -extern __typeof (xmlAutomataNewCounterTrans) xmlAutomataNewCounterTrans __attribute((alias("xmlAutomataNewCounterTrans__internal_alias"))); -#else -#ifndef xmlAutomataNewCounterTrans -extern __typeof (xmlAutomataNewCounterTrans) xmlAutomataNewCounterTrans__internal_alias __attribute((visibility("hidden"))); -#define xmlAutomataNewCounterTrans xmlAutomataNewCounterTrans__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED) -#ifdef bottom_xmlregexp -#undef xmlAutomataNewEpsilon -extern __typeof (xmlAutomataNewEpsilon) xmlAutomataNewEpsilon __attribute((alias("xmlAutomataNewEpsilon__internal_alias"))); -#else -#ifndef xmlAutomataNewEpsilon -extern __typeof (xmlAutomataNewEpsilon) xmlAutomataNewEpsilon__internal_alias __attribute((visibility("hidden"))); -#define xmlAutomataNewEpsilon xmlAutomataNewEpsilon__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED) -#ifdef bottom_xmlregexp -#undef xmlAutomataNewNegTrans -extern __typeof (xmlAutomataNewNegTrans) xmlAutomataNewNegTrans __attribute((alias("xmlAutomataNewNegTrans__internal_alias"))); -#else -#ifndef xmlAutomataNewNegTrans -extern __typeof (xmlAutomataNewNegTrans) xmlAutomataNewNegTrans__internal_alias __attribute((visibility("hidden"))); -#define xmlAutomataNewNegTrans xmlAutomataNewNegTrans__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED) -#ifdef bottom_xmlregexp -#undef xmlAutomataNewOnceTrans -extern __typeof (xmlAutomataNewOnceTrans) xmlAutomataNewOnceTrans __attribute((alias("xmlAutomataNewOnceTrans__internal_alias"))); -#else -#ifndef xmlAutomataNewOnceTrans -extern __typeof (xmlAutomataNewOnceTrans) xmlAutomataNewOnceTrans__internal_alias __attribute((visibility("hidden"))); -#define xmlAutomataNewOnceTrans xmlAutomataNewOnceTrans__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED) -#ifdef bottom_xmlregexp -#undef xmlAutomataNewOnceTrans2 -extern __typeof (xmlAutomataNewOnceTrans2) xmlAutomataNewOnceTrans2 __attribute((alias("xmlAutomataNewOnceTrans2__internal_alias"))); -#else -#ifndef xmlAutomataNewOnceTrans2 -extern __typeof (xmlAutomataNewOnceTrans2) xmlAutomataNewOnceTrans2__internal_alias __attribute((visibility("hidden"))); -#define xmlAutomataNewOnceTrans2 xmlAutomataNewOnceTrans2__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED) -#ifdef bottom_xmlregexp -#undef xmlAutomataNewState -extern __typeof (xmlAutomataNewState) xmlAutomataNewState __attribute((alias("xmlAutomataNewState__internal_alias"))); -#else -#ifndef xmlAutomataNewState -extern __typeof (xmlAutomataNewState) xmlAutomataNewState__internal_alias __attribute((visibility("hidden"))); -#define xmlAutomataNewState xmlAutomataNewState__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED) -#ifdef bottom_xmlregexp -#undef xmlAutomataNewTransition -extern __typeof (xmlAutomataNewTransition) xmlAutomataNewTransition __attribute((alias("xmlAutomataNewTransition__internal_alias"))); -#else -#ifndef xmlAutomataNewTransition -extern __typeof (xmlAutomataNewTransition) xmlAutomataNewTransition__internal_alias __attribute((visibility("hidden"))); -#define xmlAutomataNewTransition xmlAutomataNewTransition__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED) -#ifdef bottom_xmlregexp -#undef xmlAutomataNewTransition2 -extern __typeof (xmlAutomataNewTransition2) xmlAutomataNewTransition2 __attribute((alias("xmlAutomataNewTransition2__internal_alias"))); -#else -#ifndef xmlAutomataNewTransition2 -extern __typeof (xmlAutomataNewTransition2) xmlAutomataNewTransition2__internal_alias __attribute((visibility("hidden"))); -#define xmlAutomataNewTransition2 xmlAutomataNewTransition2__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED) -#ifdef bottom_xmlregexp -#undef xmlAutomataSetFinalState -extern __typeof (xmlAutomataSetFinalState) xmlAutomataSetFinalState __attribute((alias("xmlAutomataSetFinalState__internal_alias"))); -#else -#ifndef xmlAutomataSetFinalState -extern __typeof (xmlAutomataSetFinalState) xmlAutomataSetFinalState__internal_alias __attribute((visibility("hidden"))); -#define xmlAutomataSetFinalState xmlAutomataSetFinalState__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_DEBUG_ENABLED) -#ifdef bottom_debugXML -#undef xmlBoolToText -extern __typeof (xmlBoolToText) xmlBoolToText __attribute((alias("xmlBoolToText__internal_alias"))); -#else -#ifndef xmlBoolToText -extern __typeof (xmlBoolToText) xmlBoolToText__internal_alias __attribute((visibility("hidden"))); -#define xmlBoolToText xmlBoolToText__internal_alias -#endif -#endif -#endif - -#ifdef bottom_buf -#undef xmlBufContent -extern __typeof (xmlBufContent) xmlBufContent __attribute((alias("xmlBufContent__internal_alias"))); -#else -#ifndef xmlBufContent -extern __typeof (xmlBufContent) xmlBufContent__internal_alias __attribute((visibility("hidden"))); -#define xmlBufContent xmlBufContent__internal_alias -#endif -#endif - -#ifdef bottom_buf -#undef xmlBufEnd -extern __typeof (xmlBufEnd) xmlBufEnd __attribute((alias("xmlBufEnd__internal_alias"))); -#else -#ifndef xmlBufEnd -extern __typeof (xmlBufEnd) xmlBufEnd__internal_alias __attribute((visibility("hidden"))); -#define xmlBufEnd xmlBufEnd__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlBufGetNodeContent -extern __typeof (xmlBufGetNodeContent) xmlBufGetNodeContent __attribute((alias("xmlBufGetNodeContent__internal_alias"))); -#else -#ifndef xmlBufGetNodeContent -extern __typeof (xmlBufGetNodeContent) xmlBufGetNodeContent__internal_alias __attribute((visibility("hidden"))); -#define xmlBufGetNodeContent xmlBufGetNodeContent__internal_alias -#endif -#endif - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_xmlsave -#undef xmlBufNodeDump -extern __typeof (xmlBufNodeDump) xmlBufNodeDump __attribute((alias("xmlBufNodeDump__internal_alias"))); -#else -#ifndef xmlBufNodeDump -extern __typeof (xmlBufNodeDump) xmlBufNodeDump__internal_alias __attribute((visibility("hidden"))); -#define xmlBufNodeDump xmlBufNodeDump__internal_alias -#endif -#endif -#endif - -#ifdef bottom_buf -#undef xmlBufShrink -extern __typeof (xmlBufShrink) xmlBufShrink __attribute((alias("xmlBufShrink__internal_alias"))); -#else -#ifndef xmlBufShrink -extern __typeof (xmlBufShrink) xmlBufShrink__internal_alias __attribute((visibility("hidden"))); -#define xmlBufShrink xmlBufShrink__internal_alias -#endif -#endif - -#ifdef bottom_buf -#undef xmlBufUse -extern __typeof (xmlBufUse) xmlBufUse __attribute((alias("xmlBufUse__internal_alias"))); -#else -#ifndef xmlBufUse -extern __typeof (xmlBufUse) xmlBufUse__internal_alias __attribute((visibility("hidden"))); -#define xmlBufUse xmlBufUse__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlBufferAdd -extern __typeof (xmlBufferAdd) xmlBufferAdd __attribute((alias("xmlBufferAdd__internal_alias"))); -#else -#ifndef xmlBufferAdd -extern __typeof (xmlBufferAdd) xmlBufferAdd__internal_alias __attribute((visibility("hidden"))); -#define xmlBufferAdd xmlBufferAdd__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlBufferAddHead -extern __typeof (xmlBufferAddHead) xmlBufferAddHead __attribute((alias("xmlBufferAddHead__internal_alias"))); -#else -#ifndef xmlBufferAddHead -extern __typeof (xmlBufferAddHead) xmlBufferAddHead__internal_alias __attribute((visibility("hidden"))); -#define xmlBufferAddHead xmlBufferAddHead__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlBufferCCat -extern __typeof (xmlBufferCCat) xmlBufferCCat __attribute((alias("xmlBufferCCat__internal_alias"))); -#else -#ifndef xmlBufferCCat -extern __typeof (xmlBufferCCat) xmlBufferCCat__internal_alias __attribute((visibility("hidden"))); -#define xmlBufferCCat xmlBufferCCat__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlBufferCat -extern __typeof (xmlBufferCat) xmlBufferCat __attribute((alias("xmlBufferCat__internal_alias"))); -#else -#ifndef xmlBufferCat -extern __typeof (xmlBufferCat) xmlBufferCat__internal_alias __attribute((visibility("hidden"))); -#define xmlBufferCat xmlBufferCat__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlBufferContent -extern __typeof (xmlBufferContent) xmlBufferContent __attribute((alias("xmlBufferContent__internal_alias"))); -#else -#ifndef xmlBufferContent -extern __typeof (xmlBufferContent) xmlBufferContent__internal_alias __attribute((visibility("hidden"))); -#define xmlBufferContent xmlBufferContent__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlBufferCreate -extern __typeof (xmlBufferCreate) xmlBufferCreate __attribute((alias("xmlBufferCreate__internal_alias"))); -#else -#ifndef xmlBufferCreate -extern __typeof (xmlBufferCreate) xmlBufferCreate__internal_alias __attribute((visibility("hidden"))); -#define xmlBufferCreate xmlBufferCreate__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlBufferCreateSize -extern __typeof (xmlBufferCreateSize) xmlBufferCreateSize __attribute((alias("xmlBufferCreateSize__internal_alias"))); -#else -#ifndef xmlBufferCreateSize -extern __typeof (xmlBufferCreateSize) xmlBufferCreateSize__internal_alias __attribute((visibility("hidden"))); -#define xmlBufferCreateSize xmlBufferCreateSize__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlBufferCreateStatic -extern __typeof (xmlBufferCreateStatic) xmlBufferCreateStatic __attribute((alias("xmlBufferCreateStatic__internal_alias"))); -#else -#ifndef xmlBufferCreateStatic -extern __typeof (xmlBufferCreateStatic) xmlBufferCreateStatic__internal_alias __attribute((visibility("hidden"))); -#define xmlBufferCreateStatic xmlBufferCreateStatic__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlBufferDetach -extern __typeof (xmlBufferDetach) xmlBufferDetach __attribute((alias("xmlBufferDetach__internal_alias"))); -#else -#ifndef xmlBufferDetach -extern __typeof (xmlBufferDetach) xmlBufferDetach__internal_alias __attribute((visibility("hidden"))); -#define xmlBufferDetach xmlBufferDetach__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlBufferDump -extern __typeof (xmlBufferDump) xmlBufferDump __attribute((alias("xmlBufferDump__internal_alias"))); -#else -#ifndef xmlBufferDump -extern __typeof (xmlBufferDump) xmlBufferDump__internal_alias __attribute((visibility("hidden"))); -#define xmlBufferDump xmlBufferDump__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlBufferEmpty -extern __typeof (xmlBufferEmpty) xmlBufferEmpty __attribute((alias("xmlBufferEmpty__internal_alias"))); -#else -#ifndef xmlBufferEmpty -extern __typeof (xmlBufferEmpty) xmlBufferEmpty__internal_alias __attribute((visibility("hidden"))); -#define xmlBufferEmpty xmlBufferEmpty__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlBufferFree -extern __typeof (xmlBufferFree) xmlBufferFree __attribute((alias("xmlBufferFree__internal_alias"))); -#else -#ifndef xmlBufferFree -extern __typeof (xmlBufferFree) xmlBufferFree__internal_alias __attribute((visibility("hidden"))); -#define xmlBufferFree xmlBufferFree__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlBufferGrow -extern __typeof (xmlBufferGrow) xmlBufferGrow __attribute((alias("xmlBufferGrow__internal_alias"))); -#else -#ifndef xmlBufferGrow -extern __typeof (xmlBufferGrow) xmlBufferGrow__internal_alias __attribute((visibility("hidden"))); -#define xmlBufferGrow xmlBufferGrow__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlBufferLength -extern __typeof (xmlBufferLength) xmlBufferLength __attribute((alias("xmlBufferLength__internal_alias"))); -#else -#ifndef xmlBufferLength -extern __typeof (xmlBufferLength) xmlBufferLength__internal_alias __attribute((visibility("hidden"))); -#define xmlBufferLength xmlBufferLength__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlBufferResize -extern __typeof (xmlBufferResize) xmlBufferResize __attribute((alias("xmlBufferResize__internal_alias"))); -#else -#ifndef xmlBufferResize -extern __typeof (xmlBufferResize) xmlBufferResize__internal_alias __attribute((visibility("hidden"))); -#define xmlBufferResize xmlBufferResize__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlBufferSetAllocationScheme -extern __typeof (xmlBufferSetAllocationScheme) xmlBufferSetAllocationScheme __attribute((alias("xmlBufferSetAllocationScheme__internal_alias"))); -#else -#ifndef xmlBufferSetAllocationScheme -extern __typeof (xmlBufferSetAllocationScheme) xmlBufferSetAllocationScheme__internal_alias __attribute((visibility("hidden"))); -#define xmlBufferSetAllocationScheme xmlBufferSetAllocationScheme__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlBufferShrink -extern __typeof (xmlBufferShrink) xmlBufferShrink __attribute((alias("xmlBufferShrink__internal_alias"))); -#else -#ifndef xmlBufferShrink -extern __typeof (xmlBufferShrink) xmlBufferShrink__internal_alias __attribute((visibility("hidden"))); -#define xmlBufferShrink xmlBufferShrink__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlBufferWriteCHAR -extern __typeof (xmlBufferWriteCHAR) xmlBufferWriteCHAR __attribute((alias("xmlBufferWriteCHAR__internal_alias"))); -#else -#ifndef xmlBufferWriteCHAR -extern __typeof (xmlBufferWriteCHAR) xmlBufferWriteCHAR__internal_alias __attribute((visibility("hidden"))); -#define xmlBufferWriteCHAR xmlBufferWriteCHAR__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlBufferWriteChar -extern __typeof (xmlBufferWriteChar) xmlBufferWriteChar __attribute((alias("xmlBufferWriteChar__internal_alias"))); -#else -#ifndef xmlBufferWriteChar -extern __typeof (xmlBufferWriteChar) xmlBufferWriteChar__internal_alias __attribute((visibility("hidden"))); -#define xmlBufferWriteChar xmlBufferWriteChar__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlBufferWriteQuotedString -extern __typeof (xmlBufferWriteQuotedString) xmlBufferWriteQuotedString __attribute((alias("xmlBufferWriteQuotedString__internal_alias"))); -#else -#ifndef xmlBufferWriteQuotedString -extern __typeof (xmlBufferWriteQuotedString) xmlBufferWriteQuotedString__internal_alias __attribute((visibility("hidden"))); -#define xmlBufferWriteQuotedString xmlBufferWriteQuotedString__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlBuildQName -extern __typeof (xmlBuildQName) xmlBuildQName __attribute((alias("xmlBuildQName__internal_alias"))); -#else -#ifndef xmlBuildQName -extern __typeof (xmlBuildQName) xmlBuildQName__internal_alias __attribute((visibility("hidden"))); -#define xmlBuildQName xmlBuildQName__internal_alias -#endif -#endif - -#ifdef bottom_uri -#undef xmlBuildRelativeURI -extern __typeof (xmlBuildRelativeURI) xmlBuildRelativeURI __attribute((alias("xmlBuildRelativeURI__internal_alias"))); -#else -#ifndef xmlBuildRelativeURI -extern __typeof (xmlBuildRelativeURI) xmlBuildRelativeURI__internal_alias __attribute((visibility("hidden"))); -#define xmlBuildRelativeURI xmlBuildRelativeURI__internal_alias -#endif -#endif - -#ifdef bottom_uri -#undef xmlBuildURI -extern __typeof (xmlBuildURI) xmlBuildURI __attribute((alias("xmlBuildURI__internal_alias"))); -#else -#ifndef xmlBuildURI -extern __typeof (xmlBuildURI) xmlBuildURI__internal_alias __attribute((visibility("hidden"))); -#define xmlBuildURI xmlBuildURI__internal_alias -#endif -#endif - -#ifdef bottom_encoding -#undef xmlByteConsumed -extern __typeof (xmlByteConsumed) xmlByteConsumed __attribute((alias("xmlByteConsumed__internal_alias"))); -#else -#ifndef xmlByteConsumed -extern __typeof (xmlByteConsumed) xmlByteConsumed__internal_alias __attribute((visibility("hidden"))); -#define xmlByteConsumed xmlByteConsumed__internal_alias -#endif -#endif - -#if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_c14n -#undef xmlC14NDocDumpMemory -extern __typeof (xmlC14NDocDumpMemory) xmlC14NDocDumpMemory __attribute((alias("xmlC14NDocDumpMemory__internal_alias"))); -#else -#ifndef xmlC14NDocDumpMemory -extern __typeof (xmlC14NDocDumpMemory) xmlC14NDocDumpMemory__internal_alias __attribute((visibility("hidden"))); -#define xmlC14NDocDumpMemory xmlC14NDocDumpMemory__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_c14n -#undef xmlC14NDocSave -extern __typeof (xmlC14NDocSave) xmlC14NDocSave __attribute((alias("xmlC14NDocSave__internal_alias"))); -#else -#ifndef xmlC14NDocSave -extern __typeof (xmlC14NDocSave) xmlC14NDocSave__internal_alias __attribute((visibility("hidden"))); -#define xmlC14NDocSave xmlC14NDocSave__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_c14n -#undef xmlC14NDocSaveTo -extern __typeof (xmlC14NDocSaveTo) xmlC14NDocSaveTo __attribute((alias("xmlC14NDocSaveTo__internal_alias"))); -#else -#ifndef xmlC14NDocSaveTo -extern __typeof (xmlC14NDocSaveTo) xmlC14NDocSaveTo__internal_alias __attribute((visibility("hidden"))); -#define xmlC14NDocSaveTo xmlC14NDocSaveTo__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_c14n -#undef xmlC14NExecute -extern __typeof (xmlC14NExecute) xmlC14NExecute __attribute((alias("xmlC14NExecute__internal_alias"))); -#else -#ifndef xmlC14NExecute -extern __typeof (xmlC14NExecute) xmlC14NExecute__internal_alias __attribute((visibility("hidden"))); -#define xmlC14NExecute xmlC14NExecute__internal_alias -#endif -#endif -#endif - -#ifdef bottom_uri -#undef xmlCanonicPath -extern __typeof (xmlCanonicPath) xmlCanonicPath __attribute((alias("xmlCanonicPath__internal_alias"))); -#else -#ifndef xmlCanonicPath -extern __typeof (xmlCanonicPath) xmlCanonicPath__internal_alias __attribute((visibility("hidden"))); -#define xmlCanonicPath xmlCanonicPath__internal_alias -#endif -#endif - -#if defined(LIBXML_CATALOG_ENABLED) -#ifdef bottom_catalog -#undef xmlCatalogAdd -extern __typeof (xmlCatalogAdd) xmlCatalogAdd __attribute((alias("xmlCatalogAdd__internal_alias"))); -#else -#ifndef xmlCatalogAdd -extern __typeof (xmlCatalogAdd) xmlCatalogAdd__internal_alias __attribute((visibility("hidden"))); -#define xmlCatalogAdd xmlCatalogAdd__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_CATALOG_ENABLED) -#ifdef bottom_catalog -#undef xmlCatalogAddLocal -extern __typeof (xmlCatalogAddLocal) xmlCatalogAddLocal __attribute((alias("xmlCatalogAddLocal__internal_alias"))); -#else -#ifndef xmlCatalogAddLocal -extern __typeof (xmlCatalogAddLocal) xmlCatalogAddLocal__internal_alias __attribute((visibility("hidden"))); -#define xmlCatalogAddLocal xmlCatalogAddLocal__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_CATALOG_ENABLED) -#ifdef bottom_catalog -#undef xmlCatalogCleanup -extern __typeof (xmlCatalogCleanup) xmlCatalogCleanup __attribute((alias("xmlCatalogCleanup__internal_alias"))); -#else -#ifndef xmlCatalogCleanup -extern __typeof (xmlCatalogCleanup) xmlCatalogCleanup__internal_alias __attribute((visibility("hidden"))); -#define xmlCatalogCleanup xmlCatalogCleanup__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_CATALOG_ENABLED) -#ifdef bottom_catalog -#undef xmlCatalogConvert -extern __typeof (xmlCatalogConvert) xmlCatalogConvert __attribute((alias("xmlCatalogConvert__internal_alias"))); -#else -#ifndef xmlCatalogConvert -extern __typeof (xmlCatalogConvert) xmlCatalogConvert__internal_alias __attribute((visibility("hidden"))); -#define xmlCatalogConvert xmlCatalogConvert__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_catalog -#undef xmlCatalogDump -extern __typeof (xmlCatalogDump) xmlCatalogDump __attribute((alias("xmlCatalogDump__internal_alias"))); -#else -#ifndef xmlCatalogDump -extern __typeof (xmlCatalogDump) xmlCatalogDump__internal_alias __attribute((visibility("hidden"))); -#define xmlCatalogDump xmlCatalogDump__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_CATALOG_ENABLED) -#ifdef bottom_catalog -#undef xmlCatalogFreeLocal -extern __typeof (xmlCatalogFreeLocal) xmlCatalogFreeLocal __attribute((alias("xmlCatalogFreeLocal__internal_alias"))); -#else -#ifndef xmlCatalogFreeLocal -extern __typeof (xmlCatalogFreeLocal) xmlCatalogFreeLocal__internal_alias __attribute((visibility("hidden"))); -#define xmlCatalogFreeLocal xmlCatalogFreeLocal__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_CATALOG_ENABLED) -#ifdef bottom_catalog -#undef xmlCatalogGetDefaults -extern __typeof (xmlCatalogGetDefaults) xmlCatalogGetDefaults __attribute((alias("xmlCatalogGetDefaults__internal_alias"))); -#else -#ifndef xmlCatalogGetDefaults -extern __typeof (xmlCatalogGetDefaults) xmlCatalogGetDefaults__internal_alias __attribute((visibility("hidden"))); -#define xmlCatalogGetDefaults xmlCatalogGetDefaults__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_CATALOG_ENABLED) -#ifdef bottom_catalog -#undef xmlCatalogGetPublic -extern __typeof (xmlCatalogGetPublic) xmlCatalogGetPublic __attribute((alias("xmlCatalogGetPublic__internal_alias"))); -#else -#ifndef xmlCatalogGetPublic -extern __typeof (xmlCatalogGetPublic) xmlCatalogGetPublic__internal_alias __attribute((visibility("hidden"))); -#define xmlCatalogGetPublic xmlCatalogGetPublic__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_CATALOG_ENABLED) -#ifdef bottom_catalog -#undef xmlCatalogGetSystem -extern __typeof (xmlCatalogGetSystem) xmlCatalogGetSystem __attribute((alias("xmlCatalogGetSystem__internal_alias"))); -#else -#ifndef xmlCatalogGetSystem -extern __typeof (xmlCatalogGetSystem) xmlCatalogGetSystem__internal_alias __attribute((visibility("hidden"))); -#define xmlCatalogGetSystem xmlCatalogGetSystem__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_CATALOG_ENABLED) -#ifdef bottom_catalog -#undef xmlCatalogIsEmpty -extern __typeof (xmlCatalogIsEmpty) xmlCatalogIsEmpty __attribute((alias("xmlCatalogIsEmpty__internal_alias"))); -#else -#ifndef xmlCatalogIsEmpty -extern __typeof (xmlCatalogIsEmpty) xmlCatalogIsEmpty__internal_alias __attribute((visibility("hidden"))); -#define xmlCatalogIsEmpty xmlCatalogIsEmpty__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_CATALOG_ENABLED) -#ifdef bottom_catalog -#undef xmlCatalogLocalResolve -extern __typeof (xmlCatalogLocalResolve) xmlCatalogLocalResolve __attribute((alias("xmlCatalogLocalResolve__internal_alias"))); -#else -#ifndef xmlCatalogLocalResolve -extern __typeof (xmlCatalogLocalResolve) xmlCatalogLocalResolve__internal_alias __attribute((visibility("hidden"))); -#define xmlCatalogLocalResolve xmlCatalogLocalResolve__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_CATALOG_ENABLED) -#ifdef bottom_catalog -#undef xmlCatalogLocalResolveURI -extern __typeof (xmlCatalogLocalResolveURI) xmlCatalogLocalResolveURI __attribute((alias("xmlCatalogLocalResolveURI__internal_alias"))); -#else -#ifndef xmlCatalogLocalResolveURI -extern __typeof (xmlCatalogLocalResolveURI) xmlCatalogLocalResolveURI__internal_alias __attribute((visibility("hidden"))); -#define xmlCatalogLocalResolveURI xmlCatalogLocalResolveURI__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_CATALOG_ENABLED) -#ifdef bottom_catalog -#undef xmlCatalogRemove -extern __typeof (xmlCatalogRemove) xmlCatalogRemove __attribute((alias("xmlCatalogRemove__internal_alias"))); -#else -#ifndef xmlCatalogRemove -extern __typeof (xmlCatalogRemove) xmlCatalogRemove__internal_alias __attribute((visibility("hidden"))); -#define xmlCatalogRemove xmlCatalogRemove__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_CATALOG_ENABLED) -#ifdef bottom_catalog -#undef xmlCatalogResolve -extern __typeof (xmlCatalogResolve) xmlCatalogResolve __attribute((alias("xmlCatalogResolve__internal_alias"))); -#else -#ifndef xmlCatalogResolve -extern __typeof (xmlCatalogResolve) xmlCatalogResolve__internal_alias __attribute((visibility("hidden"))); -#define xmlCatalogResolve xmlCatalogResolve__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_CATALOG_ENABLED) -#ifdef bottom_catalog -#undef xmlCatalogResolvePublic -extern __typeof (xmlCatalogResolvePublic) xmlCatalogResolvePublic __attribute((alias("xmlCatalogResolvePublic__internal_alias"))); -#else -#ifndef xmlCatalogResolvePublic -extern __typeof (xmlCatalogResolvePublic) xmlCatalogResolvePublic__internal_alias __attribute((visibility("hidden"))); -#define xmlCatalogResolvePublic xmlCatalogResolvePublic__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_CATALOG_ENABLED) -#ifdef bottom_catalog -#undef xmlCatalogResolveSystem -extern __typeof (xmlCatalogResolveSystem) xmlCatalogResolveSystem __attribute((alias("xmlCatalogResolveSystem__internal_alias"))); -#else -#ifndef xmlCatalogResolveSystem -extern __typeof (xmlCatalogResolveSystem) xmlCatalogResolveSystem__internal_alias __attribute((visibility("hidden"))); -#define xmlCatalogResolveSystem xmlCatalogResolveSystem__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_CATALOG_ENABLED) -#ifdef bottom_catalog -#undef xmlCatalogResolveURI -extern __typeof (xmlCatalogResolveURI) xmlCatalogResolveURI __attribute((alias("xmlCatalogResolveURI__internal_alias"))); -#else -#ifndef xmlCatalogResolveURI -extern __typeof (xmlCatalogResolveURI) xmlCatalogResolveURI__internal_alias __attribute((visibility("hidden"))); -#define xmlCatalogResolveURI xmlCatalogResolveURI__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_CATALOG_ENABLED) -#ifdef bottom_catalog -#undef xmlCatalogSetDebug -extern __typeof (xmlCatalogSetDebug) xmlCatalogSetDebug __attribute((alias("xmlCatalogSetDebug__internal_alias"))); -#else -#ifndef xmlCatalogSetDebug -extern __typeof (xmlCatalogSetDebug) xmlCatalogSetDebug__internal_alias __attribute((visibility("hidden"))); -#define xmlCatalogSetDebug xmlCatalogSetDebug__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_CATALOG_ENABLED) -#ifdef bottom_catalog -#undef xmlCatalogSetDefaultPrefer -extern __typeof (xmlCatalogSetDefaultPrefer) xmlCatalogSetDefaultPrefer __attribute((alias("xmlCatalogSetDefaultPrefer__internal_alias"))); -#else -#ifndef xmlCatalogSetDefaultPrefer -extern __typeof (xmlCatalogSetDefaultPrefer) xmlCatalogSetDefaultPrefer__internal_alias __attribute((visibility("hidden"))); -#define xmlCatalogSetDefaultPrefer xmlCatalogSetDefaultPrefer__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_CATALOG_ENABLED) -#ifdef bottom_catalog -#undef xmlCatalogSetDefaults -extern __typeof (xmlCatalogSetDefaults) xmlCatalogSetDefaults __attribute((alias("xmlCatalogSetDefaults__internal_alias"))); -#else -#ifndef xmlCatalogSetDefaults -extern __typeof (xmlCatalogSetDefaults) xmlCatalogSetDefaults__internal_alias __attribute((visibility("hidden"))); -#define xmlCatalogSetDefaults xmlCatalogSetDefaults__internal_alias -#endif -#endif -#endif - -#ifdef bottom_encoding -#undef xmlCharEncCloseFunc -extern __typeof (xmlCharEncCloseFunc) xmlCharEncCloseFunc __attribute((alias("xmlCharEncCloseFunc__internal_alias"))); -#else -#ifndef xmlCharEncCloseFunc -extern __typeof (xmlCharEncCloseFunc) xmlCharEncCloseFunc__internal_alias __attribute((visibility("hidden"))); -#define xmlCharEncCloseFunc xmlCharEncCloseFunc__internal_alias -#endif -#endif - -#ifdef bottom_encoding -#undef xmlCharEncFirstLine -extern __typeof (xmlCharEncFirstLine) xmlCharEncFirstLine __attribute((alias("xmlCharEncFirstLine__internal_alias"))); -#else -#ifndef xmlCharEncFirstLine -extern __typeof (xmlCharEncFirstLine) xmlCharEncFirstLine__internal_alias __attribute((visibility("hidden"))); -#define xmlCharEncFirstLine xmlCharEncFirstLine__internal_alias -#endif -#endif - -#ifdef bottom_encoding -#undef xmlCharEncInFunc -extern __typeof (xmlCharEncInFunc) xmlCharEncInFunc __attribute((alias("xmlCharEncInFunc__internal_alias"))); -#else -#ifndef xmlCharEncInFunc -extern __typeof (xmlCharEncInFunc) xmlCharEncInFunc__internal_alias __attribute((visibility("hidden"))); -#define xmlCharEncInFunc xmlCharEncInFunc__internal_alias -#endif -#endif - -#ifdef bottom_encoding -#undef xmlCharEncOutFunc -extern __typeof (xmlCharEncOutFunc) xmlCharEncOutFunc __attribute((alias("xmlCharEncOutFunc__internal_alias"))); -#else -#ifndef xmlCharEncOutFunc -extern __typeof (xmlCharEncOutFunc) xmlCharEncOutFunc__internal_alias __attribute((visibility("hidden"))); -#define xmlCharEncOutFunc xmlCharEncOutFunc__internal_alias -#endif -#endif - -#ifdef bottom_chvalid -#undef xmlCharInRange -extern __typeof (xmlCharInRange) xmlCharInRange __attribute((alias("xmlCharInRange__internal_alias"))); -#else -#ifndef xmlCharInRange -extern __typeof (xmlCharInRange) xmlCharInRange__internal_alias __attribute((visibility("hidden"))); -#define xmlCharInRange xmlCharInRange__internal_alias -#endif -#endif - -#ifdef bottom_xmlstring -#undef xmlCharStrdup -extern __typeof (xmlCharStrdup) xmlCharStrdup __attribute((alias("xmlCharStrdup__internal_alias"))); -#else -#ifndef xmlCharStrdup -extern __typeof (xmlCharStrdup) xmlCharStrdup__internal_alias __attribute((visibility("hidden"))); -#define xmlCharStrdup xmlCharStrdup__internal_alias -#endif -#endif - -#ifdef bottom_xmlstring -#undef xmlCharStrndup -extern __typeof (xmlCharStrndup) xmlCharStrndup __attribute((alias("xmlCharStrndup__internal_alias"))); -#else -#ifndef xmlCharStrndup -extern __typeof (xmlCharStrndup) xmlCharStrndup__internal_alias __attribute((visibility("hidden"))); -#define xmlCharStrndup xmlCharStrndup__internal_alias -#endif -#endif - -#ifdef bottom_xmlIO -#undef xmlCheckFilename -extern __typeof (xmlCheckFilename) xmlCheckFilename __attribute((alias("xmlCheckFilename__internal_alias"))); -#else -#ifndef xmlCheckFilename -extern __typeof (xmlCheckFilename) xmlCheckFilename__internal_alias __attribute((visibility("hidden"))); -#define xmlCheckFilename xmlCheckFilename__internal_alias -#endif -#endif - -#ifdef bottom_xmlIO -#undef xmlCheckHTTPInput -extern __typeof (xmlCheckHTTPInput) xmlCheckHTTPInput __attribute((alias("xmlCheckHTTPInput__internal_alias"))); -#else -#ifndef xmlCheckHTTPInput -extern __typeof (xmlCheckHTTPInput) xmlCheckHTTPInput__internal_alias __attribute((visibility("hidden"))); -#define xmlCheckHTTPInput xmlCheckHTTPInput__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlCheckLanguageID -extern __typeof (xmlCheckLanguageID) xmlCheckLanguageID __attribute((alias("xmlCheckLanguageID__internal_alias"))); -#else -#ifndef xmlCheckLanguageID -extern __typeof (xmlCheckLanguageID) xmlCheckLanguageID__internal_alias __attribute((visibility("hidden"))); -#define xmlCheckLanguageID xmlCheckLanguageID__internal_alias -#endif -#endif - -#ifdef bottom_xmlstring -#undef xmlCheckUTF8 -extern __typeof (xmlCheckUTF8) xmlCheckUTF8 __attribute((alias("xmlCheckUTF8__internal_alias"))); -#else -#ifndef xmlCheckUTF8 -extern __typeof (xmlCheckUTF8) xmlCheckUTF8__internal_alias __attribute((visibility("hidden"))); -#define xmlCheckUTF8 xmlCheckUTF8__internal_alias -#endif -#endif - -#ifdef bottom_parserInternals -#undef xmlCheckVersion -extern __typeof (xmlCheckVersion) xmlCheckVersion __attribute((alias("xmlCheckVersion__internal_alias"))); -#else -#ifndef xmlCheckVersion -extern __typeof (xmlCheckVersion) xmlCheckVersion__internal_alias __attribute((visibility("hidden"))); -#define xmlCheckVersion xmlCheckVersion__internal_alias -#endif -#endif - -#if defined(LIBXML_TREE_ENABLED) -#ifdef bottom_tree -#undef xmlChildElementCount -extern __typeof (xmlChildElementCount) xmlChildElementCount __attribute((alias("xmlChildElementCount__internal_alias"))); -#else -#ifndef xmlChildElementCount -extern __typeof (xmlChildElementCount) xmlChildElementCount__internal_alias __attribute((visibility("hidden"))); -#define xmlChildElementCount xmlChildElementCount__internal_alias -#endif -#endif -#endif - -#ifdef bottom_encoding -#undef xmlCleanupCharEncodingHandlers -extern __typeof (xmlCleanupCharEncodingHandlers) xmlCleanupCharEncodingHandlers __attribute((alias("xmlCleanupCharEncodingHandlers__internal_alias"))); -#else -#ifndef xmlCleanupCharEncodingHandlers -extern __typeof (xmlCleanupCharEncodingHandlers) xmlCleanupCharEncodingHandlers__internal_alias __attribute((visibility("hidden"))); -#define xmlCleanupCharEncodingHandlers xmlCleanupCharEncodingHandlers__internal_alias -#endif -#endif - -#ifdef bottom_encoding -#undef xmlCleanupEncodingAliases -extern __typeof (xmlCleanupEncodingAliases) xmlCleanupEncodingAliases __attribute((alias("xmlCleanupEncodingAliases__internal_alias"))); -#else -#ifndef xmlCleanupEncodingAliases -extern __typeof (xmlCleanupEncodingAliases) xmlCleanupEncodingAliases__internal_alias __attribute((visibility("hidden"))); -#define xmlCleanupEncodingAliases xmlCleanupEncodingAliases__internal_alias -#endif -#endif - -#ifdef bottom_globals -#undef xmlCleanupGlobals -extern __typeof (xmlCleanupGlobals) xmlCleanupGlobals __attribute((alias("xmlCleanupGlobals__internal_alias"))); -#else -#ifndef xmlCleanupGlobals -extern __typeof (xmlCleanupGlobals) xmlCleanupGlobals__internal_alias __attribute((visibility("hidden"))); -#define xmlCleanupGlobals xmlCleanupGlobals__internal_alias -#endif -#endif - -#ifdef bottom_xmlIO -#undef xmlCleanupInputCallbacks -extern __typeof (xmlCleanupInputCallbacks) xmlCleanupInputCallbacks __attribute((alias("xmlCleanupInputCallbacks__internal_alias"))); -#else -#ifndef xmlCleanupInputCallbacks -extern __typeof (xmlCleanupInputCallbacks) xmlCleanupInputCallbacks__internal_alias __attribute((visibility("hidden"))); -#define xmlCleanupInputCallbacks xmlCleanupInputCallbacks__internal_alias -#endif -#endif - -#ifdef bottom_xmlmemory -#undef xmlCleanupMemory -extern __typeof (xmlCleanupMemory) xmlCleanupMemory __attribute((alias("xmlCleanupMemory__internal_alias"))); -#else -#ifndef xmlCleanupMemory -extern __typeof (xmlCleanupMemory) xmlCleanupMemory__internal_alias __attribute((visibility("hidden"))); -#define xmlCleanupMemory xmlCleanupMemory__internal_alias -#endif -#endif - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_xmlIO -#undef xmlCleanupOutputCallbacks -extern __typeof (xmlCleanupOutputCallbacks) xmlCleanupOutputCallbacks __attribute((alias("xmlCleanupOutputCallbacks__internal_alias"))); -#else -#ifndef xmlCleanupOutputCallbacks -extern __typeof (xmlCleanupOutputCallbacks) xmlCleanupOutputCallbacks__internal_alias __attribute((visibility("hidden"))); -#define xmlCleanupOutputCallbacks xmlCleanupOutputCallbacks__internal_alias -#endif -#endif -#endif - -#ifdef bottom_parser -#undef xmlCleanupParser -extern __typeof (xmlCleanupParser) xmlCleanupParser __attribute((alias("xmlCleanupParser__internal_alias"))); -#else -#ifndef xmlCleanupParser -extern __typeof (xmlCleanupParser) xmlCleanupParser__internal_alias __attribute((visibility("hidden"))); -#define xmlCleanupParser xmlCleanupParser__internal_alias -#endif -#endif - -#if defined(LIBXML_LEGACY_ENABLED) -#ifdef bottom_legacy -#undef xmlCleanupPredefinedEntities -extern __typeof (xmlCleanupPredefinedEntities) xmlCleanupPredefinedEntities __attribute((alias("xmlCleanupPredefinedEntities__internal_alias"))); -#else -#ifndef xmlCleanupPredefinedEntities -extern __typeof (xmlCleanupPredefinedEntities) xmlCleanupPredefinedEntities__internal_alias __attribute((visibility("hidden"))); -#define xmlCleanupPredefinedEntities xmlCleanupPredefinedEntities__internal_alias -#endif -#endif -#endif - -#ifdef bottom_threads -#undef xmlCleanupThreads -extern __typeof (xmlCleanupThreads) xmlCleanupThreads __attribute((alias("xmlCleanupThreads__internal_alias"))); -#else -#ifndef xmlCleanupThreads -extern __typeof (xmlCleanupThreads) xmlCleanupThreads__internal_alias __attribute((visibility("hidden"))); -#define xmlCleanupThreads xmlCleanupThreads__internal_alias -#endif -#endif - -#ifdef bottom_parserInternals -#undef xmlClearNodeInfoSeq -extern __typeof (xmlClearNodeInfoSeq) xmlClearNodeInfoSeq __attribute((alias("xmlClearNodeInfoSeq__internal_alias"))); -#else -#ifndef xmlClearNodeInfoSeq -extern __typeof (xmlClearNodeInfoSeq) xmlClearNodeInfoSeq__internal_alias __attribute((visibility("hidden"))); -#define xmlClearNodeInfoSeq xmlClearNodeInfoSeq__internal_alias -#endif -#endif - -#ifdef bottom_parserInternals -#undef xmlClearParserCtxt -extern __typeof (xmlClearParserCtxt) xmlClearParserCtxt __attribute((alias("xmlClearParserCtxt__internal_alias"))); -#else -#ifndef xmlClearParserCtxt -extern __typeof (xmlClearParserCtxt) xmlClearParserCtxt__internal_alias __attribute((visibility("hidden"))); -#define xmlClearParserCtxt xmlClearParserCtxt__internal_alias -#endif -#endif - -#if defined(LIBXML_CATALOG_ENABLED) -#ifdef bottom_catalog -#undef xmlConvertSGMLCatalog -extern __typeof (xmlConvertSGMLCatalog) xmlConvertSGMLCatalog __attribute((alias("xmlConvertSGMLCatalog__internal_alias"))); -#else -#ifndef xmlConvertSGMLCatalog -extern __typeof (xmlConvertSGMLCatalog) xmlConvertSGMLCatalog__internal_alias __attribute((visibility("hidden"))); -#define xmlConvertSGMLCatalog xmlConvertSGMLCatalog__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_TREE_ENABLED) -#ifdef bottom_valid -#undef xmlCopyAttributeTable -extern __typeof (xmlCopyAttributeTable) xmlCopyAttributeTable __attribute((alias("xmlCopyAttributeTable__internal_alias"))); -#else -#ifndef xmlCopyAttributeTable -extern __typeof (xmlCopyAttributeTable) xmlCopyAttributeTable__internal_alias __attribute((visibility("hidden"))); -#define xmlCopyAttributeTable xmlCopyAttributeTable__internal_alias -#endif -#endif -#endif - -#ifdef bottom_parserInternals -#undef xmlCopyChar -extern __typeof (xmlCopyChar) xmlCopyChar __attribute((alias("xmlCopyChar__internal_alias"))); -#else -#ifndef xmlCopyChar -extern __typeof (xmlCopyChar) xmlCopyChar__internal_alias __attribute((visibility("hidden"))); -#define xmlCopyChar xmlCopyChar__internal_alias -#endif -#endif - -#ifdef bottom_parserInternals -#undef xmlCopyCharMultiByte -extern __typeof (xmlCopyCharMultiByte) xmlCopyCharMultiByte __attribute((alias("xmlCopyCharMultiByte__internal_alias"))); -#else -#ifndef xmlCopyCharMultiByte -extern __typeof (xmlCopyCharMultiByte) xmlCopyCharMultiByte__internal_alias __attribute((visibility("hidden"))); -#define xmlCopyCharMultiByte xmlCopyCharMultiByte__internal_alias -#endif -#endif - -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_tree -#undef xmlCopyDoc -extern __typeof (xmlCopyDoc) xmlCopyDoc __attribute((alias("xmlCopyDoc__internal_alias"))); -#else -#ifndef xmlCopyDoc -extern __typeof (xmlCopyDoc) xmlCopyDoc__internal_alias __attribute((visibility("hidden"))); -#define xmlCopyDoc xmlCopyDoc__internal_alias -#endif -#endif -#endif - -#ifdef bottom_valid -#undef xmlCopyDocElementContent -extern __typeof (xmlCopyDocElementContent) xmlCopyDocElementContent __attribute((alias("xmlCopyDocElementContent__internal_alias"))); -#else -#ifndef xmlCopyDocElementContent -extern __typeof (xmlCopyDocElementContent) xmlCopyDocElementContent__internal_alias __attribute((visibility("hidden"))); -#define xmlCopyDocElementContent xmlCopyDocElementContent__internal_alias -#endif -#endif - -#if defined(LIBXML_TREE_ENABLED) -#ifdef bottom_tree -#undef xmlCopyDtd -extern __typeof (xmlCopyDtd) xmlCopyDtd __attribute((alias("xmlCopyDtd__internal_alias"))); -#else -#ifndef xmlCopyDtd -extern __typeof (xmlCopyDtd) xmlCopyDtd__internal_alias __attribute((visibility("hidden"))); -#define xmlCopyDtd xmlCopyDtd__internal_alias -#endif -#endif -#endif - -#ifdef bottom_valid -#undef xmlCopyElementContent -extern __typeof (xmlCopyElementContent) xmlCopyElementContent __attribute((alias("xmlCopyElementContent__internal_alias"))); -#else -#ifndef xmlCopyElementContent -extern __typeof (xmlCopyElementContent) xmlCopyElementContent__internal_alias __attribute((visibility("hidden"))); -#define xmlCopyElementContent xmlCopyElementContent__internal_alias -#endif -#endif - -#if defined(LIBXML_TREE_ENABLED) -#ifdef bottom_valid -#undef xmlCopyElementTable -extern __typeof (xmlCopyElementTable) xmlCopyElementTable __attribute((alias("xmlCopyElementTable__internal_alias"))); -#else -#ifndef xmlCopyElementTable -extern __typeof (xmlCopyElementTable) xmlCopyElementTable__internal_alias __attribute((visibility("hidden"))); -#define xmlCopyElementTable xmlCopyElementTable__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_TREE_ENABLED) -#ifdef bottom_entities -#undef xmlCopyEntitiesTable -extern __typeof (xmlCopyEntitiesTable) xmlCopyEntitiesTable __attribute((alias("xmlCopyEntitiesTable__internal_alias"))); -#else -#ifndef xmlCopyEntitiesTable -extern __typeof (xmlCopyEntitiesTable) xmlCopyEntitiesTable__internal_alias __attribute((visibility("hidden"))); -#define xmlCopyEntitiesTable xmlCopyEntitiesTable__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_TREE_ENABLED) -#ifdef bottom_valid -#undef xmlCopyEnumeration -extern __typeof (xmlCopyEnumeration) xmlCopyEnumeration __attribute((alias("xmlCopyEnumeration__internal_alias"))); -#else -#ifndef xmlCopyEnumeration -extern __typeof (xmlCopyEnumeration) xmlCopyEnumeration__internal_alias __attribute((visibility("hidden"))); -#define xmlCopyEnumeration xmlCopyEnumeration__internal_alias -#endif -#endif -#endif - -#ifdef bottom_error -#undef xmlCopyError -extern __typeof (xmlCopyError) xmlCopyError __attribute((alias("xmlCopyError__internal_alias"))); -#else -#ifndef xmlCopyError -extern __typeof (xmlCopyError) xmlCopyError__internal_alias __attribute((visibility("hidden"))); -#define xmlCopyError xmlCopyError__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlCopyNamespace -extern __typeof (xmlCopyNamespace) xmlCopyNamespace __attribute((alias("xmlCopyNamespace__internal_alias"))); -#else -#ifndef xmlCopyNamespace -extern __typeof (xmlCopyNamespace) xmlCopyNamespace__internal_alias __attribute((visibility("hidden"))); -#define xmlCopyNamespace xmlCopyNamespace__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlCopyNamespaceList -extern __typeof (xmlCopyNamespaceList) xmlCopyNamespaceList __attribute((alias("xmlCopyNamespaceList__internal_alias"))); -#else -#ifndef xmlCopyNamespaceList -extern __typeof (xmlCopyNamespaceList) xmlCopyNamespaceList__internal_alias __attribute((visibility("hidden"))); -#define xmlCopyNamespaceList xmlCopyNamespaceList__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlCopyNode -extern __typeof (xmlCopyNode) xmlCopyNode __attribute((alias("xmlCopyNode__internal_alias"))); -#else -#ifndef xmlCopyNode -extern __typeof (xmlCopyNode) xmlCopyNode__internal_alias __attribute((visibility("hidden"))); -#define xmlCopyNode xmlCopyNode__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlCopyNodeList -extern __typeof (xmlCopyNodeList) xmlCopyNodeList __attribute((alias("xmlCopyNodeList__internal_alias"))); -#else -#ifndef xmlCopyNodeList -extern __typeof (xmlCopyNodeList) xmlCopyNodeList__internal_alias __attribute((visibility("hidden"))); -#define xmlCopyNodeList xmlCopyNodeList__internal_alias -#endif -#endif - -#if defined(LIBXML_TREE_ENABLED) -#ifdef bottom_valid -#undef xmlCopyNotationTable -extern __typeof (xmlCopyNotationTable) xmlCopyNotationTable __attribute((alias("xmlCopyNotationTable__internal_alias"))); -#else -#ifndef xmlCopyNotationTable -extern __typeof (xmlCopyNotationTable) xmlCopyNotationTable__internal_alias __attribute((visibility("hidden"))); -#define xmlCopyNotationTable xmlCopyNotationTable__internal_alias -#endif -#endif -#endif - -#ifdef bottom_tree -#undef xmlCopyProp -extern __typeof (xmlCopyProp) xmlCopyProp __attribute((alias("xmlCopyProp__internal_alias"))); -#else -#ifndef xmlCopyProp -extern __typeof (xmlCopyProp) xmlCopyProp__internal_alias __attribute((visibility("hidden"))); -#define xmlCopyProp xmlCopyProp__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlCopyPropList -extern __typeof (xmlCopyPropList) xmlCopyPropList __attribute((alias("xmlCopyPropList__internal_alias"))); -#else -#ifndef xmlCopyPropList -extern __typeof (xmlCopyPropList) xmlCopyPropList__internal_alias __attribute((visibility("hidden"))); -#define xmlCopyPropList xmlCopyPropList__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlCreateDocParserCtxt -extern __typeof (xmlCreateDocParserCtxt) xmlCreateDocParserCtxt __attribute((alias("xmlCreateDocParserCtxt__internal_alias"))); -#else -#ifndef xmlCreateDocParserCtxt -extern __typeof (xmlCreateDocParserCtxt) xmlCreateDocParserCtxt__internal_alias __attribute((visibility("hidden"))); -#define xmlCreateDocParserCtxt xmlCreateDocParserCtxt__internal_alias -#endif -#endif - -#ifdef bottom_entities -#undef xmlCreateEntitiesTable -extern __typeof (xmlCreateEntitiesTable) xmlCreateEntitiesTable __attribute((alias("xmlCreateEntitiesTable__internal_alias"))); -#else -#ifndef xmlCreateEntitiesTable -extern __typeof (xmlCreateEntitiesTable) xmlCreateEntitiesTable__internal_alias __attribute((visibility("hidden"))); -#define xmlCreateEntitiesTable xmlCreateEntitiesTable__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlCreateEntityParserCtxt -extern __typeof (xmlCreateEntityParserCtxt) xmlCreateEntityParserCtxt __attribute((alias("xmlCreateEntityParserCtxt__internal_alias"))); -#else -#ifndef xmlCreateEntityParserCtxt -extern __typeof (xmlCreateEntityParserCtxt) xmlCreateEntityParserCtxt__internal_alias __attribute((visibility("hidden"))); -#define xmlCreateEntityParserCtxt xmlCreateEntityParserCtxt__internal_alias -#endif -#endif - -#ifdef bottom_valid -#undef xmlCreateEnumeration -extern __typeof (xmlCreateEnumeration) xmlCreateEnumeration __attribute((alias("xmlCreateEnumeration__internal_alias"))); -#else -#ifndef xmlCreateEnumeration -extern __typeof (xmlCreateEnumeration) xmlCreateEnumeration__internal_alias __attribute((visibility("hidden"))); -#define xmlCreateEnumeration xmlCreateEnumeration__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlCreateFileParserCtxt -extern __typeof (xmlCreateFileParserCtxt) xmlCreateFileParserCtxt __attribute((alias("xmlCreateFileParserCtxt__internal_alias"))); -#else -#ifndef xmlCreateFileParserCtxt -extern __typeof (xmlCreateFileParserCtxt) xmlCreateFileParserCtxt__internal_alias __attribute((visibility("hidden"))); -#define xmlCreateFileParserCtxt xmlCreateFileParserCtxt__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlCreateIOParserCtxt -extern __typeof (xmlCreateIOParserCtxt) xmlCreateIOParserCtxt __attribute((alias("xmlCreateIOParserCtxt__internal_alias"))); -#else -#ifndef xmlCreateIOParserCtxt -extern __typeof (xmlCreateIOParserCtxt) xmlCreateIOParserCtxt__internal_alias __attribute((visibility("hidden"))); -#define xmlCreateIOParserCtxt xmlCreateIOParserCtxt__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlCreateIntSubset -extern __typeof (xmlCreateIntSubset) xmlCreateIntSubset __attribute((alias("xmlCreateIntSubset__internal_alias"))); -#else -#ifndef xmlCreateIntSubset -extern __typeof (xmlCreateIntSubset) xmlCreateIntSubset__internal_alias __attribute((visibility("hidden"))); -#define xmlCreateIntSubset xmlCreateIntSubset__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlCreateMemoryParserCtxt -extern __typeof (xmlCreateMemoryParserCtxt) xmlCreateMemoryParserCtxt __attribute((alias("xmlCreateMemoryParserCtxt__internal_alias"))); -#else -#ifndef xmlCreateMemoryParserCtxt -extern __typeof (xmlCreateMemoryParserCtxt) xmlCreateMemoryParserCtxt__internal_alias __attribute((visibility("hidden"))); -#define xmlCreateMemoryParserCtxt xmlCreateMemoryParserCtxt__internal_alias -#endif -#endif - -#if defined(LIBXML_PUSH_ENABLED) -#ifdef bottom_parser -#undef xmlCreatePushParserCtxt -extern __typeof (xmlCreatePushParserCtxt) xmlCreatePushParserCtxt __attribute((alias("xmlCreatePushParserCtxt__internal_alias"))); -#else -#ifndef xmlCreatePushParserCtxt -extern __typeof (xmlCreatePushParserCtxt) xmlCreatePushParserCtxt__internal_alias __attribute((visibility("hidden"))); -#define xmlCreatePushParserCtxt xmlCreatePushParserCtxt__internal_alias -#endif -#endif -#endif - -#ifdef bottom_uri -#undef xmlCreateURI -extern __typeof (xmlCreateURI) xmlCreateURI __attribute((alias("xmlCreateURI__internal_alias"))); -#else -#ifndef xmlCreateURI -extern __typeof (xmlCreateURI) xmlCreateURI__internal_alias __attribute((visibility("hidden"))); -#define xmlCreateURI xmlCreateURI__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlCreateURLParserCtxt -extern __typeof (xmlCreateURLParserCtxt) xmlCreateURLParserCtxt __attribute((alias("xmlCreateURLParserCtxt__internal_alias"))); -#else -#ifndef xmlCreateURLParserCtxt -extern __typeof (xmlCreateURLParserCtxt) xmlCreateURLParserCtxt__internal_alias __attribute((visibility("hidden"))); -#define xmlCreateURLParserCtxt xmlCreateURLParserCtxt__internal_alias -#endif -#endif - -#ifdef bottom_error -#undef xmlCtxtGetLastError -extern __typeof (xmlCtxtGetLastError) xmlCtxtGetLastError __attribute((alias("xmlCtxtGetLastError__internal_alias"))); -#else -#ifndef xmlCtxtGetLastError -extern __typeof (xmlCtxtGetLastError) xmlCtxtGetLastError__internal_alias __attribute((visibility("hidden"))); -#define xmlCtxtGetLastError xmlCtxtGetLastError__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlCtxtReadDoc -extern __typeof (xmlCtxtReadDoc) xmlCtxtReadDoc __attribute((alias("xmlCtxtReadDoc__internal_alias"))); -#else -#ifndef xmlCtxtReadDoc -extern __typeof (xmlCtxtReadDoc) xmlCtxtReadDoc__internal_alias __attribute((visibility("hidden"))); -#define xmlCtxtReadDoc xmlCtxtReadDoc__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlCtxtReadFd -extern __typeof (xmlCtxtReadFd) xmlCtxtReadFd __attribute((alias("xmlCtxtReadFd__internal_alias"))); -#else -#ifndef xmlCtxtReadFd -extern __typeof (xmlCtxtReadFd) xmlCtxtReadFd__internal_alias __attribute((visibility("hidden"))); -#define xmlCtxtReadFd xmlCtxtReadFd__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlCtxtReadFile -extern __typeof (xmlCtxtReadFile) xmlCtxtReadFile __attribute((alias("xmlCtxtReadFile__internal_alias"))); -#else -#ifndef xmlCtxtReadFile -extern __typeof (xmlCtxtReadFile) xmlCtxtReadFile__internal_alias __attribute((visibility("hidden"))); -#define xmlCtxtReadFile xmlCtxtReadFile__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlCtxtReadIO -extern __typeof (xmlCtxtReadIO) xmlCtxtReadIO __attribute((alias("xmlCtxtReadIO__internal_alias"))); -#else -#ifndef xmlCtxtReadIO -extern __typeof (xmlCtxtReadIO) xmlCtxtReadIO__internal_alias __attribute((visibility("hidden"))); -#define xmlCtxtReadIO xmlCtxtReadIO__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlCtxtReadMemory -extern __typeof (xmlCtxtReadMemory) xmlCtxtReadMemory __attribute((alias("xmlCtxtReadMemory__internal_alias"))); -#else -#ifndef xmlCtxtReadMemory -extern __typeof (xmlCtxtReadMemory) xmlCtxtReadMemory__internal_alias __attribute((visibility("hidden"))); -#define xmlCtxtReadMemory xmlCtxtReadMemory__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlCtxtReset -extern __typeof (xmlCtxtReset) xmlCtxtReset __attribute((alias("xmlCtxtReset__internal_alias"))); -#else -#ifndef xmlCtxtReset -extern __typeof (xmlCtxtReset) xmlCtxtReset__internal_alias __attribute((visibility("hidden"))); -#define xmlCtxtReset xmlCtxtReset__internal_alias -#endif -#endif - -#ifdef bottom_error -#undef xmlCtxtResetLastError -extern __typeof (xmlCtxtResetLastError) xmlCtxtResetLastError __attribute((alias("xmlCtxtResetLastError__internal_alias"))); -#else -#ifndef xmlCtxtResetLastError -extern __typeof (xmlCtxtResetLastError) xmlCtxtResetLastError__internal_alias __attribute((visibility("hidden"))); -#define xmlCtxtResetLastError xmlCtxtResetLastError__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlCtxtResetPush -extern __typeof (xmlCtxtResetPush) xmlCtxtResetPush __attribute((alias("xmlCtxtResetPush__internal_alias"))); -#else -#ifndef xmlCtxtResetPush -extern __typeof (xmlCtxtResetPush) xmlCtxtResetPush__internal_alias __attribute((visibility("hidden"))); -#define xmlCtxtResetPush xmlCtxtResetPush__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlCtxtUseOptions -extern __typeof (xmlCtxtUseOptions) xmlCtxtUseOptions __attribute((alias("xmlCtxtUseOptions__internal_alias"))); -#else -#ifndef xmlCtxtUseOptions -extern __typeof (xmlCtxtUseOptions) xmlCtxtUseOptions__internal_alias __attribute((visibility("hidden"))); -#define xmlCtxtUseOptions xmlCtxtUseOptions__internal_alias -#endif -#endif - -#ifdef bottom_parserInternals -#undef xmlCurrentChar -extern __typeof (xmlCurrentChar) xmlCurrentChar __attribute((alias("xmlCurrentChar__internal_alias"))); -#else -#ifndef xmlCurrentChar -extern __typeof (xmlCurrentChar) xmlCurrentChar__internal_alias __attribute((visibility("hidden"))); -#define xmlCurrentChar xmlCurrentChar__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlDOMWrapAdoptNode -extern __typeof (xmlDOMWrapAdoptNode) xmlDOMWrapAdoptNode __attribute((alias("xmlDOMWrapAdoptNode__internal_alias"))); -#else -#ifndef xmlDOMWrapAdoptNode -extern __typeof (xmlDOMWrapAdoptNode) xmlDOMWrapAdoptNode__internal_alias __attribute((visibility("hidden"))); -#define xmlDOMWrapAdoptNode xmlDOMWrapAdoptNode__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlDOMWrapCloneNode -extern __typeof (xmlDOMWrapCloneNode) xmlDOMWrapCloneNode __attribute((alias("xmlDOMWrapCloneNode__internal_alias"))); -#else -#ifndef xmlDOMWrapCloneNode -extern __typeof (xmlDOMWrapCloneNode) xmlDOMWrapCloneNode__internal_alias __attribute((visibility("hidden"))); -#define xmlDOMWrapCloneNode xmlDOMWrapCloneNode__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlDOMWrapFreeCtxt -extern __typeof (xmlDOMWrapFreeCtxt) xmlDOMWrapFreeCtxt __attribute((alias("xmlDOMWrapFreeCtxt__internal_alias"))); -#else -#ifndef xmlDOMWrapFreeCtxt -extern __typeof (xmlDOMWrapFreeCtxt) xmlDOMWrapFreeCtxt__internal_alias __attribute((visibility("hidden"))); -#define xmlDOMWrapFreeCtxt xmlDOMWrapFreeCtxt__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlDOMWrapNewCtxt -extern __typeof (xmlDOMWrapNewCtxt) xmlDOMWrapNewCtxt __attribute((alias("xmlDOMWrapNewCtxt__internal_alias"))); -#else -#ifndef xmlDOMWrapNewCtxt -extern __typeof (xmlDOMWrapNewCtxt) xmlDOMWrapNewCtxt__internal_alias __attribute((visibility("hidden"))); -#define xmlDOMWrapNewCtxt xmlDOMWrapNewCtxt__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlDOMWrapReconcileNamespaces -extern __typeof (xmlDOMWrapReconcileNamespaces) xmlDOMWrapReconcileNamespaces __attribute((alias("xmlDOMWrapReconcileNamespaces__internal_alias"))); -#else -#ifndef xmlDOMWrapReconcileNamespaces -extern __typeof (xmlDOMWrapReconcileNamespaces) xmlDOMWrapReconcileNamespaces__internal_alias __attribute((visibility("hidden"))); -#define xmlDOMWrapReconcileNamespaces xmlDOMWrapReconcileNamespaces__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlDOMWrapRemoveNode -extern __typeof (xmlDOMWrapRemoveNode) xmlDOMWrapRemoveNode __attribute((alias("xmlDOMWrapRemoveNode__internal_alias"))); -#else -#ifndef xmlDOMWrapRemoveNode -extern __typeof (xmlDOMWrapRemoveNode) xmlDOMWrapRemoveNode__internal_alias __attribute((visibility("hidden"))); -#define xmlDOMWrapRemoveNode xmlDOMWrapRemoveNode__internal_alias -#endif -#endif - -#if defined(LIBXML_DEBUG_ENABLED) -#ifdef bottom_debugXML -#undef xmlDebugCheckDocument -extern __typeof (xmlDebugCheckDocument) xmlDebugCheckDocument __attribute((alias("xmlDebugCheckDocument__internal_alias"))); -#else -#ifndef xmlDebugCheckDocument -extern __typeof (xmlDebugCheckDocument) xmlDebugCheckDocument__internal_alias __attribute((visibility("hidden"))); -#define xmlDebugCheckDocument xmlDebugCheckDocument__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_DEBUG_ENABLED) -#ifdef bottom_debugXML -#undef xmlDebugDumpAttr -extern __typeof (xmlDebugDumpAttr) xmlDebugDumpAttr __attribute((alias("xmlDebugDumpAttr__internal_alias"))); -#else -#ifndef xmlDebugDumpAttr -extern __typeof (xmlDebugDumpAttr) xmlDebugDumpAttr__internal_alias __attribute((visibility("hidden"))); -#define xmlDebugDumpAttr xmlDebugDumpAttr__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_DEBUG_ENABLED) -#ifdef bottom_debugXML -#undef xmlDebugDumpAttrList -extern __typeof (xmlDebugDumpAttrList) xmlDebugDumpAttrList __attribute((alias("xmlDebugDumpAttrList__internal_alias"))); -#else -#ifndef xmlDebugDumpAttrList -extern __typeof (xmlDebugDumpAttrList) xmlDebugDumpAttrList__internal_alias __attribute((visibility("hidden"))); -#define xmlDebugDumpAttrList xmlDebugDumpAttrList__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_DEBUG_ENABLED) -#ifdef bottom_debugXML -#undef xmlDebugDumpDTD -extern __typeof (xmlDebugDumpDTD) xmlDebugDumpDTD __attribute((alias("xmlDebugDumpDTD__internal_alias"))); -#else -#ifndef xmlDebugDumpDTD -extern __typeof (xmlDebugDumpDTD) xmlDebugDumpDTD__internal_alias __attribute((visibility("hidden"))); -#define xmlDebugDumpDTD xmlDebugDumpDTD__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_DEBUG_ENABLED) -#ifdef bottom_debugXML -#undef xmlDebugDumpDocument -extern __typeof (xmlDebugDumpDocument) xmlDebugDumpDocument __attribute((alias("xmlDebugDumpDocument__internal_alias"))); -#else -#ifndef xmlDebugDumpDocument -extern __typeof (xmlDebugDumpDocument) xmlDebugDumpDocument__internal_alias __attribute((visibility("hidden"))); -#define xmlDebugDumpDocument xmlDebugDumpDocument__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_DEBUG_ENABLED) -#ifdef bottom_debugXML -#undef xmlDebugDumpDocumentHead -extern __typeof (xmlDebugDumpDocumentHead) xmlDebugDumpDocumentHead __attribute((alias("xmlDebugDumpDocumentHead__internal_alias"))); -#else -#ifndef xmlDebugDumpDocumentHead -extern __typeof (xmlDebugDumpDocumentHead) xmlDebugDumpDocumentHead__internal_alias __attribute((visibility("hidden"))); -#define xmlDebugDumpDocumentHead xmlDebugDumpDocumentHead__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_DEBUG_ENABLED) -#ifdef bottom_debugXML -#undef xmlDebugDumpEntities -extern __typeof (xmlDebugDumpEntities) xmlDebugDumpEntities __attribute((alias("xmlDebugDumpEntities__internal_alias"))); -#else -#ifndef xmlDebugDumpEntities -extern __typeof (xmlDebugDumpEntities) xmlDebugDumpEntities__internal_alias __attribute((visibility("hidden"))); -#define xmlDebugDumpEntities xmlDebugDumpEntities__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_DEBUG_ENABLED) -#ifdef bottom_debugXML -#undef xmlDebugDumpNode -extern __typeof (xmlDebugDumpNode) xmlDebugDumpNode __attribute((alias("xmlDebugDumpNode__internal_alias"))); -#else -#ifndef xmlDebugDumpNode -extern __typeof (xmlDebugDumpNode) xmlDebugDumpNode__internal_alias __attribute((visibility("hidden"))); -#define xmlDebugDumpNode xmlDebugDumpNode__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_DEBUG_ENABLED) -#ifdef bottom_debugXML -#undef xmlDebugDumpNodeList -extern __typeof (xmlDebugDumpNodeList) xmlDebugDumpNodeList __attribute((alias("xmlDebugDumpNodeList__internal_alias"))); -#else -#ifndef xmlDebugDumpNodeList -extern __typeof (xmlDebugDumpNodeList) xmlDebugDumpNodeList__internal_alias __attribute((visibility("hidden"))); -#define xmlDebugDumpNodeList xmlDebugDumpNodeList__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_DEBUG_ENABLED) -#ifdef bottom_debugXML -#undef xmlDebugDumpOneNode -extern __typeof (xmlDebugDumpOneNode) xmlDebugDumpOneNode __attribute((alias("xmlDebugDumpOneNode__internal_alias"))); -#else -#ifndef xmlDebugDumpOneNode -extern __typeof (xmlDebugDumpOneNode) xmlDebugDumpOneNode__internal_alias __attribute((visibility("hidden"))); -#define xmlDebugDumpOneNode xmlDebugDumpOneNode__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_DEBUG_ENABLED) -#ifdef bottom_debugXML -#undef xmlDebugDumpString -extern __typeof (xmlDebugDumpString) xmlDebugDumpString __attribute((alias("xmlDebugDumpString__internal_alias"))); -#else -#ifndef xmlDebugDumpString -extern __typeof (xmlDebugDumpString) xmlDebugDumpString__internal_alias __attribute((visibility("hidden"))); -#define xmlDebugDumpString xmlDebugDumpString__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_LEGACY_ENABLED) -#ifdef bottom_legacy -#undef xmlDecodeEntities -extern __typeof (xmlDecodeEntities) xmlDecodeEntities __attribute((alias("xmlDecodeEntities__internal_alias"))); -#else -#ifndef xmlDecodeEntities -extern __typeof (xmlDecodeEntities) xmlDecodeEntities__internal_alias __attribute((visibility("hidden"))); -#define xmlDecodeEntities xmlDecodeEntities__internal_alias -#endif -#endif -#endif - -#ifdef bottom_SAX2 -#undef xmlDefaultSAXHandlerInit -extern __typeof (xmlDefaultSAXHandlerInit) xmlDefaultSAXHandlerInit __attribute((alias("xmlDefaultSAXHandlerInit__internal_alias"))); -#else -#ifndef xmlDefaultSAXHandlerInit -extern __typeof (xmlDefaultSAXHandlerInit) xmlDefaultSAXHandlerInit__internal_alias __attribute((visibility("hidden"))); -#define xmlDefaultSAXHandlerInit xmlDefaultSAXHandlerInit__internal_alias -#endif -#endif - -#ifdef bottom_encoding -#undef xmlDelEncodingAlias -extern __typeof (xmlDelEncodingAlias) xmlDelEncodingAlias __attribute((alias("xmlDelEncodingAlias__internal_alias"))); -#else -#ifndef xmlDelEncodingAlias -extern __typeof (xmlDelEncodingAlias) xmlDelEncodingAlias__internal_alias __attribute((visibility("hidden"))); -#define xmlDelEncodingAlias xmlDelEncodingAlias__internal_alias -#endif -#endif - -#ifdef bottom_globals -#undef xmlDeregisterNodeDefault -extern __typeof (xmlDeregisterNodeDefault) xmlDeregisterNodeDefault __attribute((alias("xmlDeregisterNodeDefault__internal_alias"))); -#else -#ifndef xmlDeregisterNodeDefault -extern __typeof (xmlDeregisterNodeDefault) xmlDeregisterNodeDefault__internal_alias __attribute((visibility("hidden"))); -#define xmlDeregisterNodeDefault xmlDeregisterNodeDefault__internal_alias -#endif -#endif - -#ifdef bottom_encoding -#undef xmlDetectCharEncoding -extern __typeof (xmlDetectCharEncoding) xmlDetectCharEncoding __attribute((alias("xmlDetectCharEncoding__internal_alias"))); -#else -#ifndef xmlDetectCharEncoding -extern __typeof (xmlDetectCharEncoding) xmlDetectCharEncoding__internal_alias __attribute((visibility("hidden"))); -#define xmlDetectCharEncoding xmlDetectCharEncoding__internal_alias -#endif -#endif - -#ifdef bottom_dict -#undef xmlDictCleanup -extern __typeof (xmlDictCleanup) xmlDictCleanup __attribute((alias("xmlDictCleanup__internal_alias"))); -#else -#ifndef xmlDictCleanup -extern __typeof (xmlDictCleanup) xmlDictCleanup__internal_alias __attribute((visibility("hidden"))); -#define xmlDictCleanup xmlDictCleanup__internal_alias -#endif -#endif - -#ifdef bottom_dict -#undef xmlDictCreate -extern __typeof (xmlDictCreate) xmlDictCreate __attribute((alias("xmlDictCreate__internal_alias"))); -#else -#ifndef xmlDictCreate -extern __typeof (xmlDictCreate) xmlDictCreate__internal_alias __attribute((visibility("hidden"))); -#define xmlDictCreate xmlDictCreate__internal_alias -#endif -#endif - -#ifdef bottom_dict -#undef xmlDictCreateSub -extern __typeof (xmlDictCreateSub) xmlDictCreateSub __attribute((alias("xmlDictCreateSub__internal_alias"))); -#else -#ifndef xmlDictCreateSub -extern __typeof (xmlDictCreateSub) xmlDictCreateSub__internal_alias __attribute((visibility("hidden"))); -#define xmlDictCreateSub xmlDictCreateSub__internal_alias -#endif -#endif - -#ifdef bottom_dict -#undef xmlDictExists -extern __typeof (xmlDictExists) xmlDictExists __attribute((alias("xmlDictExists__internal_alias"))); -#else -#ifndef xmlDictExists -extern __typeof (xmlDictExists) xmlDictExists__internal_alias __attribute((visibility("hidden"))); -#define xmlDictExists xmlDictExists__internal_alias -#endif -#endif - -#ifdef bottom_dict -#undef xmlDictFree -extern __typeof (xmlDictFree) xmlDictFree __attribute((alias("xmlDictFree__internal_alias"))); -#else -#ifndef xmlDictFree -extern __typeof (xmlDictFree) xmlDictFree__internal_alias __attribute((visibility("hidden"))); -#define xmlDictFree xmlDictFree__internal_alias -#endif -#endif - -#ifdef bottom_dict -#undef xmlDictGetUsage -extern __typeof (xmlDictGetUsage) xmlDictGetUsage __attribute((alias("xmlDictGetUsage__internal_alias"))); -#else -#ifndef xmlDictGetUsage -extern __typeof (xmlDictGetUsage) xmlDictGetUsage__internal_alias __attribute((visibility("hidden"))); -#define xmlDictGetUsage xmlDictGetUsage__internal_alias -#endif -#endif - -#ifdef bottom_dict -#undef xmlDictLookup -extern __typeof (xmlDictLookup) xmlDictLookup __attribute((alias("xmlDictLookup__internal_alias"))); -#else -#ifndef xmlDictLookup -extern __typeof (xmlDictLookup) xmlDictLookup__internal_alias __attribute((visibility("hidden"))); -#define xmlDictLookup xmlDictLookup__internal_alias -#endif -#endif - -#ifdef bottom_dict -#undef xmlDictOwns -extern __typeof (xmlDictOwns) xmlDictOwns __attribute((alias("xmlDictOwns__internal_alias"))); -#else -#ifndef xmlDictOwns -extern __typeof (xmlDictOwns) xmlDictOwns__internal_alias __attribute((visibility("hidden"))); -#define xmlDictOwns xmlDictOwns__internal_alias -#endif -#endif - -#ifdef bottom_dict -#undef xmlDictQLookup -extern __typeof (xmlDictQLookup) xmlDictQLookup __attribute((alias("xmlDictQLookup__internal_alias"))); -#else -#ifndef xmlDictQLookup -extern __typeof (xmlDictQLookup) xmlDictQLookup__internal_alias __attribute((visibility("hidden"))); -#define xmlDictQLookup xmlDictQLookup__internal_alias -#endif -#endif - -#ifdef bottom_dict -#undef xmlDictReference -extern __typeof (xmlDictReference) xmlDictReference __attribute((alias("xmlDictReference__internal_alias"))); -#else -#ifndef xmlDictReference -extern __typeof (xmlDictReference) xmlDictReference__internal_alias __attribute((visibility("hidden"))); -#define xmlDictReference xmlDictReference__internal_alias -#endif -#endif - -#ifdef bottom_dict -#undef xmlDictSetLimit -extern __typeof (xmlDictSetLimit) xmlDictSetLimit __attribute((alias("xmlDictSetLimit__internal_alias"))); -#else -#ifndef xmlDictSetLimit -extern __typeof (xmlDictSetLimit) xmlDictSetLimit__internal_alias __attribute((visibility("hidden"))); -#define xmlDictSetLimit xmlDictSetLimit__internal_alias -#endif -#endif - -#ifdef bottom_dict -#undef xmlDictSize -extern __typeof (xmlDictSize) xmlDictSize __attribute((alias("xmlDictSize__internal_alias"))); -#else -#ifndef xmlDictSize -extern __typeof (xmlDictSize) xmlDictSize__internal_alias __attribute((visibility("hidden"))); -#define xmlDictSize xmlDictSize__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlDocCopyNode -extern __typeof (xmlDocCopyNode) xmlDocCopyNode __attribute((alias("xmlDocCopyNode__internal_alias"))); -#else -#ifndef xmlDocCopyNode -extern __typeof (xmlDocCopyNode) xmlDocCopyNode__internal_alias __attribute((visibility("hidden"))); -#define xmlDocCopyNode xmlDocCopyNode__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlDocCopyNodeList -extern __typeof (xmlDocCopyNodeList) xmlDocCopyNodeList __attribute((alias("xmlDocCopyNodeList__internal_alias"))); -#else -#ifndef xmlDocCopyNodeList -extern __typeof (xmlDocCopyNodeList) xmlDocCopyNodeList__internal_alias __attribute((visibility("hidden"))); -#define xmlDocCopyNodeList xmlDocCopyNodeList__internal_alias -#endif -#endif - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_xmlsave -#undef xmlDocDump -extern __typeof (xmlDocDump) xmlDocDump __attribute((alias("xmlDocDump__internal_alias"))); -#else -#ifndef xmlDocDump -extern __typeof (xmlDocDump) xmlDocDump__internal_alias __attribute((visibility("hidden"))); -#define xmlDocDump xmlDocDump__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_xmlsave -#undef xmlDocDumpFormatMemory -extern __typeof (xmlDocDumpFormatMemory) xmlDocDumpFormatMemory __attribute((alias("xmlDocDumpFormatMemory__internal_alias"))); -#else -#ifndef xmlDocDumpFormatMemory -extern __typeof (xmlDocDumpFormatMemory) xmlDocDumpFormatMemory__internal_alias __attribute((visibility("hidden"))); -#define xmlDocDumpFormatMemory xmlDocDumpFormatMemory__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_xmlsave -#undef xmlDocDumpFormatMemoryEnc -extern __typeof (xmlDocDumpFormatMemoryEnc) xmlDocDumpFormatMemoryEnc __attribute((alias("xmlDocDumpFormatMemoryEnc__internal_alias"))); -#else -#ifndef xmlDocDumpFormatMemoryEnc -extern __typeof (xmlDocDumpFormatMemoryEnc) xmlDocDumpFormatMemoryEnc__internal_alias __attribute((visibility("hidden"))); -#define xmlDocDumpFormatMemoryEnc xmlDocDumpFormatMemoryEnc__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_xmlsave -#undef xmlDocDumpMemory -extern __typeof (xmlDocDumpMemory) xmlDocDumpMemory __attribute((alias("xmlDocDumpMemory__internal_alias"))); -#else -#ifndef xmlDocDumpMemory -extern __typeof (xmlDocDumpMemory) xmlDocDumpMemory__internal_alias __attribute((visibility("hidden"))); -#define xmlDocDumpMemory xmlDocDumpMemory__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_xmlsave -#undef xmlDocDumpMemoryEnc -extern __typeof (xmlDocDumpMemoryEnc) xmlDocDumpMemoryEnc __attribute((alias("xmlDocDumpMemoryEnc__internal_alias"))); -#else -#ifndef xmlDocDumpMemoryEnc -extern __typeof (xmlDocDumpMemoryEnc) xmlDocDumpMemoryEnc__internal_alias __attribute((visibility("hidden"))); -#define xmlDocDumpMemoryEnc xmlDocDumpMemoryEnc__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_xmlsave -#undef xmlDocFormatDump -extern __typeof (xmlDocFormatDump) xmlDocFormatDump __attribute((alias("xmlDocFormatDump__internal_alias"))); -#else -#ifndef xmlDocFormatDump -extern __typeof (xmlDocFormatDump) xmlDocFormatDump__internal_alias __attribute((visibility("hidden"))); -#define xmlDocFormatDump xmlDocFormatDump__internal_alias -#endif -#endif -#endif - -#ifdef bottom_tree -#undef xmlDocGetRootElement -extern __typeof (xmlDocGetRootElement) xmlDocGetRootElement __attribute((alias("xmlDocGetRootElement__internal_alias"))); -#else -#ifndef xmlDocGetRootElement -extern __typeof (xmlDocGetRootElement) xmlDocGetRootElement__internal_alias __attribute((visibility("hidden"))); -#define xmlDocGetRootElement xmlDocGetRootElement__internal_alias -#endif -#endif - -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_tree -#undef xmlDocSetRootElement -extern __typeof (xmlDocSetRootElement) xmlDocSetRootElement __attribute((alias("xmlDocSetRootElement__internal_alias"))); -#else -#ifndef xmlDocSetRootElement -extern __typeof (xmlDocSetRootElement) xmlDocSetRootElement__internal_alias __attribute((visibility("hidden"))); -#define xmlDocSetRootElement xmlDocSetRootElement__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_valid -#undef xmlDumpAttributeDecl -extern __typeof (xmlDumpAttributeDecl) xmlDumpAttributeDecl __attribute((alias("xmlDumpAttributeDecl__internal_alias"))); -#else -#ifndef xmlDumpAttributeDecl -extern __typeof (xmlDumpAttributeDecl) xmlDumpAttributeDecl__internal_alias __attribute((visibility("hidden"))); -#define xmlDumpAttributeDecl xmlDumpAttributeDecl__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_valid -#undef xmlDumpAttributeTable -extern __typeof (xmlDumpAttributeTable) xmlDumpAttributeTable __attribute((alias("xmlDumpAttributeTable__internal_alias"))); -#else -#ifndef xmlDumpAttributeTable -extern __typeof (xmlDumpAttributeTable) xmlDumpAttributeTable__internal_alias __attribute((visibility("hidden"))); -#define xmlDumpAttributeTable xmlDumpAttributeTable__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_valid -#undef xmlDumpElementDecl -extern __typeof (xmlDumpElementDecl) xmlDumpElementDecl __attribute((alias("xmlDumpElementDecl__internal_alias"))); -#else -#ifndef xmlDumpElementDecl -extern __typeof (xmlDumpElementDecl) xmlDumpElementDecl__internal_alias __attribute((visibility("hidden"))); -#define xmlDumpElementDecl xmlDumpElementDecl__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_valid -#undef xmlDumpElementTable -extern __typeof (xmlDumpElementTable) xmlDumpElementTable __attribute((alias("xmlDumpElementTable__internal_alias"))); -#else -#ifndef xmlDumpElementTable -extern __typeof (xmlDumpElementTable) xmlDumpElementTable__internal_alias __attribute((visibility("hidden"))); -#define xmlDumpElementTable xmlDumpElementTable__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_entities -#undef xmlDumpEntitiesTable -extern __typeof (xmlDumpEntitiesTable) xmlDumpEntitiesTable __attribute((alias("xmlDumpEntitiesTable__internal_alias"))); -#else -#ifndef xmlDumpEntitiesTable -extern __typeof (xmlDumpEntitiesTable) xmlDumpEntitiesTable__internal_alias __attribute((visibility("hidden"))); -#define xmlDumpEntitiesTable xmlDumpEntitiesTable__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_entities -#undef xmlDumpEntityDecl -extern __typeof (xmlDumpEntityDecl) xmlDumpEntityDecl __attribute((alias("xmlDumpEntityDecl__internal_alias"))); -#else -#ifndef xmlDumpEntityDecl -extern __typeof (xmlDumpEntityDecl) xmlDumpEntityDecl__internal_alias __attribute((visibility("hidden"))); -#define xmlDumpEntityDecl xmlDumpEntityDecl__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_valid -#undef xmlDumpNotationDecl -extern __typeof (xmlDumpNotationDecl) xmlDumpNotationDecl __attribute((alias("xmlDumpNotationDecl__internal_alias"))); -#else -#ifndef xmlDumpNotationDecl -extern __typeof (xmlDumpNotationDecl) xmlDumpNotationDecl__internal_alias __attribute((visibility("hidden"))); -#define xmlDumpNotationDecl xmlDumpNotationDecl__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_valid -#undef xmlDumpNotationTable -extern __typeof (xmlDumpNotationTable) xmlDumpNotationTable __attribute((alias("xmlDumpNotationTable__internal_alias"))); -#else -#ifndef xmlDumpNotationTable -extern __typeof (xmlDumpNotationTable) xmlDumpNotationTable__internal_alias __attribute((visibility("hidden"))); -#define xmlDumpNotationTable xmlDumpNotationTable__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_xmlsave -#undef xmlElemDump -extern __typeof (xmlElemDump) xmlElemDump __attribute((alias("xmlElemDump__internal_alias"))); -#else -#ifndef xmlElemDump -extern __typeof (xmlElemDump) xmlElemDump__internal_alias __attribute((visibility("hidden"))); -#define xmlElemDump xmlElemDump__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_LEGACY_ENABLED) -#ifdef bottom_legacy -#undef xmlEncodeEntities -extern __typeof (xmlEncodeEntities) xmlEncodeEntities __attribute((alias("xmlEncodeEntities__internal_alias"))); -#else -#ifndef xmlEncodeEntities -extern __typeof (xmlEncodeEntities) xmlEncodeEntities__internal_alias __attribute((visibility("hidden"))); -#define xmlEncodeEntities xmlEncodeEntities__internal_alias -#endif -#endif -#endif - -#ifdef bottom_entities -#undef xmlEncodeEntitiesReentrant -extern __typeof (xmlEncodeEntitiesReentrant) xmlEncodeEntitiesReentrant __attribute((alias("xmlEncodeEntitiesReentrant__internal_alias"))); -#else -#ifndef xmlEncodeEntitiesReentrant -extern __typeof (xmlEncodeEntitiesReentrant) xmlEncodeEntitiesReentrant__internal_alias __attribute((visibility("hidden"))); -#define xmlEncodeEntitiesReentrant xmlEncodeEntitiesReentrant__internal_alias -#endif -#endif - -#ifdef bottom_entities -#undef xmlEncodeSpecialChars -extern __typeof (xmlEncodeSpecialChars) xmlEncodeSpecialChars __attribute((alias("xmlEncodeSpecialChars__internal_alias"))); -#else -#ifndef xmlEncodeSpecialChars -extern __typeof (xmlEncodeSpecialChars) xmlEncodeSpecialChars__internal_alias __attribute((visibility("hidden"))); -#define xmlEncodeSpecialChars xmlEncodeSpecialChars__internal_alias -#endif -#endif - -#ifdef bottom_parserInternals -#undef xmlErrMemory -extern __typeof (xmlErrMemory) xmlErrMemory __attribute((alias("xmlErrMemory__internal_alias"))); -#else -#ifndef xmlErrMemory -extern __typeof (xmlErrMemory) xmlErrMemory__internal_alias __attribute((visibility("hidden"))); -#define xmlErrMemory xmlErrMemory__internal_alias -#endif -#endif - -#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED) -#ifdef bottom_xmlregexp -#undef xmlExpCtxtNbCons -extern __typeof (xmlExpCtxtNbCons) xmlExpCtxtNbCons __attribute((alias("xmlExpCtxtNbCons__internal_alias"))); -#else -#ifndef xmlExpCtxtNbCons -extern __typeof (xmlExpCtxtNbCons) xmlExpCtxtNbCons__internal_alias __attribute((visibility("hidden"))); -#define xmlExpCtxtNbCons xmlExpCtxtNbCons__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED) -#ifdef bottom_xmlregexp -#undef xmlExpCtxtNbNodes -extern __typeof (xmlExpCtxtNbNodes) xmlExpCtxtNbNodes __attribute((alias("xmlExpCtxtNbNodes__internal_alias"))); -#else -#ifndef xmlExpCtxtNbNodes -extern __typeof (xmlExpCtxtNbNodes) xmlExpCtxtNbNodes__internal_alias __attribute((visibility("hidden"))); -#define xmlExpCtxtNbNodes xmlExpCtxtNbNodes__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED) -#ifdef bottom_xmlregexp -#undef xmlExpDump -extern __typeof (xmlExpDump) xmlExpDump __attribute((alias("xmlExpDump__internal_alias"))); -#else -#ifndef xmlExpDump -extern __typeof (xmlExpDump) xmlExpDump__internal_alias __attribute((visibility("hidden"))); -#define xmlExpDump xmlExpDump__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED) -#ifdef bottom_xmlregexp -#undef xmlExpExpDerive -extern __typeof (xmlExpExpDerive) xmlExpExpDerive __attribute((alias("xmlExpExpDerive__internal_alias"))); -#else -#ifndef xmlExpExpDerive -extern __typeof (xmlExpExpDerive) xmlExpExpDerive__internal_alias __attribute((visibility("hidden"))); -#define xmlExpExpDerive xmlExpExpDerive__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED) -#ifdef bottom_xmlregexp -#undef xmlExpFree -extern __typeof (xmlExpFree) xmlExpFree __attribute((alias("xmlExpFree__internal_alias"))); -#else -#ifndef xmlExpFree -extern __typeof (xmlExpFree) xmlExpFree__internal_alias __attribute((visibility("hidden"))); -#define xmlExpFree xmlExpFree__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED) -#ifdef bottom_xmlregexp -#undef xmlExpFreeCtxt -extern __typeof (xmlExpFreeCtxt) xmlExpFreeCtxt __attribute((alias("xmlExpFreeCtxt__internal_alias"))); -#else -#ifndef xmlExpFreeCtxt -extern __typeof (xmlExpFreeCtxt) xmlExpFreeCtxt__internal_alias __attribute((visibility("hidden"))); -#define xmlExpFreeCtxt xmlExpFreeCtxt__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED) -#ifdef bottom_xmlregexp -#undef xmlExpGetLanguage -extern __typeof (xmlExpGetLanguage) xmlExpGetLanguage __attribute((alias("xmlExpGetLanguage__internal_alias"))); -#else -#ifndef xmlExpGetLanguage -extern __typeof (xmlExpGetLanguage) xmlExpGetLanguage__internal_alias __attribute((visibility("hidden"))); -#define xmlExpGetLanguage xmlExpGetLanguage__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED) -#ifdef bottom_xmlregexp -#undef xmlExpGetStart -extern __typeof (xmlExpGetStart) xmlExpGetStart __attribute((alias("xmlExpGetStart__internal_alias"))); -#else -#ifndef xmlExpGetStart -extern __typeof (xmlExpGetStart) xmlExpGetStart__internal_alias __attribute((visibility("hidden"))); -#define xmlExpGetStart xmlExpGetStart__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED) -#ifdef bottom_xmlregexp -#undef xmlExpIsNillable -extern __typeof (xmlExpIsNillable) xmlExpIsNillable __attribute((alias("xmlExpIsNillable__internal_alias"))); -#else -#ifndef xmlExpIsNillable -extern __typeof (xmlExpIsNillable) xmlExpIsNillable__internal_alias __attribute((visibility("hidden"))); -#define xmlExpIsNillable xmlExpIsNillable__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED) -#ifdef bottom_xmlregexp -#undef xmlExpMaxToken -extern __typeof (xmlExpMaxToken) xmlExpMaxToken __attribute((alias("xmlExpMaxToken__internal_alias"))); -#else -#ifndef xmlExpMaxToken -extern __typeof (xmlExpMaxToken) xmlExpMaxToken__internal_alias __attribute((visibility("hidden"))); -#define xmlExpMaxToken xmlExpMaxToken__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED) -#ifdef bottom_xmlregexp -#undef xmlExpNewAtom -extern __typeof (xmlExpNewAtom) xmlExpNewAtom __attribute((alias("xmlExpNewAtom__internal_alias"))); -#else -#ifndef xmlExpNewAtom -extern __typeof (xmlExpNewAtom) xmlExpNewAtom__internal_alias __attribute((visibility("hidden"))); -#define xmlExpNewAtom xmlExpNewAtom__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED) -#ifdef bottom_xmlregexp -#undef xmlExpNewCtxt -extern __typeof (xmlExpNewCtxt) xmlExpNewCtxt __attribute((alias("xmlExpNewCtxt__internal_alias"))); -#else -#ifndef xmlExpNewCtxt -extern __typeof (xmlExpNewCtxt) xmlExpNewCtxt__internal_alias __attribute((visibility("hidden"))); -#define xmlExpNewCtxt xmlExpNewCtxt__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED) -#ifdef bottom_xmlregexp -#undef xmlExpNewOr -extern __typeof (xmlExpNewOr) xmlExpNewOr __attribute((alias("xmlExpNewOr__internal_alias"))); -#else -#ifndef xmlExpNewOr -extern __typeof (xmlExpNewOr) xmlExpNewOr__internal_alias __attribute((visibility("hidden"))); -#define xmlExpNewOr xmlExpNewOr__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED) -#ifdef bottom_xmlregexp -#undef xmlExpNewRange -extern __typeof (xmlExpNewRange) xmlExpNewRange __attribute((alias("xmlExpNewRange__internal_alias"))); -#else -#ifndef xmlExpNewRange -extern __typeof (xmlExpNewRange) xmlExpNewRange__internal_alias __attribute((visibility("hidden"))); -#define xmlExpNewRange xmlExpNewRange__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED) -#ifdef bottom_xmlregexp -#undef xmlExpNewSeq -extern __typeof (xmlExpNewSeq) xmlExpNewSeq __attribute((alias("xmlExpNewSeq__internal_alias"))); -#else -#ifndef xmlExpNewSeq -extern __typeof (xmlExpNewSeq) xmlExpNewSeq__internal_alias __attribute((visibility("hidden"))); -#define xmlExpNewSeq xmlExpNewSeq__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED) -#ifdef bottom_xmlregexp -#undef xmlExpParse -extern __typeof (xmlExpParse) xmlExpParse __attribute((alias("xmlExpParse__internal_alias"))); -#else -#ifndef xmlExpParse -extern __typeof (xmlExpParse) xmlExpParse__internal_alias __attribute((visibility("hidden"))); -#define xmlExpParse xmlExpParse__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED) -#ifdef bottom_xmlregexp -#undef xmlExpRef -extern __typeof (xmlExpRef) xmlExpRef __attribute((alias("xmlExpRef__internal_alias"))); -#else -#ifndef xmlExpRef -extern __typeof (xmlExpRef) xmlExpRef__internal_alias __attribute((visibility("hidden"))); -#define xmlExpRef xmlExpRef__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED) -#ifdef bottom_xmlregexp -#undef xmlExpStringDerive -extern __typeof (xmlExpStringDerive) xmlExpStringDerive __attribute((alias("xmlExpStringDerive__internal_alias"))); -#else -#ifndef xmlExpStringDerive -extern __typeof (xmlExpStringDerive) xmlExpStringDerive__internal_alias __attribute((visibility("hidden"))); -#define xmlExpStringDerive xmlExpStringDerive__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED) -#ifdef bottom_xmlregexp -#undef xmlExpSubsume -extern __typeof (xmlExpSubsume) xmlExpSubsume __attribute((alias("xmlExpSubsume__internal_alias"))); -#else -#ifndef xmlExpSubsume -extern __typeof (xmlExpSubsume) xmlExpSubsume__internal_alias __attribute((visibility("hidden"))); -#define xmlExpSubsume xmlExpSubsume__internal_alias -#endif -#endif -#endif - -#ifdef bottom_xmlIO -#undef xmlFileClose -extern __typeof (xmlFileClose) xmlFileClose __attribute((alias("xmlFileClose__internal_alias"))); -#else -#ifndef xmlFileClose -extern __typeof (xmlFileClose) xmlFileClose__internal_alias __attribute((visibility("hidden"))); -#define xmlFileClose xmlFileClose__internal_alias -#endif -#endif - -#ifdef bottom_xmlIO -#undef xmlFileMatch -extern __typeof (xmlFileMatch) xmlFileMatch __attribute((alias("xmlFileMatch__internal_alias"))); -#else -#ifndef xmlFileMatch -extern __typeof (xmlFileMatch) xmlFileMatch__internal_alias __attribute((visibility("hidden"))); -#define xmlFileMatch xmlFileMatch__internal_alias -#endif -#endif - -#ifdef bottom_xmlIO -#undef xmlFileOpen -extern __typeof (xmlFileOpen) xmlFileOpen __attribute((alias("xmlFileOpen__internal_alias"))); -#else -#ifndef xmlFileOpen -extern __typeof (xmlFileOpen) xmlFileOpen__internal_alias __attribute((visibility("hidden"))); -#define xmlFileOpen xmlFileOpen__internal_alias -#endif -#endif - -#ifdef bottom_xmlIO -#undef xmlFileRead -extern __typeof (xmlFileRead) xmlFileRead __attribute((alias("xmlFileRead__internal_alias"))); -#else -#ifndef xmlFileRead -extern __typeof (xmlFileRead) xmlFileRead__internal_alias __attribute((visibility("hidden"))); -#define xmlFileRead xmlFileRead__internal_alias -#endif -#endif - -#ifdef bottom_encoding -#undef xmlFindCharEncodingHandler -extern __typeof (xmlFindCharEncodingHandler) xmlFindCharEncodingHandler __attribute((alias("xmlFindCharEncodingHandler__internal_alias"))); -#else -#ifndef xmlFindCharEncodingHandler -extern __typeof (xmlFindCharEncodingHandler) xmlFindCharEncodingHandler__internal_alias __attribute((visibility("hidden"))); -#define xmlFindCharEncodingHandler xmlFindCharEncodingHandler__internal_alias -#endif -#endif - -#if defined(LIBXML_TREE_ENABLED) -#ifdef bottom_tree -#undef xmlFirstElementChild -extern __typeof (xmlFirstElementChild) xmlFirstElementChild __attribute((alias("xmlFirstElementChild__internal_alias"))); -#else -#ifndef xmlFirstElementChild -extern __typeof (xmlFirstElementChild) xmlFirstElementChild__internal_alias __attribute((visibility("hidden"))); -#define xmlFirstElementChild xmlFirstElementChild__internal_alias -#endif -#endif -#endif - -#ifdef bottom_valid -#undef xmlFreeAttributeTable -extern __typeof (xmlFreeAttributeTable) xmlFreeAttributeTable __attribute((alias("xmlFreeAttributeTable__internal_alias"))); -#else -#ifndef xmlFreeAttributeTable -extern __typeof (xmlFreeAttributeTable) xmlFreeAttributeTable__internal_alias __attribute((visibility("hidden"))); -#define xmlFreeAttributeTable xmlFreeAttributeTable__internal_alias -#endif -#endif - -#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED) -#ifdef bottom_xmlregexp -#undef xmlFreeAutomata -extern __typeof (xmlFreeAutomata) xmlFreeAutomata __attribute((alias("xmlFreeAutomata__internal_alias"))); -#else -#ifndef xmlFreeAutomata -extern __typeof (xmlFreeAutomata) xmlFreeAutomata__internal_alias __attribute((visibility("hidden"))); -#define xmlFreeAutomata xmlFreeAutomata__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_CATALOG_ENABLED) -#ifdef bottom_catalog -#undef xmlFreeCatalog -extern __typeof (xmlFreeCatalog) xmlFreeCatalog __attribute((alias("xmlFreeCatalog__internal_alias"))); -#else -#ifndef xmlFreeCatalog -extern __typeof (xmlFreeCatalog) xmlFreeCatalog__internal_alias __attribute((visibility("hidden"))); -#define xmlFreeCatalog xmlFreeCatalog__internal_alias -#endif -#endif -#endif - -#ifdef bottom_tree -#undef xmlFreeDoc -extern __typeof (xmlFreeDoc) xmlFreeDoc __attribute((alias("xmlFreeDoc__internal_alias"))); -#else -#ifndef xmlFreeDoc -extern __typeof (xmlFreeDoc) xmlFreeDoc__internal_alias __attribute((visibility("hidden"))); -#define xmlFreeDoc xmlFreeDoc__internal_alias -#endif -#endif - -#ifdef bottom_valid -#undef xmlFreeDocElementContent -extern __typeof (xmlFreeDocElementContent) xmlFreeDocElementContent __attribute((alias("xmlFreeDocElementContent__internal_alias"))); -#else -#ifndef xmlFreeDocElementContent -extern __typeof (xmlFreeDocElementContent) xmlFreeDocElementContent__internal_alias __attribute((visibility("hidden"))); -#define xmlFreeDocElementContent xmlFreeDocElementContent__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlFreeDtd -extern __typeof (xmlFreeDtd) xmlFreeDtd __attribute((alias("xmlFreeDtd__internal_alias"))); -#else -#ifndef xmlFreeDtd -extern __typeof (xmlFreeDtd) xmlFreeDtd__internal_alias __attribute((visibility("hidden"))); -#define xmlFreeDtd xmlFreeDtd__internal_alias -#endif -#endif - -#ifdef bottom_valid -#undef xmlFreeElementContent -extern __typeof (xmlFreeElementContent) xmlFreeElementContent __attribute((alias("xmlFreeElementContent__internal_alias"))); -#else -#ifndef xmlFreeElementContent -extern __typeof (xmlFreeElementContent) xmlFreeElementContent__internal_alias __attribute((visibility("hidden"))); -#define xmlFreeElementContent xmlFreeElementContent__internal_alias -#endif -#endif - -#ifdef bottom_valid -#undef xmlFreeElementTable -extern __typeof (xmlFreeElementTable) xmlFreeElementTable __attribute((alias("xmlFreeElementTable__internal_alias"))); -#else -#ifndef xmlFreeElementTable -extern __typeof (xmlFreeElementTable) xmlFreeElementTable__internal_alias __attribute((visibility("hidden"))); -#define xmlFreeElementTable xmlFreeElementTable__internal_alias -#endif -#endif - -#ifdef bottom_entities -#undef xmlFreeEntitiesTable -extern __typeof (xmlFreeEntitiesTable) xmlFreeEntitiesTable __attribute((alias("xmlFreeEntitiesTable__internal_alias"))); -#else -#ifndef xmlFreeEntitiesTable -extern __typeof (xmlFreeEntitiesTable) xmlFreeEntitiesTable__internal_alias __attribute((visibility("hidden"))); -#define xmlFreeEntitiesTable xmlFreeEntitiesTable__internal_alias -#endif -#endif - -#ifdef bottom_valid -#undef xmlFreeEnumeration -extern __typeof (xmlFreeEnumeration) xmlFreeEnumeration __attribute((alias("xmlFreeEnumeration__internal_alias"))); -#else -#ifndef xmlFreeEnumeration -extern __typeof (xmlFreeEnumeration) xmlFreeEnumeration__internal_alias __attribute((visibility("hidden"))); -#define xmlFreeEnumeration xmlFreeEnumeration__internal_alias -#endif -#endif - -#ifdef bottom_valid -#undef xmlFreeIDTable -extern __typeof (xmlFreeIDTable) xmlFreeIDTable __attribute((alias("xmlFreeIDTable__internal_alias"))); -#else -#ifndef xmlFreeIDTable -extern __typeof (xmlFreeIDTable) xmlFreeIDTable__internal_alias __attribute((visibility("hidden"))); -#define xmlFreeIDTable xmlFreeIDTable__internal_alias -#endif -#endif - -#ifdef bottom_parserInternals -#undef xmlFreeInputStream -extern __typeof (xmlFreeInputStream) xmlFreeInputStream __attribute((alias("xmlFreeInputStream__internal_alias"))); -#else -#ifndef xmlFreeInputStream -extern __typeof (xmlFreeInputStream) xmlFreeInputStream__internal_alias __attribute((visibility("hidden"))); -#define xmlFreeInputStream xmlFreeInputStream__internal_alias -#endif -#endif - -#ifdef bottom_threads -#undef xmlFreeMutex -extern __typeof (xmlFreeMutex) xmlFreeMutex __attribute((alias("xmlFreeMutex__internal_alias"))); -#else -#ifndef xmlFreeMutex -extern __typeof (xmlFreeMutex) xmlFreeMutex__internal_alias __attribute((visibility("hidden"))); -#define xmlFreeMutex xmlFreeMutex__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlFreeNode -extern __typeof (xmlFreeNode) xmlFreeNode __attribute((alias("xmlFreeNode__internal_alias"))); -#else -#ifndef xmlFreeNode -extern __typeof (xmlFreeNode) xmlFreeNode__internal_alias __attribute((visibility("hidden"))); -#define xmlFreeNode xmlFreeNode__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlFreeNodeList -extern __typeof (xmlFreeNodeList) xmlFreeNodeList __attribute((alias("xmlFreeNodeList__internal_alias"))); -#else -#ifndef xmlFreeNodeList -extern __typeof (xmlFreeNodeList) xmlFreeNodeList__internal_alias __attribute((visibility("hidden"))); -#define xmlFreeNodeList xmlFreeNodeList__internal_alias -#endif -#endif - -#ifdef bottom_valid -#undef xmlFreeNotationTable -extern __typeof (xmlFreeNotationTable) xmlFreeNotationTable __attribute((alias("xmlFreeNotationTable__internal_alias"))); -#else -#ifndef xmlFreeNotationTable -extern __typeof (xmlFreeNotationTable) xmlFreeNotationTable__internal_alias __attribute((visibility("hidden"))); -#define xmlFreeNotationTable xmlFreeNotationTable__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlFreeNs -extern __typeof (xmlFreeNs) xmlFreeNs __attribute((alias("xmlFreeNs__internal_alias"))); -#else -#ifndef xmlFreeNs -extern __typeof (xmlFreeNs) xmlFreeNs__internal_alias __attribute((visibility("hidden"))); -#define xmlFreeNs xmlFreeNs__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlFreeNsList -extern __typeof (xmlFreeNsList) xmlFreeNsList __attribute((alias("xmlFreeNsList__internal_alias"))); -#else -#ifndef xmlFreeNsList -extern __typeof (xmlFreeNsList) xmlFreeNsList__internal_alias __attribute((visibility("hidden"))); -#define xmlFreeNsList xmlFreeNsList__internal_alias -#endif -#endif - -#ifdef bottom_parserInternals -#undef xmlFreeParserCtxt -extern __typeof (xmlFreeParserCtxt) xmlFreeParserCtxt __attribute((alias("xmlFreeParserCtxt__internal_alias"))); -#else -#ifndef xmlFreeParserCtxt -extern __typeof (xmlFreeParserCtxt) xmlFreeParserCtxt__internal_alias __attribute((visibility("hidden"))); -#define xmlFreeParserCtxt xmlFreeParserCtxt__internal_alias -#endif -#endif - -#ifdef bottom_xmlIO -#undef xmlFreeParserInputBuffer -extern __typeof (xmlFreeParserInputBuffer) xmlFreeParserInputBuffer __attribute((alias("xmlFreeParserInputBuffer__internal_alias"))); -#else -#ifndef xmlFreeParserInputBuffer -extern __typeof (xmlFreeParserInputBuffer) xmlFreeParserInputBuffer__internal_alias __attribute((visibility("hidden"))); -#define xmlFreeParserInputBuffer xmlFreeParserInputBuffer__internal_alias -#endif -#endif - -#if defined(LIBXML_PATTERN_ENABLED) -#ifdef bottom_pattern -#undef xmlFreePattern -extern __typeof (xmlFreePattern) xmlFreePattern __attribute((alias("xmlFreePattern__internal_alias"))); -#else -#ifndef xmlFreePattern -extern __typeof (xmlFreePattern) xmlFreePattern__internal_alias __attribute((visibility("hidden"))); -#define xmlFreePattern xmlFreePattern__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_PATTERN_ENABLED) -#ifdef bottom_pattern -#undef xmlFreePatternList -extern __typeof (xmlFreePatternList) xmlFreePatternList __attribute((alias("xmlFreePatternList__internal_alias"))); -#else -#ifndef xmlFreePatternList -extern __typeof (xmlFreePatternList) xmlFreePatternList__internal_alias __attribute((visibility("hidden"))); -#define xmlFreePatternList xmlFreePatternList__internal_alias -#endif -#endif -#endif - -#ifdef bottom_tree -#undef xmlFreeProp -extern __typeof (xmlFreeProp) xmlFreeProp __attribute((alias("xmlFreeProp__internal_alias"))); -#else -#ifndef xmlFreeProp -extern __typeof (xmlFreeProp) xmlFreeProp__internal_alias __attribute((visibility("hidden"))); -#define xmlFreeProp xmlFreeProp__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlFreePropList -extern __typeof (xmlFreePropList) xmlFreePropList __attribute((alias("xmlFreePropList__internal_alias"))); -#else -#ifndef xmlFreePropList -extern __typeof (xmlFreePropList) xmlFreePropList__internal_alias __attribute((visibility("hidden"))); -#define xmlFreePropList xmlFreePropList__internal_alias -#endif -#endif - -#ifdef bottom_threads -#undef xmlFreeRMutex -extern __typeof (xmlFreeRMutex) xmlFreeRMutex __attribute((alias("xmlFreeRMutex__internal_alias"))); -#else -#ifndef xmlFreeRMutex -extern __typeof (xmlFreeRMutex) xmlFreeRMutex__internal_alias __attribute((visibility("hidden"))); -#define xmlFreeRMutex xmlFreeRMutex__internal_alias -#endif -#endif - -#ifdef bottom_valid -#undef xmlFreeRefTable -extern __typeof (xmlFreeRefTable) xmlFreeRefTable __attribute((alias("xmlFreeRefTable__internal_alias"))); -#else -#ifndef xmlFreeRefTable -extern __typeof (xmlFreeRefTable) xmlFreeRefTable__internal_alias __attribute((visibility("hidden"))); -#define xmlFreeRefTable xmlFreeRefTable__internal_alias -#endif -#endif - -#if defined(LIBXML_PATTERN_ENABLED) -#ifdef bottom_pattern -#undef xmlFreeStreamCtxt -extern __typeof (xmlFreeStreamCtxt) xmlFreeStreamCtxt __attribute((alias("xmlFreeStreamCtxt__internal_alias"))); -#else -#ifndef xmlFreeStreamCtxt -extern __typeof (xmlFreeStreamCtxt) xmlFreeStreamCtxt__internal_alias __attribute((visibility("hidden"))); -#define xmlFreeStreamCtxt xmlFreeStreamCtxt__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlFreeTextReader -extern __typeof (xmlFreeTextReader) xmlFreeTextReader __attribute((alias("xmlFreeTextReader__internal_alias"))); -#else -#ifndef xmlFreeTextReader -extern __typeof (xmlFreeTextReader) xmlFreeTextReader__internal_alias __attribute((visibility("hidden"))); -#define xmlFreeTextReader xmlFreeTextReader__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlFreeTextWriter -extern __typeof (xmlFreeTextWriter) xmlFreeTextWriter __attribute((alias("xmlFreeTextWriter__internal_alias"))); -#else -#ifndef xmlFreeTextWriter -extern __typeof (xmlFreeTextWriter) xmlFreeTextWriter__internal_alias __attribute((visibility("hidden"))); -#define xmlFreeTextWriter xmlFreeTextWriter__internal_alias -#endif -#endif -#endif - -#ifdef bottom_uri -#undef xmlFreeURI -extern __typeof (xmlFreeURI) xmlFreeURI __attribute((alias("xmlFreeURI__internal_alias"))); -#else -#ifndef xmlFreeURI -extern __typeof (xmlFreeURI) xmlFreeURI__internal_alias __attribute((visibility("hidden"))); -#define xmlFreeURI xmlFreeURI__internal_alias -#endif -#endif - -#if defined(LIBXML_VALID_ENABLED) -#ifdef bottom_valid -#undef xmlFreeValidCtxt -extern __typeof (xmlFreeValidCtxt) xmlFreeValidCtxt __attribute((alias("xmlFreeValidCtxt__internal_alias"))); -#else -#ifndef xmlFreeValidCtxt -extern __typeof (xmlFreeValidCtxt) xmlFreeValidCtxt__internal_alias __attribute((visibility("hidden"))); -#define xmlFreeValidCtxt xmlFreeValidCtxt__internal_alias -#endif -#endif -#endif - -#ifdef bottom_xmlmemory -#undef xmlGcMemGet -extern __typeof (xmlGcMemGet) xmlGcMemGet __attribute((alias("xmlGcMemGet__internal_alias"))); -#else -#ifndef xmlGcMemGet -extern __typeof (xmlGcMemGet) xmlGcMemGet__internal_alias __attribute((visibility("hidden"))); -#define xmlGcMemGet xmlGcMemGet__internal_alias -#endif -#endif - -#ifdef bottom_xmlmemory -#undef xmlGcMemSetup -extern __typeof (xmlGcMemSetup) xmlGcMemSetup __attribute((alias("xmlGcMemSetup__internal_alias"))); -#else -#ifndef xmlGcMemSetup -extern __typeof (xmlGcMemSetup) xmlGcMemSetup__internal_alias __attribute((visibility("hidden"))); -#define xmlGcMemSetup xmlGcMemSetup__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlGetBufferAllocationScheme -extern __typeof (xmlGetBufferAllocationScheme) xmlGetBufferAllocationScheme __attribute((alias("xmlGetBufferAllocationScheme__internal_alias"))); -#else -#ifndef xmlGetBufferAllocationScheme -extern __typeof (xmlGetBufferAllocationScheme) xmlGetBufferAllocationScheme__internal_alias __attribute((visibility("hidden"))); -#define xmlGetBufferAllocationScheme xmlGetBufferAllocationScheme__internal_alias -#endif -#endif - -#ifdef bottom_encoding -#undef xmlGetCharEncodingHandler -extern __typeof (xmlGetCharEncodingHandler) xmlGetCharEncodingHandler __attribute((alias("xmlGetCharEncodingHandler__internal_alias"))); -#else -#ifndef xmlGetCharEncodingHandler -extern __typeof (xmlGetCharEncodingHandler) xmlGetCharEncodingHandler__internal_alias __attribute((visibility("hidden"))); -#define xmlGetCharEncodingHandler xmlGetCharEncodingHandler__internal_alias -#endif -#endif - -#ifdef bottom_encoding -#undef xmlGetCharEncodingName -extern __typeof (xmlGetCharEncodingName) xmlGetCharEncodingName __attribute((alias("xmlGetCharEncodingName__internal_alias"))); -#else -#ifndef xmlGetCharEncodingName -extern __typeof (xmlGetCharEncodingName) xmlGetCharEncodingName__internal_alias __attribute((visibility("hidden"))); -#define xmlGetCharEncodingName xmlGetCharEncodingName__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlGetCompressMode -extern __typeof (xmlGetCompressMode) xmlGetCompressMode __attribute((alias("xmlGetCompressMode__internal_alias"))); -#else -#ifndef xmlGetCompressMode -extern __typeof (xmlGetCompressMode) xmlGetCompressMode__internal_alias __attribute((visibility("hidden"))); -#define xmlGetCompressMode xmlGetCompressMode__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlGetDocCompressMode -extern __typeof (xmlGetDocCompressMode) xmlGetDocCompressMode __attribute((alias("xmlGetDocCompressMode__internal_alias"))); -#else -#ifndef xmlGetDocCompressMode -extern __typeof (xmlGetDocCompressMode) xmlGetDocCompressMode__internal_alias __attribute((visibility("hidden"))); -#define xmlGetDocCompressMode xmlGetDocCompressMode__internal_alias -#endif -#endif - -#ifdef bottom_entities -#undef xmlGetDocEntity -extern __typeof (xmlGetDocEntity) xmlGetDocEntity __attribute((alias("xmlGetDocEntity__internal_alias"))); -#else -#ifndef xmlGetDocEntity -extern __typeof (xmlGetDocEntity) xmlGetDocEntity__internal_alias __attribute((visibility("hidden"))); -#define xmlGetDocEntity xmlGetDocEntity__internal_alias -#endif -#endif - -#ifdef bottom_valid -#undef xmlGetDtdAttrDesc -extern __typeof (xmlGetDtdAttrDesc) xmlGetDtdAttrDesc __attribute((alias("xmlGetDtdAttrDesc__internal_alias"))); -#else -#ifndef xmlGetDtdAttrDesc -extern __typeof (xmlGetDtdAttrDesc) xmlGetDtdAttrDesc__internal_alias __attribute((visibility("hidden"))); -#define xmlGetDtdAttrDesc xmlGetDtdAttrDesc__internal_alias -#endif -#endif - -#ifdef bottom_valid -#undef xmlGetDtdElementDesc -extern __typeof (xmlGetDtdElementDesc) xmlGetDtdElementDesc __attribute((alias("xmlGetDtdElementDesc__internal_alias"))); -#else -#ifndef xmlGetDtdElementDesc -extern __typeof (xmlGetDtdElementDesc) xmlGetDtdElementDesc__internal_alias __attribute((visibility("hidden"))); -#define xmlGetDtdElementDesc xmlGetDtdElementDesc__internal_alias -#endif -#endif - -#ifdef bottom_entities -#undef xmlGetDtdEntity -extern __typeof (xmlGetDtdEntity) xmlGetDtdEntity __attribute((alias("xmlGetDtdEntity__internal_alias"))); -#else -#ifndef xmlGetDtdEntity -extern __typeof (xmlGetDtdEntity) xmlGetDtdEntity__internal_alias __attribute((visibility("hidden"))); -#define xmlGetDtdEntity xmlGetDtdEntity__internal_alias -#endif -#endif - -#ifdef bottom_valid -#undef xmlGetDtdNotationDesc -extern __typeof (xmlGetDtdNotationDesc) xmlGetDtdNotationDesc __attribute((alias("xmlGetDtdNotationDesc__internal_alias"))); -#else -#ifndef xmlGetDtdNotationDesc -extern __typeof (xmlGetDtdNotationDesc) xmlGetDtdNotationDesc__internal_alias __attribute((visibility("hidden"))); -#define xmlGetDtdNotationDesc xmlGetDtdNotationDesc__internal_alias -#endif -#endif - -#ifdef bottom_valid -#undef xmlGetDtdQAttrDesc -extern __typeof (xmlGetDtdQAttrDesc) xmlGetDtdQAttrDesc __attribute((alias("xmlGetDtdQAttrDesc__internal_alias"))); -#else -#ifndef xmlGetDtdQAttrDesc -extern __typeof (xmlGetDtdQAttrDesc) xmlGetDtdQAttrDesc__internal_alias __attribute((visibility("hidden"))); -#define xmlGetDtdQAttrDesc xmlGetDtdQAttrDesc__internal_alias -#endif -#endif - -#ifdef bottom_valid -#undef xmlGetDtdQElementDesc -extern __typeof (xmlGetDtdQElementDesc) xmlGetDtdQElementDesc __attribute((alias("xmlGetDtdQElementDesc__internal_alias"))); -#else -#ifndef xmlGetDtdQElementDesc -extern __typeof (xmlGetDtdQElementDesc) xmlGetDtdQElementDesc__internal_alias __attribute((visibility("hidden"))); -#define xmlGetDtdQElementDesc xmlGetDtdQElementDesc__internal_alias -#endif -#endif - -#ifdef bottom_encoding -#undef xmlGetEncodingAlias -extern __typeof (xmlGetEncodingAlias) xmlGetEncodingAlias __attribute((alias("xmlGetEncodingAlias__internal_alias"))); -#else -#ifndef xmlGetEncodingAlias -extern __typeof (xmlGetEncodingAlias) xmlGetEncodingAlias__internal_alias __attribute((visibility("hidden"))); -#define xmlGetEncodingAlias xmlGetEncodingAlias__internal_alias -#endif -#endif - -#ifdef bottom_xmlIO -#undef xmlGetExternalEntityLoader -extern __typeof (xmlGetExternalEntityLoader) xmlGetExternalEntityLoader __attribute((alias("xmlGetExternalEntityLoader__internal_alias"))); -#else -#ifndef xmlGetExternalEntityLoader -extern __typeof (xmlGetExternalEntityLoader) xmlGetExternalEntityLoader__internal_alias __attribute((visibility("hidden"))); -#define xmlGetExternalEntityLoader xmlGetExternalEntityLoader__internal_alias -#endif -#endif - -#if defined(LIBXML_LEGACY_ENABLED) -#ifdef bottom_legacy -#undef xmlGetFeature -extern __typeof (xmlGetFeature) xmlGetFeature __attribute((alias("xmlGetFeature__internal_alias"))); -#else -#ifndef xmlGetFeature -extern __typeof (xmlGetFeature) xmlGetFeature__internal_alias __attribute((visibility("hidden"))); -#define xmlGetFeature xmlGetFeature__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_LEGACY_ENABLED) -#ifdef bottom_legacy -#undef xmlGetFeaturesList -extern __typeof (xmlGetFeaturesList) xmlGetFeaturesList __attribute((alias("xmlGetFeaturesList__internal_alias"))); -#else -#ifndef xmlGetFeaturesList -extern __typeof (xmlGetFeaturesList) xmlGetFeaturesList__internal_alias __attribute((visibility("hidden"))); -#define xmlGetFeaturesList xmlGetFeaturesList__internal_alias -#endif -#endif -#endif - -#ifdef bottom_threads -#undef xmlGetGlobalState -extern __typeof (xmlGetGlobalState) xmlGetGlobalState __attribute((alias("xmlGetGlobalState__internal_alias"))); -#else -#ifndef xmlGetGlobalState -extern __typeof (xmlGetGlobalState) xmlGetGlobalState__internal_alias __attribute((visibility("hidden"))); -#define xmlGetGlobalState xmlGetGlobalState__internal_alias -#endif -#endif - -#ifdef bottom_valid -#undef xmlGetID -extern __typeof (xmlGetID) xmlGetID __attribute((alias("xmlGetID__internal_alias"))); -#else -#ifndef xmlGetID -extern __typeof (xmlGetID) xmlGetID__internal_alias __attribute((visibility("hidden"))); -#define xmlGetID xmlGetID__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlGetIntSubset -extern __typeof (xmlGetIntSubset) xmlGetIntSubset __attribute((alias("xmlGetIntSubset__internal_alias"))); -#else -#ifndef xmlGetIntSubset -extern __typeof (xmlGetIntSubset) xmlGetIntSubset__internal_alias __attribute((visibility("hidden"))); -#define xmlGetIntSubset xmlGetIntSubset__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlGetLastChild -extern __typeof (xmlGetLastChild) xmlGetLastChild __attribute((alias("xmlGetLastChild__internal_alias"))); -#else -#ifndef xmlGetLastChild -extern __typeof (xmlGetLastChild) xmlGetLastChild__internal_alias __attribute((visibility("hidden"))); -#define xmlGetLastChild xmlGetLastChild__internal_alias -#endif -#endif - -#ifdef bottom_error -#undef xmlGetLastError -extern __typeof (xmlGetLastError) xmlGetLastError __attribute((alias("xmlGetLastError__internal_alias"))); -#else -#ifndef xmlGetLastError -extern __typeof (xmlGetLastError) xmlGetLastError__internal_alias __attribute((visibility("hidden"))); -#define xmlGetLastError xmlGetLastError__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlGetLineNo -extern __typeof (xmlGetLineNo) xmlGetLineNo __attribute((alias("xmlGetLineNo__internal_alias"))); -#else -#ifndef xmlGetLineNo -extern __typeof (xmlGetLineNo) xmlGetLineNo__internal_alias __attribute((visibility("hidden"))); -#define xmlGetLineNo xmlGetLineNo__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlGetNoNsProp -extern __typeof (xmlGetNoNsProp) xmlGetNoNsProp __attribute((alias("xmlGetNoNsProp__internal_alias"))); -#else -#ifndef xmlGetNoNsProp -extern __typeof (xmlGetNoNsProp) xmlGetNoNsProp__internal_alias __attribute((visibility("hidden"))); -#define xmlGetNoNsProp xmlGetNoNsProp__internal_alias -#endif -#endif - -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED) -#ifdef bottom_tree -#undef xmlGetNodePath -extern __typeof (xmlGetNodePath) xmlGetNodePath __attribute((alias("xmlGetNodePath__internal_alias"))); -#else -#ifndef xmlGetNodePath -extern __typeof (xmlGetNodePath) xmlGetNodePath__internal_alias __attribute((visibility("hidden"))); -#define xmlGetNodePath xmlGetNodePath__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_tree -#undef xmlGetNsList -extern __typeof (xmlGetNsList) xmlGetNsList __attribute((alias("xmlGetNsList__internal_alias"))); -#else -#ifndef xmlGetNsList -extern __typeof (xmlGetNsList) xmlGetNsList__internal_alias __attribute((visibility("hidden"))); -#define xmlGetNsList xmlGetNsList__internal_alias -#endif -#endif -#endif - -#ifdef bottom_tree -#undef xmlGetNsProp -extern __typeof (xmlGetNsProp) xmlGetNsProp __attribute((alias("xmlGetNsProp__internal_alias"))); -#else -#ifndef xmlGetNsProp -extern __typeof (xmlGetNsProp) xmlGetNsProp__internal_alias __attribute((visibility("hidden"))); -#define xmlGetNsProp xmlGetNsProp__internal_alias -#endif -#endif - -#ifdef bottom_entities -#undef xmlGetParameterEntity -extern __typeof (xmlGetParameterEntity) xmlGetParameterEntity __attribute((alias("xmlGetParameterEntity__internal_alias"))); -#else -#ifndef xmlGetParameterEntity -extern __typeof (xmlGetParameterEntity) xmlGetParameterEntity__internal_alias __attribute((visibility("hidden"))); -#define xmlGetParameterEntity xmlGetParameterEntity__internal_alias -#endif -#endif - -#ifdef bottom_entities -#undef xmlGetPredefinedEntity -extern __typeof (xmlGetPredefinedEntity) xmlGetPredefinedEntity __attribute((alias("xmlGetPredefinedEntity__internal_alias"))); -#else -#ifndef xmlGetPredefinedEntity -extern __typeof (xmlGetPredefinedEntity) xmlGetPredefinedEntity__internal_alias __attribute((visibility("hidden"))); -#define xmlGetPredefinedEntity xmlGetPredefinedEntity__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlGetProp -extern __typeof (xmlGetProp) xmlGetProp __attribute((alias("xmlGetProp__internal_alias"))); -#else -#ifndef xmlGetProp -extern __typeof (xmlGetProp) xmlGetProp__internal_alias __attribute((visibility("hidden"))); -#define xmlGetProp xmlGetProp__internal_alias -#endif -#endif - -#ifdef bottom_valid -#undef xmlGetRefs -extern __typeof (xmlGetRefs) xmlGetRefs __attribute((alias("xmlGetRefs__internal_alias"))); -#else -#ifndef xmlGetRefs -extern __typeof (xmlGetRefs) xmlGetRefs__internal_alias __attribute((visibility("hidden"))); -#define xmlGetRefs xmlGetRefs__internal_alias -#endif -#endif - -#ifdef bottom_threads -#undef xmlGetThreadId -extern __typeof (xmlGetThreadId) xmlGetThreadId __attribute((alias("xmlGetThreadId__internal_alias"))); -#else -#ifndef xmlGetThreadId -extern __typeof (xmlGetThreadId) xmlGetThreadId__internal_alias __attribute((visibility("hidden"))); -#define xmlGetThreadId xmlGetThreadId__internal_alias -#endif -#endif - -#ifdef bottom_xmlstring -#undef xmlGetUTF8Char -extern __typeof (xmlGetUTF8Char) xmlGetUTF8Char __attribute((alias("xmlGetUTF8Char__internal_alias"))); -#else -#ifndef xmlGetUTF8Char -extern __typeof (xmlGetUTF8Char) xmlGetUTF8Char__internal_alias __attribute((visibility("hidden"))); -#define xmlGetUTF8Char xmlGetUTF8Char__internal_alias -#endif -#endif - -#if defined(LIBXML_LEGACY_ENABLED) -#ifdef bottom_legacy -#undef xmlHandleEntity -extern __typeof (xmlHandleEntity) xmlHandleEntity __attribute((alias("xmlHandleEntity__internal_alias"))); -#else -#ifndef xmlHandleEntity -extern __typeof (xmlHandleEntity) xmlHandleEntity__internal_alias __attribute((visibility("hidden"))); -#define xmlHandleEntity xmlHandleEntity__internal_alias -#endif -#endif -#endif - -#ifdef bottom_parser -#undef xmlHasFeature -extern __typeof (xmlHasFeature) xmlHasFeature __attribute((alias("xmlHasFeature__internal_alias"))); -#else -#ifndef xmlHasFeature -extern __typeof (xmlHasFeature) xmlHasFeature__internal_alias __attribute((visibility("hidden"))); -#define xmlHasFeature xmlHasFeature__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlHasNsProp -extern __typeof (xmlHasNsProp) xmlHasNsProp __attribute((alias("xmlHasNsProp__internal_alias"))); -#else -#ifndef xmlHasNsProp -extern __typeof (xmlHasNsProp) xmlHasNsProp__internal_alias __attribute((visibility("hidden"))); -#define xmlHasNsProp xmlHasNsProp__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlHasProp -extern __typeof (xmlHasProp) xmlHasProp __attribute((alias("xmlHasProp__internal_alias"))); -#else -#ifndef xmlHasProp -extern __typeof (xmlHasProp) xmlHasProp__internal_alias __attribute((visibility("hidden"))); -#define xmlHasProp xmlHasProp__internal_alias -#endif -#endif - -#ifdef bottom_hash -#undef xmlHashAddEntry -extern __typeof (xmlHashAddEntry) xmlHashAddEntry __attribute((alias("xmlHashAddEntry__internal_alias"))); -#else -#ifndef xmlHashAddEntry -extern __typeof (xmlHashAddEntry) xmlHashAddEntry__internal_alias __attribute((visibility("hidden"))); -#define xmlHashAddEntry xmlHashAddEntry__internal_alias -#endif -#endif - -#ifdef bottom_hash -#undef xmlHashAddEntry2 -extern __typeof (xmlHashAddEntry2) xmlHashAddEntry2 __attribute((alias("xmlHashAddEntry2__internal_alias"))); -#else -#ifndef xmlHashAddEntry2 -extern __typeof (xmlHashAddEntry2) xmlHashAddEntry2__internal_alias __attribute((visibility("hidden"))); -#define xmlHashAddEntry2 xmlHashAddEntry2__internal_alias -#endif -#endif - -#ifdef bottom_hash -#undef xmlHashAddEntry3 -extern __typeof (xmlHashAddEntry3) xmlHashAddEntry3 __attribute((alias("xmlHashAddEntry3__internal_alias"))); -#else -#ifndef xmlHashAddEntry3 -extern __typeof (xmlHashAddEntry3) xmlHashAddEntry3__internal_alias __attribute((visibility("hidden"))); -#define xmlHashAddEntry3 xmlHashAddEntry3__internal_alias -#endif -#endif - -#ifdef bottom_hash -#undef xmlHashCopy -extern __typeof (xmlHashCopy) xmlHashCopy __attribute((alias("xmlHashCopy__internal_alias"))); -#else -#ifndef xmlHashCopy -extern __typeof (xmlHashCopy) xmlHashCopy__internal_alias __attribute((visibility("hidden"))); -#define xmlHashCopy xmlHashCopy__internal_alias -#endif -#endif - -#ifdef bottom_hash -#undef xmlHashCreate -extern __typeof (xmlHashCreate) xmlHashCreate __attribute((alias("xmlHashCreate__internal_alias"))); -#else -#ifndef xmlHashCreate -extern __typeof (xmlHashCreate) xmlHashCreate__internal_alias __attribute((visibility("hidden"))); -#define xmlHashCreate xmlHashCreate__internal_alias -#endif -#endif - -#ifdef bottom_hash -#undef xmlHashCreateDict -extern __typeof (xmlHashCreateDict) xmlHashCreateDict __attribute((alias("xmlHashCreateDict__internal_alias"))); -#else -#ifndef xmlHashCreateDict -extern __typeof (xmlHashCreateDict) xmlHashCreateDict__internal_alias __attribute((visibility("hidden"))); -#define xmlHashCreateDict xmlHashCreateDict__internal_alias -#endif -#endif - -#ifdef bottom_hash -#undef xmlHashDefaultDeallocator -extern __typeof (xmlHashDefaultDeallocator) xmlHashDefaultDeallocator __attribute((alias("xmlHashDefaultDeallocator__internal_alias"))); -#else -#ifndef xmlHashDefaultDeallocator -extern __typeof (xmlHashDefaultDeallocator) xmlHashDefaultDeallocator__internal_alias __attribute((visibility("hidden"))); -#define xmlHashDefaultDeallocator xmlHashDefaultDeallocator__internal_alias -#endif -#endif - -#ifdef bottom_hash -#undef xmlHashFree -extern __typeof (xmlHashFree) xmlHashFree __attribute((alias("xmlHashFree__internal_alias"))); -#else -#ifndef xmlHashFree -extern __typeof (xmlHashFree) xmlHashFree__internal_alias __attribute((visibility("hidden"))); -#define xmlHashFree xmlHashFree__internal_alias -#endif -#endif - -#ifdef bottom_hash -#undef xmlHashLookup -extern __typeof (xmlHashLookup) xmlHashLookup __attribute((alias("xmlHashLookup__internal_alias"))); -#else -#ifndef xmlHashLookup -extern __typeof (xmlHashLookup) xmlHashLookup__internal_alias __attribute((visibility("hidden"))); -#define xmlHashLookup xmlHashLookup__internal_alias -#endif -#endif - -#ifdef bottom_hash -#undef xmlHashLookup2 -extern __typeof (xmlHashLookup2) xmlHashLookup2 __attribute((alias("xmlHashLookup2__internal_alias"))); -#else -#ifndef xmlHashLookup2 -extern __typeof (xmlHashLookup2) xmlHashLookup2__internal_alias __attribute((visibility("hidden"))); -#define xmlHashLookup2 xmlHashLookup2__internal_alias -#endif -#endif - -#ifdef bottom_hash -#undef xmlHashLookup3 -extern __typeof (xmlHashLookup3) xmlHashLookup3 __attribute((alias("xmlHashLookup3__internal_alias"))); -#else -#ifndef xmlHashLookup3 -extern __typeof (xmlHashLookup3) xmlHashLookup3__internal_alias __attribute((visibility("hidden"))); -#define xmlHashLookup3 xmlHashLookup3__internal_alias -#endif -#endif - -#ifdef bottom_hash -#undef xmlHashQLookup -extern __typeof (xmlHashQLookup) xmlHashQLookup __attribute((alias("xmlHashQLookup__internal_alias"))); -#else -#ifndef xmlHashQLookup -extern __typeof (xmlHashQLookup) xmlHashQLookup__internal_alias __attribute((visibility("hidden"))); -#define xmlHashQLookup xmlHashQLookup__internal_alias -#endif -#endif - -#ifdef bottom_hash -#undef xmlHashQLookup2 -extern __typeof (xmlHashQLookup2) xmlHashQLookup2 __attribute((alias("xmlHashQLookup2__internal_alias"))); -#else -#ifndef xmlHashQLookup2 -extern __typeof (xmlHashQLookup2) xmlHashQLookup2__internal_alias __attribute((visibility("hidden"))); -#define xmlHashQLookup2 xmlHashQLookup2__internal_alias -#endif -#endif - -#ifdef bottom_hash -#undef xmlHashQLookup3 -extern __typeof (xmlHashQLookup3) xmlHashQLookup3 __attribute((alias("xmlHashQLookup3__internal_alias"))); -#else -#ifndef xmlHashQLookup3 -extern __typeof (xmlHashQLookup3) xmlHashQLookup3__internal_alias __attribute((visibility("hidden"))); -#define xmlHashQLookup3 xmlHashQLookup3__internal_alias -#endif -#endif - -#ifdef bottom_hash -#undef xmlHashRemoveEntry -extern __typeof (xmlHashRemoveEntry) xmlHashRemoveEntry __attribute((alias("xmlHashRemoveEntry__internal_alias"))); -#else -#ifndef xmlHashRemoveEntry -extern __typeof (xmlHashRemoveEntry) xmlHashRemoveEntry__internal_alias __attribute((visibility("hidden"))); -#define xmlHashRemoveEntry xmlHashRemoveEntry__internal_alias -#endif -#endif - -#ifdef bottom_hash -#undef xmlHashRemoveEntry2 -extern __typeof (xmlHashRemoveEntry2) xmlHashRemoveEntry2 __attribute((alias("xmlHashRemoveEntry2__internal_alias"))); -#else -#ifndef xmlHashRemoveEntry2 -extern __typeof (xmlHashRemoveEntry2) xmlHashRemoveEntry2__internal_alias __attribute((visibility("hidden"))); -#define xmlHashRemoveEntry2 xmlHashRemoveEntry2__internal_alias -#endif -#endif - -#ifdef bottom_hash -#undef xmlHashRemoveEntry3 -extern __typeof (xmlHashRemoveEntry3) xmlHashRemoveEntry3 __attribute((alias("xmlHashRemoveEntry3__internal_alias"))); -#else -#ifndef xmlHashRemoveEntry3 -extern __typeof (xmlHashRemoveEntry3) xmlHashRemoveEntry3__internal_alias __attribute((visibility("hidden"))); -#define xmlHashRemoveEntry3 xmlHashRemoveEntry3__internal_alias -#endif -#endif - -#ifdef bottom_hash -#undef xmlHashScan -extern __typeof (xmlHashScan) xmlHashScan __attribute((alias("xmlHashScan__internal_alias"))); -#else -#ifndef xmlHashScan -extern __typeof (xmlHashScan) xmlHashScan__internal_alias __attribute((visibility("hidden"))); -#define xmlHashScan xmlHashScan__internal_alias -#endif -#endif - -#ifdef bottom_hash -#undef xmlHashScan3 -extern __typeof (xmlHashScan3) xmlHashScan3 __attribute((alias("xmlHashScan3__internal_alias"))); -#else -#ifndef xmlHashScan3 -extern __typeof (xmlHashScan3) xmlHashScan3__internal_alias __attribute((visibility("hidden"))); -#define xmlHashScan3 xmlHashScan3__internal_alias -#endif -#endif - -#ifdef bottom_hash -#undef xmlHashScanFull -extern __typeof (xmlHashScanFull) xmlHashScanFull __attribute((alias("xmlHashScanFull__internal_alias"))); -#else -#ifndef xmlHashScanFull -extern __typeof (xmlHashScanFull) xmlHashScanFull__internal_alias __attribute((visibility("hidden"))); -#define xmlHashScanFull xmlHashScanFull__internal_alias -#endif -#endif - -#ifdef bottom_hash -#undef xmlHashScanFull3 -extern __typeof (xmlHashScanFull3) xmlHashScanFull3 __attribute((alias("xmlHashScanFull3__internal_alias"))); -#else -#ifndef xmlHashScanFull3 -extern __typeof (xmlHashScanFull3) xmlHashScanFull3__internal_alias __attribute((visibility("hidden"))); -#define xmlHashScanFull3 xmlHashScanFull3__internal_alias -#endif -#endif - -#ifdef bottom_hash -#undef xmlHashSize -extern __typeof (xmlHashSize) xmlHashSize __attribute((alias("xmlHashSize__internal_alias"))); -#else -#ifndef xmlHashSize -extern __typeof (xmlHashSize) xmlHashSize__internal_alias __attribute((visibility("hidden"))); -#define xmlHashSize xmlHashSize__internal_alias -#endif -#endif - -#ifdef bottom_hash -#undef xmlHashUpdateEntry -extern __typeof (xmlHashUpdateEntry) xmlHashUpdateEntry __attribute((alias("xmlHashUpdateEntry__internal_alias"))); -#else -#ifndef xmlHashUpdateEntry -extern __typeof (xmlHashUpdateEntry) xmlHashUpdateEntry__internal_alias __attribute((visibility("hidden"))); -#define xmlHashUpdateEntry xmlHashUpdateEntry__internal_alias -#endif -#endif - -#ifdef bottom_hash -#undef xmlHashUpdateEntry2 -extern __typeof (xmlHashUpdateEntry2) xmlHashUpdateEntry2 __attribute((alias("xmlHashUpdateEntry2__internal_alias"))); -#else -#ifndef xmlHashUpdateEntry2 -extern __typeof (xmlHashUpdateEntry2) xmlHashUpdateEntry2__internal_alias __attribute((visibility("hidden"))); -#define xmlHashUpdateEntry2 xmlHashUpdateEntry2__internal_alias -#endif -#endif - -#ifdef bottom_hash -#undef xmlHashUpdateEntry3 -extern __typeof (xmlHashUpdateEntry3) xmlHashUpdateEntry3 __attribute((alias("xmlHashUpdateEntry3__internal_alias"))); -#else -#ifndef xmlHashUpdateEntry3 -extern __typeof (xmlHashUpdateEntry3) xmlHashUpdateEntry3__internal_alias __attribute((visibility("hidden"))); -#define xmlHashUpdateEntry3 xmlHashUpdateEntry3__internal_alias -#endif -#endif - -#if defined(LIBXML_FTP_ENABLED) -#ifdef bottom_xmlIO -#undef xmlIOFTPClose -extern __typeof (xmlIOFTPClose) xmlIOFTPClose __attribute((alias("xmlIOFTPClose__internal_alias"))); -#else -#ifndef xmlIOFTPClose -extern __typeof (xmlIOFTPClose) xmlIOFTPClose__internal_alias __attribute((visibility("hidden"))); -#define xmlIOFTPClose xmlIOFTPClose__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_FTP_ENABLED) -#ifdef bottom_xmlIO -#undef xmlIOFTPMatch -extern __typeof (xmlIOFTPMatch) xmlIOFTPMatch __attribute((alias("xmlIOFTPMatch__internal_alias"))); -#else -#ifndef xmlIOFTPMatch -extern __typeof (xmlIOFTPMatch) xmlIOFTPMatch__internal_alias __attribute((visibility("hidden"))); -#define xmlIOFTPMatch xmlIOFTPMatch__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_FTP_ENABLED) -#ifdef bottom_xmlIO -#undef xmlIOFTPOpen -extern __typeof (xmlIOFTPOpen) xmlIOFTPOpen __attribute((alias("xmlIOFTPOpen__internal_alias"))); -#else -#ifndef xmlIOFTPOpen -extern __typeof (xmlIOFTPOpen) xmlIOFTPOpen__internal_alias __attribute((visibility("hidden"))); -#define xmlIOFTPOpen xmlIOFTPOpen__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_FTP_ENABLED) -#ifdef bottom_xmlIO -#undef xmlIOFTPRead -extern __typeof (xmlIOFTPRead) xmlIOFTPRead __attribute((alias("xmlIOFTPRead__internal_alias"))); -#else -#ifndef xmlIOFTPRead -extern __typeof (xmlIOFTPRead) xmlIOFTPRead__internal_alias __attribute((visibility("hidden"))); -#define xmlIOFTPRead xmlIOFTPRead__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTTP_ENABLED) -#ifdef bottom_xmlIO -#undef xmlIOHTTPClose -extern __typeof (xmlIOHTTPClose) xmlIOHTTPClose __attribute((alias("xmlIOHTTPClose__internal_alias"))); -#else -#ifndef xmlIOHTTPClose -extern __typeof (xmlIOHTTPClose) xmlIOHTTPClose__internal_alias __attribute((visibility("hidden"))); -#define xmlIOHTTPClose xmlIOHTTPClose__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTTP_ENABLED) -#ifdef bottom_xmlIO -#undef xmlIOHTTPMatch -extern __typeof (xmlIOHTTPMatch) xmlIOHTTPMatch __attribute((alias("xmlIOHTTPMatch__internal_alias"))); -#else -#ifndef xmlIOHTTPMatch -extern __typeof (xmlIOHTTPMatch) xmlIOHTTPMatch__internal_alias __attribute((visibility("hidden"))); -#define xmlIOHTTPMatch xmlIOHTTPMatch__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTTP_ENABLED) -#ifdef bottom_xmlIO -#undef xmlIOHTTPOpen -extern __typeof (xmlIOHTTPOpen) xmlIOHTTPOpen __attribute((alias("xmlIOHTTPOpen__internal_alias"))); -#else -#ifndef xmlIOHTTPOpen -extern __typeof (xmlIOHTTPOpen) xmlIOHTTPOpen__internal_alias __attribute((visibility("hidden"))); -#define xmlIOHTTPOpen xmlIOHTTPOpen__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTTP_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_xmlIO -#undef xmlIOHTTPOpenW -extern __typeof (xmlIOHTTPOpenW) xmlIOHTTPOpenW __attribute((alias("xmlIOHTTPOpenW__internal_alias"))); -#else -#ifndef xmlIOHTTPOpenW -extern __typeof (xmlIOHTTPOpenW) xmlIOHTTPOpenW__internal_alias __attribute((visibility("hidden"))); -#define xmlIOHTTPOpenW xmlIOHTTPOpenW__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTTP_ENABLED) -#ifdef bottom_xmlIO -#undef xmlIOHTTPRead -extern __typeof (xmlIOHTTPRead) xmlIOHTTPRead __attribute((alias("xmlIOHTTPRead__internal_alias"))); -#else -#ifndef xmlIOHTTPRead -extern __typeof (xmlIOHTTPRead) xmlIOHTTPRead__internal_alias __attribute((visibility("hidden"))); -#define xmlIOHTTPRead xmlIOHTTPRead__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_VALID_ENABLED) -#ifdef bottom_parser -#undef xmlIOParseDTD -extern __typeof (xmlIOParseDTD) xmlIOParseDTD __attribute((alias("xmlIOParseDTD__internal_alias"))); -#else -#ifndef xmlIOParseDTD -extern __typeof (xmlIOParseDTD) xmlIOParseDTD__internal_alias __attribute((visibility("hidden"))); -#define xmlIOParseDTD xmlIOParseDTD__internal_alias -#endif -#endif -#endif - -#ifdef bottom_encoding -#undef xmlInitCharEncodingHandlers -extern __typeof (xmlInitCharEncodingHandlers) xmlInitCharEncodingHandlers __attribute((alias("xmlInitCharEncodingHandlers__internal_alias"))); -#else -#ifndef xmlInitCharEncodingHandlers -extern __typeof (xmlInitCharEncodingHandlers) xmlInitCharEncodingHandlers__internal_alias __attribute((visibility("hidden"))); -#define xmlInitCharEncodingHandlers xmlInitCharEncodingHandlers__internal_alias -#endif -#endif - -#ifdef bottom_globals -#undef xmlInitGlobals -extern __typeof (xmlInitGlobals) xmlInitGlobals __attribute((alias("xmlInitGlobals__internal_alias"))); -#else -#ifndef xmlInitGlobals -extern __typeof (xmlInitGlobals) xmlInitGlobals__internal_alias __attribute((visibility("hidden"))); -#define xmlInitGlobals xmlInitGlobals__internal_alias -#endif -#endif - -#ifdef bottom_xmlmemory -#undef xmlInitMemory -extern __typeof (xmlInitMemory) xmlInitMemory __attribute((alias("xmlInitMemory__internal_alias"))); -#else -#ifndef xmlInitMemory -extern __typeof (xmlInitMemory) xmlInitMemory__internal_alias __attribute((visibility("hidden"))); -#define xmlInitMemory xmlInitMemory__internal_alias -#endif -#endif - -#ifdef bottom_parserInternals -#undef xmlInitNodeInfoSeq -extern __typeof (xmlInitNodeInfoSeq) xmlInitNodeInfoSeq __attribute((alias("xmlInitNodeInfoSeq__internal_alias"))); -#else -#ifndef xmlInitNodeInfoSeq -extern __typeof (xmlInitNodeInfoSeq) xmlInitNodeInfoSeq__internal_alias __attribute((visibility("hidden"))); -#define xmlInitNodeInfoSeq xmlInitNodeInfoSeq__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlInitParser -extern __typeof (xmlInitParser) xmlInitParser __attribute((alias("xmlInitParser__internal_alias"))); -#else -#ifndef xmlInitParser -extern __typeof (xmlInitParser) xmlInitParser__internal_alias __attribute((visibility("hidden"))); -#define xmlInitParser xmlInitParser__internal_alias -#endif -#endif - -#ifdef bottom_parserInternals -#undef xmlInitParserCtxt -extern __typeof (xmlInitParserCtxt) xmlInitParserCtxt __attribute((alias("xmlInitParserCtxt__internal_alias"))); -#else -#ifndef xmlInitParserCtxt -extern __typeof (xmlInitParserCtxt) xmlInitParserCtxt__internal_alias __attribute((visibility("hidden"))); -#define xmlInitParserCtxt xmlInitParserCtxt__internal_alias -#endif -#endif - -#ifdef bottom_threads -#undef xmlInitThreads -extern __typeof (xmlInitThreads) xmlInitThreads __attribute((alias("xmlInitThreads__internal_alias"))); -#else -#ifndef xmlInitThreads -extern __typeof (xmlInitThreads) xmlInitThreads__internal_alias __attribute((visibility("hidden"))); -#define xmlInitThreads xmlInitThreads__internal_alias -#endif -#endif - -#if defined(LIBXML_CATALOG_ENABLED) -#ifdef bottom_catalog -#undef xmlInitializeCatalog -extern __typeof (xmlInitializeCatalog) xmlInitializeCatalog __attribute((alias("xmlInitializeCatalog__internal_alias"))); -#else -#ifndef xmlInitializeCatalog -extern __typeof (xmlInitializeCatalog) xmlInitializeCatalog__internal_alias __attribute((visibility("hidden"))); -#define xmlInitializeCatalog xmlInitializeCatalog__internal_alias -#endif -#endif -#endif - -#ifdef bottom_dict -#undef xmlInitializeDict -extern __typeof (xmlInitializeDict) xmlInitializeDict __attribute((alias("xmlInitializeDict__internal_alias"))); -#else -#ifndef xmlInitializeDict -extern __typeof (xmlInitializeDict) xmlInitializeDict__internal_alias __attribute((visibility("hidden"))); -#define xmlInitializeDict xmlInitializeDict__internal_alias -#endif -#endif - -#ifdef bottom_globals -#undef xmlInitializeGlobalState -extern __typeof (xmlInitializeGlobalState) xmlInitializeGlobalState __attribute((alias("xmlInitializeGlobalState__internal_alias"))); -#else -#ifndef xmlInitializeGlobalState -extern __typeof (xmlInitializeGlobalState) xmlInitializeGlobalState__internal_alias __attribute((visibility("hidden"))); -#define xmlInitializeGlobalState xmlInitializeGlobalState__internal_alias -#endif -#endif - -#if defined(LIBXML_LEGACY_ENABLED) -#ifdef bottom_legacy -#undef xmlInitializePredefinedEntities -extern __typeof (xmlInitializePredefinedEntities) xmlInitializePredefinedEntities __attribute((alias("xmlInitializePredefinedEntities__internal_alias"))); -#else -#ifndef xmlInitializePredefinedEntities -extern __typeof (xmlInitializePredefinedEntities) xmlInitializePredefinedEntities__internal_alias __attribute((visibility("hidden"))); -#define xmlInitializePredefinedEntities xmlInitializePredefinedEntities__internal_alias -#endif -#endif -#endif - -#ifdef bottom_chvalid -#undef xmlIsBaseChar -extern __typeof (xmlIsBaseChar) xmlIsBaseChar __attribute((alias("xmlIsBaseChar__internal_alias"))); -#else -#ifndef xmlIsBaseChar -extern __typeof (xmlIsBaseChar) xmlIsBaseChar__internal_alias __attribute((visibility("hidden"))); -#define xmlIsBaseChar xmlIsBaseChar__internal_alias -#endif -#endif - -#ifdef bottom_chvalid -#undef xmlIsBlank -extern __typeof (xmlIsBlank) xmlIsBlank __attribute((alias("xmlIsBlank__internal_alias"))); -#else -#ifndef xmlIsBlank -extern __typeof (xmlIsBlank) xmlIsBlank__internal_alias __attribute((visibility("hidden"))); -#define xmlIsBlank xmlIsBlank__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlIsBlankNode -extern __typeof (xmlIsBlankNode) xmlIsBlankNode __attribute((alias("xmlIsBlankNode__internal_alias"))); -#else -#ifndef xmlIsBlankNode -extern __typeof (xmlIsBlankNode) xmlIsBlankNode__internal_alias __attribute((visibility("hidden"))); -#define xmlIsBlankNode xmlIsBlankNode__internal_alias -#endif -#endif - -#ifdef bottom_chvalid -#undef xmlIsChar -extern __typeof (xmlIsChar) xmlIsChar __attribute((alias("xmlIsChar__internal_alias"))); -#else -#ifndef xmlIsChar -extern __typeof (xmlIsChar) xmlIsChar__internal_alias __attribute((visibility("hidden"))); -#define xmlIsChar xmlIsChar__internal_alias -#endif -#endif - -#ifdef bottom_chvalid -#undef xmlIsCombining -extern __typeof (xmlIsCombining) xmlIsCombining __attribute((alias("xmlIsCombining__internal_alias"))); -#else -#ifndef xmlIsCombining -extern __typeof (xmlIsCombining) xmlIsCombining__internal_alias __attribute((visibility("hidden"))); -#define xmlIsCombining xmlIsCombining__internal_alias -#endif -#endif - -#ifdef bottom_chvalid -#undef xmlIsDigit -extern __typeof (xmlIsDigit) xmlIsDigit __attribute((alias("xmlIsDigit__internal_alias"))); -#else -#ifndef xmlIsDigit -extern __typeof (xmlIsDigit) xmlIsDigit__internal_alias __attribute((visibility("hidden"))); -#define xmlIsDigit xmlIsDigit__internal_alias -#endif -#endif - -#ifdef bottom_chvalid -#undef xmlIsExtender -extern __typeof (xmlIsExtender) xmlIsExtender __attribute((alias("xmlIsExtender__internal_alias"))); -#else -#ifndef xmlIsExtender -extern __typeof (xmlIsExtender) xmlIsExtender__internal_alias __attribute((visibility("hidden"))); -#define xmlIsExtender xmlIsExtender__internal_alias -#endif -#endif - -#ifdef bottom_valid -#undef xmlIsID -extern __typeof (xmlIsID) xmlIsID __attribute((alias("xmlIsID__internal_alias"))); -#else -#ifndef xmlIsID -extern __typeof (xmlIsID) xmlIsID__internal_alias __attribute((visibility("hidden"))); -#define xmlIsID xmlIsID__internal_alias -#endif -#endif - -#ifdef bottom_chvalid -#undef xmlIsIdeographic -extern __typeof (xmlIsIdeographic) xmlIsIdeographic __attribute((alias("xmlIsIdeographic__internal_alias"))); -#else -#ifndef xmlIsIdeographic -extern __typeof (xmlIsIdeographic) xmlIsIdeographic__internal_alias __attribute((visibility("hidden"))); -#define xmlIsIdeographic xmlIsIdeographic__internal_alias -#endif -#endif - -#ifdef bottom_parserInternals -#undef xmlIsLetter -extern __typeof (xmlIsLetter) xmlIsLetter __attribute((alias("xmlIsLetter__internal_alias"))); -#else -#ifndef xmlIsLetter -extern __typeof (xmlIsLetter) xmlIsLetter__internal_alias __attribute((visibility("hidden"))); -#define xmlIsLetter xmlIsLetter__internal_alias -#endif -#endif - -#ifdef bottom_threads -#undef xmlIsMainThread -extern __typeof (xmlIsMainThread) xmlIsMainThread __attribute((alias("xmlIsMainThread__internal_alias"))); -#else -#ifndef xmlIsMainThread -extern __typeof (xmlIsMainThread) xmlIsMainThread__internal_alias __attribute((visibility("hidden"))); -#define xmlIsMainThread xmlIsMainThread__internal_alias -#endif -#endif - -#ifdef bottom_valid -#undef xmlIsMixedElement -extern __typeof (xmlIsMixedElement) xmlIsMixedElement __attribute((alias("xmlIsMixedElement__internal_alias"))); -#else -#ifndef xmlIsMixedElement -extern __typeof (xmlIsMixedElement) xmlIsMixedElement__internal_alias __attribute((visibility("hidden"))); -#define xmlIsMixedElement xmlIsMixedElement__internal_alias -#endif -#endif - -#ifdef bottom_chvalid -#undef xmlIsPubidChar -extern __typeof (xmlIsPubidChar) xmlIsPubidChar __attribute((alias("xmlIsPubidChar__internal_alias"))); -#else -#ifndef xmlIsPubidChar -extern __typeof (xmlIsPubidChar) xmlIsPubidChar__internal_alias __attribute((visibility("hidden"))); -#define xmlIsPubidChar xmlIsPubidChar__internal_alias -#endif -#endif - -#ifdef bottom_valid -#undef xmlIsRef -extern __typeof (xmlIsRef) xmlIsRef __attribute((alias("xmlIsRef__internal_alias"))); -#else -#ifndef xmlIsRef -extern __typeof (xmlIsRef) xmlIsRef__internal_alias __attribute((visibility("hidden"))); -#define xmlIsRef xmlIsRef__internal_alias -#endif -#endif - -#ifdef bottom_xmlsave -#undef xmlIsXHTML -extern __typeof (xmlIsXHTML) xmlIsXHTML __attribute((alias("xmlIsXHTML__internal_alias"))); -#else -#ifndef xmlIsXHTML -extern __typeof (xmlIsXHTML) xmlIsXHTML__internal_alias __attribute((visibility("hidden"))); -#define xmlIsXHTML xmlIsXHTML__internal_alias -#endif -#endif - -#ifdef bottom_parserInternals -#undef xmlKeepBlanksDefault -extern __typeof (xmlKeepBlanksDefault) xmlKeepBlanksDefault __attribute((alias("xmlKeepBlanksDefault__internal_alias"))); -#else -#ifndef xmlKeepBlanksDefault -extern __typeof (xmlKeepBlanksDefault) xmlKeepBlanksDefault__internal_alias __attribute((visibility("hidden"))); -#define xmlKeepBlanksDefault xmlKeepBlanksDefault__internal_alias -#endif -#endif - -#if defined(LIBXML_TREE_ENABLED) -#ifdef bottom_tree -#undef xmlLastElementChild -extern __typeof (xmlLastElementChild) xmlLastElementChild __attribute((alias("xmlLastElementChild__internal_alias"))); -#else -#ifndef xmlLastElementChild -extern __typeof (xmlLastElementChild) xmlLastElementChild__internal_alias __attribute((visibility("hidden"))); -#define xmlLastElementChild xmlLastElementChild__internal_alias -#endif -#endif -#endif - -#ifdef bottom_parserInternals -#undef xmlLineNumbersDefault -extern __typeof (xmlLineNumbersDefault) xmlLineNumbersDefault __attribute((alias("xmlLineNumbersDefault__internal_alias"))); -#else -#ifndef xmlLineNumbersDefault -extern __typeof (xmlLineNumbersDefault) xmlLineNumbersDefault__internal_alias __attribute((visibility("hidden"))); -#define xmlLineNumbersDefault xmlLineNumbersDefault__internal_alias -#endif -#endif - -#ifdef bottom_list -#undef xmlLinkGetData -extern __typeof (xmlLinkGetData) xmlLinkGetData __attribute((alias("xmlLinkGetData__internal_alias"))); -#else -#ifndef xmlLinkGetData -extern __typeof (xmlLinkGetData) xmlLinkGetData__internal_alias __attribute((visibility("hidden"))); -#define xmlLinkGetData xmlLinkGetData__internal_alias -#endif -#endif - -#ifdef bottom_list -#undef xmlListAppend -extern __typeof (xmlListAppend) xmlListAppend __attribute((alias("xmlListAppend__internal_alias"))); -#else -#ifndef xmlListAppend -extern __typeof (xmlListAppend) xmlListAppend__internal_alias __attribute((visibility("hidden"))); -#define xmlListAppend xmlListAppend__internal_alias -#endif -#endif - -#ifdef bottom_list -#undef xmlListClear -extern __typeof (xmlListClear) xmlListClear __attribute((alias("xmlListClear__internal_alias"))); -#else -#ifndef xmlListClear -extern __typeof (xmlListClear) xmlListClear__internal_alias __attribute((visibility("hidden"))); -#define xmlListClear xmlListClear__internal_alias -#endif -#endif - -#ifdef bottom_list -#undef xmlListCopy -extern __typeof (xmlListCopy) xmlListCopy __attribute((alias("xmlListCopy__internal_alias"))); -#else -#ifndef xmlListCopy -extern __typeof (xmlListCopy) xmlListCopy__internal_alias __attribute((visibility("hidden"))); -#define xmlListCopy xmlListCopy__internal_alias -#endif -#endif - -#ifdef bottom_list -#undef xmlListCreate -extern __typeof (xmlListCreate) xmlListCreate __attribute((alias("xmlListCreate__internal_alias"))); -#else -#ifndef xmlListCreate -extern __typeof (xmlListCreate) xmlListCreate__internal_alias __attribute((visibility("hidden"))); -#define xmlListCreate xmlListCreate__internal_alias -#endif -#endif - -#ifdef bottom_list -#undef xmlListDelete -extern __typeof (xmlListDelete) xmlListDelete __attribute((alias("xmlListDelete__internal_alias"))); -#else -#ifndef xmlListDelete -extern __typeof (xmlListDelete) xmlListDelete__internal_alias __attribute((visibility("hidden"))); -#define xmlListDelete xmlListDelete__internal_alias -#endif -#endif - -#ifdef bottom_list -#undef xmlListDup -extern __typeof (xmlListDup) xmlListDup __attribute((alias("xmlListDup__internal_alias"))); -#else -#ifndef xmlListDup -extern __typeof (xmlListDup) xmlListDup__internal_alias __attribute((visibility("hidden"))); -#define xmlListDup xmlListDup__internal_alias -#endif -#endif - -#ifdef bottom_list -#undef xmlListEmpty -extern __typeof (xmlListEmpty) xmlListEmpty __attribute((alias("xmlListEmpty__internal_alias"))); -#else -#ifndef xmlListEmpty -extern __typeof (xmlListEmpty) xmlListEmpty__internal_alias __attribute((visibility("hidden"))); -#define xmlListEmpty xmlListEmpty__internal_alias -#endif -#endif - -#ifdef bottom_list -#undef xmlListEnd -extern __typeof (xmlListEnd) xmlListEnd __attribute((alias("xmlListEnd__internal_alias"))); -#else -#ifndef xmlListEnd -extern __typeof (xmlListEnd) xmlListEnd__internal_alias __attribute((visibility("hidden"))); -#define xmlListEnd xmlListEnd__internal_alias -#endif -#endif - -#ifdef bottom_list -#undef xmlListFront -extern __typeof (xmlListFront) xmlListFront __attribute((alias("xmlListFront__internal_alias"))); -#else -#ifndef xmlListFront -extern __typeof (xmlListFront) xmlListFront__internal_alias __attribute((visibility("hidden"))); -#define xmlListFront xmlListFront__internal_alias -#endif -#endif - -#ifdef bottom_list -#undef xmlListInsert -extern __typeof (xmlListInsert) xmlListInsert __attribute((alias("xmlListInsert__internal_alias"))); -#else -#ifndef xmlListInsert -extern __typeof (xmlListInsert) xmlListInsert__internal_alias __attribute((visibility("hidden"))); -#define xmlListInsert xmlListInsert__internal_alias -#endif -#endif - -#ifdef bottom_list -#undef xmlListMerge -extern __typeof (xmlListMerge) xmlListMerge __attribute((alias("xmlListMerge__internal_alias"))); -#else -#ifndef xmlListMerge -extern __typeof (xmlListMerge) xmlListMerge__internal_alias __attribute((visibility("hidden"))); -#define xmlListMerge xmlListMerge__internal_alias -#endif -#endif - -#ifdef bottom_list -#undef xmlListPopBack -extern __typeof (xmlListPopBack) xmlListPopBack __attribute((alias("xmlListPopBack__internal_alias"))); -#else -#ifndef xmlListPopBack -extern __typeof (xmlListPopBack) xmlListPopBack__internal_alias __attribute((visibility("hidden"))); -#define xmlListPopBack xmlListPopBack__internal_alias -#endif -#endif - -#ifdef bottom_list -#undef xmlListPopFront -extern __typeof (xmlListPopFront) xmlListPopFront __attribute((alias("xmlListPopFront__internal_alias"))); -#else -#ifndef xmlListPopFront -extern __typeof (xmlListPopFront) xmlListPopFront__internal_alias __attribute((visibility("hidden"))); -#define xmlListPopFront xmlListPopFront__internal_alias -#endif -#endif - -#ifdef bottom_list -#undef xmlListPushBack -extern __typeof (xmlListPushBack) xmlListPushBack __attribute((alias("xmlListPushBack__internal_alias"))); -#else -#ifndef xmlListPushBack -extern __typeof (xmlListPushBack) xmlListPushBack__internal_alias __attribute((visibility("hidden"))); -#define xmlListPushBack xmlListPushBack__internal_alias -#endif -#endif - -#ifdef bottom_list -#undef xmlListPushFront -extern __typeof (xmlListPushFront) xmlListPushFront __attribute((alias("xmlListPushFront__internal_alias"))); -#else -#ifndef xmlListPushFront -extern __typeof (xmlListPushFront) xmlListPushFront__internal_alias __attribute((visibility("hidden"))); -#define xmlListPushFront xmlListPushFront__internal_alias -#endif -#endif - -#ifdef bottom_list -#undef xmlListRemoveAll -extern __typeof (xmlListRemoveAll) xmlListRemoveAll __attribute((alias("xmlListRemoveAll__internal_alias"))); -#else -#ifndef xmlListRemoveAll -extern __typeof (xmlListRemoveAll) xmlListRemoveAll__internal_alias __attribute((visibility("hidden"))); -#define xmlListRemoveAll xmlListRemoveAll__internal_alias -#endif -#endif - -#ifdef bottom_list -#undef xmlListRemoveFirst -extern __typeof (xmlListRemoveFirst) xmlListRemoveFirst __attribute((alias("xmlListRemoveFirst__internal_alias"))); -#else -#ifndef xmlListRemoveFirst -extern __typeof (xmlListRemoveFirst) xmlListRemoveFirst__internal_alias __attribute((visibility("hidden"))); -#define xmlListRemoveFirst xmlListRemoveFirst__internal_alias -#endif -#endif - -#ifdef bottom_list -#undef xmlListRemoveLast -extern __typeof (xmlListRemoveLast) xmlListRemoveLast __attribute((alias("xmlListRemoveLast__internal_alias"))); -#else -#ifndef xmlListRemoveLast -extern __typeof (xmlListRemoveLast) xmlListRemoveLast__internal_alias __attribute((visibility("hidden"))); -#define xmlListRemoveLast xmlListRemoveLast__internal_alias -#endif -#endif - -#ifdef bottom_list -#undef xmlListReverse -extern __typeof (xmlListReverse) xmlListReverse __attribute((alias("xmlListReverse__internal_alias"))); -#else -#ifndef xmlListReverse -extern __typeof (xmlListReverse) xmlListReverse__internal_alias __attribute((visibility("hidden"))); -#define xmlListReverse xmlListReverse__internal_alias -#endif -#endif - -#ifdef bottom_list -#undef xmlListReverseSearch -extern __typeof (xmlListReverseSearch) xmlListReverseSearch __attribute((alias("xmlListReverseSearch__internal_alias"))); -#else -#ifndef xmlListReverseSearch -extern __typeof (xmlListReverseSearch) xmlListReverseSearch__internal_alias __attribute((visibility("hidden"))); -#define xmlListReverseSearch xmlListReverseSearch__internal_alias -#endif -#endif - -#ifdef bottom_list -#undef xmlListReverseWalk -extern __typeof (xmlListReverseWalk) xmlListReverseWalk __attribute((alias("xmlListReverseWalk__internal_alias"))); -#else -#ifndef xmlListReverseWalk -extern __typeof (xmlListReverseWalk) xmlListReverseWalk__internal_alias __attribute((visibility("hidden"))); -#define xmlListReverseWalk xmlListReverseWalk__internal_alias -#endif -#endif - -#ifdef bottom_list -#undef xmlListSearch -extern __typeof (xmlListSearch) xmlListSearch __attribute((alias("xmlListSearch__internal_alias"))); -#else -#ifndef xmlListSearch -extern __typeof (xmlListSearch) xmlListSearch__internal_alias __attribute((visibility("hidden"))); -#define xmlListSearch xmlListSearch__internal_alias -#endif -#endif - -#ifdef bottom_list -#undef xmlListSize -extern __typeof (xmlListSize) xmlListSize __attribute((alias("xmlListSize__internal_alias"))); -#else -#ifndef xmlListSize -extern __typeof (xmlListSize) xmlListSize__internal_alias __attribute((visibility("hidden"))); -#define xmlListSize xmlListSize__internal_alias -#endif -#endif - -#ifdef bottom_list -#undef xmlListSort -extern __typeof (xmlListSort) xmlListSort __attribute((alias("xmlListSort__internal_alias"))); -#else -#ifndef xmlListSort -extern __typeof (xmlListSort) xmlListSort__internal_alias __attribute((visibility("hidden"))); -#define xmlListSort xmlListSort__internal_alias -#endif -#endif - -#ifdef bottom_list -#undef xmlListWalk -extern __typeof (xmlListWalk) xmlListWalk __attribute((alias("xmlListWalk__internal_alias"))); -#else -#ifndef xmlListWalk -extern __typeof (xmlListWalk) xmlListWalk__internal_alias __attribute((visibility("hidden"))); -#define xmlListWalk xmlListWalk__internal_alias -#endif -#endif - -#if defined(LIBXML_CATALOG_ENABLED) -#ifdef bottom_catalog -#undef xmlLoadACatalog -extern __typeof (xmlLoadACatalog) xmlLoadACatalog __attribute((alias("xmlLoadACatalog__internal_alias"))); -#else -#ifndef xmlLoadACatalog -extern __typeof (xmlLoadACatalog) xmlLoadACatalog__internal_alias __attribute((visibility("hidden"))); -#define xmlLoadACatalog xmlLoadACatalog__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_CATALOG_ENABLED) -#ifdef bottom_catalog -#undef xmlLoadCatalog -extern __typeof (xmlLoadCatalog) xmlLoadCatalog __attribute((alias("xmlLoadCatalog__internal_alias"))); -#else -#ifndef xmlLoadCatalog -extern __typeof (xmlLoadCatalog) xmlLoadCatalog__internal_alias __attribute((visibility("hidden"))); -#define xmlLoadCatalog xmlLoadCatalog__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_CATALOG_ENABLED) -#ifdef bottom_catalog -#undef xmlLoadCatalogs -extern __typeof (xmlLoadCatalogs) xmlLoadCatalogs __attribute((alias("xmlLoadCatalogs__internal_alias"))); -#else -#ifndef xmlLoadCatalogs -extern __typeof (xmlLoadCatalogs) xmlLoadCatalogs__internal_alias __attribute((visibility("hidden"))); -#define xmlLoadCatalogs xmlLoadCatalogs__internal_alias -#endif -#endif -#endif - -#ifdef bottom_xmlIO -#undef xmlLoadExternalEntity -extern __typeof (xmlLoadExternalEntity) xmlLoadExternalEntity __attribute((alias("xmlLoadExternalEntity__internal_alias"))); -#else -#ifndef xmlLoadExternalEntity -extern __typeof (xmlLoadExternalEntity) xmlLoadExternalEntity__internal_alias __attribute((visibility("hidden"))); -#define xmlLoadExternalEntity xmlLoadExternalEntity__internal_alias -#endif -#endif - -#if defined(LIBXML_CATALOG_ENABLED) -#ifdef bottom_catalog -#undef xmlLoadSGMLSuperCatalog -extern __typeof (xmlLoadSGMLSuperCatalog) xmlLoadSGMLSuperCatalog __attribute((alias("xmlLoadSGMLSuperCatalog__internal_alias"))); -#else -#ifndef xmlLoadSGMLSuperCatalog -extern __typeof (xmlLoadSGMLSuperCatalog) xmlLoadSGMLSuperCatalog__internal_alias __attribute((visibility("hidden"))); -#define xmlLoadSGMLSuperCatalog xmlLoadSGMLSuperCatalog__internal_alias -#endif -#endif -#endif - -#ifdef bottom_threads -#undef xmlLockLibrary -extern __typeof (xmlLockLibrary) xmlLockLibrary __attribute((alias("xmlLockLibrary__internal_alias"))); -#else -#ifndef xmlLockLibrary -extern __typeof (xmlLockLibrary) xmlLockLibrary__internal_alias __attribute((visibility("hidden"))); -#define xmlLockLibrary xmlLockLibrary__internal_alias -#endif -#endif - -#if defined(LIBXML_DEBUG_ENABLED) -#ifdef bottom_debugXML -#undef xmlLsCountNode -extern __typeof (xmlLsCountNode) xmlLsCountNode __attribute((alias("xmlLsCountNode__internal_alias"))); -#else -#ifndef xmlLsCountNode -extern __typeof (xmlLsCountNode) xmlLsCountNode__internal_alias __attribute((visibility("hidden"))); -#define xmlLsCountNode xmlLsCountNode__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_DEBUG_ENABLED) -#ifdef bottom_debugXML -#undef xmlLsOneNode -extern __typeof (xmlLsOneNode) xmlLsOneNode __attribute((alias("xmlLsOneNode__internal_alias"))); -#else -#ifndef xmlLsOneNode -extern __typeof (xmlLsOneNode) xmlLsOneNode__internal_alias __attribute((visibility("hidden"))); -#define xmlLsOneNode xmlLsOneNode__internal_alias -#endif -#endif -#endif - -#ifdef bottom_xmlmemory -#undef xmlMallocAtomicLoc -extern __typeof (xmlMallocAtomicLoc) xmlMallocAtomicLoc __attribute((alias("xmlMallocAtomicLoc__internal_alias"))); -#else -#ifndef xmlMallocAtomicLoc -extern __typeof (xmlMallocAtomicLoc) xmlMallocAtomicLoc__internal_alias __attribute((visibility("hidden"))); -#define xmlMallocAtomicLoc xmlMallocAtomicLoc__internal_alias -#endif -#endif - -#ifdef bottom_xmlmemory -#undef xmlMallocLoc -extern __typeof (xmlMallocLoc) xmlMallocLoc __attribute((alias("xmlMallocLoc__internal_alias"))); -#else -#ifndef xmlMallocLoc -extern __typeof (xmlMallocLoc) xmlMallocLoc__internal_alias __attribute((visibility("hidden"))); -#define xmlMallocLoc xmlMallocLoc__internal_alias -#endif -#endif - -#ifdef bottom_xmlmemory -#undef xmlMemBlocks -extern __typeof (xmlMemBlocks) xmlMemBlocks __attribute((alias("xmlMemBlocks__internal_alias"))); -#else -#ifndef xmlMemBlocks -extern __typeof (xmlMemBlocks) xmlMemBlocks__internal_alias __attribute((visibility("hidden"))); -#define xmlMemBlocks xmlMemBlocks__internal_alias -#endif -#endif - -#ifdef bottom_xmlmemory -#undef xmlMemDisplay -extern __typeof (xmlMemDisplay) xmlMemDisplay __attribute((alias("xmlMemDisplay__internal_alias"))); -#else -#ifndef xmlMemDisplay -extern __typeof (xmlMemDisplay) xmlMemDisplay__internal_alias __attribute((visibility("hidden"))); -#define xmlMemDisplay xmlMemDisplay__internal_alias -#endif -#endif - -#ifdef bottom_xmlmemory -#undef xmlMemDisplayLast -extern __typeof (xmlMemDisplayLast) xmlMemDisplayLast __attribute((alias("xmlMemDisplayLast__internal_alias"))); -#else -#ifndef xmlMemDisplayLast -extern __typeof (xmlMemDisplayLast) xmlMemDisplayLast__internal_alias __attribute((visibility("hidden"))); -#define xmlMemDisplayLast xmlMemDisplayLast__internal_alias -#endif -#endif - -#ifdef bottom_xmlmemory -#undef xmlMemFree -extern __typeof (xmlMemFree) xmlMemFree __attribute((alias("xmlMemFree__internal_alias"))); -#else -#ifndef xmlMemFree -extern __typeof (xmlMemFree) xmlMemFree__internal_alias __attribute((visibility("hidden"))); -#define xmlMemFree xmlMemFree__internal_alias -#endif -#endif - -#ifdef bottom_xmlmemory -#undef xmlMemGet -extern __typeof (xmlMemGet) xmlMemGet __attribute((alias("xmlMemGet__internal_alias"))); -#else -#ifndef xmlMemGet -extern __typeof (xmlMemGet) xmlMemGet__internal_alias __attribute((visibility("hidden"))); -#define xmlMemGet xmlMemGet__internal_alias -#endif -#endif - -#ifdef bottom_xmlmemory -#undef xmlMemMalloc -extern __typeof (xmlMemMalloc) xmlMemMalloc __attribute((alias("xmlMemMalloc__internal_alias"))); -#else -#ifndef xmlMemMalloc -extern __typeof (xmlMemMalloc) xmlMemMalloc__internal_alias __attribute((visibility("hidden"))); -#define xmlMemMalloc xmlMemMalloc__internal_alias -#endif -#endif - -#ifdef bottom_xmlmemory -#undef xmlMemRealloc -extern __typeof (xmlMemRealloc) xmlMemRealloc __attribute((alias("xmlMemRealloc__internal_alias"))); -#else -#ifndef xmlMemRealloc -extern __typeof (xmlMemRealloc) xmlMemRealloc__internal_alias __attribute((visibility("hidden"))); -#define xmlMemRealloc xmlMemRealloc__internal_alias -#endif -#endif - -#ifdef bottom_xmlmemory -#undef xmlMemSetup -extern __typeof (xmlMemSetup) xmlMemSetup __attribute((alias("xmlMemSetup__internal_alias"))); -#else -#ifndef xmlMemSetup -extern __typeof (xmlMemSetup) xmlMemSetup__internal_alias __attribute((visibility("hidden"))); -#define xmlMemSetup xmlMemSetup__internal_alias -#endif -#endif - -#ifdef bottom_xmlmemory -#undef xmlMemShow -extern __typeof (xmlMemShow) xmlMemShow __attribute((alias("xmlMemShow__internal_alias"))); -#else -#ifndef xmlMemShow -extern __typeof (xmlMemShow) xmlMemShow__internal_alias __attribute((visibility("hidden"))); -#define xmlMemShow xmlMemShow__internal_alias -#endif -#endif - -#ifdef bottom_xmlmemory -#undef xmlMemStrdupLoc -extern __typeof (xmlMemStrdupLoc) xmlMemStrdupLoc __attribute((alias("xmlMemStrdupLoc__internal_alias"))); -#else -#ifndef xmlMemStrdupLoc -extern __typeof (xmlMemStrdupLoc) xmlMemStrdupLoc__internal_alias __attribute((visibility("hidden"))); -#define xmlMemStrdupLoc xmlMemStrdupLoc__internal_alias -#endif -#endif - -#ifdef bottom_xmlmemory -#undef xmlMemUsed -extern __typeof (xmlMemUsed) xmlMemUsed __attribute((alias("xmlMemUsed__internal_alias"))); -#else -#ifndef xmlMemUsed -extern __typeof (xmlMemUsed) xmlMemUsed__internal_alias __attribute((visibility("hidden"))); -#define xmlMemUsed xmlMemUsed__internal_alias -#endif -#endif - -#ifdef bottom_xmlmemory -#undef xmlMemoryDump -extern __typeof (xmlMemoryDump) xmlMemoryDump __attribute((alias("xmlMemoryDump__internal_alias"))); -#else -#ifndef xmlMemoryDump -extern __typeof (xmlMemoryDump) xmlMemoryDump__internal_alias __attribute((visibility("hidden"))); -#define xmlMemoryDump xmlMemoryDump__internal_alias -#endif -#endif - -#ifdef bottom_xmlmemory -#undef xmlMemoryStrdup -extern __typeof (xmlMemoryStrdup) xmlMemoryStrdup __attribute((alias("xmlMemoryStrdup__internal_alias"))); -#else -#ifndef xmlMemoryStrdup -extern __typeof (xmlMemoryStrdup) xmlMemoryStrdup__internal_alias __attribute((visibility("hidden"))); -#define xmlMemoryStrdup xmlMemoryStrdup__internal_alias -#endif -#endif - -#if defined(LIBXML_MODULES_ENABLED) -#ifdef bottom_xmlmodule -#undef xmlModuleClose -extern __typeof (xmlModuleClose) xmlModuleClose __attribute((alias("xmlModuleClose__internal_alias"))); -#else -#ifndef xmlModuleClose -extern __typeof (xmlModuleClose) xmlModuleClose__internal_alias __attribute((visibility("hidden"))); -#define xmlModuleClose xmlModuleClose__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_MODULES_ENABLED) -#ifdef bottom_xmlmodule -#undef xmlModuleFree -extern __typeof (xmlModuleFree) xmlModuleFree __attribute((alias("xmlModuleFree__internal_alias"))); -#else -#ifndef xmlModuleFree -extern __typeof (xmlModuleFree) xmlModuleFree__internal_alias __attribute((visibility("hidden"))); -#define xmlModuleFree xmlModuleFree__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_MODULES_ENABLED) -#ifdef bottom_xmlmodule -#undef xmlModuleOpen -extern __typeof (xmlModuleOpen) xmlModuleOpen __attribute((alias("xmlModuleOpen__internal_alias"))); -#else -#ifndef xmlModuleOpen -extern __typeof (xmlModuleOpen) xmlModuleOpen__internal_alias __attribute((visibility("hidden"))); -#define xmlModuleOpen xmlModuleOpen__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_MODULES_ENABLED) -#ifdef bottom_xmlmodule -#undef xmlModuleSymbol -extern __typeof (xmlModuleSymbol) xmlModuleSymbol __attribute((alias("xmlModuleSymbol__internal_alias"))); -#else -#ifndef xmlModuleSymbol -extern __typeof (xmlModuleSymbol) xmlModuleSymbol__internal_alias __attribute((visibility("hidden"))); -#define xmlModuleSymbol xmlModuleSymbol__internal_alias -#endif -#endif -#endif - -#ifdef bottom_threads -#undef xmlMutexLock -extern __typeof (xmlMutexLock) xmlMutexLock __attribute((alias("xmlMutexLock__internal_alias"))); -#else -#ifndef xmlMutexLock -extern __typeof (xmlMutexLock) xmlMutexLock__internal_alias __attribute((visibility("hidden"))); -#define xmlMutexLock xmlMutexLock__internal_alias -#endif -#endif - -#ifdef bottom_threads -#undef xmlMutexUnlock -extern __typeof (xmlMutexUnlock) xmlMutexUnlock __attribute((alias("xmlMutexUnlock__internal_alias"))); -#else -#ifndef xmlMutexUnlock -extern __typeof (xmlMutexUnlock) xmlMutexUnlock__internal_alias __attribute((visibility("hidden"))); -#define xmlMutexUnlock xmlMutexUnlock__internal_alias -#endif -#endif - -#if defined(LIBXML_LEGACY_ENABLED) -#ifdef bottom_legacy -#undef xmlNamespaceParseNCName -extern __typeof (xmlNamespaceParseNCName) xmlNamespaceParseNCName __attribute((alias("xmlNamespaceParseNCName__internal_alias"))); -#else -#ifndef xmlNamespaceParseNCName -extern __typeof (xmlNamespaceParseNCName) xmlNamespaceParseNCName__internal_alias __attribute((visibility("hidden"))); -#define xmlNamespaceParseNCName xmlNamespaceParseNCName__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_LEGACY_ENABLED) -#ifdef bottom_legacy -#undef xmlNamespaceParseNSDef -extern __typeof (xmlNamespaceParseNSDef) xmlNamespaceParseNSDef __attribute((alias("xmlNamespaceParseNSDef__internal_alias"))); -#else -#ifndef xmlNamespaceParseNSDef -extern __typeof (xmlNamespaceParseNSDef) xmlNamespaceParseNSDef__internal_alias __attribute((visibility("hidden"))); -#define xmlNamespaceParseNSDef xmlNamespaceParseNSDef__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_LEGACY_ENABLED) -#ifdef bottom_legacy -#undef xmlNamespaceParseQName -extern __typeof (xmlNamespaceParseQName) xmlNamespaceParseQName __attribute((alias("xmlNamespaceParseQName__internal_alias"))); -#else -#ifndef xmlNamespaceParseQName -extern __typeof (xmlNamespaceParseQName) xmlNamespaceParseQName__internal_alias __attribute((visibility("hidden"))); -#define xmlNamespaceParseQName xmlNamespaceParseQName__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_FTP_ENABLED) -#ifdef bottom_nanoftp -#undef xmlNanoFTPCheckResponse -extern __typeof (xmlNanoFTPCheckResponse) xmlNanoFTPCheckResponse __attribute((alias("xmlNanoFTPCheckResponse__internal_alias"))); -#else -#ifndef xmlNanoFTPCheckResponse -extern __typeof (xmlNanoFTPCheckResponse) xmlNanoFTPCheckResponse__internal_alias __attribute((visibility("hidden"))); -#define xmlNanoFTPCheckResponse xmlNanoFTPCheckResponse__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_FTP_ENABLED) -#ifdef bottom_nanoftp -#undef xmlNanoFTPCleanup -extern __typeof (xmlNanoFTPCleanup) xmlNanoFTPCleanup __attribute((alias("xmlNanoFTPCleanup__internal_alias"))); -#else -#ifndef xmlNanoFTPCleanup -extern __typeof (xmlNanoFTPCleanup) xmlNanoFTPCleanup__internal_alias __attribute((visibility("hidden"))); -#define xmlNanoFTPCleanup xmlNanoFTPCleanup__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_FTP_ENABLED) -#ifdef bottom_nanoftp -#undef xmlNanoFTPClose -extern __typeof (xmlNanoFTPClose) xmlNanoFTPClose __attribute((alias("xmlNanoFTPClose__internal_alias"))); -#else -#ifndef xmlNanoFTPClose -extern __typeof (xmlNanoFTPClose) xmlNanoFTPClose__internal_alias __attribute((visibility("hidden"))); -#define xmlNanoFTPClose xmlNanoFTPClose__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_FTP_ENABLED) -#ifdef bottom_nanoftp -#undef xmlNanoFTPCloseConnection -extern __typeof (xmlNanoFTPCloseConnection) xmlNanoFTPCloseConnection __attribute((alias("xmlNanoFTPCloseConnection__internal_alias"))); -#else -#ifndef xmlNanoFTPCloseConnection -extern __typeof (xmlNanoFTPCloseConnection) xmlNanoFTPCloseConnection__internal_alias __attribute((visibility("hidden"))); -#define xmlNanoFTPCloseConnection xmlNanoFTPCloseConnection__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_FTP_ENABLED) -#ifdef bottom_nanoftp -#undef xmlNanoFTPConnect -extern __typeof (xmlNanoFTPConnect) xmlNanoFTPConnect __attribute((alias("xmlNanoFTPConnect__internal_alias"))); -#else -#ifndef xmlNanoFTPConnect -extern __typeof (xmlNanoFTPConnect) xmlNanoFTPConnect__internal_alias __attribute((visibility("hidden"))); -#define xmlNanoFTPConnect xmlNanoFTPConnect__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_FTP_ENABLED) -#ifdef bottom_nanoftp -#undef xmlNanoFTPConnectTo -extern __typeof (xmlNanoFTPConnectTo) xmlNanoFTPConnectTo __attribute((alias("xmlNanoFTPConnectTo__internal_alias"))); -#else -#ifndef xmlNanoFTPConnectTo -extern __typeof (xmlNanoFTPConnectTo) xmlNanoFTPConnectTo__internal_alias __attribute((visibility("hidden"))); -#define xmlNanoFTPConnectTo xmlNanoFTPConnectTo__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_FTP_ENABLED) -#ifdef bottom_nanoftp -#undef xmlNanoFTPCwd -extern __typeof (xmlNanoFTPCwd) xmlNanoFTPCwd __attribute((alias("xmlNanoFTPCwd__internal_alias"))); -#else -#ifndef xmlNanoFTPCwd -extern __typeof (xmlNanoFTPCwd) xmlNanoFTPCwd__internal_alias __attribute((visibility("hidden"))); -#define xmlNanoFTPCwd xmlNanoFTPCwd__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_FTP_ENABLED) -#ifdef bottom_nanoftp -#undef xmlNanoFTPDele -extern __typeof (xmlNanoFTPDele) xmlNanoFTPDele __attribute((alias("xmlNanoFTPDele__internal_alias"))); -#else -#ifndef xmlNanoFTPDele -extern __typeof (xmlNanoFTPDele) xmlNanoFTPDele__internal_alias __attribute((visibility("hidden"))); -#define xmlNanoFTPDele xmlNanoFTPDele__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_FTP_ENABLED) -#ifdef bottom_nanoftp -#undef xmlNanoFTPFreeCtxt -extern __typeof (xmlNanoFTPFreeCtxt) xmlNanoFTPFreeCtxt __attribute((alias("xmlNanoFTPFreeCtxt__internal_alias"))); -#else -#ifndef xmlNanoFTPFreeCtxt -extern __typeof (xmlNanoFTPFreeCtxt) xmlNanoFTPFreeCtxt__internal_alias __attribute((visibility("hidden"))); -#define xmlNanoFTPFreeCtxt xmlNanoFTPFreeCtxt__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_FTP_ENABLED) -#ifdef bottom_nanoftp -#undef xmlNanoFTPGet -extern __typeof (xmlNanoFTPGet) xmlNanoFTPGet __attribute((alias("xmlNanoFTPGet__internal_alias"))); -#else -#ifndef xmlNanoFTPGet -extern __typeof (xmlNanoFTPGet) xmlNanoFTPGet__internal_alias __attribute((visibility("hidden"))); -#define xmlNanoFTPGet xmlNanoFTPGet__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_FTP_ENABLED) -#ifdef bottom_nanoftp -#undef xmlNanoFTPGetConnection -extern __typeof (xmlNanoFTPGetConnection) xmlNanoFTPGetConnection __attribute((alias("xmlNanoFTPGetConnection__internal_alias"))); -#else -#ifndef xmlNanoFTPGetConnection -extern __typeof (xmlNanoFTPGetConnection) xmlNanoFTPGetConnection__internal_alias __attribute((visibility("hidden"))); -#define xmlNanoFTPGetConnection xmlNanoFTPGetConnection__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_FTP_ENABLED) -#ifdef bottom_nanoftp -#undef xmlNanoFTPGetResponse -extern __typeof (xmlNanoFTPGetResponse) xmlNanoFTPGetResponse __attribute((alias("xmlNanoFTPGetResponse__internal_alias"))); -#else -#ifndef xmlNanoFTPGetResponse -extern __typeof (xmlNanoFTPGetResponse) xmlNanoFTPGetResponse__internal_alias __attribute((visibility("hidden"))); -#define xmlNanoFTPGetResponse xmlNanoFTPGetResponse__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_FTP_ENABLED) -#ifdef bottom_nanoftp -#undef xmlNanoFTPGetSocket -extern __typeof (xmlNanoFTPGetSocket) xmlNanoFTPGetSocket __attribute((alias("xmlNanoFTPGetSocket__internal_alias"))); -#else -#ifndef xmlNanoFTPGetSocket -extern __typeof (xmlNanoFTPGetSocket) xmlNanoFTPGetSocket__internal_alias __attribute((visibility("hidden"))); -#define xmlNanoFTPGetSocket xmlNanoFTPGetSocket__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_FTP_ENABLED) -#ifdef bottom_nanoftp -#undef xmlNanoFTPInit -extern __typeof (xmlNanoFTPInit) xmlNanoFTPInit __attribute((alias("xmlNanoFTPInit__internal_alias"))); -#else -#ifndef xmlNanoFTPInit -extern __typeof (xmlNanoFTPInit) xmlNanoFTPInit__internal_alias __attribute((visibility("hidden"))); -#define xmlNanoFTPInit xmlNanoFTPInit__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_FTP_ENABLED) -#ifdef bottom_nanoftp -#undef xmlNanoFTPList -extern __typeof (xmlNanoFTPList) xmlNanoFTPList __attribute((alias("xmlNanoFTPList__internal_alias"))); -#else -#ifndef xmlNanoFTPList -extern __typeof (xmlNanoFTPList) xmlNanoFTPList__internal_alias __attribute((visibility("hidden"))); -#define xmlNanoFTPList xmlNanoFTPList__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_FTP_ENABLED) -#ifdef bottom_nanoftp -#undef xmlNanoFTPNewCtxt -extern __typeof (xmlNanoFTPNewCtxt) xmlNanoFTPNewCtxt __attribute((alias("xmlNanoFTPNewCtxt__internal_alias"))); -#else -#ifndef xmlNanoFTPNewCtxt -extern __typeof (xmlNanoFTPNewCtxt) xmlNanoFTPNewCtxt__internal_alias __attribute((visibility("hidden"))); -#define xmlNanoFTPNewCtxt xmlNanoFTPNewCtxt__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_FTP_ENABLED) -#ifdef bottom_nanoftp -#undef xmlNanoFTPOpen -extern __typeof (xmlNanoFTPOpen) xmlNanoFTPOpen __attribute((alias("xmlNanoFTPOpen__internal_alias"))); -#else -#ifndef xmlNanoFTPOpen -extern __typeof (xmlNanoFTPOpen) xmlNanoFTPOpen__internal_alias __attribute((visibility("hidden"))); -#define xmlNanoFTPOpen xmlNanoFTPOpen__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_FTP_ENABLED) -#ifdef bottom_nanoftp -#undef xmlNanoFTPProxy -extern __typeof (xmlNanoFTPProxy) xmlNanoFTPProxy __attribute((alias("xmlNanoFTPProxy__internal_alias"))); -#else -#ifndef xmlNanoFTPProxy -extern __typeof (xmlNanoFTPProxy) xmlNanoFTPProxy__internal_alias __attribute((visibility("hidden"))); -#define xmlNanoFTPProxy xmlNanoFTPProxy__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_FTP_ENABLED) -#ifdef bottom_nanoftp -#undef xmlNanoFTPQuit -extern __typeof (xmlNanoFTPQuit) xmlNanoFTPQuit __attribute((alias("xmlNanoFTPQuit__internal_alias"))); -#else -#ifndef xmlNanoFTPQuit -extern __typeof (xmlNanoFTPQuit) xmlNanoFTPQuit__internal_alias __attribute((visibility("hidden"))); -#define xmlNanoFTPQuit xmlNanoFTPQuit__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_FTP_ENABLED) -#ifdef bottom_nanoftp -#undef xmlNanoFTPRead -extern __typeof (xmlNanoFTPRead) xmlNanoFTPRead __attribute((alias("xmlNanoFTPRead__internal_alias"))); -#else -#ifndef xmlNanoFTPRead -extern __typeof (xmlNanoFTPRead) xmlNanoFTPRead__internal_alias __attribute((visibility("hidden"))); -#define xmlNanoFTPRead xmlNanoFTPRead__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_FTP_ENABLED) -#ifdef bottom_nanoftp -#undef xmlNanoFTPScanProxy -extern __typeof (xmlNanoFTPScanProxy) xmlNanoFTPScanProxy __attribute((alias("xmlNanoFTPScanProxy__internal_alias"))); -#else -#ifndef xmlNanoFTPScanProxy -extern __typeof (xmlNanoFTPScanProxy) xmlNanoFTPScanProxy__internal_alias __attribute((visibility("hidden"))); -#define xmlNanoFTPScanProxy xmlNanoFTPScanProxy__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_FTP_ENABLED) -#ifdef bottom_nanoftp -#undef xmlNanoFTPUpdateURL -extern __typeof (xmlNanoFTPUpdateURL) xmlNanoFTPUpdateURL __attribute((alias("xmlNanoFTPUpdateURL__internal_alias"))); -#else -#ifndef xmlNanoFTPUpdateURL -extern __typeof (xmlNanoFTPUpdateURL) xmlNanoFTPUpdateURL__internal_alias __attribute((visibility("hidden"))); -#define xmlNanoFTPUpdateURL xmlNanoFTPUpdateURL__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTTP_ENABLED) -#ifdef bottom_nanohttp -#undef xmlNanoHTTPAuthHeader -extern __typeof (xmlNanoHTTPAuthHeader) xmlNanoHTTPAuthHeader __attribute((alias("xmlNanoHTTPAuthHeader__internal_alias"))); -#else -#ifndef xmlNanoHTTPAuthHeader -extern __typeof (xmlNanoHTTPAuthHeader) xmlNanoHTTPAuthHeader__internal_alias __attribute((visibility("hidden"))); -#define xmlNanoHTTPAuthHeader xmlNanoHTTPAuthHeader__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTTP_ENABLED) -#ifdef bottom_nanohttp -#undef xmlNanoHTTPCleanup -extern __typeof (xmlNanoHTTPCleanup) xmlNanoHTTPCleanup __attribute((alias("xmlNanoHTTPCleanup__internal_alias"))); -#else -#ifndef xmlNanoHTTPCleanup -extern __typeof (xmlNanoHTTPCleanup) xmlNanoHTTPCleanup__internal_alias __attribute((visibility("hidden"))); -#define xmlNanoHTTPCleanup xmlNanoHTTPCleanup__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTTP_ENABLED) -#ifdef bottom_nanohttp -#undef xmlNanoHTTPClose -extern __typeof (xmlNanoHTTPClose) xmlNanoHTTPClose __attribute((alias("xmlNanoHTTPClose__internal_alias"))); -#else -#ifndef xmlNanoHTTPClose -extern __typeof (xmlNanoHTTPClose) xmlNanoHTTPClose__internal_alias __attribute((visibility("hidden"))); -#define xmlNanoHTTPClose xmlNanoHTTPClose__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTTP_ENABLED) -#ifdef bottom_nanohttp -#undef xmlNanoHTTPContentLength -extern __typeof (xmlNanoHTTPContentLength) xmlNanoHTTPContentLength __attribute((alias("xmlNanoHTTPContentLength__internal_alias"))); -#else -#ifndef xmlNanoHTTPContentLength -extern __typeof (xmlNanoHTTPContentLength) xmlNanoHTTPContentLength__internal_alias __attribute((visibility("hidden"))); -#define xmlNanoHTTPContentLength xmlNanoHTTPContentLength__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTTP_ENABLED) -#ifdef bottom_nanohttp -#undef xmlNanoHTTPEncoding -extern __typeof (xmlNanoHTTPEncoding) xmlNanoHTTPEncoding __attribute((alias("xmlNanoHTTPEncoding__internal_alias"))); -#else -#ifndef xmlNanoHTTPEncoding -extern __typeof (xmlNanoHTTPEncoding) xmlNanoHTTPEncoding__internal_alias __attribute((visibility("hidden"))); -#define xmlNanoHTTPEncoding xmlNanoHTTPEncoding__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTTP_ENABLED) -#ifdef bottom_nanohttp -#undef xmlNanoHTTPFetch -extern __typeof (xmlNanoHTTPFetch) xmlNanoHTTPFetch __attribute((alias("xmlNanoHTTPFetch__internal_alias"))); -#else -#ifndef xmlNanoHTTPFetch -extern __typeof (xmlNanoHTTPFetch) xmlNanoHTTPFetch__internal_alias __attribute((visibility("hidden"))); -#define xmlNanoHTTPFetch xmlNanoHTTPFetch__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTTP_ENABLED) -#ifdef bottom_nanohttp -#undef xmlNanoHTTPInit -extern __typeof (xmlNanoHTTPInit) xmlNanoHTTPInit __attribute((alias("xmlNanoHTTPInit__internal_alias"))); -#else -#ifndef xmlNanoHTTPInit -extern __typeof (xmlNanoHTTPInit) xmlNanoHTTPInit__internal_alias __attribute((visibility("hidden"))); -#define xmlNanoHTTPInit xmlNanoHTTPInit__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTTP_ENABLED) -#ifdef bottom_nanohttp -#undef xmlNanoHTTPMethod -extern __typeof (xmlNanoHTTPMethod) xmlNanoHTTPMethod __attribute((alias("xmlNanoHTTPMethod__internal_alias"))); -#else -#ifndef xmlNanoHTTPMethod -extern __typeof (xmlNanoHTTPMethod) xmlNanoHTTPMethod__internal_alias __attribute((visibility("hidden"))); -#define xmlNanoHTTPMethod xmlNanoHTTPMethod__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTTP_ENABLED) -#ifdef bottom_nanohttp -#undef xmlNanoHTTPMethodRedir -extern __typeof (xmlNanoHTTPMethodRedir) xmlNanoHTTPMethodRedir __attribute((alias("xmlNanoHTTPMethodRedir__internal_alias"))); -#else -#ifndef xmlNanoHTTPMethodRedir -extern __typeof (xmlNanoHTTPMethodRedir) xmlNanoHTTPMethodRedir__internal_alias __attribute((visibility("hidden"))); -#define xmlNanoHTTPMethodRedir xmlNanoHTTPMethodRedir__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTTP_ENABLED) -#ifdef bottom_nanohttp -#undef xmlNanoHTTPMimeType -extern __typeof (xmlNanoHTTPMimeType) xmlNanoHTTPMimeType __attribute((alias("xmlNanoHTTPMimeType__internal_alias"))); -#else -#ifndef xmlNanoHTTPMimeType -extern __typeof (xmlNanoHTTPMimeType) xmlNanoHTTPMimeType__internal_alias __attribute((visibility("hidden"))); -#define xmlNanoHTTPMimeType xmlNanoHTTPMimeType__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTTP_ENABLED) -#ifdef bottom_nanohttp -#undef xmlNanoHTTPOpen -extern __typeof (xmlNanoHTTPOpen) xmlNanoHTTPOpen __attribute((alias("xmlNanoHTTPOpen__internal_alias"))); -#else -#ifndef xmlNanoHTTPOpen -extern __typeof (xmlNanoHTTPOpen) xmlNanoHTTPOpen__internal_alias __attribute((visibility("hidden"))); -#define xmlNanoHTTPOpen xmlNanoHTTPOpen__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTTP_ENABLED) -#ifdef bottom_nanohttp -#undef xmlNanoHTTPOpenRedir -extern __typeof (xmlNanoHTTPOpenRedir) xmlNanoHTTPOpenRedir __attribute((alias("xmlNanoHTTPOpenRedir__internal_alias"))); -#else -#ifndef xmlNanoHTTPOpenRedir -extern __typeof (xmlNanoHTTPOpenRedir) xmlNanoHTTPOpenRedir__internal_alias __attribute((visibility("hidden"))); -#define xmlNanoHTTPOpenRedir xmlNanoHTTPOpenRedir__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTTP_ENABLED) -#ifdef bottom_nanohttp -#undef xmlNanoHTTPRead -extern __typeof (xmlNanoHTTPRead) xmlNanoHTTPRead __attribute((alias("xmlNanoHTTPRead__internal_alias"))); -#else -#ifndef xmlNanoHTTPRead -extern __typeof (xmlNanoHTTPRead) xmlNanoHTTPRead__internal_alias __attribute((visibility("hidden"))); -#define xmlNanoHTTPRead xmlNanoHTTPRead__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTTP_ENABLED) -#ifdef bottom_nanohttp -#undef xmlNanoHTTPRedir -extern __typeof (xmlNanoHTTPRedir) xmlNanoHTTPRedir __attribute((alias("xmlNanoHTTPRedir__internal_alias"))); -#else -#ifndef xmlNanoHTTPRedir -extern __typeof (xmlNanoHTTPRedir) xmlNanoHTTPRedir__internal_alias __attribute((visibility("hidden"))); -#define xmlNanoHTTPRedir xmlNanoHTTPRedir__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTTP_ENABLED) -#ifdef bottom_nanohttp -#undef xmlNanoHTTPReturnCode -extern __typeof (xmlNanoHTTPReturnCode) xmlNanoHTTPReturnCode __attribute((alias("xmlNanoHTTPReturnCode__internal_alias"))); -#else -#ifndef xmlNanoHTTPReturnCode -extern __typeof (xmlNanoHTTPReturnCode) xmlNanoHTTPReturnCode__internal_alias __attribute((visibility("hidden"))); -#define xmlNanoHTTPReturnCode xmlNanoHTTPReturnCode__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTTP_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_nanohttp -#undef xmlNanoHTTPSave -extern __typeof (xmlNanoHTTPSave) xmlNanoHTTPSave __attribute((alias("xmlNanoHTTPSave__internal_alias"))); -#else -#ifndef xmlNanoHTTPSave -extern __typeof (xmlNanoHTTPSave) xmlNanoHTTPSave__internal_alias __attribute((visibility("hidden"))); -#define xmlNanoHTTPSave xmlNanoHTTPSave__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTTP_ENABLED) -#ifdef bottom_nanohttp -#undef xmlNanoHTTPScanProxy -extern __typeof (xmlNanoHTTPScanProxy) xmlNanoHTTPScanProxy __attribute((alias("xmlNanoHTTPScanProxy__internal_alias"))); -#else -#ifndef xmlNanoHTTPScanProxy -extern __typeof (xmlNanoHTTPScanProxy) xmlNanoHTTPScanProxy__internal_alias __attribute((visibility("hidden"))); -#define xmlNanoHTTPScanProxy xmlNanoHTTPScanProxy__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED) -#ifdef bottom_xmlregexp -#undef xmlNewAutomata -extern __typeof (xmlNewAutomata) xmlNewAutomata __attribute((alias("xmlNewAutomata__internal_alias"))); -#else -#ifndef xmlNewAutomata -extern __typeof (xmlNewAutomata) xmlNewAutomata__internal_alias __attribute((visibility("hidden"))); -#define xmlNewAutomata xmlNewAutomata__internal_alias -#endif -#endif -#endif - -#ifdef bottom_tree -#undef xmlNewCDataBlock -extern __typeof (xmlNewCDataBlock) xmlNewCDataBlock __attribute((alias("xmlNewCDataBlock__internal_alias"))); -#else -#ifndef xmlNewCDataBlock -extern __typeof (xmlNewCDataBlock) xmlNewCDataBlock__internal_alias __attribute((visibility("hidden"))); -#define xmlNewCDataBlock xmlNewCDataBlock__internal_alias -#endif -#endif - -#if defined(LIBXML_CATALOG_ENABLED) -#ifdef bottom_catalog -#undef xmlNewCatalog -extern __typeof (xmlNewCatalog) xmlNewCatalog __attribute((alias("xmlNewCatalog__internal_alias"))); -#else -#ifndef xmlNewCatalog -extern __typeof (xmlNewCatalog) xmlNewCatalog__internal_alias __attribute((visibility("hidden"))); -#define xmlNewCatalog xmlNewCatalog__internal_alias -#endif -#endif -#endif - -#ifdef bottom_encoding -#undef xmlNewCharEncodingHandler -extern __typeof (xmlNewCharEncodingHandler) xmlNewCharEncodingHandler __attribute((alias("xmlNewCharEncodingHandler__internal_alias"))); -#else -#ifndef xmlNewCharEncodingHandler -extern __typeof (xmlNewCharEncodingHandler) xmlNewCharEncodingHandler__internal_alias __attribute((visibility("hidden"))); -#define xmlNewCharEncodingHandler xmlNewCharEncodingHandler__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlNewCharRef -extern __typeof (xmlNewCharRef) xmlNewCharRef __attribute((alias("xmlNewCharRef__internal_alias"))); -#else -#ifndef xmlNewCharRef -extern __typeof (xmlNewCharRef) xmlNewCharRef__internal_alias __attribute((visibility("hidden"))); -#define xmlNewCharRef xmlNewCharRef__internal_alias -#endif -#endif - -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_tree -#undef xmlNewChild -extern __typeof (xmlNewChild) xmlNewChild __attribute((alias("xmlNewChild__internal_alias"))); -#else -#ifndef xmlNewChild -extern __typeof (xmlNewChild) xmlNewChild__internal_alias __attribute((visibility("hidden"))); -#define xmlNewChild xmlNewChild__internal_alias -#endif -#endif -#endif - -#ifdef bottom_tree -#undef xmlNewComment -extern __typeof (xmlNewComment) xmlNewComment __attribute((alias("xmlNewComment__internal_alias"))); -#else -#ifndef xmlNewComment -extern __typeof (xmlNewComment) xmlNewComment__internal_alias __attribute((visibility("hidden"))); -#define xmlNewComment xmlNewComment__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlNewDoc -extern __typeof (xmlNewDoc) xmlNewDoc __attribute((alias("xmlNewDoc__internal_alias"))); -#else -#ifndef xmlNewDoc -extern __typeof (xmlNewDoc) xmlNewDoc__internal_alias __attribute((visibility("hidden"))); -#define xmlNewDoc xmlNewDoc__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlNewDocComment -extern __typeof (xmlNewDocComment) xmlNewDocComment __attribute((alias("xmlNewDocComment__internal_alias"))); -#else -#ifndef xmlNewDocComment -extern __typeof (xmlNewDocComment) xmlNewDocComment__internal_alias __attribute((visibility("hidden"))); -#define xmlNewDocComment xmlNewDocComment__internal_alias -#endif -#endif - -#ifdef bottom_valid -#undef xmlNewDocElementContent -extern __typeof (xmlNewDocElementContent) xmlNewDocElementContent __attribute((alias("xmlNewDocElementContent__internal_alias"))); -#else -#ifndef xmlNewDocElementContent -extern __typeof (xmlNewDocElementContent) xmlNewDocElementContent__internal_alias __attribute((visibility("hidden"))); -#define xmlNewDocElementContent xmlNewDocElementContent__internal_alias -#endif -#endif - -#if defined(LIBXML_TREE_ENABLED) -#ifdef bottom_tree -#undef xmlNewDocFragment -extern __typeof (xmlNewDocFragment) xmlNewDocFragment __attribute((alias("xmlNewDocFragment__internal_alias"))); -#else -#ifndef xmlNewDocFragment -extern __typeof (xmlNewDocFragment) xmlNewDocFragment__internal_alias __attribute((visibility("hidden"))); -#define xmlNewDocFragment xmlNewDocFragment__internal_alias -#endif -#endif -#endif - -#ifdef bottom_tree -#undef xmlNewDocNode -extern __typeof (xmlNewDocNode) xmlNewDocNode __attribute((alias("xmlNewDocNode__internal_alias"))); -#else -#ifndef xmlNewDocNode -extern __typeof (xmlNewDocNode) xmlNewDocNode__internal_alias __attribute((visibility("hidden"))); -#define xmlNewDocNode xmlNewDocNode__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlNewDocNodeEatName -extern __typeof (xmlNewDocNodeEatName) xmlNewDocNodeEatName __attribute((alias("xmlNewDocNodeEatName__internal_alias"))); -#else -#ifndef xmlNewDocNodeEatName -extern __typeof (xmlNewDocNodeEatName) xmlNewDocNodeEatName__internal_alias __attribute((visibility("hidden"))); -#define xmlNewDocNodeEatName xmlNewDocNodeEatName__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlNewDocPI -extern __typeof (xmlNewDocPI) xmlNewDocPI __attribute((alias("xmlNewDocPI__internal_alias"))); -#else -#ifndef xmlNewDocPI -extern __typeof (xmlNewDocPI) xmlNewDocPI__internal_alias __attribute((visibility("hidden"))); -#define xmlNewDocPI xmlNewDocPI__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlNewDocProp -extern __typeof (xmlNewDocProp) xmlNewDocProp __attribute((alias("xmlNewDocProp__internal_alias"))); -#else -#ifndef xmlNewDocProp -extern __typeof (xmlNewDocProp) xmlNewDocProp__internal_alias __attribute((visibility("hidden"))); -#define xmlNewDocProp xmlNewDocProp__internal_alias -#endif -#endif - -#if defined(LIBXML_TREE_ENABLED) -#ifdef bottom_tree -#undef xmlNewDocRawNode -extern __typeof (xmlNewDocRawNode) xmlNewDocRawNode __attribute((alias("xmlNewDocRawNode__internal_alias"))); -#else -#ifndef xmlNewDocRawNode -extern __typeof (xmlNewDocRawNode) xmlNewDocRawNode__internal_alias __attribute((visibility("hidden"))); -#define xmlNewDocRawNode xmlNewDocRawNode__internal_alias -#endif -#endif -#endif - -#ifdef bottom_tree -#undef xmlNewDocText -extern __typeof (xmlNewDocText) xmlNewDocText __attribute((alias("xmlNewDocText__internal_alias"))); -#else -#ifndef xmlNewDocText -extern __typeof (xmlNewDocText) xmlNewDocText__internal_alias __attribute((visibility("hidden"))); -#define xmlNewDocText xmlNewDocText__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlNewDocTextLen -extern __typeof (xmlNewDocTextLen) xmlNewDocTextLen __attribute((alias("xmlNewDocTextLen__internal_alias"))); -#else -#ifndef xmlNewDocTextLen -extern __typeof (xmlNewDocTextLen) xmlNewDocTextLen__internal_alias __attribute((visibility("hidden"))); -#define xmlNewDocTextLen xmlNewDocTextLen__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlNewDtd -extern __typeof (xmlNewDtd) xmlNewDtd __attribute((alias("xmlNewDtd__internal_alias"))); -#else -#ifndef xmlNewDtd -extern __typeof (xmlNewDtd) xmlNewDtd__internal_alias __attribute((visibility("hidden"))); -#define xmlNewDtd xmlNewDtd__internal_alias -#endif -#endif - -#ifdef bottom_valid -#undef xmlNewElementContent -extern __typeof (xmlNewElementContent) xmlNewElementContent __attribute((alias("xmlNewElementContent__internal_alias"))); -#else -#ifndef xmlNewElementContent -extern __typeof (xmlNewElementContent) xmlNewElementContent__internal_alias __attribute((visibility("hidden"))); -#define xmlNewElementContent xmlNewElementContent__internal_alias -#endif -#endif - -#ifdef bottom_entities -#undef xmlNewEntity -extern __typeof (xmlNewEntity) xmlNewEntity __attribute((alias("xmlNewEntity__internal_alias"))); -#else -#ifndef xmlNewEntity -extern __typeof (xmlNewEntity) xmlNewEntity__internal_alias __attribute((visibility("hidden"))); -#define xmlNewEntity xmlNewEntity__internal_alias -#endif -#endif - -#ifdef bottom_parserInternals -#undef xmlNewEntityInputStream -extern __typeof (xmlNewEntityInputStream) xmlNewEntityInputStream __attribute((alias("xmlNewEntityInputStream__internal_alias"))); -#else -#ifndef xmlNewEntityInputStream -extern __typeof (xmlNewEntityInputStream) xmlNewEntityInputStream__internal_alias __attribute((visibility("hidden"))); -#define xmlNewEntityInputStream xmlNewEntityInputStream__internal_alias -#endif -#endif - -#if defined(LIBXML_LEGACY_ENABLED) -#ifdef bottom_legacy -#undef xmlNewGlobalNs -extern __typeof (xmlNewGlobalNs) xmlNewGlobalNs __attribute((alias("xmlNewGlobalNs__internal_alias"))); -#else -#ifndef xmlNewGlobalNs -extern __typeof (xmlNewGlobalNs) xmlNewGlobalNs__internal_alias __attribute((visibility("hidden"))); -#define xmlNewGlobalNs xmlNewGlobalNs__internal_alias -#endif -#endif -#endif - -#ifdef bottom_parserInternals -#undef xmlNewIOInputStream -extern __typeof (xmlNewIOInputStream) xmlNewIOInputStream __attribute((alias("xmlNewIOInputStream__internal_alias"))); -#else -#ifndef xmlNewIOInputStream -extern __typeof (xmlNewIOInputStream) xmlNewIOInputStream__internal_alias __attribute((visibility("hidden"))); -#define xmlNewIOInputStream xmlNewIOInputStream__internal_alias -#endif -#endif - -#ifdef bottom_parserInternals -#undef xmlNewInputFromFile -extern __typeof (xmlNewInputFromFile) xmlNewInputFromFile __attribute((alias("xmlNewInputFromFile__internal_alias"))); -#else -#ifndef xmlNewInputFromFile -extern __typeof (xmlNewInputFromFile) xmlNewInputFromFile__internal_alias __attribute((visibility("hidden"))); -#define xmlNewInputFromFile xmlNewInputFromFile__internal_alias -#endif -#endif - -#ifdef bottom_parserInternals -#undef xmlNewInputStream -extern __typeof (xmlNewInputStream) xmlNewInputStream __attribute((alias("xmlNewInputStream__internal_alias"))); -#else -#ifndef xmlNewInputStream -extern __typeof (xmlNewInputStream) xmlNewInputStream__internal_alias __attribute((visibility("hidden"))); -#define xmlNewInputStream xmlNewInputStream__internal_alias -#endif -#endif - -#ifdef bottom_threads -#undef xmlNewMutex -extern __typeof (xmlNewMutex) xmlNewMutex __attribute((alias("xmlNewMutex__internal_alias"))); -#else -#ifndef xmlNewMutex -extern __typeof (xmlNewMutex) xmlNewMutex__internal_alias __attribute((visibility("hidden"))); -#define xmlNewMutex xmlNewMutex__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlNewNode -extern __typeof (xmlNewNode) xmlNewNode __attribute((alias("xmlNewNode__internal_alias"))); -#else -#ifndef xmlNewNode -extern __typeof (xmlNewNode) xmlNewNode__internal_alias __attribute((visibility("hidden"))); -#define xmlNewNode xmlNewNode__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlNewNodeEatName -extern __typeof (xmlNewNodeEatName) xmlNewNodeEatName __attribute((alias("xmlNewNodeEatName__internal_alias"))); -#else -#ifndef xmlNewNodeEatName -extern __typeof (xmlNewNodeEatName) xmlNewNodeEatName__internal_alias __attribute((visibility("hidden"))); -#define xmlNewNodeEatName xmlNewNodeEatName__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlNewNs -extern __typeof (xmlNewNs) xmlNewNs __attribute((alias("xmlNewNs__internal_alias"))); -#else -#ifndef xmlNewNs -extern __typeof (xmlNewNs) xmlNewNs__internal_alias __attribute((visibility("hidden"))); -#define xmlNewNs xmlNewNs__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlNewNsProp -extern __typeof (xmlNewNsProp) xmlNewNsProp __attribute((alias("xmlNewNsProp__internal_alias"))); -#else -#ifndef xmlNewNsProp -extern __typeof (xmlNewNsProp) xmlNewNsProp__internal_alias __attribute((visibility("hidden"))); -#define xmlNewNsProp xmlNewNsProp__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlNewNsPropEatName -extern __typeof (xmlNewNsPropEatName) xmlNewNsPropEatName __attribute((alias("xmlNewNsPropEatName__internal_alias"))); -#else -#ifndef xmlNewNsPropEatName -extern __typeof (xmlNewNsPropEatName) xmlNewNsPropEatName__internal_alias __attribute((visibility("hidden"))); -#define xmlNewNsPropEatName xmlNewNsPropEatName__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlNewPI -extern __typeof (xmlNewPI) xmlNewPI __attribute((alias("xmlNewPI__internal_alias"))); -#else -#ifndef xmlNewPI -extern __typeof (xmlNewPI) xmlNewPI__internal_alias __attribute((visibility("hidden"))); -#define xmlNewPI xmlNewPI__internal_alias -#endif -#endif - -#ifdef bottom_parserInternals -#undef xmlNewParserCtxt -extern __typeof (xmlNewParserCtxt) xmlNewParserCtxt __attribute((alias("xmlNewParserCtxt__internal_alias"))); -#else -#ifndef xmlNewParserCtxt -extern __typeof (xmlNewParserCtxt) xmlNewParserCtxt__internal_alias __attribute((visibility("hidden"))); -#define xmlNewParserCtxt xmlNewParserCtxt__internal_alias -#endif -#endif - -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_tree -#undef xmlNewProp -extern __typeof (xmlNewProp) xmlNewProp __attribute((alias("xmlNewProp__internal_alias"))); -#else -#ifndef xmlNewProp -extern __typeof (xmlNewProp) xmlNewProp__internal_alias __attribute((visibility("hidden"))); -#define xmlNewProp xmlNewProp__internal_alias -#endif -#endif -#endif - -#ifdef bottom_threads -#undef xmlNewRMutex -extern __typeof (xmlNewRMutex) xmlNewRMutex __attribute((alias("xmlNewRMutex__internal_alias"))); -#else -#ifndef xmlNewRMutex -extern __typeof (xmlNewRMutex) xmlNewRMutex__internal_alias __attribute((visibility("hidden"))); -#define xmlNewRMutex xmlNewRMutex__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlNewReference -extern __typeof (xmlNewReference) xmlNewReference __attribute((alias("xmlNewReference__internal_alias"))); -#else -#ifndef xmlNewReference -extern __typeof (xmlNewReference) xmlNewReference__internal_alias __attribute((visibility("hidden"))); -#define xmlNewReference xmlNewReference__internal_alias -#endif -#endif - -#ifdef bottom_parserInternals -#undef xmlNewStringInputStream -extern __typeof (xmlNewStringInputStream) xmlNewStringInputStream __attribute((alias("xmlNewStringInputStream__internal_alias"))); -#else -#ifndef xmlNewStringInputStream -extern __typeof (xmlNewStringInputStream) xmlNewStringInputStream__internal_alias __attribute((visibility("hidden"))); -#define xmlNewStringInputStream xmlNewStringInputStream__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlNewText -extern __typeof (xmlNewText) xmlNewText __attribute((alias("xmlNewText__internal_alias"))); -#else -#ifndef xmlNewText -extern __typeof (xmlNewText) xmlNewText__internal_alias __attribute((visibility("hidden"))); -#define xmlNewText xmlNewText__internal_alias -#endif -#endif - -#if defined(LIBXML_TREE_ENABLED) -#ifdef bottom_tree -#undef xmlNewTextChild -extern __typeof (xmlNewTextChild) xmlNewTextChild __attribute((alias("xmlNewTextChild__internal_alias"))); -#else -#ifndef xmlNewTextChild -extern __typeof (xmlNewTextChild) xmlNewTextChild__internal_alias __attribute((visibility("hidden"))); -#define xmlNewTextChild xmlNewTextChild__internal_alias -#endif -#endif -#endif - -#ifdef bottom_tree -#undef xmlNewTextLen -extern __typeof (xmlNewTextLen) xmlNewTextLen __attribute((alias("xmlNewTextLen__internal_alias"))); -#else -#ifndef xmlNewTextLen -extern __typeof (xmlNewTextLen) xmlNewTextLen__internal_alias __attribute((visibility("hidden"))); -#define xmlNewTextLen xmlNewTextLen__internal_alias -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlNewTextReader -extern __typeof (xmlNewTextReader) xmlNewTextReader __attribute((alias("xmlNewTextReader__internal_alias"))); -#else -#ifndef xmlNewTextReader -extern __typeof (xmlNewTextReader) xmlNewTextReader__internal_alias __attribute((visibility("hidden"))); -#define xmlNewTextReader xmlNewTextReader__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlNewTextReaderFilename -extern __typeof (xmlNewTextReaderFilename) xmlNewTextReaderFilename __attribute((alias("xmlNewTextReaderFilename__internal_alias"))); -#else -#ifndef xmlNewTextReaderFilename -extern __typeof (xmlNewTextReaderFilename) xmlNewTextReaderFilename__internal_alias __attribute((visibility("hidden"))); -#define xmlNewTextReaderFilename xmlNewTextReaderFilename__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlNewTextWriter -extern __typeof (xmlNewTextWriter) xmlNewTextWriter __attribute((alias("xmlNewTextWriter__internal_alias"))); -#else -#ifndef xmlNewTextWriter -extern __typeof (xmlNewTextWriter) xmlNewTextWriter__internal_alias __attribute((visibility("hidden"))); -#define xmlNewTextWriter xmlNewTextWriter__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlNewTextWriterDoc -extern __typeof (xmlNewTextWriterDoc) xmlNewTextWriterDoc __attribute((alias("xmlNewTextWriterDoc__internal_alias"))); -#else -#ifndef xmlNewTextWriterDoc -extern __typeof (xmlNewTextWriterDoc) xmlNewTextWriterDoc__internal_alias __attribute((visibility("hidden"))); -#define xmlNewTextWriterDoc xmlNewTextWriterDoc__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlNewTextWriterFilename -extern __typeof (xmlNewTextWriterFilename) xmlNewTextWriterFilename __attribute((alias("xmlNewTextWriterFilename__internal_alias"))); -#else -#ifndef xmlNewTextWriterFilename -extern __typeof (xmlNewTextWriterFilename) xmlNewTextWriterFilename__internal_alias __attribute((visibility("hidden"))); -#define xmlNewTextWriterFilename xmlNewTextWriterFilename__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlNewTextWriterMemory -extern __typeof (xmlNewTextWriterMemory) xmlNewTextWriterMemory __attribute((alias("xmlNewTextWriterMemory__internal_alias"))); -#else -#ifndef xmlNewTextWriterMemory -extern __typeof (xmlNewTextWriterMemory) xmlNewTextWriterMemory__internal_alias __attribute((visibility("hidden"))); -#define xmlNewTextWriterMemory xmlNewTextWriterMemory__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlNewTextWriterPushParser -extern __typeof (xmlNewTextWriterPushParser) xmlNewTextWriterPushParser __attribute((alias("xmlNewTextWriterPushParser__internal_alias"))); -#else -#ifndef xmlNewTextWriterPushParser -extern __typeof (xmlNewTextWriterPushParser) xmlNewTextWriterPushParser__internal_alias __attribute((visibility("hidden"))); -#define xmlNewTextWriterPushParser xmlNewTextWriterPushParser__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlNewTextWriterTree -extern __typeof (xmlNewTextWriterTree) xmlNewTextWriterTree __attribute((alias("xmlNewTextWriterTree__internal_alias"))); -#else -#ifndef xmlNewTextWriterTree -extern __typeof (xmlNewTextWriterTree) xmlNewTextWriterTree__internal_alias __attribute((visibility("hidden"))); -#define xmlNewTextWriterTree xmlNewTextWriterTree__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_VALID_ENABLED) -#ifdef bottom_valid -#undef xmlNewValidCtxt -extern __typeof (xmlNewValidCtxt) xmlNewValidCtxt __attribute((alias("xmlNewValidCtxt__internal_alias"))); -#else -#ifndef xmlNewValidCtxt -extern __typeof (xmlNewValidCtxt) xmlNewValidCtxt__internal_alias __attribute((visibility("hidden"))); -#define xmlNewValidCtxt xmlNewValidCtxt__internal_alias -#endif -#endif -#endif - -#ifdef bottom_parserInternals -#undef xmlNextChar -extern __typeof (xmlNextChar) xmlNextChar __attribute((alias("xmlNextChar__internal_alias"))); -#else -#ifndef xmlNextChar -extern __typeof (xmlNextChar) xmlNextChar__internal_alias __attribute((visibility("hidden"))); -#define xmlNextChar xmlNextChar__internal_alias -#endif -#endif - -#if defined(LIBXML_TREE_ENABLED) -#ifdef bottom_tree -#undef xmlNextElementSibling -extern __typeof (xmlNextElementSibling) xmlNextElementSibling __attribute((alias("xmlNextElementSibling__internal_alias"))); -#else -#ifndef xmlNextElementSibling -extern __typeof (xmlNextElementSibling) xmlNextElementSibling__internal_alias __attribute((visibility("hidden"))); -#define xmlNextElementSibling xmlNextElementSibling__internal_alias -#endif -#endif -#endif - -#ifdef bottom_xmlIO -#undef xmlNoNetExternalEntityLoader -extern __typeof (xmlNoNetExternalEntityLoader) xmlNoNetExternalEntityLoader __attribute((alias("xmlNoNetExternalEntityLoader__internal_alias"))); -#else -#ifndef xmlNoNetExternalEntityLoader -extern __typeof (xmlNoNetExternalEntityLoader) xmlNoNetExternalEntityLoader__internal_alias __attribute((visibility("hidden"))); -#define xmlNoNetExternalEntityLoader xmlNoNetExternalEntityLoader__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlNodeAddContent -extern __typeof (xmlNodeAddContent) xmlNodeAddContent __attribute((alias("xmlNodeAddContent__internal_alias"))); -#else -#ifndef xmlNodeAddContent -extern __typeof (xmlNodeAddContent) xmlNodeAddContent__internal_alias __attribute((visibility("hidden"))); -#define xmlNodeAddContent xmlNodeAddContent__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlNodeAddContentLen -extern __typeof (xmlNodeAddContentLen) xmlNodeAddContentLen __attribute((alias("xmlNodeAddContentLen__internal_alias"))); -#else -#ifndef xmlNodeAddContentLen -extern __typeof (xmlNodeAddContentLen) xmlNodeAddContentLen__internal_alias __attribute((visibility("hidden"))); -#define xmlNodeAddContentLen xmlNodeAddContentLen__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlNodeBufGetContent -extern __typeof (xmlNodeBufGetContent) xmlNodeBufGetContent __attribute((alias("xmlNodeBufGetContent__internal_alias"))); -#else -#ifndef xmlNodeBufGetContent -extern __typeof (xmlNodeBufGetContent) xmlNodeBufGetContent__internal_alias __attribute((visibility("hidden"))); -#define xmlNodeBufGetContent xmlNodeBufGetContent__internal_alias -#endif -#endif - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_xmlsave -#undef xmlNodeDump -extern __typeof (xmlNodeDump) xmlNodeDump __attribute((alias("xmlNodeDump__internal_alias"))); -#else -#ifndef xmlNodeDump -extern __typeof (xmlNodeDump) xmlNodeDump__internal_alias __attribute((visibility("hidden"))); -#define xmlNodeDump xmlNodeDump__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_xmlsave -#undef xmlNodeDumpOutput -extern __typeof (xmlNodeDumpOutput) xmlNodeDumpOutput __attribute((alias("xmlNodeDumpOutput__internal_alias"))); -#else -#ifndef xmlNodeDumpOutput -extern __typeof (xmlNodeDumpOutput) xmlNodeDumpOutput__internal_alias __attribute((visibility("hidden"))); -#define xmlNodeDumpOutput xmlNodeDumpOutput__internal_alias -#endif -#endif -#endif - -#ifdef bottom_tree -#undef xmlNodeGetBase -extern __typeof (xmlNodeGetBase) xmlNodeGetBase __attribute((alias("xmlNodeGetBase__internal_alias"))); -#else -#ifndef xmlNodeGetBase -extern __typeof (xmlNodeGetBase) xmlNodeGetBase__internal_alias __attribute((visibility("hidden"))); -#define xmlNodeGetBase xmlNodeGetBase__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlNodeGetContent -extern __typeof (xmlNodeGetContent) xmlNodeGetContent __attribute((alias("xmlNodeGetContent__internal_alias"))); -#else -#ifndef xmlNodeGetContent -extern __typeof (xmlNodeGetContent) xmlNodeGetContent__internal_alias __attribute((visibility("hidden"))); -#define xmlNodeGetContent xmlNodeGetContent__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlNodeGetLang -extern __typeof (xmlNodeGetLang) xmlNodeGetLang __attribute((alias("xmlNodeGetLang__internal_alias"))); -#else -#ifndef xmlNodeGetLang -extern __typeof (xmlNodeGetLang) xmlNodeGetLang__internal_alias __attribute((visibility("hidden"))); -#define xmlNodeGetLang xmlNodeGetLang__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlNodeGetSpacePreserve -extern __typeof (xmlNodeGetSpacePreserve) xmlNodeGetSpacePreserve __attribute((alias("xmlNodeGetSpacePreserve__internal_alias"))); -#else -#ifndef xmlNodeGetSpacePreserve -extern __typeof (xmlNodeGetSpacePreserve) xmlNodeGetSpacePreserve__internal_alias __attribute((visibility("hidden"))); -#define xmlNodeGetSpacePreserve xmlNodeGetSpacePreserve__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlNodeIsText -extern __typeof (xmlNodeIsText) xmlNodeIsText __attribute((alias("xmlNodeIsText__internal_alias"))); -#else -#ifndef xmlNodeIsText -extern __typeof (xmlNodeIsText) xmlNodeIsText__internal_alias __attribute((visibility("hidden"))); -#define xmlNodeIsText xmlNodeIsText__internal_alias -#endif -#endif - -#if defined(LIBXML_TREE_ENABLED) -#ifdef bottom_tree -#undef xmlNodeListGetRawString -extern __typeof (xmlNodeListGetRawString) xmlNodeListGetRawString __attribute((alias("xmlNodeListGetRawString__internal_alias"))); -#else -#ifndef xmlNodeListGetRawString -extern __typeof (xmlNodeListGetRawString) xmlNodeListGetRawString__internal_alias __attribute((visibility("hidden"))); -#define xmlNodeListGetRawString xmlNodeListGetRawString__internal_alias -#endif -#endif -#endif - -#ifdef bottom_tree -#undef xmlNodeListGetString -extern __typeof (xmlNodeListGetString) xmlNodeListGetString __attribute((alias("xmlNodeListGetString__internal_alias"))); -#else -#ifndef xmlNodeListGetString -extern __typeof (xmlNodeListGetString) xmlNodeListGetString__internal_alias __attribute((visibility("hidden"))); -#define xmlNodeListGetString xmlNodeListGetString__internal_alias -#endif -#endif - -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) -#ifdef bottom_tree -#undef xmlNodeSetBase -extern __typeof (xmlNodeSetBase) xmlNodeSetBase __attribute((alias("xmlNodeSetBase__internal_alias"))); -#else -#ifndef xmlNodeSetBase -extern __typeof (xmlNodeSetBase) xmlNodeSetBase__internal_alias __attribute((visibility("hidden"))); -#define xmlNodeSetBase xmlNodeSetBase__internal_alias -#endif -#endif -#endif - -#ifdef bottom_tree -#undef xmlNodeSetContent -extern __typeof (xmlNodeSetContent) xmlNodeSetContent __attribute((alias("xmlNodeSetContent__internal_alias"))); -#else -#ifndef xmlNodeSetContent -extern __typeof (xmlNodeSetContent) xmlNodeSetContent__internal_alias __attribute((visibility("hidden"))); -#define xmlNodeSetContent xmlNodeSetContent__internal_alias -#endif -#endif - -#if defined(LIBXML_TREE_ENABLED) -#ifdef bottom_tree -#undef xmlNodeSetContentLen -extern __typeof (xmlNodeSetContentLen) xmlNodeSetContentLen __attribute((alias("xmlNodeSetContentLen__internal_alias"))); -#else -#ifndef xmlNodeSetContentLen -extern __typeof (xmlNodeSetContentLen) xmlNodeSetContentLen__internal_alias __attribute((visibility("hidden"))); -#define xmlNodeSetContentLen xmlNodeSetContentLen__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_TREE_ENABLED) -#ifdef bottom_tree -#undef xmlNodeSetLang -extern __typeof (xmlNodeSetLang) xmlNodeSetLang __attribute((alias("xmlNodeSetLang__internal_alias"))); -#else -#ifndef xmlNodeSetLang -extern __typeof (xmlNodeSetLang) xmlNodeSetLang__internal_alias __attribute((visibility("hidden"))); -#define xmlNodeSetLang xmlNodeSetLang__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_TREE_ENABLED) -#ifdef bottom_tree -#undef xmlNodeSetName -extern __typeof (xmlNodeSetName) xmlNodeSetName __attribute((alias("xmlNodeSetName__internal_alias"))); -#else -#ifndef xmlNodeSetName -extern __typeof (xmlNodeSetName) xmlNodeSetName__internal_alias __attribute((visibility("hidden"))); -#define xmlNodeSetName xmlNodeSetName__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_TREE_ENABLED) -#ifdef bottom_tree -#undef xmlNodeSetSpacePreserve -extern __typeof (xmlNodeSetSpacePreserve) xmlNodeSetSpacePreserve __attribute((alias("xmlNodeSetSpacePreserve__internal_alias"))); -#else -#ifndef xmlNodeSetSpacePreserve -extern __typeof (xmlNodeSetSpacePreserve) xmlNodeSetSpacePreserve__internal_alias __attribute((visibility("hidden"))); -#define xmlNodeSetSpacePreserve xmlNodeSetSpacePreserve__internal_alias -#endif -#endif -#endif - -#ifdef bottom_uri -#undef xmlNormalizeURIPath -extern __typeof (xmlNormalizeURIPath) xmlNormalizeURIPath __attribute((alias("xmlNormalizeURIPath__internal_alias"))); -#else -#ifndef xmlNormalizeURIPath -extern __typeof (xmlNormalizeURIPath) xmlNormalizeURIPath__internal_alias __attribute((visibility("hidden"))); -#define xmlNormalizeURIPath xmlNormalizeURIPath__internal_alias -#endif -#endif - -#ifdef bottom_xmlIO -#undef xmlNormalizeWindowsPath -extern __typeof (xmlNormalizeWindowsPath) xmlNormalizeWindowsPath __attribute((alias("xmlNormalizeWindowsPath__internal_alias"))); -#else -#ifndef xmlNormalizeWindowsPath -extern __typeof (xmlNormalizeWindowsPath) xmlNormalizeWindowsPath__internal_alias __attribute((visibility("hidden"))); -#define xmlNormalizeWindowsPath xmlNormalizeWindowsPath__internal_alias -#endif -#endif - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_xmlIO -#undef xmlOutputBufferClose -extern __typeof (xmlOutputBufferClose) xmlOutputBufferClose __attribute((alias("xmlOutputBufferClose__internal_alias"))); -#else -#ifndef xmlOutputBufferClose -extern __typeof (xmlOutputBufferClose) xmlOutputBufferClose__internal_alias __attribute((visibility("hidden"))); -#define xmlOutputBufferClose xmlOutputBufferClose__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_xmlIO -#undef xmlOutputBufferCreateBuffer -extern __typeof (xmlOutputBufferCreateBuffer) xmlOutputBufferCreateBuffer __attribute((alias("xmlOutputBufferCreateBuffer__internal_alias"))); -#else -#ifndef xmlOutputBufferCreateBuffer -extern __typeof (xmlOutputBufferCreateBuffer) xmlOutputBufferCreateBuffer__internal_alias __attribute((visibility("hidden"))); -#define xmlOutputBufferCreateBuffer xmlOutputBufferCreateBuffer__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_xmlIO -#undef xmlOutputBufferCreateFd -extern __typeof (xmlOutputBufferCreateFd) xmlOutputBufferCreateFd __attribute((alias("xmlOutputBufferCreateFd__internal_alias"))); -#else -#ifndef xmlOutputBufferCreateFd -extern __typeof (xmlOutputBufferCreateFd) xmlOutputBufferCreateFd__internal_alias __attribute((visibility("hidden"))); -#define xmlOutputBufferCreateFd xmlOutputBufferCreateFd__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_xmlIO -#undef xmlOutputBufferCreateFile -extern __typeof (xmlOutputBufferCreateFile) xmlOutputBufferCreateFile __attribute((alias("xmlOutputBufferCreateFile__internal_alias"))); -#else -#ifndef xmlOutputBufferCreateFile -extern __typeof (xmlOutputBufferCreateFile) xmlOutputBufferCreateFile__internal_alias __attribute((visibility("hidden"))); -#define xmlOutputBufferCreateFile xmlOutputBufferCreateFile__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_xmlIO -#undef xmlOutputBufferCreateFilename -extern __typeof (xmlOutputBufferCreateFilename) xmlOutputBufferCreateFilename __attribute((alias("xmlOutputBufferCreateFilename__internal_alias"))); -#else -#ifndef xmlOutputBufferCreateFilename -extern __typeof (xmlOutputBufferCreateFilename) xmlOutputBufferCreateFilename__internal_alias __attribute((visibility("hidden"))); -#define xmlOutputBufferCreateFilename xmlOutputBufferCreateFilename__internal_alias -#endif -#endif -#endif - -#ifdef bottom_xmlIO -#undef xmlOutputBufferCreateFilenameDefault -extern __typeof (xmlOutputBufferCreateFilenameDefault) xmlOutputBufferCreateFilenameDefault __attribute((alias("xmlOutputBufferCreateFilenameDefault__internal_alias"))); -#else -#ifndef xmlOutputBufferCreateFilenameDefault -extern __typeof (xmlOutputBufferCreateFilenameDefault) xmlOutputBufferCreateFilenameDefault__internal_alias __attribute((visibility("hidden"))); -#define xmlOutputBufferCreateFilenameDefault xmlOutputBufferCreateFilenameDefault__internal_alias -#endif -#endif - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_xmlIO -#undef xmlOutputBufferCreateIO -extern __typeof (xmlOutputBufferCreateIO) xmlOutputBufferCreateIO __attribute((alias("xmlOutputBufferCreateIO__internal_alias"))); -#else -#ifndef xmlOutputBufferCreateIO -extern __typeof (xmlOutputBufferCreateIO) xmlOutputBufferCreateIO__internal_alias __attribute((visibility("hidden"))); -#define xmlOutputBufferCreateIO xmlOutputBufferCreateIO__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_xmlIO -#undef xmlOutputBufferFlush -extern __typeof (xmlOutputBufferFlush) xmlOutputBufferFlush __attribute((alias("xmlOutputBufferFlush__internal_alias"))); -#else -#ifndef xmlOutputBufferFlush -extern __typeof (xmlOutputBufferFlush) xmlOutputBufferFlush__internal_alias __attribute((visibility("hidden"))); -#define xmlOutputBufferFlush xmlOutputBufferFlush__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_xmlIO -#undef xmlOutputBufferGetContent -extern __typeof (xmlOutputBufferGetContent) xmlOutputBufferGetContent __attribute((alias("xmlOutputBufferGetContent__internal_alias"))); -#else -#ifndef xmlOutputBufferGetContent -extern __typeof (xmlOutputBufferGetContent) xmlOutputBufferGetContent__internal_alias __attribute((visibility("hidden"))); -#define xmlOutputBufferGetContent xmlOutputBufferGetContent__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_xmlIO -#undef xmlOutputBufferGetSize -extern __typeof (xmlOutputBufferGetSize) xmlOutputBufferGetSize __attribute((alias("xmlOutputBufferGetSize__internal_alias"))); -#else -#ifndef xmlOutputBufferGetSize -extern __typeof (xmlOutputBufferGetSize) xmlOutputBufferGetSize__internal_alias __attribute((visibility("hidden"))); -#define xmlOutputBufferGetSize xmlOutputBufferGetSize__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_xmlIO -#undef xmlOutputBufferWrite -extern __typeof (xmlOutputBufferWrite) xmlOutputBufferWrite __attribute((alias("xmlOutputBufferWrite__internal_alias"))); -#else -#ifndef xmlOutputBufferWrite -extern __typeof (xmlOutputBufferWrite) xmlOutputBufferWrite__internal_alias __attribute((visibility("hidden"))); -#define xmlOutputBufferWrite xmlOutputBufferWrite__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_xmlIO -#undef xmlOutputBufferWriteEscape -extern __typeof (xmlOutputBufferWriteEscape) xmlOutputBufferWriteEscape __attribute((alias("xmlOutputBufferWriteEscape__internal_alias"))); -#else -#ifndef xmlOutputBufferWriteEscape -extern __typeof (xmlOutputBufferWriteEscape) xmlOutputBufferWriteEscape__internal_alias __attribute((visibility("hidden"))); -#define xmlOutputBufferWriteEscape xmlOutputBufferWriteEscape__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_xmlIO -#undef xmlOutputBufferWriteString -extern __typeof (xmlOutputBufferWriteString) xmlOutputBufferWriteString __attribute((alias("xmlOutputBufferWriteString__internal_alias"))); -#else -#ifndef xmlOutputBufferWriteString -extern __typeof (xmlOutputBufferWriteString) xmlOutputBufferWriteString__internal_alias __attribute((visibility("hidden"))); -#define xmlOutputBufferWriteString xmlOutputBufferWriteString__internal_alias -#endif -#endif -#endif - -#ifdef bottom_parser -#undef xmlParseAttValue -extern __typeof (xmlParseAttValue) xmlParseAttValue __attribute((alias("xmlParseAttValue__internal_alias"))); -#else -#ifndef xmlParseAttValue -extern __typeof (xmlParseAttValue) xmlParseAttValue__internal_alias __attribute((visibility("hidden"))); -#define xmlParseAttValue xmlParseAttValue__internal_alias -#endif -#endif - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef bottom_parser -#undef xmlParseAttribute -extern __typeof (xmlParseAttribute) xmlParseAttribute __attribute((alias("xmlParseAttribute__internal_alias"))); -#else -#ifndef xmlParseAttribute -extern __typeof (xmlParseAttribute) xmlParseAttribute__internal_alias __attribute((visibility("hidden"))); -#define xmlParseAttribute xmlParseAttribute__internal_alias -#endif -#endif -#endif - -#ifdef bottom_parser -#undef xmlParseAttributeListDecl -extern __typeof (xmlParseAttributeListDecl) xmlParseAttributeListDecl __attribute((alias("xmlParseAttributeListDecl__internal_alias"))); -#else -#ifndef xmlParseAttributeListDecl -extern __typeof (xmlParseAttributeListDecl) xmlParseAttributeListDecl__internal_alias __attribute((visibility("hidden"))); -#define xmlParseAttributeListDecl xmlParseAttributeListDecl__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlParseAttributeType -extern __typeof (xmlParseAttributeType) xmlParseAttributeType __attribute((alias("xmlParseAttributeType__internal_alias"))); -#else -#ifndef xmlParseAttributeType -extern __typeof (xmlParseAttributeType) xmlParseAttributeType__internal_alias __attribute((visibility("hidden"))); -#define xmlParseAttributeType xmlParseAttributeType__internal_alias -#endif -#endif - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef bottom_parser -#undef xmlParseBalancedChunkMemory -extern __typeof (xmlParseBalancedChunkMemory) xmlParseBalancedChunkMemory __attribute((alias("xmlParseBalancedChunkMemory__internal_alias"))); -#else -#ifndef xmlParseBalancedChunkMemory -extern __typeof (xmlParseBalancedChunkMemory) xmlParseBalancedChunkMemory__internal_alias __attribute((visibility("hidden"))); -#define xmlParseBalancedChunkMemory xmlParseBalancedChunkMemory__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef bottom_parser -#undef xmlParseBalancedChunkMemoryRecover -extern __typeof (xmlParseBalancedChunkMemoryRecover) xmlParseBalancedChunkMemoryRecover __attribute((alias("xmlParseBalancedChunkMemoryRecover__internal_alias"))); -#else -#ifndef xmlParseBalancedChunkMemoryRecover -extern __typeof (xmlParseBalancedChunkMemoryRecover) xmlParseBalancedChunkMemoryRecover__internal_alias __attribute((visibility("hidden"))); -#define xmlParseBalancedChunkMemoryRecover xmlParseBalancedChunkMemoryRecover__internal_alias -#endif -#endif -#endif - -#ifdef bottom_parser -#undef xmlParseCDSect -extern __typeof (xmlParseCDSect) xmlParseCDSect __attribute((alias("xmlParseCDSect__internal_alias"))); -#else -#ifndef xmlParseCDSect -extern __typeof (xmlParseCDSect) xmlParseCDSect__internal_alias __attribute((visibility("hidden"))); -#define xmlParseCDSect xmlParseCDSect__internal_alias -#endif -#endif - -#if defined(LIBXML_CATALOG_ENABLED) -#ifdef bottom_catalog -#undef xmlParseCatalogFile -extern __typeof (xmlParseCatalogFile) xmlParseCatalogFile __attribute((alias("xmlParseCatalogFile__internal_alias"))); -#else -#ifndef xmlParseCatalogFile -extern __typeof (xmlParseCatalogFile) xmlParseCatalogFile__internal_alias __attribute((visibility("hidden"))); -#define xmlParseCatalogFile xmlParseCatalogFile__internal_alias -#endif -#endif -#endif - -#ifdef bottom_parser -#undef xmlParseCharData -extern __typeof (xmlParseCharData) xmlParseCharData __attribute((alias("xmlParseCharData__internal_alias"))); -#else -#ifndef xmlParseCharData -extern __typeof (xmlParseCharData) xmlParseCharData__internal_alias __attribute((visibility("hidden"))); -#define xmlParseCharData xmlParseCharData__internal_alias -#endif -#endif - -#ifdef bottom_encoding -#undef xmlParseCharEncoding -extern __typeof (xmlParseCharEncoding) xmlParseCharEncoding __attribute((alias("xmlParseCharEncoding__internal_alias"))); -#else -#ifndef xmlParseCharEncoding -extern __typeof (xmlParseCharEncoding) xmlParseCharEncoding__internal_alias __attribute((visibility("hidden"))); -#define xmlParseCharEncoding xmlParseCharEncoding__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlParseCharRef -extern __typeof (xmlParseCharRef) xmlParseCharRef __attribute((alias("xmlParseCharRef__internal_alias"))); -#else -#ifndef xmlParseCharRef -extern __typeof (xmlParseCharRef) xmlParseCharRef__internal_alias __attribute((visibility("hidden"))); -#define xmlParseCharRef xmlParseCharRef__internal_alias -#endif -#endif - -#if defined(LIBXML_PUSH_ENABLED) -#ifdef bottom_parser -#undef xmlParseChunk -extern __typeof (xmlParseChunk) xmlParseChunk __attribute((alias("xmlParseChunk__internal_alias"))); -#else -#ifndef xmlParseChunk -extern __typeof (xmlParseChunk) xmlParseChunk__internal_alias __attribute((visibility("hidden"))); -#define xmlParseChunk xmlParseChunk__internal_alias -#endif -#endif -#endif - -#ifdef bottom_parser -#undef xmlParseComment -extern __typeof (xmlParseComment) xmlParseComment __attribute((alias("xmlParseComment__internal_alias"))); -#else -#ifndef xmlParseComment -extern __typeof (xmlParseComment) xmlParseComment__internal_alias __attribute((visibility("hidden"))); -#define xmlParseComment xmlParseComment__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlParseContent -extern __typeof (xmlParseContent) xmlParseContent __attribute((alias("xmlParseContent__internal_alias"))); -#else -#ifndef xmlParseContent -extern __typeof (xmlParseContent) xmlParseContent__internal_alias __attribute((visibility("hidden"))); -#define xmlParseContent xmlParseContent__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlParseCtxtExternalEntity -extern __typeof (xmlParseCtxtExternalEntity) xmlParseCtxtExternalEntity __attribute((alias("xmlParseCtxtExternalEntity__internal_alias"))); -#else -#ifndef xmlParseCtxtExternalEntity -extern __typeof (xmlParseCtxtExternalEntity) xmlParseCtxtExternalEntity__internal_alias __attribute((visibility("hidden"))); -#define xmlParseCtxtExternalEntity xmlParseCtxtExternalEntity__internal_alias -#endif -#endif - -#if defined(LIBXML_VALID_ENABLED) -#ifdef bottom_parser -#undef xmlParseDTD -extern __typeof (xmlParseDTD) xmlParseDTD __attribute((alias("xmlParseDTD__internal_alias"))); -#else -#ifndef xmlParseDTD -extern __typeof (xmlParseDTD) xmlParseDTD__internal_alias __attribute((visibility("hidden"))); -#define xmlParseDTD xmlParseDTD__internal_alias -#endif -#endif -#endif - -#ifdef bottom_parser -#undef xmlParseDefaultDecl -extern __typeof (xmlParseDefaultDecl) xmlParseDefaultDecl __attribute((alias("xmlParseDefaultDecl__internal_alias"))); -#else -#ifndef xmlParseDefaultDecl -extern __typeof (xmlParseDefaultDecl) xmlParseDefaultDecl__internal_alias __attribute((visibility("hidden"))); -#define xmlParseDefaultDecl xmlParseDefaultDecl__internal_alias -#endif -#endif - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef bottom_parser -#undef xmlParseDoc -extern __typeof (xmlParseDoc) xmlParseDoc __attribute((alias("xmlParseDoc__internal_alias"))); -#else -#ifndef xmlParseDoc -extern __typeof (xmlParseDoc) xmlParseDoc__internal_alias __attribute((visibility("hidden"))); -#define xmlParseDoc xmlParseDoc__internal_alias -#endif -#endif -#endif - -#ifdef bottom_parser -#undef xmlParseDocTypeDecl -extern __typeof (xmlParseDocTypeDecl) xmlParseDocTypeDecl __attribute((alias("xmlParseDocTypeDecl__internal_alias"))); -#else -#ifndef xmlParseDocTypeDecl -extern __typeof (xmlParseDocTypeDecl) xmlParseDocTypeDecl__internal_alias __attribute((visibility("hidden"))); -#define xmlParseDocTypeDecl xmlParseDocTypeDecl__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlParseDocument -extern __typeof (xmlParseDocument) xmlParseDocument __attribute((alias("xmlParseDocument__internal_alias"))); -#else -#ifndef xmlParseDocument -extern __typeof (xmlParseDocument) xmlParseDocument__internal_alias __attribute((visibility("hidden"))); -#define xmlParseDocument xmlParseDocument__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlParseElement -extern __typeof (xmlParseElement) xmlParseElement __attribute((alias("xmlParseElement__internal_alias"))); -#else -#ifndef xmlParseElement -extern __typeof (xmlParseElement) xmlParseElement__internal_alias __attribute((visibility("hidden"))); -#define xmlParseElement xmlParseElement__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlParseElementChildrenContentDecl -extern __typeof (xmlParseElementChildrenContentDecl) xmlParseElementChildrenContentDecl __attribute((alias("xmlParseElementChildrenContentDecl__internal_alias"))); -#else -#ifndef xmlParseElementChildrenContentDecl -extern __typeof (xmlParseElementChildrenContentDecl) xmlParseElementChildrenContentDecl__internal_alias __attribute((visibility("hidden"))); -#define xmlParseElementChildrenContentDecl xmlParseElementChildrenContentDecl__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlParseElementContentDecl -extern __typeof (xmlParseElementContentDecl) xmlParseElementContentDecl __attribute((alias("xmlParseElementContentDecl__internal_alias"))); -#else -#ifndef xmlParseElementContentDecl -extern __typeof (xmlParseElementContentDecl) xmlParseElementContentDecl__internal_alias __attribute((visibility("hidden"))); -#define xmlParseElementContentDecl xmlParseElementContentDecl__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlParseElementDecl -extern __typeof (xmlParseElementDecl) xmlParseElementDecl __attribute((alias("xmlParseElementDecl__internal_alias"))); -#else -#ifndef xmlParseElementDecl -extern __typeof (xmlParseElementDecl) xmlParseElementDecl__internal_alias __attribute((visibility("hidden"))); -#define xmlParseElementDecl xmlParseElementDecl__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlParseElementMixedContentDecl -extern __typeof (xmlParseElementMixedContentDecl) xmlParseElementMixedContentDecl __attribute((alias("xmlParseElementMixedContentDecl__internal_alias"))); -#else -#ifndef xmlParseElementMixedContentDecl -extern __typeof (xmlParseElementMixedContentDecl) xmlParseElementMixedContentDecl__internal_alias __attribute((visibility("hidden"))); -#define xmlParseElementMixedContentDecl xmlParseElementMixedContentDecl__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlParseEncName -extern __typeof (xmlParseEncName) xmlParseEncName __attribute((alias("xmlParseEncName__internal_alias"))); -#else -#ifndef xmlParseEncName -extern __typeof (xmlParseEncName) xmlParseEncName__internal_alias __attribute((visibility("hidden"))); -#define xmlParseEncName xmlParseEncName__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlParseEncodingDecl -extern __typeof (xmlParseEncodingDecl) xmlParseEncodingDecl __attribute((alias("xmlParseEncodingDecl__internal_alias"))); -#else -#ifndef xmlParseEncodingDecl -extern __typeof (xmlParseEncodingDecl) xmlParseEncodingDecl__internal_alias __attribute((visibility("hidden"))); -#define xmlParseEncodingDecl xmlParseEncodingDecl__internal_alias -#endif -#endif - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef bottom_parser -#undef xmlParseEndTag -extern __typeof (xmlParseEndTag) xmlParseEndTag __attribute((alias("xmlParseEndTag__internal_alias"))); -#else -#ifndef xmlParseEndTag -extern __typeof (xmlParseEndTag) xmlParseEndTag__internal_alias __attribute((visibility("hidden"))); -#define xmlParseEndTag xmlParseEndTag__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef bottom_parser -#undef xmlParseEntity -extern __typeof (xmlParseEntity) xmlParseEntity __attribute((alias("xmlParseEntity__internal_alias"))); -#else -#ifndef xmlParseEntity -extern __typeof (xmlParseEntity) xmlParseEntity__internal_alias __attribute((visibility("hidden"))); -#define xmlParseEntity xmlParseEntity__internal_alias -#endif -#endif -#endif - -#ifdef bottom_parser -#undef xmlParseEntityDecl -extern __typeof (xmlParseEntityDecl) xmlParseEntityDecl __attribute((alias("xmlParseEntityDecl__internal_alias"))); -#else -#ifndef xmlParseEntityDecl -extern __typeof (xmlParseEntityDecl) xmlParseEntityDecl__internal_alias __attribute((visibility("hidden"))); -#define xmlParseEntityDecl xmlParseEntityDecl__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlParseEntityRef -extern __typeof (xmlParseEntityRef) xmlParseEntityRef __attribute((alias("xmlParseEntityRef__internal_alias"))); -#else -#ifndef xmlParseEntityRef -extern __typeof (xmlParseEntityRef) xmlParseEntityRef__internal_alias __attribute((visibility("hidden"))); -#define xmlParseEntityRef xmlParseEntityRef__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlParseEntityValue -extern __typeof (xmlParseEntityValue) xmlParseEntityValue __attribute((alias("xmlParseEntityValue__internal_alias"))); -#else -#ifndef xmlParseEntityValue -extern __typeof (xmlParseEntityValue) xmlParseEntityValue__internal_alias __attribute((visibility("hidden"))); -#define xmlParseEntityValue xmlParseEntityValue__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlParseEnumeratedType -extern __typeof (xmlParseEnumeratedType) xmlParseEnumeratedType __attribute((alias("xmlParseEnumeratedType__internal_alias"))); -#else -#ifndef xmlParseEnumeratedType -extern __typeof (xmlParseEnumeratedType) xmlParseEnumeratedType__internal_alias __attribute((visibility("hidden"))); -#define xmlParseEnumeratedType xmlParseEnumeratedType__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlParseEnumerationType -extern __typeof (xmlParseEnumerationType) xmlParseEnumerationType __attribute((alias("xmlParseEnumerationType__internal_alias"))); -#else -#ifndef xmlParseEnumerationType -extern __typeof (xmlParseEnumerationType) xmlParseEnumerationType__internal_alias __attribute((visibility("hidden"))); -#define xmlParseEnumerationType xmlParseEnumerationType__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlParseExtParsedEnt -extern __typeof (xmlParseExtParsedEnt) xmlParseExtParsedEnt __attribute((alias("xmlParseExtParsedEnt__internal_alias"))); -#else -#ifndef xmlParseExtParsedEnt -extern __typeof (xmlParseExtParsedEnt) xmlParseExtParsedEnt__internal_alias __attribute((visibility("hidden"))); -#define xmlParseExtParsedEnt xmlParseExtParsedEnt__internal_alias -#endif -#endif - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef bottom_parser -#undef xmlParseExternalEntity -extern __typeof (xmlParseExternalEntity) xmlParseExternalEntity __attribute((alias("xmlParseExternalEntity__internal_alias"))); -#else -#ifndef xmlParseExternalEntity -extern __typeof (xmlParseExternalEntity) xmlParseExternalEntity__internal_alias __attribute((visibility("hidden"))); -#define xmlParseExternalEntity xmlParseExternalEntity__internal_alias -#endif -#endif -#endif - -#ifdef bottom_parser -#undef xmlParseExternalID -extern __typeof (xmlParseExternalID) xmlParseExternalID __attribute((alias("xmlParseExternalID__internal_alias"))); -#else -#ifndef xmlParseExternalID -extern __typeof (xmlParseExternalID) xmlParseExternalID__internal_alias __attribute((visibility("hidden"))); -#define xmlParseExternalID xmlParseExternalID__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlParseExternalSubset -extern __typeof (xmlParseExternalSubset) xmlParseExternalSubset __attribute((alias("xmlParseExternalSubset__internal_alias"))); -#else -#ifndef xmlParseExternalSubset -extern __typeof (xmlParseExternalSubset) xmlParseExternalSubset__internal_alias __attribute((visibility("hidden"))); -#define xmlParseExternalSubset xmlParseExternalSubset__internal_alias -#endif -#endif - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef bottom_parser -#undef xmlParseFile -extern __typeof (xmlParseFile) xmlParseFile __attribute((alias("xmlParseFile__internal_alias"))); -#else -#ifndef xmlParseFile -extern __typeof (xmlParseFile) xmlParseFile__internal_alias __attribute((visibility("hidden"))); -#define xmlParseFile xmlParseFile__internal_alias -#endif -#endif -#endif - -#ifdef bottom_parser -#undef xmlParseInNodeContext -extern __typeof (xmlParseInNodeContext) xmlParseInNodeContext __attribute((alias("xmlParseInNodeContext__internal_alias"))); -#else -#ifndef xmlParseInNodeContext -extern __typeof (xmlParseInNodeContext) xmlParseInNodeContext__internal_alias __attribute((visibility("hidden"))); -#define xmlParseInNodeContext xmlParseInNodeContext__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlParseMarkupDecl -extern __typeof (xmlParseMarkupDecl) xmlParseMarkupDecl __attribute((alias("xmlParseMarkupDecl__internal_alias"))); -#else -#ifndef xmlParseMarkupDecl -extern __typeof (xmlParseMarkupDecl) xmlParseMarkupDecl__internal_alias __attribute((visibility("hidden"))); -#define xmlParseMarkupDecl xmlParseMarkupDecl__internal_alias -#endif -#endif - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef bottom_parser -#undef xmlParseMemory -extern __typeof (xmlParseMemory) xmlParseMemory __attribute((alias("xmlParseMemory__internal_alias"))); -#else -#ifndef xmlParseMemory -extern __typeof (xmlParseMemory) xmlParseMemory__internal_alias __attribute((visibility("hidden"))); -#define xmlParseMemory xmlParseMemory__internal_alias -#endif -#endif -#endif - -#ifdef bottom_parser -#undef xmlParseMisc -extern __typeof (xmlParseMisc) xmlParseMisc __attribute((alias("xmlParseMisc__internal_alias"))); -#else -#ifndef xmlParseMisc -extern __typeof (xmlParseMisc) xmlParseMisc__internal_alias __attribute((visibility("hidden"))); -#define xmlParseMisc xmlParseMisc__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlParseName -extern __typeof (xmlParseName) xmlParseName __attribute((alias("xmlParseName__internal_alias"))); -#else -#ifndef xmlParseName -extern __typeof (xmlParseName) xmlParseName__internal_alias __attribute((visibility("hidden"))); -#define xmlParseName xmlParseName__internal_alias -#endif -#endif - -#if defined(LIBXML_LEGACY_ENABLED) -#ifdef bottom_legacy -#undef xmlParseNamespace -extern __typeof (xmlParseNamespace) xmlParseNamespace __attribute((alias("xmlParseNamespace__internal_alias"))); -#else -#ifndef xmlParseNamespace -extern __typeof (xmlParseNamespace) xmlParseNamespace__internal_alias __attribute((visibility("hidden"))); -#define xmlParseNamespace xmlParseNamespace__internal_alias -#endif -#endif -#endif - -#ifdef bottom_parser -#undef xmlParseNmtoken -extern __typeof (xmlParseNmtoken) xmlParseNmtoken __attribute((alias("xmlParseNmtoken__internal_alias"))); -#else -#ifndef xmlParseNmtoken -extern __typeof (xmlParseNmtoken) xmlParseNmtoken__internal_alias __attribute((visibility("hidden"))); -#define xmlParseNmtoken xmlParseNmtoken__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlParseNotationDecl -extern __typeof (xmlParseNotationDecl) xmlParseNotationDecl __attribute((alias("xmlParseNotationDecl__internal_alias"))); -#else -#ifndef xmlParseNotationDecl -extern __typeof (xmlParseNotationDecl) xmlParseNotationDecl__internal_alias __attribute((visibility("hidden"))); -#define xmlParseNotationDecl xmlParseNotationDecl__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlParseNotationType -extern __typeof (xmlParseNotationType) xmlParseNotationType __attribute((alias("xmlParseNotationType__internal_alias"))); -#else -#ifndef xmlParseNotationType -extern __typeof (xmlParseNotationType) xmlParseNotationType__internal_alias __attribute((visibility("hidden"))); -#define xmlParseNotationType xmlParseNotationType__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlParsePEReference -extern __typeof (xmlParsePEReference) xmlParsePEReference __attribute((alias("xmlParsePEReference__internal_alias"))); -#else -#ifndef xmlParsePEReference -extern __typeof (xmlParsePEReference) xmlParsePEReference__internal_alias __attribute((visibility("hidden"))); -#define xmlParsePEReference xmlParsePEReference__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlParsePI -extern __typeof (xmlParsePI) xmlParsePI __attribute((alias("xmlParsePI__internal_alias"))); -#else -#ifndef xmlParsePI -extern __typeof (xmlParsePI) xmlParsePI__internal_alias __attribute((visibility("hidden"))); -#define xmlParsePI xmlParsePI__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlParsePITarget -extern __typeof (xmlParsePITarget) xmlParsePITarget __attribute((alias("xmlParsePITarget__internal_alias"))); -#else -#ifndef xmlParsePITarget -extern __typeof (xmlParsePITarget) xmlParsePITarget__internal_alias __attribute((visibility("hidden"))); -#define xmlParsePITarget xmlParsePITarget__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlParsePubidLiteral -extern __typeof (xmlParsePubidLiteral) xmlParsePubidLiteral __attribute((alias("xmlParsePubidLiteral__internal_alias"))); -#else -#ifndef xmlParsePubidLiteral -extern __typeof (xmlParsePubidLiteral) xmlParsePubidLiteral__internal_alias __attribute((visibility("hidden"))); -#define xmlParsePubidLiteral xmlParsePubidLiteral__internal_alias -#endif -#endif - -#if defined(LIBXML_LEGACY_ENABLED) -#ifdef bottom_legacy -#undef xmlParseQuotedString -extern __typeof (xmlParseQuotedString) xmlParseQuotedString __attribute((alias("xmlParseQuotedString__internal_alias"))); -#else -#ifndef xmlParseQuotedString -extern __typeof (xmlParseQuotedString) xmlParseQuotedString__internal_alias __attribute((visibility("hidden"))); -#define xmlParseQuotedString xmlParseQuotedString__internal_alias -#endif -#endif -#endif - -#ifdef bottom_parser -#undef xmlParseReference -extern __typeof (xmlParseReference) xmlParseReference __attribute((alias("xmlParseReference__internal_alias"))); -#else -#ifndef xmlParseReference -extern __typeof (xmlParseReference) xmlParseReference__internal_alias __attribute((visibility("hidden"))); -#define xmlParseReference xmlParseReference__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlParseSDDecl -extern __typeof (xmlParseSDDecl) xmlParseSDDecl __attribute((alias("xmlParseSDDecl__internal_alias"))); -#else -#ifndef xmlParseSDDecl -extern __typeof (xmlParseSDDecl) xmlParseSDDecl__internal_alias __attribute((visibility("hidden"))); -#define xmlParseSDDecl xmlParseSDDecl__internal_alias -#endif -#endif - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef bottom_parser -#undef xmlParseStartTag -extern __typeof (xmlParseStartTag) xmlParseStartTag __attribute((alias("xmlParseStartTag__internal_alias"))); -#else -#ifndef xmlParseStartTag -extern __typeof (xmlParseStartTag) xmlParseStartTag__internal_alias __attribute((visibility("hidden"))); -#define xmlParseStartTag xmlParseStartTag__internal_alias -#endif -#endif -#endif - -#ifdef bottom_parser -#undef xmlParseSystemLiteral -extern __typeof (xmlParseSystemLiteral) xmlParseSystemLiteral __attribute((alias("xmlParseSystemLiteral__internal_alias"))); -#else -#ifndef xmlParseSystemLiteral -extern __typeof (xmlParseSystemLiteral) xmlParseSystemLiteral__internal_alias __attribute((visibility("hidden"))); -#define xmlParseSystemLiteral xmlParseSystemLiteral__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlParseTextDecl -extern __typeof (xmlParseTextDecl) xmlParseTextDecl __attribute((alias("xmlParseTextDecl__internal_alias"))); -#else -#ifndef xmlParseTextDecl -extern __typeof (xmlParseTextDecl) xmlParseTextDecl__internal_alias __attribute((visibility("hidden"))); -#define xmlParseTextDecl xmlParseTextDecl__internal_alias -#endif -#endif - -#ifdef bottom_uri -#undef xmlParseURI -extern __typeof (xmlParseURI) xmlParseURI __attribute((alias("xmlParseURI__internal_alias"))); -#else -#ifndef xmlParseURI -extern __typeof (xmlParseURI) xmlParseURI__internal_alias __attribute((visibility("hidden"))); -#define xmlParseURI xmlParseURI__internal_alias -#endif -#endif - -#ifdef bottom_uri -#undef xmlParseURIRaw -extern __typeof (xmlParseURIRaw) xmlParseURIRaw __attribute((alias("xmlParseURIRaw__internal_alias"))); -#else -#ifndef xmlParseURIRaw -extern __typeof (xmlParseURIRaw) xmlParseURIRaw__internal_alias __attribute((visibility("hidden"))); -#define xmlParseURIRaw xmlParseURIRaw__internal_alias -#endif -#endif - -#ifdef bottom_uri -#undef xmlParseURIReference -extern __typeof (xmlParseURIReference) xmlParseURIReference __attribute((alias("xmlParseURIReference__internal_alias"))); -#else -#ifndef xmlParseURIReference -extern __typeof (xmlParseURIReference) xmlParseURIReference__internal_alias __attribute((visibility("hidden"))); -#define xmlParseURIReference xmlParseURIReference__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlParseVersionInfo -extern __typeof (xmlParseVersionInfo) xmlParseVersionInfo __attribute((alias("xmlParseVersionInfo__internal_alias"))); -#else -#ifndef xmlParseVersionInfo -extern __typeof (xmlParseVersionInfo) xmlParseVersionInfo__internal_alias __attribute((visibility("hidden"))); -#define xmlParseVersionInfo xmlParseVersionInfo__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlParseVersionNum -extern __typeof (xmlParseVersionNum) xmlParseVersionNum __attribute((alias("xmlParseVersionNum__internal_alias"))); -#else -#ifndef xmlParseVersionNum -extern __typeof (xmlParseVersionNum) xmlParseVersionNum__internal_alias __attribute((visibility("hidden"))); -#define xmlParseVersionNum xmlParseVersionNum__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlParseXMLDecl -extern __typeof (xmlParseXMLDecl) xmlParseXMLDecl __attribute((alias("xmlParseXMLDecl__internal_alias"))); -#else -#ifndef xmlParseXMLDecl -extern __typeof (xmlParseXMLDecl) xmlParseXMLDecl__internal_alias __attribute((visibility("hidden"))); -#define xmlParseXMLDecl xmlParseXMLDecl__internal_alias -#endif -#endif - -#ifdef bottom_parserInternals -#undef xmlParserAddNodeInfo -extern __typeof (xmlParserAddNodeInfo) xmlParserAddNodeInfo __attribute((alias("xmlParserAddNodeInfo__internal_alias"))); -#else -#ifndef xmlParserAddNodeInfo -extern __typeof (xmlParserAddNodeInfo) xmlParserAddNodeInfo__internal_alias __attribute((visibility("hidden"))); -#define xmlParserAddNodeInfo xmlParserAddNodeInfo__internal_alias -#endif -#endif - -#ifdef bottom_error -#undef xmlParserError -extern __typeof (xmlParserError) xmlParserError __attribute((alias("xmlParserError__internal_alias"))); -#else -#ifndef xmlParserError -extern __typeof (xmlParserError) xmlParserError__internal_alias __attribute((visibility("hidden"))); -#define xmlParserError xmlParserError__internal_alias -#endif -#endif - -#ifdef bottom_parserInternals -#undef xmlParserFindNodeInfo -extern __typeof (xmlParserFindNodeInfo) xmlParserFindNodeInfo __attribute((alias("xmlParserFindNodeInfo__internal_alias"))); -#else -#ifndef xmlParserFindNodeInfo -extern __typeof (xmlParserFindNodeInfo) xmlParserFindNodeInfo__internal_alias __attribute((visibility("hidden"))); -#define xmlParserFindNodeInfo xmlParserFindNodeInfo__internal_alias -#endif -#endif - -#ifdef bottom_parserInternals -#undef xmlParserFindNodeInfoIndex -extern __typeof (xmlParserFindNodeInfoIndex) xmlParserFindNodeInfoIndex __attribute((alias("xmlParserFindNodeInfoIndex__internal_alias"))); -#else -#ifndef xmlParserFindNodeInfoIndex -extern __typeof (xmlParserFindNodeInfoIndex) xmlParserFindNodeInfoIndex__internal_alias __attribute((visibility("hidden"))); -#define xmlParserFindNodeInfoIndex xmlParserFindNodeInfoIndex__internal_alias -#endif -#endif - -#ifdef bottom_xmlIO -#undef xmlParserGetDirectory -extern __typeof (xmlParserGetDirectory) xmlParserGetDirectory __attribute((alias("xmlParserGetDirectory__internal_alias"))); -#else -#ifndef xmlParserGetDirectory -extern __typeof (xmlParserGetDirectory) xmlParserGetDirectory__internal_alias __attribute((visibility("hidden"))); -#define xmlParserGetDirectory xmlParserGetDirectory__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlParserHandlePEReference -extern __typeof (xmlParserHandlePEReference) xmlParserHandlePEReference __attribute((alias("xmlParserHandlePEReference__internal_alias"))); -#else -#ifndef xmlParserHandlePEReference -extern __typeof (xmlParserHandlePEReference) xmlParserHandlePEReference__internal_alias __attribute((visibility("hidden"))); -#define xmlParserHandlePEReference xmlParserHandlePEReference__internal_alias -#endif -#endif - -#if defined(LIBXML_LEGACY_ENABLED) -#ifdef bottom_legacy -#undef xmlParserHandleReference -extern __typeof (xmlParserHandleReference) xmlParserHandleReference __attribute((alias("xmlParserHandleReference__internal_alias"))); -#else -#ifndef xmlParserHandleReference -extern __typeof (xmlParserHandleReference) xmlParserHandleReference__internal_alias __attribute((visibility("hidden"))); -#define xmlParserHandleReference xmlParserHandleReference__internal_alias -#endif -#endif -#endif - -#ifdef bottom_xmlIO -#undef xmlParserInputBufferCreateFd -extern __typeof (xmlParserInputBufferCreateFd) xmlParserInputBufferCreateFd __attribute((alias("xmlParserInputBufferCreateFd__internal_alias"))); -#else -#ifndef xmlParserInputBufferCreateFd -extern __typeof (xmlParserInputBufferCreateFd) xmlParserInputBufferCreateFd__internal_alias __attribute((visibility("hidden"))); -#define xmlParserInputBufferCreateFd xmlParserInputBufferCreateFd__internal_alias -#endif -#endif - -#ifdef bottom_xmlIO -#undef xmlParserInputBufferCreateFile -extern __typeof (xmlParserInputBufferCreateFile) xmlParserInputBufferCreateFile __attribute((alias("xmlParserInputBufferCreateFile__internal_alias"))); -#else -#ifndef xmlParserInputBufferCreateFile -extern __typeof (xmlParserInputBufferCreateFile) xmlParserInputBufferCreateFile__internal_alias __attribute((visibility("hidden"))); -#define xmlParserInputBufferCreateFile xmlParserInputBufferCreateFile__internal_alias -#endif -#endif - -#ifdef bottom_xmlIO -#undef xmlParserInputBufferCreateFilename -extern __typeof (xmlParserInputBufferCreateFilename) xmlParserInputBufferCreateFilename __attribute((alias("xmlParserInputBufferCreateFilename__internal_alias"))); -#else -#ifndef xmlParserInputBufferCreateFilename -extern __typeof (xmlParserInputBufferCreateFilename) xmlParserInputBufferCreateFilename__internal_alias __attribute((visibility("hidden"))); -#define xmlParserInputBufferCreateFilename xmlParserInputBufferCreateFilename__internal_alias -#endif -#endif - -#ifdef bottom_xmlIO -#undef xmlParserInputBufferCreateFilenameDefault -extern __typeof (xmlParserInputBufferCreateFilenameDefault) xmlParserInputBufferCreateFilenameDefault __attribute((alias("xmlParserInputBufferCreateFilenameDefault__internal_alias"))); -#else -#ifndef xmlParserInputBufferCreateFilenameDefault -extern __typeof (xmlParserInputBufferCreateFilenameDefault) xmlParserInputBufferCreateFilenameDefault__internal_alias __attribute((visibility("hidden"))); -#define xmlParserInputBufferCreateFilenameDefault xmlParserInputBufferCreateFilenameDefault__internal_alias -#endif -#endif - -#ifdef bottom_xmlIO -#undef xmlParserInputBufferCreateIO -extern __typeof (xmlParserInputBufferCreateIO) xmlParserInputBufferCreateIO __attribute((alias("xmlParserInputBufferCreateIO__internal_alias"))); -#else -#ifndef xmlParserInputBufferCreateIO -extern __typeof (xmlParserInputBufferCreateIO) xmlParserInputBufferCreateIO__internal_alias __attribute((visibility("hidden"))); -#define xmlParserInputBufferCreateIO xmlParserInputBufferCreateIO__internal_alias -#endif -#endif - -#ifdef bottom_xmlIO -#undef xmlParserInputBufferCreateMem -extern __typeof (xmlParserInputBufferCreateMem) xmlParserInputBufferCreateMem __attribute((alias("xmlParserInputBufferCreateMem__internal_alias"))); -#else -#ifndef xmlParserInputBufferCreateMem -extern __typeof (xmlParserInputBufferCreateMem) xmlParserInputBufferCreateMem__internal_alias __attribute((visibility("hidden"))); -#define xmlParserInputBufferCreateMem xmlParserInputBufferCreateMem__internal_alias -#endif -#endif - -#ifdef bottom_xmlIO -#undef xmlParserInputBufferCreateStatic -extern __typeof (xmlParserInputBufferCreateStatic) xmlParserInputBufferCreateStatic __attribute((alias("xmlParserInputBufferCreateStatic__internal_alias"))); -#else -#ifndef xmlParserInputBufferCreateStatic -extern __typeof (xmlParserInputBufferCreateStatic) xmlParserInputBufferCreateStatic__internal_alias __attribute((visibility("hidden"))); -#define xmlParserInputBufferCreateStatic xmlParserInputBufferCreateStatic__internal_alias -#endif -#endif - -#ifdef bottom_xmlIO -#undef xmlParserInputBufferGrow -extern __typeof (xmlParserInputBufferGrow) xmlParserInputBufferGrow __attribute((alias("xmlParserInputBufferGrow__internal_alias"))); -#else -#ifndef xmlParserInputBufferGrow -extern __typeof (xmlParserInputBufferGrow) xmlParserInputBufferGrow__internal_alias __attribute((visibility("hidden"))); -#define xmlParserInputBufferGrow xmlParserInputBufferGrow__internal_alias -#endif -#endif - -#ifdef bottom_xmlIO -#undef xmlParserInputBufferPush -extern __typeof (xmlParserInputBufferPush) xmlParserInputBufferPush __attribute((alias("xmlParserInputBufferPush__internal_alias"))); -#else -#ifndef xmlParserInputBufferPush -extern __typeof (xmlParserInputBufferPush) xmlParserInputBufferPush__internal_alias __attribute((visibility("hidden"))); -#define xmlParserInputBufferPush xmlParserInputBufferPush__internal_alias -#endif -#endif - -#ifdef bottom_xmlIO -#undef xmlParserInputBufferRead -extern __typeof (xmlParserInputBufferRead) xmlParserInputBufferRead __attribute((alias("xmlParserInputBufferRead__internal_alias"))); -#else -#ifndef xmlParserInputBufferRead -extern __typeof (xmlParserInputBufferRead) xmlParserInputBufferRead__internal_alias __attribute((visibility("hidden"))); -#define xmlParserInputBufferRead xmlParserInputBufferRead__internal_alias -#endif -#endif - -#ifdef bottom_parserInternals -#undef xmlParserInputGrow -extern __typeof (xmlParserInputGrow) xmlParserInputGrow __attribute((alias("xmlParserInputGrow__internal_alias"))); -#else -#ifndef xmlParserInputGrow -extern __typeof (xmlParserInputGrow) xmlParserInputGrow__internal_alias __attribute((visibility("hidden"))); -#define xmlParserInputGrow xmlParserInputGrow__internal_alias -#endif -#endif - -#ifdef bottom_parserInternals -#undef xmlParserInputRead -extern __typeof (xmlParserInputRead) xmlParserInputRead __attribute((alias("xmlParserInputRead__internal_alias"))); -#else -#ifndef xmlParserInputRead -extern __typeof (xmlParserInputRead) xmlParserInputRead__internal_alias __attribute((visibility("hidden"))); -#define xmlParserInputRead xmlParserInputRead__internal_alias -#endif -#endif - -#ifdef bottom_parserInternals -#undef xmlParserInputShrink -extern __typeof (xmlParserInputShrink) xmlParserInputShrink __attribute((alias("xmlParserInputShrink__internal_alias"))); -#else -#ifndef xmlParserInputShrink -extern __typeof (xmlParserInputShrink) xmlParserInputShrink__internal_alias __attribute((visibility("hidden"))); -#define xmlParserInputShrink xmlParserInputShrink__internal_alias -#endif -#endif - -#ifdef bottom_error -#undef xmlParserPrintFileContext -extern __typeof (xmlParserPrintFileContext) xmlParserPrintFileContext __attribute((alias("xmlParserPrintFileContext__internal_alias"))); -#else -#ifndef xmlParserPrintFileContext -extern __typeof (xmlParserPrintFileContext) xmlParserPrintFileContext__internal_alias __attribute((visibility("hidden"))); -#define xmlParserPrintFileContext xmlParserPrintFileContext__internal_alias -#endif -#endif - -#ifdef bottom_error -#undef xmlParserPrintFileInfo -extern __typeof (xmlParserPrintFileInfo) xmlParserPrintFileInfo __attribute((alias("xmlParserPrintFileInfo__internal_alias"))); -#else -#ifndef xmlParserPrintFileInfo -extern __typeof (xmlParserPrintFileInfo) xmlParserPrintFileInfo__internal_alias __attribute((visibility("hidden"))); -#define xmlParserPrintFileInfo xmlParserPrintFileInfo__internal_alias -#endif -#endif - -#ifdef bottom_error -#undef xmlParserValidityError -extern __typeof (xmlParserValidityError) xmlParserValidityError __attribute((alias("xmlParserValidityError__internal_alias"))); -#else -#ifndef xmlParserValidityError -extern __typeof (xmlParserValidityError) xmlParserValidityError__internal_alias __attribute((visibility("hidden"))); -#define xmlParserValidityError xmlParserValidityError__internal_alias -#endif -#endif - -#ifdef bottom_error -#undef xmlParserValidityWarning -extern __typeof (xmlParserValidityWarning) xmlParserValidityWarning __attribute((alias("xmlParserValidityWarning__internal_alias"))); -#else -#ifndef xmlParserValidityWarning -extern __typeof (xmlParserValidityWarning) xmlParserValidityWarning__internal_alias __attribute((visibility("hidden"))); -#define xmlParserValidityWarning xmlParserValidityWarning__internal_alias -#endif -#endif - -#ifdef bottom_error -#undef xmlParserWarning -extern __typeof (xmlParserWarning) xmlParserWarning __attribute((alias("xmlParserWarning__internal_alias"))); -#else -#ifndef xmlParserWarning -extern __typeof (xmlParserWarning) xmlParserWarning__internal_alias __attribute((visibility("hidden"))); -#define xmlParserWarning xmlParserWarning__internal_alias -#endif -#endif - -#ifdef bottom_uri -#undef xmlPathToURI -extern __typeof (xmlPathToURI) xmlPathToURI __attribute((alias("xmlPathToURI__internal_alias"))); -#else -#ifndef xmlPathToURI -extern __typeof (xmlPathToURI) xmlPathToURI__internal_alias __attribute((visibility("hidden"))); -#define xmlPathToURI xmlPathToURI__internal_alias -#endif -#endif - -#if defined(LIBXML_PATTERN_ENABLED) -#ifdef bottom_pattern -#undef xmlPatternFromRoot -extern __typeof (xmlPatternFromRoot) xmlPatternFromRoot __attribute((alias("xmlPatternFromRoot__internal_alias"))); -#else -#ifndef xmlPatternFromRoot -extern __typeof (xmlPatternFromRoot) xmlPatternFromRoot__internal_alias __attribute((visibility("hidden"))); -#define xmlPatternFromRoot xmlPatternFromRoot__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_PATTERN_ENABLED) -#ifdef bottom_pattern -#undef xmlPatternGetStreamCtxt -extern __typeof (xmlPatternGetStreamCtxt) xmlPatternGetStreamCtxt __attribute((alias("xmlPatternGetStreamCtxt__internal_alias"))); -#else -#ifndef xmlPatternGetStreamCtxt -extern __typeof (xmlPatternGetStreamCtxt) xmlPatternGetStreamCtxt__internal_alias __attribute((visibility("hidden"))); -#define xmlPatternGetStreamCtxt xmlPatternGetStreamCtxt__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_PATTERN_ENABLED) -#ifdef bottom_pattern -#undef xmlPatternMatch -extern __typeof (xmlPatternMatch) xmlPatternMatch __attribute((alias("xmlPatternMatch__internal_alias"))); -#else -#ifndef xmlPatternMatch -extern __typeof (xmlPatternMatch) xmlPatternMatch__internal_alias __attribute((visibility("hidden"))); -#define xmlPatternMatch xmlPatternMatch__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_PATTERN_ENABLED) -#ifdef bottom_pattern -#undef xmlPatternMaxDepth -extern __typeof (xmlPatternMaxDepth) xmlPatternMaxDepth __attribute((alias("xmlPatternMaxDepth__internal_alias"))); -#else -#ifndef xmlPatternMaxDepth -extern __typeof (xmlPatternMaxDepth) xmlPatternMaxDepth__internal_alias __attribute((visibility("hidden"))); -#define xmlPatternMaxDepth xmlPatternMaxDepth__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_PATTERN_ENABLED) -#ifdef bottom_pattern -#undef xmlPatternMinDepth -extern __typeof (xmlPatternMinDepth) xmlPatternMinDepth __attribute((alias("xmlPatternMinDepth__internal_alias"))); -#else -#ifndef xmlPatternMinDepth -extern __typeof (xmlPatternMinDepth) xmlPatternMinDepth__internal_alias __attribute((visibility("hidden"))); -#define xmlPatternMinDepth xmlPatternMinDepth__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_PATTERN_ENABLED) -#ifdef bottom_pattern -#undef xmlPatternStreamable -extern __typeof (xmlPatternStreamable) xmlPatternStreamable __attribute((alias("xmlPatternStreamable__internal_alias"))); -#else -#ifndef xmlPatternStreamable -extern __typeof (xmlPatternStreamable) xmlPatternStreamable__internal_alias __attribute((visibility("hidden"))); -#define xmlPatternStreamable xmlPatternStreamable__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_PATTERN_ENABLED) -#ifdef bottom_pattern -#undef xmlPatterncompile -extern __typeof (xmlPatterncompile) xmlPatterncompile __attribute((alias("xmlPatterncompile__internal_alias"))); -#else -#ifndef xmlPatterncompile -extern __typeof (xmlPatterncompile) xmlPatterncompile__internal_alias __attribute((visibility("hidden"))); -#define xmlPatterncompile xmlPatterncompile__internal_alias -#endif -#endif -#endif - -#ifdef bottom_parserInternals -#undef xmlPedanticParserDefault -extern __typeof (xmlPedanticParserDefault) xmlPedanticParserDefault __attribute((alias("xmlPedanticParserDefault__internal_alias"))); -#else -#ifndef xmlPedanticParserDefault -extern __typeof (xmlPedanticParserDefault) xmlPedanticParserDefault__internal_alias __attribute((visibility("hidden"))); -#define xmlPedanticParserDefault xmlPedanticParserDefault__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlPopInput -extern __typeof (xmlPopInput) xmlPopInput __attribute((alias("xmlPopInput__internal_alias"))); -#else -#ifndef xmlPopInput -extern __typeof (xmlPopInput) xmlPopInput__internal_alias __attribute((visibility("hidden"))); -#define xmlPopInput xmlPopInput__internal_alias -#endif -#endif - -#ifdef bottom_xmlIO -#undef xmlPopInputCallbacks -extern __typeof (xmlPopInputCallbacks) xmlPopInputCallbacks __attribute((alias("xmlPopInputCallbacks__internal_alias"))); -#else -#ifndef xmlPopInputCallbacks -extern __typeof (xmlPopInputCallbacks) xmlPopInputCallbacks__internal_alias __attribute((visibility("hidden"))); -#define xmlPopInputCallbacks xmlPopInputCallbacks__internal_alias -#endif -#endif - -#if defined(LIBXML_TREE_ENABLED) -#ifdef bottom_tree -#undef xmlPreviousElementSibling -extern __typeof (xmlPreviousElementSibling) xmlPreviousElementSibling __attribute((alias("xmlPreviousElementSibling__internal_alias"))); -#else -#ifndef xmlPreviousElementSibling -extern __typeof (xmlPreviousElementSibling) xmlPreviousElementSibling__internal_alias __attribute((visibility("hidden"))); -#define xmlPreviousElementSibling xmlPreviousElementSibling__internal_alias -#endif -#endif -#endif - -#ifdef bottom_uri -#undef xmlPrintURI -extern __typeof (xmlPrintURI) xmlPrintURI __attribute((alias("xmlPrintURI__internal_alias"))); -#else -#ifndef xmlPrintURI -extern __typeof (xmlPrintURI) xmlPrintURI__internal_alias __attribute((visibility("hidden"))); -#define xmlPrintURI xmlPrintURI__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlPushInput -extern __typeof (xmlPushInput) xmlPushInput __attribute((alias("xmlPushInput__internal_alias"))); -#else -#ifndef xmlPushInput -extern __typeof (xmlPushInput) xmlPushInput__internal_alias __attribute((visibility("hidden"))); -#define xmlPushInput xmlPushInput__internal_alias -#endif -#endif - -#ifdef bottom_threads -#undef xmlRMutexLock -extern __typeof (xmlRMutexLock) xmlRMutexLock __attribute((alias("xmlRMutexLock__internal_alias"))); -#else -#ifndef xmlRMutexLock -extern __typeof (xmlRMutexLock) xmlRMutexLock__internal_alias __attribute((visibility("hidden"))); -#define xmlRMutexLock xmlRMutexLock__internal_alias -#endif -#endif - -#ifdef bottom_threads -#undef xmlRMutexUnlock -extern __typeof (xmlRMutexUnlock) xmlRMutexUnlock __attribute((alias("xmlRMutexUnlock__internal_alias"))); -#else -#ifndef xmlRMutexUnlock -extern __typeof (xmlRMutexUnlock) xmlRMutexUnlock__internal_alias __attribute((visibility("hidden"))); -#define xmlRMutexUnlock xmlRMutexUnlock__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlReadDoc -extern __typeof (xmlReadDoc) xmlReadDoc __attribute((alias("xmlReadDoc__internal_alias"))); -#else -#ifndef xmlReadDoc -extern __typeof (xmlReadDoc) xmlReadDoc__internal_alias __attribute((visibility("hidden"))); -#define xmlReadDoc xmlReadDoc__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlReadFd -extern __typeof (xmlReadFd) xmlReadFd __attribute((alias("xmlReadFd__internal_alias"))); -#else -#ifndef xmlReadFd -extern __typeof (xmlReadFd) xmlReadFd__internal_alias __attribute((visibility("hidden"))); -#define xmlReadFd xmlReadFd__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlReadFile -extern __typeof (xmlReadFile) xmlReadFile __attribute((alias("xmlReadFile__internal_alias"))); -#else -#ifndef xmlReadFile -extern __typeof (xmlReadFile) xmlReadFile__internal_alias __attribute((visibility("hidden"))); -#define xmlReadFile xmlReadFile__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlReadIO -extern __typeof (xmlReadIO) xmlReadIO __attribute((alias("xmlReadIO__internal_alias"))); -#else -#ifndef xmlReadIO -extern __typeof (xmlReadIO) xmlReadIO__internal_alias __attribute((visibility("hidden"))); -#define xmlReadIO xmlReadIO__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlReadMemory -extern __typeof (xmlReadMemory) xmlReadMemory __attribute((alias("xmlReadMemory__internal_alias"))); -#else -#ifndef xmlReadMemory -extern __typeof (xmlReadMemory) xmlReadMemory__internal_alias __attribute((visibility("hidden"))); -#define xmlReadMemory xmlReadMemory__internal_alias -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlReaderForDoc -extern __typeof (xmlReaderForDoc) xmlReaderForDoc __attribute((alias("xmlReaderForDoc__internal_alias"))); -#else -#ifndef xmlReaderForDoc -extern __typeof (xmlReaderForDoc) xmlReaderForDoc__internal_alias __attribute((visibility("hidden"))); -#define xmlReaderForDoc xmlReaderForDoc__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlReaderForFd -extern __typeof (xmlReaderForFd) xmlReaderForFd __attribute((alias("xmlReaderForFd__internal_alias"))); -#else -#ifndef xmlReaderForFd -extern __typeof (xmlReaderForFd) xmlReaderForFd__internal_alias __attribute((visibility("hidden"))); -#define xmlReaderForFd xmlReaderForFd__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlReaderForFile -extern __typeof (xmlReaderForFile) xmlReaderForFile __attribute((alias("xmlReaderForFile__internal_alias"))); -#else -#ifndef xmlReaderForFile -extern __typeof (xmlReaderForFile) xmlReaderForFile__internal_alias __attribute((visibility("hidden"))); -#define xmlReaderForFile xmlReaderForFile__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlReaderForIO -extern __typeof (xmlReaderForIO) xmlReaderForIO __attribute((alias("xmlReaderForIO__internal_alias"))); -#else -#ifndef xmlReaderForIO -extern __typeof (xmlReaderForIO) xmlReaderForIO__internal_alias __attribute((visibility("hidden"))); -#define xmlReaderForIO xmlReaderForIO__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlReaderForMemory -extern __typeof (xmlReaderForMemory) xmlReaderForMemory __attribute((alias("xmlReaderForMemory__internal_alias"))); -#else -#ifndef xmlReaderForMemory -extern __typeof (xmlReaderForMemory) xmlReaderForMemory__internal_alias __attribute((visibility("hidden"))); -#define xmlReaderForMemory xmlReaderForMemory__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlReaderNewDoc -extern __typeof (xmlReaderNewDoc) xmlReaderNewDoc __attribute((alias("xmlReaderNewDoc__internal_alias"))); -#else -#ifndef xmlReaderNewDoc -extern __typeof (xmlReaderNewDoc) xmlReaderNewDoc__internal_alias __attribute((visibility("hidden"))); -#define xmlReaderNewDoc xmlReaderNewDoc__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlReaderNewFd -extern __typeof (xmlReaderNewFd) xmlReaderNewFd __attribute((alias("xmlReaderNewFd__internal_alias"))); -#else -#ifndef xmlReaderNewFd -extern __typeof (xmlReaderNewFd) xmlReaderNewFd__internal_alias __attribute((visibility("hidden"))); -#define xmlReaderNewFd xmlReaderNewFd__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlReaderNewFile -extern __typeof (xmlReaderNewFile) xmlReaderNewFile __attribute((alias("xmlReaderNewFile__internal_alias"))); -#else -#ifndef xmlReaderNewFile -extern __typeof (xmlReaderNewFile) xmlReaderNewFile__internal_alias __attribute((visibility("hidden"))); -#define xmlReaderNewFile xmlReaderNewFile__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlReaderNewIO -extern __typeof (xmlReaderNewIO) xmlReaderNewIO __attribute((alias("xmlReaderNewIO__internal_alias"))); -#else -#ifndef xmlReaderNewIO -extern __typeof (xmlReaderNewIO) xmlReaderNewIO__internal_alias __attribute((visibility("hidden"))); -#define xmlReaderNewIO xmlReaderNewIO__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlReaderNewMemory -extern __typeof (xmlReaderNewMemory) xmlReaderNewMemory __attribute((alias("xmlReaderNewMemory__internal_alias"))); -#else -#ifndef xmlReaderNewMemory -extern __typeof (xmlReaderNewMemory) xmlReaderNewMemory__internal_alias __attribute((visibility("hidden"))); -#define xmlReaderNewMemory xmlReaderNewMemory__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlReaderNewWalker -extern __typeof (xmlReaderNewWalker) xmlReaderNewWalker __attribute((alias("xmlReaderNewWalker__internal_alias"))); -#else -#ifndef xmlReaderNewWalker -extern __typeof (xmlReaderNewWalker) xmlReaderNewWalker__internal_alias __attribute((visibility("hidden"))); -#define xmlReaderNewWalker xmlReaderNewWalker__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlReaderWalker -extern __typeof (xmlReaderWalker) xmlReaderWalker __attribute((alias("xmlReaderWalker__internal_alias"))); -#else -#ifndef xmlReaderWalker -extern __typeof (xmlReaderWalker) xmlReaderWalker__internal_alias __attribute((visibility("hidden"))); -#define xmlReaderWalker xmlReaderWalker__internal_alias -#endif -#endif -#endif - -#ifdef bottom_xmlmemory -#undef xmlReallocLoc -extern __typeof (xmlReallocLoc) xmlReallocLoc __attribute((alias("xmlReallocLoc__internal_alias"))); -#else -#ifndef xmlReallocLoc -extern __typeof (xmlReallocLoc) xmlReallocLoc__internal_alias __attribute((visibility("hidden"))); -#define xmlReallocLoc xmlReallocLoc__internal_alias -#endif -#endif - -#if defined(LIBXML_TREE_ENABLED) -#ifdef bottom_tree -#undef xmlReconciliateNs -extern __typeof (xmlReconciliateNs) xmlReconciliateNs __attribute((alias("xmlReconciliateNs__internal_alias"))); -#else -#ifndef xmlReconciliateNs -extern __typeof (xmlReconciliateNs) xmlReconciliateNs__internal_alias __attribute((visibility("hidden"))); -#define xmlReconciliateNs xmlReconciliateNs__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef bottom_parser -#undef xmlRecoverDoc -extern __typeof (xmlRecoverDoc) xmlRecoverDoc __attribute((alias("xmlRecoverDoc__internal_alias"))); -#else -#ifndef xmlRecoverDoc -extern __typeof (xmlRecoverDoc) xmlRecoverDoc__internal_alias __attribute((visibility("hidden"))); -#define xmlRecoverDoc xmlRecoverDoc__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef bottom_parser -#undef xmlRecoverFile -extern __typeof (xmlRecoverFile) xmlRecoverFile __attribute((alias("xmlRecoverFile__internal_alias"))); -#else -#ifndef xmlRecoverFile -extern __typeof (xmlRecoverFile) xmlRecoverFile__internal_alias __attribute((visibility("hidden"))); -#define xmlRecoverFile xmlRecoverFile__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef bottom_parser -#undef xmlRecoverMemory -extern __typeof (xmlRecoverMemory) xmlRecoverMemory __attribute((alias("xmlRecoverMemory__internal_alias"))); -#else -#ifndef xmlRecoverMemory -extern __typeof (xmlRecoverMemory) xmlRecoverMemory__internal_alias __attribute((visibility("hidden"))); -#define xmlRecoverMemory xmlRecoverMemory__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_REGEXP_ENABLED) -#ifdef bottom_xmlregexp -#undef xmlRegExecErrInfo -extern __typeof (xmlRegExecErrInfo) xmlRegExecErrInfo __attribute((alias("xmlRegExecErrInfo__internal_alias"))); -#else -#ifndef xmlRegExecErrInfo -extern __typeof (xmlRegExecErrInfo) xmlRegExecErrInfo__internal_alias __attribute((visibility("hidden"))); -#define xmlRegExecErrInfo xmlRegExecErrInfo__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_REGEXP_ENABLED) -#ifdef bottom_xmlregexp -#undef xmlRegExecNextValues -extern __typeof (xmlRegExecNextValues) xmlRegExecNextValues __attribute((alias("xmlRegExecNextValues__internal_alias"))); -#else -#ifndef xmlRegExecNextValues -extern __typeof (xmlRegExecNextValues) xmlRegExecNextValues__internal_alias __attribute((visibility("hidden"))); -#define xmlRegExecNextValues xmlRegExecNextValues__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_REGEXP_ENABLED) -#ifdef bottom_xmlregexp -#undef xmlRegExecPushString -extern __typeof (xmlRegExecPushString) xmlRegExecPushString __attribute((alias("xmlRegExecPushString__internal_alias"))); -#else -#ifndef xmlRegExecPushString -extern __typeof (xmlRegExecPushString) xmlRegExecPushString__internal_alias __attribute((visibility("hidden"))); -#define xmlRegExecPushString xmlRegExecPushString__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_REGEXP_ENABLED) -#ifdef bottom_xmlregexp -#undef xmlRegExecPushString2 -extern __typeof (xmlRegExecPushString2) xmlRegExecPushString2 __attribute((alias("xmlRegExecPushString2__internal_alias"))); -#else -#ifndef xmlRegExecPushString2 -extern __typeof (xmlRegExecPushString2) xmlRegExecPushString2__internal_alias __attribute((visibility("hidden"))); -#define xmlRegExecPushString2 xmlRegExecPushString2__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_REGEXP_ENABLED) -#ifdef bottom_xmlregexp -#undef xmlRegFreeExecCtxt -extern __typeof (xmlRegFreeExecCtxt) xmlRegFreeExecCtxt __attribute((alias("xmlRegFreeExecCtxt__internal_alias"))); -#else -#ifndef xmlRegFreeExecCtxt -extern __typeof (xmlRegFreeExecCtxt) xmlRegFreeExecCtxt__internal_alias __attribute((visibility("hidden"))); -#define xmlRegFreeExecCtxt xmlRegFreeExecCtxt__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_REGEXP_ENABLED) -#ifdef bottom_xmlregexp -#undef xmlRegFreeRegexp -extern __typeof (xmlRegFreeRegexp) xmlRegFreeRegexp __attribute((alias("xmlRegFreeRegexp__internal_alias"))); -#else -#ifndef xmlRegFreeRegexp -extern __typeof (xmlRegFreeRegexp) xmlRegFreeRegexp__internal_alias __attribute((visibility("hidden"))); -#define xmlRegFreeRegexp xmlRegFreeRegexp__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_REGEXP_ENABLED) -#ifdef bottom_xmlregexp -#undef xmlRegNewExecCtxt -extern __typeof (xmlRegNewExecCtxt) xmlRegNewExecCtxt __attribute((alias("xmlRegNewExecCtxt__internal_alias"))); -#else -#ifndef xmlRegNewExecCtxt -extern __typeof (xmlRegNewExecCtxt) xmlRegNewExecCtxt__internal_alias __attribute((visibility("hidden"))); -#define xmlRegNewExecCtxt xmlRegNewExecCtxt__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_REGEXP_ENABLED) -#ifdef bottom_xmlregexp -#undef xmlRegexpCompile -extern __typeof (xmlRegexpCompile) xmlRegexpCompile __attribute((alias("xmlRegexpCompile__internal_alias"))); -#else -#ifndef xmlRegexpCompile -extern __typeof (xmlRegexpCompile) xmlRegexpCompile__internal_alias __attribute((visibility("hidden"))); -#define xmlRegexpCompile xmlRegexpCompile__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_REGEXP_ENABLED) -#ifdef bottom_xmlregexp -#undef xmlRegexpExec -extern __typeof (xmlRegexpExec) xmlRegexpExec __attribute((alias("xmlRegexpExec__internal_alias"))); -#else -#ifndef xmlRegexpExec -extern __typeof (xmlRegexpExec) xmlRegexpExec__internal_alias __attribute((visibility("hidden"))); -#define xmlRegexpExec xmlRegexpExec__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_REGEXP_ENABLED) -#ifdef bottom_xmlregexp -#undef xmlRegexpIsDeterminist -extern __typeof (xmlRegexpIsDeterminist) xmlRegexpIsDeterminist __attribute((alias("xmlRegexpIsDeterminist__internal_alias"))); -#else -#ifndef xmlRegexpIsDeterminist -extern __typeof (xmlRegexpIsDeterminist) xmlRegexpIsDeterminist__internal_alias __attribute((visibility("hidden"))); -#define xmlRegexpIsDeterminist xmlRegexpIsDeterminist__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_REGEXP_ENABLED) -#ifdef bottom_xmlregexp -#undef xmlRegexpPrint -extern __typeof (xmlRegexpPrint) xmlRegexpPrint __attribute((alias("xmlRegexpPrint__internal_alias"))); -#else -#ifndef xmlRegexpPrint -extern __typeof (xmlRegexpPrint) xmlRegexpPrint__internal_alias __attribute((visibility("hidden"))); -#define xmlRegexpPrint xmlRegexpPrint__internal_alias -#endif -#endif -#endif - -#ifdef bottom_encoding -#undef xmlRegisterCharEncodingHandler -extern __typeof (xmlRegisterCharEncodingHandler) xmlRegisterCharEncodingHandler __attribute((alias("xmlRegisterCharEncodingHandler__internal_alias"))); -#else -#ifndef xmlRegisterCharEncodingHandler -extern __typeof (xmlRegisterCharEncodingHandler) xmlRegisterCharEncodingHandler__internal_alias __attribute((visibility("hidden"))); -#define xmlRegisterCharEncodingHandler xmlRegisterCharEncodingHandler__internal_alias -#endif -#endif - -#ifdef bottom_xmlIO -#undef xmlRegisterDefaultInputCallbacks -extern __typeof (xmlRegisterDefaultInputCallbacks) xmlRegisterDefaultInputCallbacks __attribute((alias("xmlRegisterDefaultInputCallbacks__internal_alias"))); -#else -#ifndef xmlRegisterDefaultInputCallbacks -extern __typeof (xmlRegisterDefaultInputCallbacks) xmlRegisterDefaultInputCallbacks__internal_alias __attribute((visibility("hidden"))); -#define xmlRegisterDefaultInputCallbacks xmlRegisterDefaultInputCallbacks__internal_alias -#endif -#endif - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_xmlIO -#undef xmlRegisterDefaultOutputCallbacks -extern __typeof (xmlRegisterDefaultOutputCallbacks) xmlRegisterDefaultOutputCallbacks __attribute((alias("xmlRegisterDefaultOutputCallbacks__internal_alias"))); -#else -#ifndef xmlRegisterDefaultOutputCallbacks -extern __typeof (xmlRegisterDefaultOutputCallbacks) xmlRegisterDefaultOutputCallbacks__internal_alias __attribute((visibility("hidden"))); -#define xmlRegisterDefaultOutputCallbacks xmlRegisterDefaultOutputCallbacks__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_OUTPUT_ENABLED) && defined(LIBXML_HTTP_ENABLED) -#ifdef bottom_xmlIO -#undef xmlRegisterHTTPPostCallbacks -extern __typeof (xmlRegisterHTTPPostCallbacks) xmlRegisterHTTPPostCallbacks __attribute((alias("xmlRegisterHTTPPostCallbacks__internal_alias"))); -#else -#ifndef xmlRegisterHTTPPostCallbacks -extern __typeof (xmlRegisterHTTPPostCallbacks) xmlRegisterHTTPPostCallbacks__internal_alias __attribute((visibility("hidden"))); -#define xmlRegisterHTTPPostCallbacks xmlRegisterHTTPPostCallbacks__internal_alias -#endif -#endif -#endif - -#ifdef bottom_xmlIO -#undef xmlRegisterInputCallbacks -extern __typeof (xmlRegisterInputCallbacks) xmlRegisterInputCallbacks __attribute((alias("xmlRegisterInputCallbacks__internal_alias"))); -#else -#ifndef xmlRegisterInputCallbacks -extern __typeof (xmlRegisterInputCallbacks) xmlRegisterInputCallbacks__internal_alias __attribute((visibility("hidden"))); -#define xmlRegisterInputCallbacks xmlRegisterInputCallbacks__internal_alias -#endif -#endif - -#ifdef bottom_globals -#undef xmlRegisterNodeDefault -extern __typeof (xmlRegisterNodeDefault) xmlRegisterNodeDefault __attribute((alias("xmlRegisterNodeDefault__internal_alias"))); -#else -#ifndef xmlRegisterNodeDefault -extern __typeof (xmlRegisterNodeDefault) xmlRegisterNodeDefault__internal_alias __attribute((visibility("hidden"))); -#define xmlRegisterNodeDefault xmlRegisterNodeDefault__internal_alias -#endif -#endif - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_xmlIO -#undef xmlRegisterOutputCallbacks -extern __typeof (xmlRegisterOutputCallbacks) xmlRegisterOutputCallbacks __attribute((alias("xmlRegisterOutputCallbacks__internal_alias"))); -#else -#ifndef xmlRegisterOutputCallbacks -extern __typeof (xmlRegisterOutputCallbacks) xmlRegisterOutputCallbacks__internal_alias __attribute((visibility("hidden"))); -#define xmlRegisterOutputCallbacks xmlRegisterOutputCallbacks__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_relaxng -#undef xmlRelaxNGCleanupTypes -extern __typeof (xmlRelaxNGCleanupTypes) xmlRelaxNGCleanupTypes __attribute((alias("xmlRelaxNGCleanupTypes__internal_alias"))); -#else -#ifndef xmlRelaxNGCleanupTypes -extern __typeof (xmlRelaxNGCleanupTypes) xmlRelaxNGCleanupTypes__internal_alias __attribute((visibility("hidden"))); -#define xmlRelaxNGCleanupTypes xmlRelaxNGCleanupTypes__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_relaxng -#undef xmlRelaxNGDump -extern __typeof (xmlRelaxNGDump) xmlRelaxNGDump __attribute((alias("xmlRelaxNGDump__internal_alias"))); -#else -#ifndef xmlRelaxNGDump -extern __typeof (xmlRelaxNGDump) xmlRelaxNGDump__internal_alias __attribute((visibility("hidden"))); -#define xmlRelaxNGDump xmlRelaxNGDump__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_relaxng -#undef xmlRelaxNGDumpTree -extern __typeof (xmlRelaxNGDumpTree) xmlRelaxNGDumpTree __attribute((alias("xmlRelaxNGDumpTree__internal_alias"))); -#else -#ifndef xmlRelaxNGDumpTree -extern __typeof (xmlRelaxNGDumpTree) xmlRelaxNGDumpTree__internal_alias __attribute((visibility("hidden"))); -#define xmlRelaxNGDumpTree xmlRelaxNGDumpTree__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_relaxng -#undef xmlRelaxNGFree -extern __typeof (xmlRelaxNGFree) xmlRelaxNGFree __attribute((alias("xmlRelaxNGFree__internal_alias"))); -#else -#ifndef xmlRelaxNGFree -extern __typeof (xmlRelaxNGFree) xmlRelaxNGFree__internal_alias __attribute((visibility("hidden"))); -#define xmlRelaxNGFree xmlRelaxNGFree__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_relaxng -#undef xmlRelaxNGFreeParserCtxt -extern __typeof (xmlRelaxNGFreeParserCtxt) xmlRelaxNGFreeParserCtxt __attribute((alias("xmlRelaxNGFreeParserCtxt__internal_alias"))); -#else -#ifndef xmlRelaxNGFreeParserCtxt -extern __typeof (xmlRelaxNGFreeParserCtxt) xmlRelaxNGFreeParserCtxt__internal_alias __attribute((visibility("hidden"))); -#define xmlRelaxNGFreeParserCtxt xmlRelaxNGFreeParserCtxt__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_relaxng -#undef xmlRelaxNGFreeValidCtxt -extern __typeof (xmlRelaxNGFreeValidCtxt) xmlRelaxNGFreeValidCtxt __attribute((alias("xmlRelaxNGFreeValidCtxt__internal_alias"))); -#else -#ifndef xmlRelaxNGFreeValidCtxt -extern __typeof (xmlRelaxNGFreeValidCtxt) xmlRelaxNGFreeValidCtxt__internal_alias __attribute((visibility("hidden"))); -#define xmlRelaxNGFreeValidCtxt xmlRelaxNGFreeValidCtxt__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_relaxng -#undef xmlRelaxNGGetParserErrors -extern __typeof (xmlRelaxNGGetParserErrors) xmlRelaxNGGetParserErrors __attribute((alias("xmlRelaxNGGetParserErrors__internal_alias"))); -#else -#ifndef xmlRelaxNGGetParserErrors -extern __typeof (xmlRelaxNGGetParserErrors) xmlRelaxNGGetParserErrors__internal_alias __attribute((visibility("hidden"))); -#define xmlRelaxNGGetParserErrors xmlRelaxNGGetParserErrors__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_relaxng -#undef xmlRelaxNGGetValidErrors -extern __typeof (xmlRelaxNGGetValidErrors) xmlRelaxNGGetValidErrors __attribute((alias("xmlRelaxNGGetValidErrors__internal_alias"))); -#else -#ifndef xmlRelaxNGGetValidErrors -extern __typeof (xmlRelaxNGGetValidErrors) xmlRelaxNGGetValidErrors__internal_alias __attribute((visibility("hidden"))); -#define xmlRelaxNGGetValidErrors xmlRelaxNGGetValidErrors__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_relaxng -#undef xmlRelaxNGInitTypes -extern __typeof (xmlRelaxNGInitTypes) xmlRelaxNGInitTypes __attribute((alias("xmlRelaxNGInitTypes__internal_alias"))); -#else -#ifndef xmlRelaxNGInitTypes -extern __typeof (xmlRelaxNGInitTypes) xmlRelaxNGInitTypes__internal_alias __attribute((visibility("hidden"))); -#define xmlRelaxNGInitTypes xmlRelaxNGInitTypes__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_relaxng -#undef xmlRelaxNGNewDocParserCtxt -extern __typeof (xmlRelaxNGNewDocParserCtxt) xmlRelaxNGNewDocParserCtxt __attribute((alias("xmlRelaxNGNewDocParserCtxt__internal_alias"))); -#else -#ifndef xmlRelaxNGNewDocParserCtxt -extern __typeof (xmlRelaxNGNewDocParserCtxt) xmlRelaxNGNewDocParserCtxt__internal_alias __attribute((visibility("hidden"))); -#define xmlRelaxNGNewDocParserCtxt xmlRelaxNGNewDocParserCtxt__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_relaxng -#undef xmlRelaxNGNewMemParserCtxt -extern __typeof (xmlRelaxNGNewMemParserCtxt) xmlRelaxNGNewMemParserCtxt __attribute((alias("xmlRelaxNGNewMemParserCtxt__internal_alias"))); -#else -#ifndef xmlRelaxNGNewMemParserCtxt -extern __typeof (xmlRelaxNGNewMemParserCtxt) xmlRelaxNGNewMemParserCtxt__internal_alias __attribute((visibility("hidden"))); -#define xmlRelaxNGNewMemParserCtxt xmlRelaxNGNewMemParserCtxt__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_relaxng -#undef xmlRelaxNGNewParserCtxt -extern __typeof (xmlRelaxNGNewParserCtxt) xmlRelaxNGNewParserCtxt __attribute((alias("xmlRelaxNGNewParserCtxt__internal_alias"))); -#else -#ifndef xmlRelaxNGNewParserCtxt -extern __typeof (xmlRelaxNGNewParserCtxt) xmlRelaxNGNewParserCtxt__internal_alias __attribute((visibility("hidden"))); -#define xmlRelaxNGNewParserCtxt xmlRelaxNGNewParserCtxt__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_relaxng -#undef xmlRelaxNGNewValidCtxt -extern __typeof (xmlRelaxNGNewValidCtxt) xmlRelaxNGNewValidCtxt __attribute((alias("xmlRelaxNGNewValidCtxt__internal_alias"))); -#else -#ifndef xmlRelaxNGNewValidCtxt -extern __typeof (xmlRelaxNGNewValidCtxt) xmlRelaxNGNewValidCtxt__internal_alias __attribute((visibility("hidden"))); -#define xmlRelaxNGNewValidCtxt xmlRelaxNGNewValidCtxt__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_relaxng -#undef xmlRelaxNGParse -extern __typeof (xmlRelaxNGParse) xmlRelaxNGParse __attribute((alias("xmlRelaxNGParse__internal_alias"))); -#else -#ifndef xmlRelaxNGParse -extern __typeof (xmlRelaxNGParse) xmlRelaxNGParse__internal_alias __attribute((visibility("hidden"))); -#define xmlRelaxNGParse xmlRelaxNGParse__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_relaxng -#undef xmlRelaxNGSetParserErrors -extern __typeof (xmlRelaxNGSetParserErrors) xmlRelaxNGSetParserErrors __attribute((alias("xmlRelaxNGSetParserErrors__internal_alias"))); -#else -#ifndef xmlRelaxNGSetParserErrors -extern __typeof (xmlRelaxNGSetParserErrors) xmlRelaxNGSetParserErrors__internal_alias __attribute((visibility("hidden"))); -#define xmlRelaxNGSetParserErrors xmlRelaxNGSetParserErrors__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_relaxng -#undef xmlRelaxNGSetParserStructuredErrors -extern __typeof (xmlRelaxNGSetParserStructuredErrors) xmlRelaxNGSetParserStructuredErrors __attribute((alias("xmlRelaxNGSetParserStructuredErrors__internal_alias"))); -#else -#ifndef xmlRelaxNGSetParserStructuredErrors -extern __typeof (xmlRelaxNGSetParserStructuredErrors) xmlRelaxNGSetParserStructuredErrors__internal_alias __attribute((visibility("hidden"))); -#define xmlRelaxNGSetParserStructuredErrors xmlRelaxNGSetParserStructuredErrors__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_relaxng -#undef xmlRelaxNGSetValidErrors -extern __typeof (xmlRelaxNGSetValidErrors) xmlRelaxNGSetValidErrors __attribute((alias("xmlRelaxNGSetValidErrors__internal_alias"))); -#else -#ifndef xmlRelaxNGSetValidErrors -extern __typeof (xmlRelaxNGSetValidErrors) xmlRelaxNGSetValidErrors__internal_alias __attribute((visibility("hidden"))); -#define xmlRelaxNGSetValidErrors xmlRelaxNGSetValidErrors__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_relaxng -#undef xmlRelaxNGSetValidStructuredErrors -extern __typeof (xmlRelaxNGSetValidStructuredErrors) xmlRelaxNGSetValidStructuredErrors __attribute((alias("xmlRelaxNGSetValidStructuredErrors__internal_alias"))); -#else -#ifndef xmlRelaxNGSetValidStructuredErrors -extern __typeof (xmlRelaxNGSetValidStructuredErrors) xmlRelaxNGSetValidStructuredErrors__internal_alias __attribute((visibility("hidden"))); -#define xmlRelaxNGSetValidStructuredErrors xmlRelaxNGSetValidStructuredErrors__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_relaxng -#undef xmlRelaxNGValidateDoc -extern __typeof (xmlRelaxNGValidateDoc) xmlRelaxNGValidateDoc __attribute((alias("xmlRelaxNGValidateDoc__internal_alias"))); -#else -#ifndef xmlRelaxNGValidateDoc -extern __typeof (xmlRelaxNGValidateDoc) xmlRelaxNGValidateDoc__internal_alias __attribute((visibility("hidden"))); -#define xmlRelaxNGValidateDoc xmlRelaxNGValidateDoc__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_relaxng -#undef xmlRelaxNGValidateFullElement -extern __typeof (xmlRelaxNGValidateFullElement) xmlRelaxNGValidateFullElement __attribute((alias("xmlRelaxNGValidateFullElement__internal_alias"))); -#else -#ifndef xmlRelaxNGValidateFullElement -extern __typeof (xmlRelaxNGValidateFullElement) xmlRelaxNGValidateFullElement__internal_alias __attribute((visibility("hidden"))); -#define xmlRelaxNGValidateFullElement xmlRelaxNGValidateFullElement__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_relaxng -#undef xmlRelaxNGValidatePopElement -extern __typeof (xmlRelaxNGValidatePopElement) xmlRelaxNGValidatePopElement __attribute((alias("xmlRelaxNGValidatePopElement__internal_alias"))); -#else -#ifndef xmlRelaxNGValidatePopElement -extern __typeof (xmlRelaxNGValidatePopElement) xmlRelaxNGValidatePopElement__internal_alias __attribute((visibility("hidden"))); -#define xmlRelaxNGValidatePopElement xmlRelaxNGValidatePopElement__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_relaxng -#undef xmlRelaxNGValidatePushCData -extern __typeof (xmlRelaxNGValidatePushCData) xmlRelaxNGValidatePushCData __attribute((alias("xmlRelaxNGValidatePushCData__internal_alias"))); -#else -#ifndef xmlRelaxNGValidatePushCData -extern __typeof (xmlRelaxNGValidatePushCData) xmlRelaxNGValidatePushCData__internal_alias __attribute((visibility("hidden"))); -#define xmlRelaxNGValidatePushCData xmlRelaxNGValidatePushCData__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_relaxng -#undef xmlRelaxNGValidatePushElement -extern __typeof (xmlRelaxNGValidatePushElement) xmlRelaxNGValidatePushElement __attribute((alias("xmlRelaxNGValidatePushElement__internal_alias"))); -#else -#ifndef xmlRelaxNGValidatePushElement -extern __typeof (xmlRelaxNGValidatePushElement) xmlRelaxNGValidatePushElement__internal_alias __attribute((visibility("hidden"))); -#define xmlRelaxNGValidatePushElement xmlRelaxNGValidatePushElement__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_relaxng -#undef xmlRelaxParserSetFlag -extern __typeof (xmlRelaxParserSetFlag) xmlRelaxParserSetFlag __attribute((alias("xmlRelaxParserSetFlag__internal_alias"))); -#else -#ifndef xmlRelaxParserSetFlag -extern __typeof (xmlRelaxParserSetFlag) xmlRelaxParserSetFlag__internal_alias __attribute((visibility("hidden"))); -#define xmlRelaxParserSetFlag xmlRelaxParserSetFlag__internal_alias -#endif -#endif -#endif - -#ifdef bottom_valid -#undef xmlRemoveID -extern __typeof (xmlRemoveID) xmlRemoveID __attribute((alias("xmlRemoveID__internal_alias"))); -#else -#ifndef xmlRemoveID -extern __typeof (xmlRemoveID) xmlRemoveID__internal_alias __attribute((visibility("hidden"))); -#define xmlRemoveID xmlRemoveID__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlRemoveProp -extern __typeof (xmlRemoveProp) xmlRemoveProp __attribute((alias("xmlRemoveProp__internal_alias"))); -#else -#ifndef xmlRemoveProp -extern __typeof (xmlRemoveProp) xmlRemoveProp__internal_alias __attribute((visibility("hidden"))); -#define xmlRemoveProp xmlRemoveProp__internal_alias -#endif -#endif - -#ifdef bottom_valid -#undef xmlRemoveRef -extern __typeof (xmlRemoveRef) xmlRemoveRef __attribute((alias("xmlRemoveRef__internal_alias"))); -#else -#ifndef xmlRemoveRef -extern __typeof (xmlRemoveRef) xmlRemoveRef__internal_alias __attribute((visibility("hidden"))); -#define xmlRemoveRef xmlRemoveRef__internal_alias -#endif -#endif - -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_tree -#undef xmlReplaceNode -extern __typeof (xmlReplaceNode) xmlReplaceNode __attribute((alias("xmlReplaceNode__internal_alias"))); -#else -#ifndef xmlReplaceNode -extern __typeof (xmlReplaceNode) xmlReplaceNode__internal_alias __attribute((visibility("hidden"))); -#define xmlReplaceNode xmlReplaceNode__internal_alias -#endif -#endif -#endif - -#ifdef bottom_error -#undef xmlResetError -extern __typeof (xmlResetError) xmlResetError __attribute((alias("xmlResetError__internal_alias"))); -#else -#ifndef xmlResetError -extern __typeof (xmlResetError) xmlResetError__internal_alias __attribute((visibility("hidden"))); -#define xmlResetError xmlResetError__internal_alias -#endif -#endif - -#ifdef bottom_error -#undef xmlResetLastError -extern __typeof (xmlResetLastError) xmlResetLastError __attribute((alias("xmlResetLastError__internal_alias"))); -#else -#ifndef xmlResetLastError -extern __typeof (xmlResetLastError) xmlResetLastError__internal_alias __attribute((visibility("hidden"))); -#define xmlResetLastError xmlResetLastError__internal_alias -#endif -#endif - -#ifdef bottom_SAX2 -#undef xmlSAX2AttributeDecl -extern __typeof (xmlSAX2AttributeDecl) xmlSAX2AttributeDecl __attribute((alias("xmlSAX2AttributeDecl__internal_alias"))); -#else -#ifndef xmlSAX2AttributeDecl -extern __typeof (xmlSAX2AttributeDecl) xmlSAX2AttributeDecl__internal_alias __attribute((visibility("hidden"))); -#define xmlSAX2AttributeDecl xmlSAX2AttributeDecl__internal_alias -#endif -#endif - -#ifdef bottom_SAX2 -#undef xmlSAX2CDataBlock -extern __typeof (xmlSAX2CDataBlock) xmlSAX2CDataBlock __attribute((alias("xmlSAX2CDataBlock__internal_alias"))); -#else -#ifndef xmlSAX2CDataBlock -extern __typeof (xmlSAX2CDataBlock) xmlSAX2CDataBlock__internal_alias __attribute((visibility("hidden"))); -#define xmlSAX2CDataBlock xmlSAX2CDataBlock__internal_alias -#endif -#endif - -#ifdef bottom_SAX2 -#undef xmlSAX2Characters -extern __typeof (xmlSAX2Characters) xmlSAX2Characters __attribute((alias("xmlSAX2Characters__internal_alias"))); -#else -#ifndef xmlSAX2Characters -extern __typeof (xmlSAX2Characters) xmlSAX2Characters__internal_alias __attribute((visibility("hidden"))); -#define xmlSAX2Characters xmlSAX2Characters__internal_alias -#endif -#endif - -#ifdef bottom_SAX2 -#undef xmlSAX2Comment -extern __typeof (xmlSAX2Comment) xmlSAX2Comment __attribute((alias("xmlSAX2Comment__internal_alias"))); -#else -#ifndef xmlSAX2Comment -extern __typeof (xmlSAX2Comment) xmlSAX2Comment__internal_alias __attribute((visibility("hidden"))); -#define xmlSAX2Comment xmlSAX2Comment__internal_alias -#endif -#endif - -#ifdef bottom_SAX2 -#undef xmlSAX2ElementDecl -extern __typeof (xmlSAX2ElementDecl) xmlSAX2ElementDecl __attribute((alias("xmlSAX2ElementDecl__internal_alias"))); -#else -#ifndef xmlSAX2ElementDecl -extern __typeof (xmlSAX2ElementDecl) xmlSAX2ElementDecl__internal_alias __attribute((visibility("hidden"))); -#define xmlSAX2ElementDecl xmlSAX2ElementDecl__internal_alias -#endif -#endif - -#ifdef bottom_SAX2 -#undef xmlSAX2EndDocument -extern __typeof (xmlSAX2EndDocument) xmlSAX2EndDocument __attribute((alias("xmlSAX2EndDocument__internal_alias"))); -#else -#ifndef xmlSAX2EndDocument -extern __typeof (xmlSAX2EndDocument) xmlSAX2EndDocument__internal_alias __attribute((visibility("hidden"))); -#define xmlSAX2EndDocument xmlSAX2EndDocument__internal_alias -#endif -#endif - -#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) || defined(LIBXML_LEGACY_ENABLED) -#ifdef bottom_SAX2 -#undef xmlSAX2EndElement -extern __typeof (xmlSAX2EndElement) xmlSAX2EndElement __attribute((alias("xmlSAX2EndElement__internal_alias"))); -#else -#ifndef xmlSAX2EndElement -extern __typeof (xmlSAX2EndElement) xmlSAX2EndElement__internal_alias __attribute((visibility("hidden"))); -#define xmlSAX2EndElement xmlSAX2EndElement__internal_alias -#endif -#endif -#endif - -#ifdef bottom_SAX2 -#undef xmlSAX2EndElementNs -extern __typeof (xmlSAX2EndElementNs) xmlSAX2EndElementNs __attribute((alias("xmlSAX2EndElementNs__internal_alias"))); -#else -#ifndef xmlSAX2EndElementNs -extern __typeof (xmlSAX2EndElementNs) xmlSAX2EndElementNs__internal_alias __attribute((visibility("hidden"))); -#define xmlSAX2EndElementNs xmlSAX2EndElementNs__internal_alias -#endif -#endif - -#ifdef bottom_SAX2 -#undef xmlSAX2EntityDecl -extern __typeof (xmlSAX2EntityDecl) xmlSAX2EntityDecl __attribute((alias("xmlSAX2EntityDecl__internal_alias"))); -#else -#ifndef xmlSAX2EntityDecl -extern __typeof (xmlSAX2EntityDecl) xmlSAX2EntityDecl__internal_alias __attribute((visibility("hidden"))); -#define xmlSAX2EntityDecl xmlSAX2EntityDecl__internal_alias -#endif -#endif - -#ifdef bottom_SAX2 -#undef xmlSAX2ExternalSubset -extern __typeof (xmlSAX2ExternalSubset) xmlSAX2ExternalSubset __attribute((alias("xmlSAX2ExternalSubset__internal_alias"))); -#else -#ifndef xmlSAX2ExternalSubset -extern __typeof (xmlSAX2ExternalSubset) xmlSAX2ExternalSubset__internal_alias __attribute((visibility("hidden"))); -#define xmlSAX2ExternalSubset xmlSAX2ExternalSubset__internal_alias -#endif -#endif - -#ifdef bottom_SAX2 -#undef xmlSAX2GetColumnNumber -extern __typeof (xmlSAX2GetColumnNumber) xmlSAX2GetColumnNumber __attribute((alias("xmlSAX2GetColumnNumber__internal_alias"))); -#else -#ifndef xmlSAX2GetColumnNumber -extern __typeof (xmlSAX2GetColumnNumber) xmlSAX2GetColumnNumber__internal_alias __attribute((visibility("hidden"))); -#define xmlSAX2GetColumnNumber xmlSAX2GetColumnNumber__internal_alias -#endif -#endif - -#ifdef bottom_SAX2 -#undef xmlSAX2GetEntity -extern __typeof (xmlSAX2GetEntity) xmlSAX2GetEntity __attribute((alias("xmlSAX2GetEntity__internal_alias"))); -#else -#ifndef xmlSAX2GetEntity -extern __typeof (xmlSAX2GetEntity) xmlSAX2GetEntity__internal_alias __attribute((visibility("hidden"))); -#define xmlSAX2GetEntity xmlSAX2GetEntity__internal_alias -#endif -#endif - -#ifdef bottom_SAX2 -#undef xmlSAX2GetLineNumber -extern __typeof (xmlSAX2GetLineNumber) xmlSAX2GetLineNumber __attribute((alias("xmlSAX2GetLineNumber__internal_alias"))); -#else -#ifndef xmlSAX2GetLineNumber -extern __typeof (xmlSAX2GetLineNumber) xmlSAX2GetLineNumber__internal_alias __attribute((visibility("hidden"))); -#define xmlSAX2GetLineNumber xmlSAX2GetLineNumber__internal_alias -#endif -#endif - -#ifdef bottom_SAX2 -#undef xmlSAX2GetParameterEntity -extern __typeof (xmlSAX2GetParameterEntity) xmlSAX2GetParameterEntity __attribute((alias("xmlSAX2GetParameterEntity__internal_alias"))); -#else -#ifndef xmlSAX2GetParameterEntity -extern __typeof (xmlSAX2GetParameterEntity) xmlSAX2GetParameterEntity__internal_alias __attribute((visibility("hidden"))); -#define xmlSAX2GetParameterEntity xmlSAX2GetParameterEntity__internal_alias -#endif -#endif - -#ifdef bottom_SAX2 -#undef xmlSAX2GetPublicId -extern __typeof (xmlSAX2GetPublicId) xmlSAX2GetPublicId __attribute((alias("xmlSAX2GetPublicId__internal_alias"))); -#else -#ifndef xmlSAX2GetPublicId -extern __typeof (xmlSAX2GetPublicId) xmlSAX2GetPublicId__internal_alias __attribute((visibility("hidden"))); -#define xmlSAX2GetPublicId xmlSAX2GetPublicId__internal_alias -#endif -#endif - -#ifdef bottom_SAX2 -#undef xmlSAX2GetSystemId -extern __typeof (xmlSAX2GetSystemId) xmlSAX2GetSystemId __attribute((alias("xmlSAX2GetSystemId__internal_alias"))); -#else -#ifndef xmlSAX2GetSystemId -extern __typeof (xmlSAX2GetSystemId) xmlSAX2GetSystemId__internal_alias __attribute((visibility("hidden"))); -#define xmlSAX2GetSystemId xmlSAX2GetSystemId__internal_alias -#endif -#endif - -#ifdef bottom_SAX2 -#undef xmlSAX2HasExternalSubset -extern __typeof (xmlSAX2HasExternalSubset) xmlSAX2HasExternalSubset __attribute((alias("xmlSAX2HasExternalSubset__internal_alias"))); -#else -#ifndef xmlSAX2HasExternalSubset -extern __typeof (xmlSAX2HasExternalSubset) xmlSAX2HasExternalSubset__internal_alias __attribute((visibility("hidden"))); -#define xmlSAX2HasExternalSubset xmlSAX2HasExternalSubset__internal_alias -#endif -#endif - -#ifdef bottom_SAX2 -#undef xmlSAX2HasInternalSubset -extern __typeof (xmlSAX2HasInternalSubset) xmlSAX2HasInternalSubset __attribute((alias("xmlSAX2HasInternalSubset__internal_alias"))); -#else -#ifndef xmlSAX2HasInternalSubset -extern __typeof (xmlSAX2HasInternalSubset) xmlSAX2HasInternalSubset__internal_alias __attribute((visibility("hidden"))); -#define xmlSAX2HasInternalSubset xmlSAX2HasInternalSubset__internal_alias -#endif -#endif - -#ifdef bottom_SAX2 -#undef xmlSAX2IgnorableWhitespace -extern __typeof (xmlSAX2IgnorableWhitespace) xmlSAX2IgnorableWhitespace __attribute((alias("xmlSAX2IgnorableWhitespace__internal_alias"))); -#else -#ifndef xmlSAX2IgnorableWhitespace -extern __typeof (xmlSAX2IgnorableWhitespace) xmlSAX2IgnorableWhitespace__internal_alias __attribute((visibility("hidden"))); -#define xmlSAX2IgnorableWhitespace xmlSAX2IgnorableWhitespace__internal_alias -#endif -#endif - -#ifdef bottom_SAX2 -#undef xmlSAX2InitDefaultSAXHandler -extern __typeof (xmlSAX2InitDefaultSAXHandler) xmlSAX2InitDefaultSAXHandler __attribute((alias("xmlSAX2InitDefaultSAXHandler__internal_alias"))); -#else -#ifndef xmlSAX2InitDefaultSAXHandler -extern __typeof (xmlSAX2InitDefaultSAXHandler) xmlSAX2InitDefaultSAXHandler__internal_alias __attribute((visibility("hidden"))); -#define xmlSAX2InitDefaultSAXHandler xmlSAX2InitDefaultSAXHandler__internal_alias -#endif -#endif - -#if defined(LIBXML_DOCB_ENABLED) -#ifdef bottom_SAX2 -#undef xmlSAX2InitDocbDefaultSAXHandler -extern __typeof (xmlSAX2InitDocbDefaultSAXHandler) xmlSAX2InitDocbDefaultSAXHandler __attribute((alias("xmlSAX2InitDocbDefaultSAXHandler__internal_alias"))); -#else -#ifndef xmlSAX2InitDocbDefaultSAXHandler -extern __typeof (xmlSAX2InitDocbDefaultSAXHandler) xmlSAX2InitDocbDefaultSAXHandler__internal_alias __attribute((visibility("hidden"))); -#define xmlSAX2InitDocbDefaultSAXHandler xmlSAX2InitDocbDefaultSAXHandler__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_HTML_ENABLED) -#ifdef bottom_SAX2 -#undef xmlSAX2InitHtmlDefaultSAXHandler -extern __typeof (xmlSAX2InitHtmlDefaultSAXHandler) xmlSAX2InitHtmlDefaultSAXHandler __attribute((alias("xmlSAX2InitHtmlDefaultSAXHandler__internal_alias"))); -#else -#ifndef xmlSAX2InitHtmlDefaultSAXHandler -extern __typeof (xmlSAX2InitHtmlDefaultSAXHandler) xmlSAX2InitHtmlDefaultSAXHandler__internal_alias __attribute((visibility("hidden"))); -#define xmlSAX2InitHtmlDefaultSAXHandler xmlSAX2InitHtmlDefaultSAXHandler__internal_alias -#endif -#endif -#endif - -#ifdef bottom_SAX2 -#undef xmlSAX2InternalSubset -extern __typeof (xmlSAX2InternalSubset) xmlSAX2InternalSubset __attribute((alias("xmlSAX2InternalSubset__internal_alias"))); -#else -#ifndef xmlSAX2InternalSubset -extern __typeof (xmlSAX2InternalSubset) xmlSAX2InternalSubset__internal_alias __attribute((visibility("hidden"))); -#define xmlSAX2InternalSubset xmlSAX2InternalSubset__internal_alias -#endif -#endif - -#ifdef bottom_SAX2 -#undef xmlSAX2IsStandalone -extern __typeof (xmlSAX2IsStandalone) xmlSAX2IsStandalone __attribute((alias("xmlSAX2IsStandalone__internal_alias"))); -#else -#ifndef xmlSAX2IsStandalone -extern __typeof (xmlSAX2IsStandalone) xmlSAX2IsStandalone__internal_alias __attribute((visibility("hidden"))); -#define xmlSAX2IsStandalone xmlSAX2IsStandalone__internal_alias -#endif -#endif - -#ifdef bottom_SAX2 -#undef xmlSAX2NotationDecl -extern __typeof (xmlSAX2NotationDecl) xmlSAX2NotationDecl __attribute((alias("xmlSAX2NotationDecl__internal_alias"))); -#else -#ifndef xmlSAX2NotationDecl -extern __typeof (xmlSAX2NotationDecl) xmlSAX2NotationDecl__internal_alias __attribute((visibility("hidden"))); -#define xmlSAX2NotationDecl xmlSAX2NotationDecl__internal_alias -#endif -#endif - -#ifdef bottom_SAX2 -#undef xmlSAX2ProcessingInstruction -extern __typeof (xmlSAX2ProcessingInstruction) xmlSAX2ProcessingInstruction __attribute((alias("xmlSAX2ProcessingInstruction__internal_alias"))); -#else -#ifndef xmlSAX2ProcessingInstruction -extern __typeof (xmlSAX2ProcessingInstruction) xmlSAX2ProcessingInstruction__internal_alias __attribute((visibility("hidden"))); -#define xmlSAX2ProcessingInstruction xmlSAX2ProcessingInstruction__internal_alias -#endif -#endif - -#ifdef bottom_SAX2 -#undef xmlSAX2Reference -extern __typeof (xmlSAX2Reference) xmlSAX2Reference __attribute((alias("xmlSAX2Reference__internal_alias"))); -#else -#ifndef xmlSAX2Reference -extern __typeof (xmlSAX2Reference) xmlSAX2Reference__internal_alias __attribute((visibility("hidden"))); -#define xmlSAX2Reference xmlSAX2Reference__internal_alias -#endif -#endif - -#ifdef bottom_SAX2 -#undef xmlSAX2ResolveEntity -extern __typeof (xmlSAX2ResolveEntity) xmlSAX2ResolveEntity __attribute((alias("xmlSAX2ResolveEntity__internal_alias"))); -#else -#ifndef xmlSAX2ResolveEntity -extern __typeof (xmlSAX2ResolveEntity) xmlSAX2ResolveEntity__internal_alias __attribute((visibility("hidden"))); -#define xmlSAX2ResolveEntity xmlSAX2ResolveEntity__internal_alias -#endif -#endif - -#ifdef bottom_SAX2 -#undef xmlSAX2SetDocumentLocator -extern __typeof (xmlSAX2SetDocumentLocator) xmlSAX2SetDocumentLocator __attribute((alias("xmlSAX2SetDocumentLocator__internal_alias"))); -#else -#ifndef xmlSAX2SetDocumentLocator -extern __typeof (xmlSAX2SetDocumentLocator) xmlSAX2SetDocumentLocator__internal_alias __attribute((visibility("hidden"))); -#define xmlSAX2SetDocumentLocator xmlSAX2SetDocumentLocator__internal_alias -#endif -#endif - -#ifdef bottom_SAX2 -#undef xmlSAX2StartDocument -extern __typeof (xmlSAX2StartDocument) xmlSAX2StartDocument __attribute((alias("xmlSAX2StartDocument__internal_alias"))); -#else -#ifndef xmlSAX2StartDocument -extern __typeof (xmlSAX2StartDocument) xmlSAX2StartDocument__internal_alias __attribute((visibility("hidden"))); -#define xmlSAX2StartDocument xmlSAX2StartDocument__internal_alias -#endif -#endif - -#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) || defined(LIBXML_LEGACY_ENABLED) -#ifdef bottom_SAX2 -#undef xmlSAX2StartElement -extern __typeof (xmlSAX2StartElement) xmlSAX2StartElement __attribute((alias("xmlSAX2StartElement__internal_alias"))); -#else -#ifndef xmlSAX2StartElement -extern __typeof (xmlSAX2StartElement) xmlSAX2StartElement__internal_alias __attribute((visibility("hidden"))); -#define xmlSAX2StartElement xmlSAX2StartElement__internal_alias -#endif -#endif -#endif - -#ifdef bottom_SAX2 -#undef xmlSAX2StartElementNs -extern __typeof (xmlSAX2StartElementNs) xmlSAX2StartElementNs __attribute((alias("xmlSAX2StartElementNs__internal_alias"))); -#else -#ifndef xmlSAX2StartElementNs -extern __typeof (xmlSAX2StartElementNs) xmlSAX2StartElementNs__internal_alias __attribute((visibility("hidden"))); -#define xmlSAX2StartElementNs xmlSAX2StartElementNs__internal_alias -#endif -#endif - -#ifdef bottom_SAX2 -#undef xmlSAX2UnparsedEntityDecl -extern __typeof (xmlSAX2UnparsedEntityDecl) xmlSAX2UnparsedEntityDecl __attribute((alias("xmlSAX2UnparsedEntityDecl__internal_alias"))); -#else -#ifndef xmlSAX2UnparsedEntityDecl -extern __typeof (xmlSAX2UnparsedEntityDecl) xmlSAX2UnparsedEntityDecl__internal_alias __attribute((visibility("hidden"))); -#define xmlSAX2UnparsedEntityDecl xmlSAX2UnparsedEntityDecl__internal_alias -#endif -#endif - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef bottom_SAX2 -#undef xmlSAXDefaultVersion -extern __typeof (xmlSAXDefaultVersion) xmlSAXDefaultVersion __attribute((alias("xmlSAXDefaultVersion__internal_alias"))); -#else -#ifndef xmlSAXDefaultVersion -extern __typeof (xmlSAXDefaultVersion) xmlSAXDefaultVersion__internal_alias __attribute((visibility("hidden"))); -#define xmlSAXDefaultVersion xmlSAXDefaultVersion__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_VALID_ENABLED) -#ifdef bottom_parser -#undef xmlSAXParseDTD -extern __typeof (xmlSAXParseDTD) xmlSAXParseDTD __attribute((alias("xmlSAXParseDTD__internal_alias"))); -#else -#ifndef xmlSAXParseDTD -extern __typeof (xmlSAXParseDTD) xmlSAXParseDTD__internal_alias __attribute((visibility("hidden"))); -#define xmlSAXParseDTD xmlSAXParseDTD__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef bottom_parser -#undef xmlSAXParseDoc -extern __typeof (xmlSAXParseDoc) xmlSAXParseDoc __attribute((alias("xmlSAXParseDoc__internal_alias"))); -#else -#ifndef xmlSAXParseDoc -extern __typeof (xmlSAXParseDoc) xmlSAXParseDoc__internal_alias __attribute((visibility("hidden"))); -#define xmlSAXParseDoc xmlSAXParseDoc__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef bottom_parser -#undef xmlSAXParseEntity -extern __typeof (xmlSAXParseEntity) xmlSAXParseEntity __attribute((alias("xmlSAXParseEntity__internal_alias"))); -#else -#ifndef xmlSAXParseEntity -extern __typeof (xmlSAXParseEntity) xmlSAXParseEntity__internal_alias __attribute((visibility("hidden"))); -#define xmlSAXParseEntity xmlSAXParseEntity__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef bottom_parser -#undef xmlSAXParseFile -extern __typeof (xmlSAXParseFile) xmlSAXParseFile __attribute((alias("xmlSAXParseFile__internal_alias"))); -#else -#ifndef xmlSAXParseFile -extern __typeof (xmlSAXParseFile) xmlSAXParseFile__internal_alias __attribute((visibility("hidden"))); -#define xmlSAXParseFile xmlSAXParseFile__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef bottom_parser -#undef xmlSAXParseFileWithData -extern __typeof (xmlSAXParseFileWithData) xmlSAXParseFileWithData __attribute((alias("xmlSAXParseFileWithData__internal_alias"))); -#else -#ifndef xmlSAXParseFileWithData -extern __typeof (xmlSAXParseFileWithData) xmlSAXParseFileWithData__internal_alias __attribute((visibility("hidden"))); -#define xmlSAXParseFileWithData xmlSAXParseFileWithData__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef bottom_parser -#undef xmlSAXParseMemory -extern __typeof (xmlSAXParseMemory) xmlSAXParseMemory __attribute((alias("xmlSAXParseMemory__internal_alias"))); -#else -#ifndef xmlSAXParseMemory -extern __typeof (xmlSAXParseMemory) xmlSAXParseMemory__internal_alias __attribute((visibility("hidden"))); -#define xmlSAXParseMemory xmlSAXParseMemory__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef bottom_parser -#undef xmlSAXParseMemoryWithData -extern __typeof (xmlSAXParseMemoryWithData) xmlSAXParseMemoryWithData __attribute((alias("xmlSAXParseMemoryWithData__internal_alias"))); -#else -#ifndef xmlSAXParseMemoryWithData -extern __typeof (xmlSAXParseMemoryWithData) xmlSAXParseMemoryWithData__internal_alias __attribute((visibility("hidden"))); -#define xmlSAXParseMemoryWithData xmlSAXParseMemoryWithData__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef bottom_parser -#undef xmlSAXUserParseFile -extern __typeof (xmlSAXUserParseFile) xmlSAXUserParseFile __attribute((alias("xmlSAXUserParseFile__internal_alias"))); -#else -#ifndef xmlSAXUserParseFile -extern __typeof (xmlSAXUserParseFile) xmlSAXUserParseFile__internal_alias __attribute((visibility("hidden"))); -#define xmlSAXUserParseFile xmlSAXUserParseFile__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef bottom_parser -#undef xmlSAXUserParseMemory -extern __typeof (xmlSAXUserParseMemory) xmlSAXUserParseMemory __attribute((alias("xmlSAXUserParseMemory__internal_alias"))); -#else -#ifndef xmlSAXUserParseMemory -extern __typeof (xmlSAXUserParseMemory) xmlSAXUserParseMemory__internal_alias __attribute((visibility("hidden"))); -#define xmlSAXUserParseMemory xmlSAXUserParseMemory__internal_alias -#endif -#endif -#endif - -#ifdef bottom_SAX2 -#undef xmlSAXVersion -extern __typeof (xmlSAXVersion) xmlSAXVersion __attribute((alias("xmlSAXVersion__internal_alias"))); -#else -#ifndef xmlSAXVersion -extern __typeof (xmlSAXVersion) xmlSAXVersion__internal_alias __attribute((visibility("hidden"))); -#define xmlSAXVersion xmlSAXVersion__internal_alias -#endif -#endif - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_xmlsave -#undef xmlSaveClose -extern __typeof (xmlSaveClose) xmlSaveClose __attribute((alias("xmlSaveClose__internal_alias"))); -#else -#ifndef xmlSaveClose -extern __typeof (xmlSaveClose) xmlSaveClose__internal_alias __attribute((visibility("hidden"))); -#define xmlSaveClose xmlSaveClose__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_xmlsave -#undef xmlSaveDoc -extern __typeof (xmlSaveDoc) xmlSaveDoc __attribute((alias("xmlSaveDoc__internal_alias"))); -#else -#ifndef xmlSaveDoc -extern __typeof (xmlSaveDoc) xmlSaveDoc__internal_alias __attribute((visibility("hidden"))); -#define xmlSaveDoc xmlSaveDoc__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_xmlsave -#undef xmlSaveFile -extern __typeof (xmlSaveFile) xmlSaveFile __attribute((alias("xmlSaveFile__internal_alias"))); -#else -#ifndef xmlSaveFile -extern __typeof (xmlSaveFile) xmlSaveFile__internal_alias __attribute((visibility("hidden"))); -#define xmlSaveFile xmlSaveFile__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_xmlsave -#undef xmlSaveFileEnc -extern __typeof (xmlSaveFileEnc) xmlSaveFileEnc __attribute((alias("xmlSaveFileEnc__internal_alias"))); -#else -#ifndef xmlSaveFileEnc -extern __typeof (xmlSaveFileEnc) xmlSaveFileEnc__internal_alias __attribute((visibility("hidden"))); -#define xmlSaveFileEnc xmlSaveFileEnc__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_xmlsave -#undef xmlSaveFileTo -extern __typeof (xmlSaveFileTo) xmlSaveFileTo __attribute((alias("xmlSaveFileTo__internal_alias"))); -#else -#ifndef xmlSaveFileTo -extern __typeof (xmlSaveFileTo) xmlSaveFileTo__internal_alias __attribute((visibility("hidden"))); -#define xmlSaveFileTo xmlSaveFileTo__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_xmlsave -#undef xmlSaveFlush -extern __typeof (xmlSaveFlush) xmlSaveFlush __attribute((alias("xmlSaveFlush__internal_alias"))); -#else -#ifndef xmlSaveFlush -extern __typeof (xmlSaveFlush) xmlSaveFlush__internal_alias __attribute((visibility("hidden"))); -#define xmlSaveFlush xmlSaveFlush__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_xmlsave -#undef xmlSaveFormatFile -extern __typeof (xmlSaveFormatFile) xmlSaveFormatFile __attribute((alias("xmlSaveFormatFile__internal_alias"))); -#else -#ifndef xmlSaveFormatFile -extern __typeof (xmlSaveFormatFile) xmlSaveFormatFile__internal_alias __attribute((visibility("hidden"))); -#define xmlSaveFormatFile xmlSaveFormatFile__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_xmlsave -#undef xmlSaveFormatFileEnc -extern __typeof (xmlSaveFormatFileEnc) xmlSaveFormatFileEnc __attribute((alias("xmlSaveFormatFileEnc__internal_alias"))); -#else -#ifndef xmlSaveFormatFileEnc -extern __typeof (xmlSaveFormatFileEnc) xmlSaveFormatFileEnc__internal_alias __attribute((visibility("hidden"))); -#define xmlSaveFormatFileEnc xmlSaveFormatFileEnc__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_xmlsave -#undef xmlSaveFormatFileTo -extern __typeof (xmlSaveFormatFileTo) xmlSaveFormatFileTo __attribute((alias("xmlSaveFormatFileTo__internal_alias"))); -#else -#ifndef xmlSaveFormatFileTo -extern __typeof (xmlSaveFormatFileTo) xmlSaveFormatFileTo__internal_alias __attribute((visibility("hidden"))); -#define xmlSaveFormatFileTo xmlSaveFormatFileTo__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_xmlsave -#undef xmlSaveSetAttrEscape -extern __typeof (xmlSaveSetAttrEscape) xmlSaveSetAttrEscape __attribute((alias("xmlSaveSetAttrEscape__internal_alias"))); -#else -#ifndef xmlSaveSetAttrEscape -extern __typeof (xmlSaveSetAttrEscape) xmlSaveSetAttrEscape__internal_alias __attribute((visibility("hidden"))); -#define xmlSaveSetAttrEscape xmlSaveSetAttrEscape__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_xmlsave -#undef xmlSaveSetEscape -extern __typeof (xmlSaveSetEscape) xmlSaveSetEscape __attribute((alias("xmlSaveSetEscape__internal_alias"))); -#else -#ifndef xmlSaveSetEscape -extern __typeof (xmlSaveSetEscape) xmlSaveSetEscape__internal_alias __attribute((visibility("hidden"))); -#define xmlSaveSetEscape xmlSaveSetEscape__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_xmlsave -#undef xmlSaveToBuffer -extern __typeof (xmlSaveToBuffer) xmlSaveToBuffer __attribute((alias("xmlSaveToBuffer__internal_alias"))); -#else -#ifndef xmlSaveToBuffer -extern __typeof (xmlSaveToBuffer) xmlSaveToBuffer__internal_alias __attribute((visibility("hidden"))); -#define xmlSaveToBuffer xmlSaveToBuffer__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_xmlsave -#undef xmlSaveToFd -extern __typeof (xmlSaveToFd) xmlSaveToFd __attribute((alias("xmlSaveToFd__internal_alias"))); -#else -#ifndef xmlSaveToFd -extern __typeof (xmlSaveToFd) xmlSaveToFd__internal_alias __attribute((visibility("hidden"))); -#define xmlSaveToFd xmlSaveToFd__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_xmlsave -#undef xmlSaveToFilename -extern __typeof (xmlSaveToFilename) xmlSaveToFilename __attribute((alias("xmlSaveToFilename__internal_alias"))); -#else -#ifndef xmlSaveToFilename -extern __typeof (xmlSaveToFilename) xmlSaveToFilename__internal_alias __attribute((visibility("hidden"))); -#define xmlSaveToFilename xmlSaveToFilename__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_xmlsave -#undef xmlSaveToIO -extern __typeof (xmlSaveToIO) xmlSaveToIO __attribute((alias("xmlSaveToIO__internal_alias"))); -#else -#ifndef xmlSaveToIO -extern __typeof (xmlSaveToIO) xmlSaveToIO__internal_alias __attribute((visibility("hidden"))); -#define xmlSaveToIO xmlSaveToIO__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_xmlsave -#undef xmlSaveTree -extern __typeof (xmlSaveTree) xmlSaveTree __attribute((alias("xmlSaveTree__internal_alias"))); -#else -#ifndef xmlSaveTree -extern __typeof (xmlSaveTree) xmlSaveTree__internal_alias __attribute((visibility("hidden"))); -#define xmlSaveTree xmlSaveTree__internal_alias -#endif -#endif -#endif - -#ifdef bottom_uri -#undef xmlSaveUri -extern __typeof (xmlSaveUri) xmlSaveUri __attribute((alias("xmlSaveUri__internal_alias"))); -#else -#ifndef xmlSaveUri -extern __typeof (xmlSaveUri) xmlSaveUri__internal_alias __attribute((visibility("hidden"))); -#define xmlSaveUri xmlSaveUri__internal_alias -#endif -#endif - -#if defined(LIBXML_LEGACY_ENABLED) -#ifdef bottom_legacy -#undef xmlScanName -extern __typeof (xmlScanName) xmlScanName __attribute((alias("xmlScanName__internal_alias"))); -#else -#ifndef xmlScanName -extern __typeof (xmlScanName) xmlScanName__internal_alias __attribute((visibility("hidden"))); -#define xmlScanName xmlScanName__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemas -#undef xmlSchemaCheckFacet -extern __typeof (xmlSchemaCheckFacet) xmlSchemaCheckFacet __attribute((alias("xmlSchemaCheckFacet__internal_alias"))); -#else -#ifndef xmlSchemaCheckFacet -extern __typeof (xmlSchemaCheckFacet) xmlSchemaCheckFacet__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaCheckFacet xmlSchemaCheckFacet__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemastypes -#undef xmlSchemaCleanupTypes -extern __typeof (xmlSchemaCleanupTypes) xmlSchemaCleanupTypes __attribute((alias("xmlSchemaCleanupTypes__internal_alias"))); -#else -#ifndef xmlSchemaCleanupTypes -extern __typeof (xmlSchemaCleanupTypes) xmlSchemaCleanupTypes__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaCleanupTypes xmlSchemaCleanupTypes__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemastypes -#undef xmlSchemaCollapseString -extern __typeof (xmlSchemaCollapseString) xmlSchemaCollapseString __attribute((alias("xmlSchemaCollapseString__internal_alias"))); -#else -#ifndef xmlSchemaCollapseString -extern __typeof (xmlSchemaCollapseString) xmlSchemaCollapseString__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaCollapseString xmlSchemaCollapseString__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemastypes -#undef xmlSchemaCompareValues -extern __typeof (xmlSchemaCompareValues) xmlSchemaCompareValues __attribute((alias("xmlSchemaCompareValues__internal_alias"))); -#else -#ifndef xmlSchemaCompareValues -extern __typeof (xmlSchemaCompareValues) xmlSchemaCompareValues__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaCompareValues xmlSchemaCompareValues__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemastypes -#undef xmlSchemaCompareValuesWhtsp -extern __typeof (xmlSchemaCompareValuesWhtsp) xmlSchemaCompareValuesWhtsp __attribute((alias("xmlSchemaCompareValuesWhtsp__internal_alias"))); -#else -#ifndef xmlSchemaCompareValuesWhtsp -extern __typeof (xmlSchemaCompareValuesWhtsp) xmlSchemaCompareValuesWhtsp__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaCompareValuesWhtsp xmlSchemaCompareValuesWhtsp__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemastypes -#undef xmlSchemaCopyValue -extern __typeof (xmlSchemaCopyValue) xmlSchemaCopyValue __attribute((alias("xmlSchemaCopyValue__internal_alias"))); -#else -#ifndef xmlSchemaCopyValue -extern __typeof (xmlSchemaCopyValue) xmlSchemaCopyValue__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaCopyValue xmlSchemaCopyValue__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_xmlschemas -#undef xmlSchemaDump -extern __typeof (xmlSchemaDump) xmlSchemaDump __attribute((alias("xmlSchemaDump__internal_alias"))); -#else -#ifndef xmlSchemaDump -extern __typeof (xmlSchemaDump) xmlSchemaDump__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaDump xmlSchemaDump__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemas -#undef xmlSchemaFree -extern __typeof (xmlSchemaFree) xmlSchemaFree __attribute((alias("xmlSchemaFree__internal_alias"))); -#else -#ifndef xmlSchemaFree -extern __typeof (xmlSchemaFree) xmlSchemaFree__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaFree xmlSchemaFree__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemas -#undef xmlSchemaFreeFacet -extern __typeof (xmlSchemaFreeFacet) xmlSchemaFreeFacet __attribute((alias("xmlSchemaFreeFacet__internal_alias"))); -#else -#ifndef xmlSchemaFreeFacet -extern __typeof (xmlSchemaFreeFacet) xmlSchemaFreeFacet__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaFreeFacet xmlSchemaFreeFacet__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemas -#undef xmlSchemaFreeParserCtxt -extern __typeof (xmlSchemaFreeParserCtxt) xmlSchemaFreeParserCtxt __attribute((alias("xmlSchemaFreeParserCtxt__internal_alias"))); -#else -#ifndef xmlSchemaFreeParserCtxt -extern __typeof (xmlSchemaFreeParserCtxt) xmlSchemaFreeParserCtxt__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaFreeParserCtxt xmlSchemaFreeParserCtxt__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemas -#undef xmlSchemaFreeType -extern __typeof (xmlSchemaFreeType) xmlSchemaFreeType __attribute((alias("xmlSchemaFreeType__internal_alias"))); -#else -#ifndef xmlSchemaFreeType -extern __typeof (xmlSchemaFreeType) xmlSchemaFreeType__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaFreeType xmlSchemaFreeType__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemas -#undef xmlSchemaFreeValidCtxt -extern __typeof (xmlSchemaFreeValidCtxt) xmlSchemaFreeValidCtxt __attribute((alias("xmlSchemaFreeValidCtxt__internal_alias"))); -#else -#ifndef xmlSchemaFreeValidCtxt -extern __typeof (xmlSchemaFreeValidCtxt) xmlSchemaFreeValidCtxt__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaFreeValidCtxt xmlSchemaFreeValidCtxt__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemastypes -#undef xmlSchemaFreeValue -extern __typeof (xmlSchemaFreeValue) xmlSchemaFreeValue __attribute((alias("xmlSchemaFreeValue__internal_alias"))); -#else -#ifndef xmlSchemaFreeValue -extern __typeof (xmlSchemaFreeValue) xmlSchemaFreeValue__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaFreeValue xmlSchemaFreeValue__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemas -#undef xmlSchemaFreeWildcard -extern __typeof (xmlSchemaFreeWildcard) xmlSchemaFreeWildcard __attribute((alias("xmlSchemaFreeWildcard__internal_alias"))); -#else -#ifndef xmlSchemaFreeWildcard -extern __typeof (xmlSchemaFreeWildcard) xmlSchemaFreeWildcard__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaFreeWildcard xmlSchemaFreeWildcard__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemastypes -#undef xmlSchemaGetBuiltInListSimpleTypeItemType -extern __typeof (xmlSchemaGetBuiltInListSimpleTypeItemType) xmlSchemaGetBuiltInListSimpleTypeItemType __attribute((alias("xmlSchemaGetBuiltInListSimpleTypeItemType__internal_alias"))); -#else -#ifndef xmlSchemaGetBuiltInListSimpleTypeItemType -extern __typeof (xmlSchemaGetBuiltInListSimpleTypeItemType) xmlSchemaGetBuiltInListSimpleTypeItemType__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaGetBuiltInListSimpleTypeItemType xmlSchemaGetBuiltInListSimpleTypeItemType__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemastypes -#undef xmlSchemaGetBuiltInType -extern __typeof (xmlSchemaGetBuiltInType) xmlSchemaGetBuiltInType __attribute((alias("xmlSchemaGetBuiltInType__internal_alias"))); -#else -#ifndef xmlSchemaGetBuiltInType -extern __typeof (xmlSchemaGetBuiltInType) xmlSchemaGetBuiltInType__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaGetBuiltInType xmlSchemaGetBuiltInType__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemastypes -#undef xmlSchemaGetCanonValue -extern __typeof (xmlSchemaGetCanonValue) xmlSchemaGetCanonValue __attribute((alias("xmlSchemaGetCanonValue__internal_alias"))); -#else -#ifndef xmlSchemaGetCanonValue -extern __typeof (xmlSchemaGetCanonValue) xmlSchemaGetCanonValue__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaGetCanonValue xmlSchemaGetCanonValue__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemastypes -#undef xmlSchemaGetCanonValueWhtsp -extern __typeof (xmlSchemaGetCanonValueWhtsp) xmlSchemaGetCanonValueWhtsp __attribute((alias("xmlSchemaGetCanonValueWhtsp__internal_alias"))); -#else -#ifndef xmlSchemaGetCanonValueWhtsp -extern __typeof (xmlSchemaGetCanonValueWhtsp) xmlSchemaGetCanonValueWhtsp__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaGetCanonValueWhtsp xmlSchemaGetCanonValueWhtsp__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemastypes -#undef xmlSchemaGetFacetValueAsULong -extern __typeof (xmlSchemaGetFacetValueAsULong) xmlSchemaGetFacetValueAsULong __attribute((alias("xmlSchemaGetFacetValueAsULong__internal_alias"))); -#else -#ifndef xmlSchemaGetFacetValueAsULong -extern __typeof (xmlSchemaGetFacetValueAsULong) xmlSchemaGetFacetValueAsULong__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaGetFacetValueAsULong xmlSchemaGetFacetValueAsULong__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemas -#undef xmlSchemaGetParserErrors -extern __typeof (xmlSchemaGetParserErrors) xmlSchemaGetParserErrors __attribute((alias("xmlSchemaGetParserErrors__internal_alias"))); -#else -#ifndef xmlSchemaGetParserErrors -extern __typeof (xmlSchemaGetParserErrors) xmlSchemaGetParserErrors__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaGetParserErrors xmlSchemaGetParserErrors__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemastypes -#undef xmlSchemaGetPredefinedType -extern __typeof (xmlSchemaGetPredefinedType) xmlSchemaGetPredefinedType __attribute((alias("xmlSchemaGetPredefinedType__internal_alias"))); -#else -#ifndef xmlSchemaGetPredefinedType -extern __typeof (xmlSchemaGetPredefinedType) xmlSchemaGetPredefinedType__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaGetPredefinedType xmlSchemaGetPredefinedType__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemastypes -#undef xmlSchemaGetValType -extern __typeof (xmlSchemaGetValType) xmlSchemaGetValType __attribute((alias("xmlSchemaGetValType__internal_alias"))); -#else -#ifndef xmlSchemaGetValType -extern __typeof (xmlSchemaGetValType) xmlSchemaGetValType__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaGetValType xmlSchemaGetValType__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemas -#undef xmlSchemaGetValidErrors -extern __typeof (xmlSchemaGetValidErrors) xmlSchemaGetValidErrors __attribute((alias("xmlSchemaGetValidErrors__internal_alias"))); -#else -#ifndef xmlSchemaGetValidErrors -extern __typeof (xmlSchemaGetValidErrors) xmlSchemaGetValidErrors__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaGetValidErrors xmlSchemaGetValidErrors__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemastypes -#undef xmlSchemaInitTypes -extern __typeof (xmlSchemaInitTypes) xmlSchemaInitTypes __attribute((alias("xmlSchemaInitTypes__internal_alias"))); -#else -#ifndef xmlSchemaInitTypes -extern __typeof (xmlSchemaInitTypes) xmlSchemaInitTypes__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaInitTypes xmlSchemaInitTypes__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemastypes -#undef xmlSchemaIsBuiltInTypeFacet -extern __typeof (xmlSchemaIsBuiltInTypeFacet) xmlSchemaIsBuiltInTypeFacet __attribute((alias("xmlSchemaIsBuiltInTypeFacet__internal_alias"))); -#else -#ifndef xmlSchemaIsBuiltInTypeFacet -extern __typeof (xmlSchemaIsBuiltInTypeFacet) xmlSchemaIsBuiltInTypeFacet__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaIsBuiltInTypeFacet xmlSchemaIsBuiltInTypeFacet__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemas -#undef xmlSchemaIsValid -extern __typeof (xmlSchemaIsValid) xmlSchemaIsValid __attribute((alias("xmlSchemaIsValid__internal_alias"))); -#else -#ifndef xmlSchemaIsValid -extern __typeof (xmlSchemaIsValid) xmlSchemaIsValid__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaIsValid xmlSchemaIsValid__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemas -#undef xmlSchemaNewDocParserCtxt -extern __typeof (xmlSchemaNewDocParserCtxt) xmlSchemaNewDocParserCtxt __attribute((alias("xmlSchemaNewDocParserCtxt__internal_alias"))); -#else -#ifndef xmlSchemaNewDocParserCtxt -extern __typeof (xmlSchemaNewDocParserCtxt) xmlSchemaNewDocParserCtxt__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaNewDocParserCtxt xmlSchemaNewDocParserCtxt__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemas -#undef xmlSchemaNewFacet -extern __typeof (xmlSchemaNewFacet) xmlSchemaNewFacet __attribute((alias("xmlSchemaNewFacet__internal_alias"))); -#else -#ifndef xmlSchemaNewFacet -extern __typeof (xmlSchemaNewFacet) xmlSchemaNewFacet__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaNewFacet xmlSchemaNewFacet__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemas -#undef xmlSchemaNewMemParserCtxt -extern __typeof (xmlSchemaNewMemParserCtxt) xmlSchemaNewMemParserCtxt __attribute((alias("xmlSchemaNewMemParserCtxt__internal_alias"))); -#else -#ifndef xmlSchemaNewMemParserCtxt -extern __typeof (xmlSchemaNewMemParserCtxt) xmlSchemaNewMemParserCtxt__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaNewMemParserCtxt xmlSchemaNewMemParserCtxt__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemastypes -#undef xmlSchemaNewNOTATIONValue -extern __typeof (xmlSchemaNewNOTATIONValue) xmlSchemaNewNOTATIONValue __attribute((alias("xmlSchemaNewNOTATIONValue__internal_alias"))); -#else -#ifndef xmlSchemaNewNOTATIONValue -extern __typeof (xmlSchemaNewNOTATIONValue) xmlSchemaNewNOTATIONValue__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaNewNOTATIONValue xmlSchemaNewNOTATIONValue__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemas -#undef xmlSchemaNewParserCtxt -extern __typeof (xmlSchemaNewParserCtxt) xmlSchemaNewParserCtxt __attribute((alias("xmlSchemaNewParserCtxt__internal_alias"))); -#else -#ifndef xmlSchemaNewParserCtxt -extern __typeof (xmlSchemaNewParserCtxt) xmlSchemaNewParserCtxt__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaNewParserCtxt xmlSchemaNewParserCtxt__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemastypes -#undef xmlSchemaNewQNameValue -extern __typeof (xmlSchemaNewQNameValue) xmlSchemaNewQNameValue __attribute((alias("xmlSchemaNewQNameValue__internal_alias"))); -#else -#ifndef xmlSchemaNewQNameValue -extern __typeof (xmlSchemaNewQNameValue) xmlSchemaNewQNameValue__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaNewQNameValue xmlSchemaNewQNameValue__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemastypes -#undef xmlSchemaNewStringValue -extern __typeof (xmlSchemaNewStringValue) xmlSchemaNewStringValue __attribute((alias("xmlSchemaNewStringValue__internal_alias"))); -#else -#ifndef xmlSchemaNewStringValue -extern __typeof (xmlSchemaNewStringValue) xmlSchemaNewStringValue__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaNewStringValue xmlSchemaNewStringValue__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemas -#undef xmlSchemaNewValidCtxt -extern __typeof (xmlSchemaNewValidCtxt) xmlSchemaNewValidCtxt __attribute((alias("xmlSchemaNewValidCtxt__internal_alias"))); -#else -#ifndef xmlSchemaNewValidCtxt -extern __typeof (xmlSchemaNewValidCtxt) xmlSchemaNewValidCtxt__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaNewValidCtxt xmlSchemaNewValidCtxt__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemas -#undef xmlSchemaParse -extern __typeof (xmlSchemaParse) xmlSchemaParse __attribute((alias("xmlSchemaParse__internal_alias"))); -#else -#ifndef xmlSchemaParse -extern __typeof (xmlSchemaParse) xmlSchemaParse__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaParse xmlSchemaParse__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemas -#undef xmlSchemaSAXPlug -extern __typeof (xmlSchemaSAXPlug) xmlSchemaSAXPlug __attribute((alias("xmlSchemaSAXPlug__internal_alias"))); -#else -#ifndef xmlSchemaSAXPlug -extern __typeof (xmlSchemaSAXPlug) xmlSchemaSAXPlug__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaSAXPlug xmlSchemaSAXPlug__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemas -#undef xmlSchemaSAXUnplug -extern __typeof (xmlSchemaSAXUnplug) xmlSchemaSAXUnplug __attribute((alias("xmlSchemaSAXUnplug__internal_alias"))); -#else -#ifndef xmlSchemaSAXUnplug -extern __typeof (xmlSchemaSAXUnplug) xmlSchemaSAXUnplug__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaSAXUnplug xmlSchemaSAXUnplug__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemas -#undef xmlSchemaSetParserErrors -extern __typeof (xmlSchemaSetParserErrors) xmlSchemaSetParserErrors __attribute((alias("xmlSchemaSetParserErrors__internal_alias"))); -#else -#ifndef xmlSchemaSetParserErrors -extern __typeof (xmlSchemaSetParserErrors) xmlSchemaSetParserErrors__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaSetParserErrors xmlSchemaSetParserErrors__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemas -#undef xmlSchemaSetParserStructuredErrors -extern __typeof (xmlSchemaSetParserStructuredErrors) xmlSchemaSetParserStructuredErrors __attribute((alias("xmlSchemaSetParserStructuredErrors__internal_alias"))); -#else -#ifndef xmlSchemaSetParserStructuredErrors -extern __typeof (xmlSchemaSetParserStructuredErrors) xmlSchemaSetParserStructuredErrors__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaSetParserStructuredErrors xmlSchemaSetParserStructuredErrors__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemas -#undef xmlSchemaSetValidErrors -extern __typeof (xmlSchemaSetValidErrors) xmlSchemaSetValidErrors __attribute((alias("xmlSchemaSetValidErrors__internal_alias"))); -#else -#ifndef xmlSchemaSetValidErrors -extern __typeof (xmlSchemaSetValidErrors) xmlSchemaSetValidErrors__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaSetValidErrors xmlSchemaSetValidErrors__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemas -#undef xmlSchemaSetValidOptions -extern __typeof (xmlSchemaSetValidOptions) xmlSchemaSetValidOptions __attribute((alias("xmlSchemaSetValidOptions__internal_alias"))); -#else -#ifndef xmlSchemaSetValidOptions -extern __typeof (xmlSchemaSetValidOptions) xmlSchemaSetValidOptions__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaSetValidOptions xmlSchemaSetValidOptions__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemas -#undef xmlSchemaSetValidStructuredErrors -extern __typeof (xmlSchemaSetValidStructuredErrors) xmlSchemaSetValidStructuredErrors __attribute((alias("xmlSchemaSetValidStructuredErrors__internal_alias"))); -#else -#ifndef xmlSchemaSetValidStructuredErrors -extern __typeof (xmlSchemaSetValidStructuredErrors) xmlSchemaSetValidStructuredErrors__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaSetValidStructuredErrors xmlSchemaSetValidStructuredErrors__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemastypes -#undef xmlSchemaValPredefTypeNode -extern __typeof (xmlSchemaValPredefTypeNode) xmlSchemaValPredefTypeNode __attribute((alias("xmlSchemaValPredefTypeNode__internal_alias"))); -#else -#ifndef xmlSchemaValPredefTypeNode -extern __typeof (xmlSchemaValPredefTypeNode) xmlSchemaValPredefTypeNode__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaValPredefTypeNode xmlSchemaValPredefTypeNode__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemastypes -#undef xmlSchemaValPredefTypeNodeNoNorm -extern __typeof (xmlSchemaValPredefTypeNodeNoNorm) xmlSchemaValPredefTypeNodeNoNorm __attribute((alias("xmlSchemaValPredefTypeNodeNoNorm__internal_alias"))); -#else -#ifndef xmlSchemaValPredefTypeNodeNoNorm -extern __typeof (xmlSchemaValPredefTypeNodeNoNorm) xmlSchemaValPredefTypeNodeNoNorm__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaValPredefTypeNodeNoNorm xmlSchemaValPredefTypeNodeNoNorm__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemas -#undef xmlSchemaValidCtxtGetOptions -extern __typeof (xmlSchemaValidCtxtGetOptions) xmlSchemaValidCtxtGetOptions __attribute((alias("xmlSchemaValidCtxtGetOptions__internal_alias"))); -#else -#ifndef xmlSchemaValidCtxtGetOptions -extern __typeof (xmlSchemaValidCtxtGetOptions) xmlSchemaValidCtxtGetOptions__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaValidCtxtGetOptions xmlSchemaValidCtxtGetOptions__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemas -#undef xmlSchemaValidCtxtGetParserCtxt -extern __typeof (xmlSchemaValidCtxtGetParserCtxt) xmlSchemaValidCtxtGetParserCtxt __attribute((alias("xmlSchemaValidCtxtGetParserCtxt__internal_alias"))); -#else -#ifndef xmlSchemaValidCtxtGetParserCtxt -extern __typeof (xmlSchemaValidCtxtGetParserCtxt) xmlSchemaValidCtxtGetParserCtxt__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaValidCtxtGetParserCtxt xmlSchemaValidCtxtGetParserCtxt__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemas -#undef xmlSchemaValidateDoc -extern __typeof (xmlSchemaValidateDoc) xmlSchemaValidateDoc __attribute((alias("xmlSchemaValidateDoc__internal_alias"))); -#else -#ifndef xmlSchemaValidateDoc -extern __typeof (xmlSchemaValidateDoc) xmlSchemaValidateDoc__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaValidateDoc xmlSchemaValidateDoc__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemastypes -#undef xmlSchemaValidateFacet -extern __typeof (xmlSchemaValidateFacet) xmlSchemaValidateFacet __attribute((alias("xmlSchemaValidateFacet__internal_alias"))); -#else -#ifndef xmlSchemaValidateFacet -extern __typeof (xmlSchemaValidateFacet) xmlSchemaValidateFacet__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaValidateFacet xmlSchemaValidateFacet__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemastypes -#undef xmlSchemaValidateFacetWhtsp -extern __typeof (xmlSchemaValidateFacetWhtsp) xmlSchemaValidateFacetWhtsp __attribute((alias("xmlSchemaValidateFacetWhtsp__internal_alias"))); -#else -#ifndef xmlSchemaValidateFacetWhtsp -extern __typeof (xmlSchemaValidateFacetWhtsp) xmlSchemaValidateFacetWhtsp__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaValidateFacetWhtsp xmlSchemaValidateFacetWhtsp__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemas -#undef xmlSchemaValidateFile -extern __typeof (xmlSchemaValidateFile) xmlSchemaValidateFile __attribute((alias("xmlSchemaValidateFile__internal_alias"))); -#else -#ifndef xmlSchemaValidateFile -extern __typeof (xmlSchemaValidateFile) xmlSchemaValidateFile__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaValidateFile xmlSchemaValidateFile__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemastypes -#undef xmlSchemaValidateLengthFacet -extern __typeof (xmlSchemaValidateLengthFacet) xmlSchemaValidateLengthFacet __attribute((alias("xmlSchemaValidateLengthFacet__internal_alias"))); -#else -#ifndef xmlSchemaValidateLengthFacet -extern __typeof (xmlSchemaValidateLengthFacet) xmlSchemaValidateLengthFacet__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaValidateLengthFacet xmlSchemaValidateLengthFacet__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemastypes -#undef xmlSchemaValidateLengthFacetWhtsp -extern __typeof (xmlSchemaValidateLengthFacetWhtsp) xmlSchemaValidateLengthFacetWhtsp __attribute((alias("xmlSchemaValidateLengthFacetWhtsp__internal_alias"))); -#else -#ifndef xmlSchemaValidateLengthFacetWhtsp -extern __typeof (xmlSchemaValidateLengthFacetWhtsp) xmlSchemaValidateLengthFacetWhtsp__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaValidateLengthFacetWhtsp xmlSchemaValidateLengthFacetWhtsp__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemastypes -#undef xmlSchemaValidateListSimpleTypeFacet -extern __typeof (xmlSchemaValidateListSimpleTypeFacet) xmlSchemaValidateListSimpleTypeFacet __attribute((alias("xmlSchemaValidateListSimpleTypeFacet__internal_alias"))); -#else -#ifndef xmlSchemaValidateListSimpleTypeFacet -extern __typeof (xmlSchemaValidateListSimpleTypeFacet) xmlSchemaValidateListSimpleTypeFacet__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaValidateListSimpleTypeFacet xmlSchemaValidateListSimpleTypeFacet__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemas -#undef xmlSchemaValidateOneElement -extern __typeof (xmlSchemaValidateOneElement) xmlSchemaValidateOneElement __attribute((alias("xmlSchemaValidateOneElement__internal_alias"))); -#else -#ifndef xmlSchemaValidateOneElement -extern __typeof (xmlSchemaValidateOneElement) xmlSchemaValidateOneElement__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaValidateOneElement xmlSchemaValidateOneElement__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemastypes -#undef xmlSchemaValidatePredefinedType -extern __typeof (xmlSchemaValidatePredefinedType) xmlSchemaValidatePredefinedType __attribute((alias("xmlSchemaValidatePredefinedType__internal_alias"))); -#else -#ifndef xmlSchemaValidatePredefinedType -extern __typeof (xmlSchemaValidatePredefinedType) xmlSchemaValidatePredefinedType__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaValidatePredefinedType xmlSchemaValidatePredefinedType__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemas -#undef xmlSchemaValidateSetFilename -extern __typeof (xmlSchemaValidateSetFilename) xmlSchemaValidateSetFilename __attribute((alias("xmlSchemaValidateSetFilename__internal_alias"))); -#else -#ifndef xmlSchemaValidateSetFilename -extern __typeof (xmlSchemaValidateSetFilename) xmlSchemaValidateSetFilename__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaValidateSetFilename xmlSchemaValidateSetFilename__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemas -#undef xmlSchemaValidateSetLocator -extern __typeof (xmlSchemaValidateSetLocator) xmlSchemaValidateSetLocator __attribute((alias("xmlSchemaValidateSetLocator__internal_alias"))); -#else -#ifndef xmlSchemaValidateSetLocator -extern __typeof (xmlSchemaValidateSetLocator) xmlSchemaValidateSetLocator__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaValidateSetLocator xmlSchemaValidateSetLocator__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemas -#undef xmlSchemaValidateStream -extern __typeof (xmlSchemaValidateStream) xmlSchemaValidateStream __attribute((alias("xmlSchemaValidateStream__internal_alias"))); -#else -#ifndef xmlSchemaValidateStream -extern __typeof (xmlSchemaValidateStream) xmlSchemaValidateStream__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaValidateStream xmlSchemaValidateStream__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemastypes -#undef xmlSchemaValueAppend -extern __typeof (xmlSchemaValueAppend) xmlSchemaValueAppend __attribute((alias("xmlSchemaValueAppend__internal_alias"))); -#else -#ifndef xmlSchemaValueAppend -extern __typeof (xmlSchemaValueAppend) xmlSchemaValueAppend__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaValueAppend xmlSchemaValueAppend__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemastypes -#undef xmlSchemaValueGetAsBoolean -extern __typeof (xmlSchemaValueGetAsBoolean) xmlSchemaValueGetAsBoolean __attribute((alias("xmlSchemaValueGetAsBoolean__internal_alias"))); -#else -#ifndef xmlSchemaValueGetAsBoolean -extern __typeof (xmlSchemaValueGetAsBoolean) xmlSchemaValueGetAsBoolean__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaValueGetAsBoolean xmlSchemaValueGetAsBoolean__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemastypes -#undef xmlSchemaValueGetAsString -extern __typeof (xmlSchemaValueGetAsString) xmlSchemaValueGetAsString __attribute((alias("xmlSchemaValueGetAsString__internal_alias"))); -#else -#ifndef xmlSchemaValueGetAsString -extern __typeof (xmlSchemaValueGetAsString) xmlSchemaValueGetAsString__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaValueGetAsString xmlSchemaValueGetAsString__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemastypes -#undef xmlSchemaValueGetNext -extern __typeof (xmlSchemaValueGetNext) xmlSchemaValueGetNext __attribute((alias("xmlSchemaValueGetNext__internal_alias"))); -#else -#ifndef xmlSchemaValueGetNext -extern __typeof (xmlSchemaValueGetNext) xmlSchemaValueGetNext__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaValueGetNext xmlSchemaValueGetNext__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlschemastypes -#undef xmlSchemaWhiteSpaceReplace -extern __typeof (xmlSchemaWhiteSpaceReplace) xmlSchemaWhiteSpaceReplace __attribute((alias("xmlSchemaWhiteSpaceReplace__internal_alias"))); -#else -#ifndef xmlSchemaWhiteSpaceReplace -extern __typeof (xmlSchemaWhiteSpaceReplace) xmlSchemaWhiteSpaceReplace__internal_alias __attribute((visibility("hidden"))); -#define xmlSchemaWhiteSpaceReplace xmlSchemaWhiteSpaceReplace__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMATRON_ENABLED) -#ifdef bottom_schematron -#undef xmlSchematronFree -extern __typeof (xmlSchematronFree) xmlSchematronFree __attribute((alias("xmlSchematronFree__internal_alias"))); -#else -#ifndef xmlSchematronFree -extern __typeof (xmlSchematronFree) xmlSchematronFree__internal_alias __attribute((visibility("hidden"))); -#define xmlSchematronFree xmlSchematronFree__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMATRON_ENABLED) -#ifdef bottom_schematron -#undef xmlSchematronFreeParserCtxt -extern __typeof (xmlSchematronFreeParserCtxt) xmlSchematronFreeParserCtxt __attribute((alias("xmlSchematronFreeParserCtxt__internal_alias"))); -#else -#ifndef xmlSchematronFreeParserCtxt -extern __typeof (xmlSchematronFreeParserCtxt) xmlSchematronFreeParserCtxt__internal_alias __attribute((visibility("hidden"))); -#define xmlSchematronFreeParserCtxt xmlSchematronFreeParserCtxt__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMATRON_ENABLED) -#ifdef bottom_schematron -#undef xmlSchematronFreeValidCtxt -extern __typeof (xmlSchematronFreeValidCtxt) xmlSchematronFreeValidCtxt __attribute((alias("xmlSchematronFreeValidCtxt__internal_alias"))); -#else -#ifndef xmlSchematronFreeValidCtxt -extern __typeof (xmlSchematronFreeValidCtxt) xmlSchematronFreeValidCtxt__internal_alias __attribute((visibility("hidden"))); -#define xmlSchematronFreeValidCtxt xmlSchematronFreeValidCtxt__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMATRON_ENABLED) -#ifdef bottom_schematron -#undef xmlSchematronNewDocParserCtxt -extern __typeof (xmlSchematronNewDocParserCtxt) xmlSchematronNewDocParserCtxt __attribute((alias("xmlSchematronNewDocParserCtxt__internal_alias"))); -#else -#ifndef xmlSchematronNewDocParserCtxt -extern __typeof (xmlSchematronNewDocParserCtxt) xmlSchematronNewDocParserCtxt__internal_alias __attribute((visibility("hidden"))); -#define xmlSchematronNewDocParserCtxt xmlSchematronNewDocParserCtxt__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMATRON_ENABLED) -#ifdef bottom_schematron -#undef xmlSchematronNewMemParserCtxt -extern __typeof (xmlSchematronNewMemParserCtxt) xmlSchematronNewMemParserCtxt __attribute((alias("xmlSchematronNewMemParserCtxt__internal_alias"))); -#else -#ifndef xmlSchematronNewMemParserCtxt -extern __typeof (xmlSchematronNewMemParserCtxt) xmlSchematronNewMemParserCtxt__internal_alias __attribute((visibility("hidden"))); -#define xmlSchematronNewMemParserCtxt xmlSchematronNewMemParserCtxt__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMATRON_ENABLED) -#ifdef bottom_schematron -#undef xmlSchematronNewParserCtxt -extern __typeof (xmlSchematronNewParserCtxt) xmlSchematronNewParserCtxt __attribute((alias("xmlSchematronNewParserCtxt__internal_alias"))); -#else -#ifndef xmlSchematronNewParserCtxt -extern __typeof (xmlSchematronNewParserCtxt) xmlSchematronNewParserCtxt__internal_alias __attribute((visibility("hidden"))); -#define xmlSchematronNewParserCtxt xmlSchematronNewParserCtxt__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMATRON_ENABLED) -#ifdef bottom_schematron -#undef xmlSchematronNewValidCtxt -extern __typeof (xmlSchematronNewValidCtxt) xmlSchematronNewValidCtxt __attribute((alias("xmlSchematronNewValidCtxt__internal_alias"))); -#else -#ifndef xmlSchematronNewValidCtxt -extern __typeof (xmlSchematronNewValidCtxt) xmlSchematronNewValidCtxt__internal_alias __attribute((visibility("hidden"))); -#define xmlSchematronNewValidCtxt xmlSchematronNewValidCtxt__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMATRON_ENABLED) -#ifdef bottom_schematron -#undef xmlSchematronParse -extern __typeof (xmlSchematronParse) xmlSchematronParse __attribute((alias("xmlSchematronParse__internal_alias"))); -#else -#ifndef xmlSchematronParse -extern __typeof (xmlSchematronParse) xmlSchematronParse__internal_alias __attribute((visibility("hidden"))); -#define xmlSchematronParse xmlSchematronParse__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMATRON_ENABLED) -#ifdef bottom_schematron -#undef xmlSchematronSetValidStructuredErrors -extern __typeof (xmlSchematronSetValidStructuredErrors) xmlSchematronSetValidStructuredErrors __attribute((alias("xmlSchematronSetValidStructuredErrors__internal_alias"))); -#else -#ifndef xmlSchematronSetValidStructuredErrors -extern __typeof (xmlSchematronSetValidStructuredErrors) xmlSchematronSetValidStructuredErrors__internal_alias __attribute((visibility("hidden"))); -#define xmlSchematronSetValidStructuredErrors xmlSchematronSetValidStructuredErrors__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SCHEMATRON_ENABLED) -#ifdef bottom_schematron -#undef xmlSchematronValidateDoc -extern __typeof (xmlSchematronValidateDoc) xmlSchematronValidateDoc __attribute((alias("xmlSchematronValidateDoc__internal_alias"))); -#else -#ifndef xmlSchematronValidateDoc -extern __typeof (xmlSchematronValidateDoc) xmlSchematronValidateDoc__internal_alias __attribute((visibility("hidden"))); -#define xmlSchematronValidateDoc xmlSchematronValidateDoc__internal_alias -#endif -#endif -#endif - -#ifdef bottom_tree -#undef xmlSearchNs -extern __typeof (xmlSearchNs) xmlSearchNs __attribute((alias("xmlSearchNs__internal_alias"))); -#else -#ifndef xmlSearchNs -extern __typeof (xmlSearchNs) xmlSearchNs__internal_alias __attribute((visibility("hidden"))); -#define xmlSearchNs xmlSearchNs__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlSearchNsByHref -extern __typeof (xmlSearchNsByHref) xmlSearchNsByHref __attribute((alias("xmlSearchNsByHref__internal_alias"))); -#else -#ifndef xmlSearchNsByHref -extern __typeof (xmlSearchNsByHref) xmlSearchNsByHref__internal_alias __attribute((visibility("hidden"))); -#define xmlSearchNsByHref xmlSearchNsByHref__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlSetBufferAllocationScheme -extern __typeof (xmlSetBufferAllocationScheme) xmlSetBufferAllocationScheme __attribute((alias("xmlSetBufferAllocationScheme__internal_alias"))); -#else -#ifndef xmlSetBufferAllocationScheme -extern __typeof (xmlSetBufferAllocationScheme) xmlSetBufferAllocationScheme__internal_alias __attribute((visibility("hidden"))); -#define xmlSetBufferAllocationScheme xmlSetBufferAllocationScheme__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlSetCompressMode -extern __typeof (xmlSetCompressMode) xmlSetCompressMode __attribute((alias("xmlSetCompressMode__internal_alias"))); -#else -#ifndef xmlSetCompressMode -extern __typeof (xmlSetCompressMode) xmlSetCompressMode__internal_alias __attribute((visibility("hidden"))); -#define xmlSetCompressMode xmlSetCompressMode__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlSetDocCompressMode -extern __typeof (xmlSetDocCompressMode) xmlSetDocCompressMode __attribute((alias("xmlSetDocCompressMode__internal_alias"))); -#else -#ifndef xmlSetDocCompressMode -extern __typeof (xmlSetDocCompressMode) xmlSetDocCompressMode__internal_alias __attribute((visibility("hidden"))); -#define xmlSetDocCompressMode xmlSetDocCompressMode__internal_alias -#endif -#endif - -#if defined(LIBXML_LEGACY_ENABLED) -#ifdef bottom_parser -#undef xmlSetEntityReferenceFunc -extern __typeof (xmlSetEntityReferenceFunc) xmlSetEntityReferenceFunc __attribute((alias("xmlSetEntityReferenceFunc__internal_alias"))); -#else -#ifndef xmlSetEntityReferenceFunc -extern __typeof (xmlSetEntityReferenceFunc) xmlSetEntityReferenceFunc__internal_alias __attribute((visibility("hidden"))); -#define xmlSetEntityReferenceFunc xmlSetEntityReferenceFunc__internal_alias -#endif -#endif -#endif - -#ifdef bottom_xmlIO -#undef xmlSetExternalEntityLoader -extern __typeof (xmlSetExternalEntityLoader) xmlSetExternalEntityLoader __attribute((alias("xmlSetExternalEntityLoader__internal_alias"))); -#else -#ifndef xmlSetExternalEntityLoader -extern __typeof (xmlSetExternalEntityLoader) xmlSetExternalEntityLoader__internal_alias __attribute((visibility("hidden"))); -#define xmlSetExternalEntityLoader xmlSetExternalEntityLoader__internal_alias -#endif -#endif - -#if defined(LIBXML_LEGACY_ENABLED) -#ifdef bottom_legacy -#undef xmlSetFeature -extern __typeof (xmlSetFeature) xmlSetFeature __attribute((alias("xmlSetFeature__internal_alias"))); -#else -#ifndef xmlSetFeature -extern __typeof (xmlSetFeature) xmlSetFeature__internal_alias __attribute((visibility("hidden"))); -#define xmlSetFeature xmlSetFeature__internal_alias -#endif -#endif -#endif - -#ifdef bottom_error -#undef xmlSetGenericErrorFunc -extern __typeof (xmlSetGenericErrorFunc) xmlSetGenericErrorFunc __attribute((alias("xmlSetGenericErrorFunc__internal_alias"))); -#else -#ifndef xmlSetGenericErrorFunc -extern __typeof (xmlSetGenericErrorFunc) xmlSetGenericErrorFunc__internal_alias __attribute((visibility("hidden"))); -#define xmlSetGenericErrorFunc xmlSetGenericErrorFunc__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlSetListDoc -extern __typeof (xmlSetListDoc) xmlSetListDoc __attribute((alias("xmlSetListDoc__internal_alias"))); -#else -#ifndef xmlSetListDoc -extern __typeof (xmlSetListDoc) xmlSetListDoc__internal_alias __attribute((visibility("hidden"))); -#define xmlSetListDoc xmlSetListDoc__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlSetNs -extern __typeof (xmlSetNs) xmlSetNs __attribute((alias("xmlSetNs__internal_alias"))); -#else -#ifndef xmlSetNs -extern __typeof (xmlSetNs) xmlSetNs__internal_alias __attribute((visibility("hidden"))); -#define xmlSetNs xmlSetNs__internal_alias -#endif -#endif - -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED) -#ifdef bottom_tree -#undef xmlSetNsProp -extern __typeof (xmlSetNsProp) xmlSetNsProp __attribute((alias("xmlSetNsProp__internal_alias"))); -#else -#ifndef xmlSetNsProp -extern __typeof (xmlSetNsProp) xmlSetNsProp__internal_alias __attribute((visibility("hidden"))); -#define xmlSetNsProp xmlSetNsProp__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED) -#ifdef bottom_tree -#undef xmlSetProp -extern __typeof (xmlSetProp) xmlSetProp __attribute((alias("xmlSetProp__internal_alias"))); -#else -#ifndef xmlSetProp -extern __typeof (xmlSetProp) xmlSetProp__internal_alias __attribute((visibility("hidden"))); -#define xmlSetProp xmlSetProp__internal_alias -#endif -#endif -#endif - -#ifdef bottom_error -#undef xmlSetStructuredErrorFunc -extern __typeof (xmlSetStructuredErrorFunc) xmlSetStructuredErrorFunc __attribute((alias("xmlSetStructuredErrorFunc__internal_alias"))); -#else -#ifndef xmlSetStructuredErrorFunc -extern __typeof (xmlSetStructuredErrorFunc) xmlSetStructuredErrorFunc__internal_alias __attribute((visibility("hidden"))); -#define xmlSetStructuredErrorFunc xmlSetStructuredErrorFunc__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlSetTreeDoc -extern __typeof (xmlSetTreeDoc) xmlSetTreeDoc __attribute((alias("xmlSetTreeDoc__internal_alias"))); -#else -#ifndef xmlSetTreeDoc -extern __typeof (xmlSetTreeDoc) xmlSetTreeDoc__internal_alias __attribute((visibility("hidden"))); -#define xmlSetTreeDoc xmlSetTreeDoc__internal_alias -#endif -#endif - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef bottom_parser -#undef xmlSetupParserForBuffer -extern __typeof (xmlSetupParserForBuffer) xmlSetupParserForBuffer __attribute((alias("xmlSetupParserForBuffer__internal_alias"))); -#else -#ifndef xmlSetupParserForBuffer -extern __typeof (xmlSetupParserForBuffer) xmlSetupParserForBuffer__internal_alias __attribute((visibility("hidden"))); -#define xmlSetupParserForBuffer xmlSetupParserForBuffer__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_debugXML -#undef xmlShell -extern __typeof (xmlShell) xmlShell __attribute((alias("xmlShell__internal_alias"))); -#else -#ifndef xmlShell -extern __typeof (xmlShell) xmlShell__internal_alias __attribute((visibility("hidden"))); -#define xmlShell xmlShell__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_debugXML -#undef xmlShellBase -extern __typeof (xmlShellBase) xmlShellBase __attribute((alias("xmlShellBase__internal_alias"))); -#else -#ifndef xmlShellBase -extern __typeof (xmlShellBase) xmlShellBase__internal_alias __attribute((visibility("hidden"))); -#define xmlShellBase xmlShellBase__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_debugXML -#undef xmlShellCat -extern __typeof (xmlShellCat) xmlShellCat __attribute((alias("xmlShellCat__internal_alias"))); -#else -#ifndef xmlShellCat -extern __typeof (xmlShellCat) xmlShellCat__internal_alias __attribute((visibility("hidden"))); -#define xmlShellCat xmlShellCat__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_debugXML -#undef xmlShellDir -extern __typeof (xmlShellDir) xmlShellDir __attribute((alias("xmlShellDir__internal_alias"))); -#else -#ifndef xmlShellDir -extern __typeof (xmlShellDir) xmlShellDir__internal_alias __attribute((visibility("hidden"))); -#define xmlShellDir xmlShellDir__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_debugXML -#undef xmlShellDu -extern __typeof (xmlShellDu) xmlShellDu __attribute((alias("xmlShellDu__internal_alias"))); -#else -#ifndef xmlShellDu -extern __typeof (xmlShellDu) xmlShellDu__internal_alias __attribute((visibility("hidden"))); -#define xmlShellDu xmlShellDu__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_debugXML -#undef xmlShellList -extern __typeof (xmlShellList) xmlShellList __attribute((alias("xmlShellList__internal_alias"))); -#else -#ifndef xmlShellList -extern __typeof (xmlShellList) xmlShellList__internal_alias __attribute((visibility("hidden"))); -#define xmlShellList xmlShellList__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_debugXML -#undef xmlShellLoad -extern __typeof (xmlShellLoad) xmlShellLoad __attribute((alias("xmlShellLoad__internal_alias"))); -#else -#ifndef xmlShellLoad -extern __typeof (xmlShellLoad) xmlShellLoad__internal_alias __attribute((visibility("hidden"))); -#define xmlShellLoad xmlShellLoad__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_debugXML -#undef xmlShellPrintNode -extern __typeof (xmlShellPrintNode) xmlShellPrintNode __attribute((alias("xmlShellPrintNode__internal_alias"))); -#else -#ifndef xmlShellPrintNode -extern __typeof (xmlShellPrintNode) xmlShellPrintNode__internal_alias __attribute((visibility("hidden"))); -#define xmlShellPrintNode xmlShellPrintNode__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_debugXML -#undef xmlShellPrintXPathError -extern __typeof (xmlShellPrintXPathError) xmlShellPrintXPathError __attribute((alias("xmlShellPrintXPathError__internal_alias"))); -#else -#ifndef xmlShellPrintXPathError -extern __typeof (xmlShellPrintXPathError) xmlShellPrintXPathError__internal_alias __attribute((visibility("hidden"))); -#define xmlShellPrintXPathError xmlShellPrintXPathError__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_debugXML -#undef xmlShellPrintXPathResult -extern __typeof (xmlShellPrintXPathResult) xmlShellPrintXPathResult __attribute((alias("xmlShellPrintXPathResult__internal_alias"))); -#else -#ifndef xmlShellPrintXPathResult -extern __typeof (xmlShellPrintXPathResult) xmlShellPrintXPathResult__internal_alias __attribute((visibility("hidden"))); -#define xmlShellPrintXPathResult xmlShellPrintXPathResult__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_debugXML -#undef xmlShellPwd -extern __typeof (xmlShellPwd) xmlShellPwd __attribute((alias("xmlShellPwd__internal_alias"))); -#else -#ifndef xmlShellPwd -extern __typeof (xmlShellPwd) xmlShellPwd__internal_alias __attribute((visibility("hidden"))); -#define xmlShellPwd xmlShellPwd__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_debugXML -#undef xmlShellSave -extern __typeof (xmlShellSave) xmlShellSave __attribute((alias("xmlShellSave__internal_alias"))); -#else -#ifndef xmlShellSave -extern __typeof (xmlShellSave) xmlShellSave__internal_alias __attribute((visibility("hidden"))); -#define xmlShellSave xmlShellSave__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_VALID_ENABLED) -#ifdef bottom_debugXML -#undef xmlShellValidate -extern __typeof (xmlShellValidate) xmlShellValidate __attribute((alias("xmlShellValidate__internal_alias"))); -#else -#ifndef xmlShellValidate -extern __typeof (xmlShellValidate) xmlShellValidate__internal_alias __attribute((visibility("hidden"))); -#define xmlShellValidate xmlShellValidate__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_debugXML -#undef xmlShellWrite -extern __typeof (xmlShellWrite) xmlShellWrite __attribute((alias("xmlShellWrite__internal_alias"))); -#else -#ifndef xmlShellWrite -extern __typeof (xmlShellWrite) xmlShellWrite__internal_alias __attribute((visibility("hidden"))); -#define xmlShellWrite xmlShellWrite__internal_alias -#endif -#endif -#endif - -#ifdef bottom_parser -#undef xmlSkipBlankChars -extern __typeof (xmlSkipBlankChars) xmlSkipBlankChars __attribute((alias("xmlSkipBlankChars__internal_alias"))); -#else -#ifndef xmlSkipBlankChars -extern __typeof (xmlSkipBlankChars) xmlSkipBlankChars__internal_alias __attribute((visibility("hidden"))); -#define xmlSkipBlankChars xmlSkipBlankChars__internal_alias -#endif -#endif - -#ifdef bottom_valid -#undef xmlSnprintfElementContent -extern __typeof (xmlSnprintfElementContent) xmlSnprintfElementContent __attribute((alias("xmlSnprintfElementContent__internal_alias"))); -#else -#ifndef xmlSnprintfElementContent -extern __typeof (xmlSnprintfElementContent) xmlSnprintfElementContent__internal_alias __attribute((visibility("hidden"))); -#define xmlSnprintfElementContent xmlSnprintfElementContent__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlSplitQName -extern __typeof (xmlSplitQName) xmlSplitQName __attribute((alias("xmlSplitQName__internal_alias"))); -#else -#ifndef xmlSplitQName -extern __typeof (xmlSplitQName) xmlSplitQName__internal_alias __attribute((visibility("hidden"))); -#define xmlSplitQName xmlSplitQName__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlSplitQName2 -extern __typeof (xmlSplitQName2) xmlSplitQName2 __attribute((alias("xmlSplitQName2__internal_alias"))); -#else -#ifndef xmlSplitQName2 -extern __typeof (xmlSplitQName2) xmlSplitQName2__internal_alias __attribute((visibility("hidden"))); -#define xmlSplitQName2 xmlSplitQName2__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlSplitQName3 -extern __typeof (xmlSplitQName3) xmlSplitQName3 __attribute((alias("xmlSplitQName3__internal_alias"))); -#else -#ifndef xmlSplitQName3 -extern __typeof (xmlSplitQName3) xmlSplitQName3__internal_alias __attribute((visibility("hidden"))); -#define xmlSplitQName3 xmlSplitQName3__internal_alias -#endif -#endif - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef bottom_valid -#undef xmlSprintfElementContent -extern __typeof (xmlSprintfElementContent) xmlSprintfElementContent __attribute((alias("xmlSprintfElementContent__internal_alias"))); -#else -#ifndef xmlSprintfElementContent -extern __typeof (xmlSprintfElementContent) xmlSprintfElementContent__internal_alias __attribute((visibility("hidden"))); -#define xmlSprintfElementContent xmlSprintfElementContent__internal_alias -#endif -#endif -#endif - -#ifdef bottom_parser -#undef xmlStopParser -extern __typeof (xmlStopParser) xmlStopParser __attribute((alias("xmlStopParser__internal_alias"))); -#else -#ifndef xmlStopParser -extern __typeof (xmlStopParser) xmlStopParser__internal_alias __attribute((visibility("hidden"))); -#define xmlStopParser xmlStopParser__internal_alias -#endif -#endif - -#ifdef bottom_xmlstring -#undef xmlStrEqual -extern __typeof (xmlStrEqual) xmlStrEqual __attribute((alias("xmlStrEqual__internal_alias"))); -#else -#ifndef xmlStrEqual -extern __typeof (xmlStrEqual) xmlStrEqual__internal_alias __attribute((visibility("hidden"))); -#define xmlStrEqual xmlStrEqual__internal_alias -#endif -#endif - -#ifdef bottom_xmlstring -#undef xmlStrPrintf -extern __typeof (xmlStrPrintf) xmlStrPrintf __attribute((alias("xmlStrPrintf__internal_alias"))); -#else -#ifndef xmlStrPrintf -extern __typeof (xmlStrPrintf) xmlStrPrintf__internal_alias __attribute((visibility("hidden"))); -#define xmlStrPrintf xmlStrPrintf__internal_alias -#endif -#endif - -#ifdef bottom_xmlstring -#undef xmlStrQEqual -extern __typeof (xmlStrQEqual) xmlStrQEqual __attribute((alias("xmlStrQEqual__internal_alias"))); -#else -#ifndef xmlStrQEqual -extern __typeof (xmlStrQEqual) xmlStrQEqual__internal_alias __attribute((visibility("hidden"))); -#define xmlStrQEqual xmlStrQEqual__internal_alias -#endif -#endif - -#ifdef bottom_xmlstring -#undef xmlStrVPrintf -extern __typeof (xmlStrVPrintf) xmlStrVPrintf __attribute((alias("xmlStrVPrintf__internal_alias"))); -#else -#ifndef xmlStrVPrintf -extern __typeof (xmlStrVPrintf) xmlStrVPrintf__internal_alias __attribute((visibility("hidden"))); -#define xmlStrVPrintf xmlStrVPrintf__internal_alias -#endif -#endif - -#ifdef bottom_xmlstring -#undef xmlStrcasecmp -extern __typeof (xmlStrcasecmp) xmlStrcasecmp __attribute((alias("xmlStrcasecmp__internal_alias"))); -#else -#ifndef xmlStrcasecmp -extern __typeof (xmlStrcasecmp) xmlStrcasecmp__internal_alias __attribute((visibility("hidden"))); -#define xmlStrcasecmp xmlStrcasecmp__internal_alias -#endif -#endif - -#ifdef bottom_xmlstring -#undef xmlStrcasestr -extern __typeof (xmlStrcasestr) xmlStrcasestr __attribute((alias("xmlStrcasestr__internal_alias"))); -#else -#ifndef xmlStrcasestr -extern __typeof (xmlStrcasestr) xmlStrcasestr__internal_alias __attribute((visibility("hidden"))); -#define xmlStrcasestr xmlStrcasestr__internal_alias -#endif -#endif - -#ifdef bottom_xmlstring -#undef xmlStrcat -extern __typeof (xmlStrcat) xmlStrcat __attribute((alias("xmlStrcat__internal_alias"))); -#else -#ifndef xmlStrcat -extern __typeof (xmlStrcat) xmlStrcat__internal_alias __attribute((visibility("hidden"))); -#define xmlStrcat xmlStrcat__internal_alias -#endif -#endif - -#ifdef bottom_xmlstring -#undef xmlStrchr -extern __typeof (xmlStrchr) xmlStrchr __attribute((alias("xmlStrchr__internal_alias"))); -#else -#ifndef xmlStrchr -extern __typeof (xmlStrchr) xmlStrchr__internal_alias __attribute((visibility("hidden"))); -#define xmlStrchr xmlStrchr__internal_alias -#endif -#endif - -#ifdef bottom_xmlstring -#undef xmlStrcmp -extern __typeof (xmlStrcmp) xmlStrcmp __attribute((alias("xmlStrcmp__internal_alias"))); -#else -#ifndef xmlStrcmp -extern __typeof (xmlStrcmp) xmlStrcmp__internal_alias __attribute((visibility("hidden"))); -#define xmlStrcmp xmlStrcmp__internal_alias -#endif -#endif - -#ifdef bottom_xmlstring -#undef xmlStrdup -extern __typeof (xmlStrdup) xmlStrdup __attribute((alias("xmlStrdup__internal_alias"))); -#else -#ifndef xmlStrdup -extern __typeof (xmlStrdup) xmlStrdup__internal_alias __attribute((visibility("hidden"))); -#define xmlStrdup xmlStrdup__internal_alias -#endif -#endif - -#if defined(LIBXML_PATTERN_ENABLED) -#ifdef bottom_pattern -#undef xmlStreamPop -extern __typeof (xmlStreamPop) xmlStreamPop __attribute((alias("xmlStreamPop__internal_alias"))); -#else -#ifndef xmlStreamPop -extern __typeof (xmlStreamPop) xmlStreamPop__internal_alias __attribute((visibility("hidden"))); -#define xmlStreamPop xmlStreamPop__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_PATTERN_ENABLED) -#ifdef bottom_pattern -#undef xmlStreamPush -extern __typeof (xmlStreamPush) xmlStreamPush __attribute((alias("xmlStreamPush__internal_alias"))); -#else -#ifndef xmlStreamPush -extern __typeof (xmlStreamPush) xmlStreamPush__internal_alias __attribute((visibility("hidden"))); -#define xmlStreamPush xmlStreamPush__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_PATTERN_ENABLED) -#ifdef bottom_pattern -#undef xmlStreamPushAttr -extern __typeof (xmlStreamPushAttr) xmlStreamPushAttr __attribute((alias("xmlStreamPushAttr__internal_alias"))); -#else -#ifndef xmlStreamPushAttr -extern __typeof (xmlStreamPushAttr) xmlStreamPushAttr__internal_alias __attribute((visibility("hidden"))); -#define xmlStreamPushAttr xmlStreamPushAttr__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_PATTERN_ENABLED) -#ifdef bottom_pattern -#undef xmlStreamPushNode -extern __typeof (xmlStreamPushNode) xmlStreamPushNode __attribute((alias("xmlStreamPushNode__internal_alias"))); -#else -#ifndef xmlStreamPushNode -extern __typeof (xmlStreamPushNode) xmlStreamPushNode__internal_alias __attribute((visibility("hidden"))); -#define xmlStreamPushNode xmlStreamPushNode__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_PATTERN_ENABLED) -#ifdef bottom_pattern -#undef xmlStreamWantsAnyNode -extern __typeof (xmlStreamWantsAnyNode) xmlStreamWantsAnyNode __attribute((alias("xmlStreamWantsAnyNode__internal_alias"))); -#else -#ifndef xmlStreamWantsAnyNode -extern __typeof (xmlStreamWantsAnyNode) xmlStreamWantsAnyNode__internal_alias __attribute((visibility("hidden"))); -#define xmlStreamWantsAnyNode xmlStreamWantsAnyNode__internal_alias -#endif -#endif -#endif - -#ifdef bottom_parserInternals -#undef xmlStringCurrentChar -extern __typeof (xmlStringCurrentChar) xmlStringCurrentChar __attribute((alias("xmlStringCurrentChar__internal_alias"))); -#else -#ifndef xmlStringCurrentChar -extern __typeof (xmlStringCurrentChar) xmlStringCurrentChar__internal_alias __attribute((visibility("hidden"))); -#define xmlStringCurrentChar xmlStringCurrentChar__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlStringDecodeEntities -extern __typeof (xmlStringDecodeEntities) xmlStringDecodeEntities __attribute((alias("xmlStringDecodeEntities__internal_alias"))); -#else -#ifndef xmlStringDecodeEntities -extern __typeof (xmlStringDecodeEntities) xmlStringDecodeEntities__internal_alias __attribute((visibility("hidden"))); -#define xmlStringDecodeEntities xmlStringDecodeEntities__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlStringGetNodeList -extern __typeof (xmlStringGetNodeList) xmlStringGetNodeList __attribute((alias("xmlStringGetNodeList__internal_alias"))); -#else -#ifndef xmlStringGetNodeList -extern __typeof (xmlStringGetNodeList) xmlStringGetNodeList__internal_alias __attribute((visibility("hidden"))); -#define xmlStringGetNodeList xmlStringGetNodeList__internal_alias -#endif -#endif - -#ifdef bottom_parser -#undef xmlStringLenDecodeEntities -extern __typeof (xmlStringLenDecodeEntities) xmlStringLenDecodeEntities __attribute((alias("xmlStringLenDecodeEntities__internal_alias"))); -#else -#ifndef xmlStringLenDecodeEntities -extern __typeof (xmlStringLenDecodeEntities) xmlStringLenDecodeEntities__internal_alias __attribute((visibility("hidden"))); -#define xmlStringLenDecodeEntities xmlStringLenDecodeEntities__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlStringLenGetNodeList -extern __typeof (xmlStringLenGetNodeList) xmlStringLenGetNodeList __attribute((alias("xmlStringLenGetNodeList__internal_alias"))); -#else -#ifndef xmlStringLenGetNodeList -extern __typeof (xmlStringLenGetNodeList) xmlStringLenGetNodeList__internal_alias __attribute((visibility("hidden"))); -#define xmlStringLenGetNodeList xmlStringLenGetNodeList__internal_alias -#endif -#endif - -#ifdef bottom_xmlstring -#undef xmlStrlen -extern __typeof (xmlStrlen) xmlStrlen __attribute((alias("xmlStrlen__internal_alias"))); -#else -#ifndef xmlStrlen -extern __typeof (xmlStrlen) xmlStrlen__internal_alias __attribute((visibility("hidden"))); -#define xmlStrlen xmlStrlen__internal_alias -#endif -#endif - -#ifdef bottom_xmlstring -#undef xmlStrncasecmp -extern __typeof (xmlStrncasecmp) xmlStrncasecmp __attribute((alias("xmlStrncasecmp__internal_alias"))); -#else -#ifndef xmlStrncasecmp -extern __typeof (xmlStrncasecmp) xmlStrncasecmp__internal_alias __attribute((visibility("hidden"))); -#define xmlStrncasecmp xmlStrncasecmp__internal_alias -#endif -#endif - -#ifdef bottom_xmlstring -#undef xmlStrncat -extern __typeof (xmlStrncat) xmlStrncat __attribute((alias("xmlStrncat__internal_alias"))); -#else -#ifndef xmlStrncat -extern __typeof (xmlStrncat) xmlStrncat__internal_alias __attribute((visibility("hidden"))); -#define xmlStrncat xmlStrncat__internal_alias -#endif -#endif - -#ifdef bottom_xmlstring -#undef xmlStrncatNew -extern __typeof (xmlStrncatNew) xmlStrncatNew __attribute((alias("xmlStrncatNew__internal_alias"))); -#else -#ifndef xmlStrncatNew -extern __typeof (xmlStrncatNew) xmlStrncatNew__internal_alias __attribute((visibility("hidden"))); -#define xmlStrncatNew xmlStrncatNew__internal_alias -#endif -#endif - -#ifdef bottom_xmlstring -#undef xmlStrncmp -extern __typeof (xmlStrncmp) xmlStrncmp __attribute((alias("xmlStrncmp__internal_alias"))); -#else -#ifndef xmlStrncmp -extern __typeof (xmlStrncmp) xmlStrncmp__internal_alias __attribute((visibility("hidden"))); -#define xmlStrncmp xmlStrncmp__internal_alias -#endif -#endif - -#ifdef bottom_xmlstring -#undef xmlStrndup -extern __typeof (xmlStrndup) xmlStrndup __attribute((alias("xmlStrndup__internal_alias"))); -#else -#ifndef xmlStrndup -extern __typeof (xmlStrndup) xmlStrndup__internal_alias __attribute((visibility("hidden"))); -#define xmlStrndup xmlStrndup__internal_alias -#endif -#endif - -#ifdef bottom_xmlstring -#undef xmlStrstr -extern __typeof (xmlStrstr) xmlStrstr __attribute((alias("xmlStrstr__internal_alias"))); -#else -#ifndef xmlStrstr -extern __typeof (xmlStrstr) xmlStrstr__internal_alias __attribute((visibility("hidden"))); -#define xmlStrstr xmlStrstr__internal_alias -#endif -#endif - -#ifdef bottom_xmlstring -#undef xmlStrsub -extern __typeof (xmlStrsub) xmlStrsub __attribute((alias("xmlStrsub__internal_alias"))); -#else -#ifndef xmlStrsub -extern __typeof (xmlStrsub) xmlStrsub__internal_alias __attribute((visibility("hidden"))); -#define xmlStrsub xmlStrsub__internal_alias -#endif -#endif - -#ifdef bottom_parserInternals -#undef xmlSubstituteEntitiesDefault -extern __typeof (xmlSubstituteEntitiesDefault) xmlSubstituteEntitiesDefault __attribute((alias("xmlSubstituteEntitiesDefault__internal_alias"))); -#else -#ifndef xmlSubstituteEntitiesDefault -extern __typeof (xmlSubstituteEntitiesDefault) xmlSubstituteEntitiesDefault__internal_alias __attribute((visibility("hidden"))); -#define xmlSubstituteEntitiesDefault xmlSubstituteEntitiesDefault__internal_alias -#endif -#endif - -#ifdef bottom_parserInternals -#undef xmlSwitchEncoding -extern __typeof (xmlSwitchEncoding) xmlSwitchEncoding __attribute((alias("xmlSwitchEncoding__internal_alias"))); -#else -#ifndef xmlSwitchEncoding -extern __typeof (xmlSwitchEncoding) xmlSwitchEncoding__internal_alias __attribute((visibility("hidden"))); -#define xmlSwitchEncoding xmlSwitchEncoding__internal_alias -#endif -#endif - -#ifdef bottom_parserInternals -#undef xmlSwitchInputEncoding -extern __typeof (xmlSwitchInputEncoding) xmlSwitchInputEncoding __attribute((alias("xmlSwitchInputEncoding__internal_alias"))); -#else -#ifndef xmlSwitchInputEncoding -extern __typeof (xmlSwitchInputEncoding) xmlSwitchInputEncoding__internal_alias __attribute((visibility("hidden"))); -#define xmlSwitchInputEncoding xmlSwitchInputEncoding__internal_alias -#endif -#endif - -#ifdef bottom_parserInternals -#undef xmlSwitchToEncoding -extern __typeof (xmlSwitchToEncoding) xmlSwitchToEncoding __attribute((alias("xmlSwitchToEncoding__internal_alias"))); -#else -#ifndef xmlSwitchToEncoding -extern __typeof (xmlSwitchToEncoding) xmlSwitchToEncoding__internal_alias __attribute((visibility("hidden"))); -#define xmlSwitchToEncoding xmlSwitchToEncoding__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlTextConcat -extern __typeof (xmlTextConcat) xmlTextConcat __attribute((alias("xmlTextConcat__internal_alias"))); -#else -#ifndef xmlTextConcat -extern __typeof (xmlTextConcat) xmlTextConcat__internal_alias __attribute((visibility("hidden"))); -#define xmlTextConcat xmlTextConcat__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlTextMerge -extern __typeof (xmlTextMerge) xmlTextMerge __attribute((alias("xmlTextMerge__internal_alias"))); -#else -#ifndef xmlTextMerge -extern __typeof (xmlTextMerge) xmlTextMerge__internal_alias __attribute((visibility("hidden"))); -#define xmlTextMerge xmlTextMerge__internal_alias -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderAttributeCount -extern __typeof (xmlTextReaderAttributeCount) xmlTextReaderAttributeCount __attribute((alias("xmlTextReaderAttributeCount__internal_alias"))); -#else -#ifndef xmlTextReaderAttributeCount -extern __typeof (xmlTextReaderAttributeCount) xmlTextReaderAttributeCount__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderAttributeCount xmlTextReaderAttributeCount__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderBaseUri -extern __typeof (xmlTextReaderBaseUri) xmlTextReaderBaseUri __attribute((alias("xmlTextReaderBaseUri__internal_alias"))); -#else -#ifndef xmlTextReaderBaseUri -extern __typeof (xmlTextReaderBaseUri) xmlTextReaderBaseUri__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderBaseUri xmlTextReaderBaseUri__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderByteConsumed -extern __typeof (xmlTextReaderByteConsumed) xmlTextReaderByteConsumed __attribute((alias("xmlTextReaderByteConsumed__internal_alias"))); -#else -#ifndef xmlTextReaderByteConsumed -extern __typeof (xmlTextReaderByteConsumed) xmlTextReaderByteConsumed__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderByteConsumed xmlTextReaderByteConsumed__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderClose -extern __typeof (xmlTextReaderClose) xmlTextReaderClose __attribute((alias("xmlTextReaderClose__internal_alias"))); -#else -#ifndef xmlTextReaderClose -extern __typeof (xmlTextReaderClose) xmlTextReaderClose__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderClose xmlTextReaderClose__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderConstBaseUri -extern __typeof (xmlTextReaderConstBaseUri) xmlTextReaderConstBaseUri __attribute((alias("xmlTextReaderConstBaseUri__internal_alias"))); -#else -#ifndef xmlTextReaderConstBaseUri -extern __typeof (xmlTextReaderConstBaseUri) xmlTextReaderConstBaseUri__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderConstBaseUri xmlTextReaderConstBaseUri__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderConstEncoding -extern __typeof (xmlTextReaderConstEncoding) xmlTextReaderConstEncoding __attribute((alias("xmlTextReaderConstEncoding__internal_alias"))); -#else -#ifndef xmlTextReaderConstEncoding -extern __typeof (xmlTextReaderConstEncoding) xmlTextReaderConstEncoding__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderConstEncoding xmlTextReaderConstEncoding__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderConstLocalName -extern __typeof (xmlTextReaderConstLocalName) xmlTextReaderConstLocalName __attribute((alias("xmlTextReaderConstLocalName__internal_alias"))); -#else -#ifndef xmlTextReaderConstLocalName -extern __typeof (xmlTextReaderConstLocalName) xmlTextReaderConstLocalName__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderConstLocalName xmlTextReaderConstLocalName__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderConstName -extern __typeof (xmlTextReaderConstName) xmlTextReaderConstName __attribute((alias("xmlTextReaderConstName__internal_alias"))); -#else -#ifndef xmlTextReaderConstName -extern __typeof (xmlTextReaderConstName) xmlTextReaderConstName__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderConstName xmlTextReaderConstName__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderConstNamespaceUri -extern __typeof (xmlTextReaderConstNamespaceUri) xmlTextReaderConstNamespaceUri __attribute((alias("xmlTextReaderConstNamespaceUri__internal_alias"))); -#else -#ifndef xmlTextReaderConstNamespaceUri -extern __typeof (xmlTextReaderConstNamespaceUri) xmlTextReaderConstNamespaceUri__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderConstNamespaceUri xmlTextReaderConstNamespaceUri__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderConstPrefix -extern __typeof (xmlTextReaderConstPrefix) xmlTextReaderConstPrefix __attribute((alias("xmlTextReaderConstPrefix__internal_alias"))); -#else -#ifndef xmlTextReaderConstPrefix -extern __typeof (xmlTextReaderConstPrefix) xmlTextReaderConstPrefix__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderConstPrefix xmlTextReaderConstPrefix__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderConstString -extern __typeof (xmlTextReaderConstString) xmlTextReaderConstString __attribute((alias("xmlTextReaderConstString__internal_alias"))); -#else -#ifndef xmlTextReaderConstString -extern __typeof (xmlTextReaderConstString) xmlTextReaderConstString__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderConstString xmlTextReaderConstString__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderConstValue -extern __typeof (xmlTextReaderConstValue) xmlTextReaderConstValue __attribute((alias("xmlTextReaderConstValue__internal_alias"))); -#else -#ifndef xmlTextReaderConstValue -extern __typeof (xmlTextReaderConstValue) xmlTextReaderConstValue__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderConstValue xmlTextReaderConstValue__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderConstXmlLang -extern __typeof (xmlTextReaderConstXmlLang) xmlTextReaderConstXmlLang __attribute((alias("xmlTextReaderConstXmlLang__internal_alias"))); -#else -#ifndef xmlTextReaderConstXmlLang -extern __typeof (xmlTextReaderConstXmlLang) xmlTextReaderConstXmlLang__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderConstXmlLang xmlTextReaderConstXmlLang__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderConstXmlVersion -extern __typeof (xmlTextReaderConstXmlVersion) xmlTextReaderConstXmlVersion __attribute((alias("xmlTextReaderConstXmlVersion__internal_alias"))); -#else -#ifndef xmlTextReaderConstXmlVersion -extern __typeof (xmlTextReaderConstXmlVersion) xmlTextReaderConstXmlVersion__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderConstXmlVersion xmlTextReaderConstXmlVersion__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderCurrentDoc -extern __typeof (xmlTextReaderCurrentDoc) xmlTextReaderCurrentDoc __attribute((alias("xmlTextReaderCurrentDoc__internal_alias"))); -#else -#ifndef xmlTextReaderCurrentDoc -extern __typeof (xmlTextReaderCurrentDoc) xmlTextReaderCurrentDoc__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderCurrentDoc xmlTextReaderCurrentDoc__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderCurrentNode -extern __typeof (xmlTextReaderCurrentNode) xmlTextReaderCurrentNode __attribute((alias("xmlTextReaderCurrentNode__internal_alias"))); -#else -#ifndef xmlTextReaderCurrentNode -extern __typeof (xmlTextReaderCurrentNode) xmlTextReaderCurrentNode__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderCurrentNode xmlTextReaderCurrentNode__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderDepth -extern __typeof (xmlTextReaderDepth) xmlTextReaderDepth __attribute((alias("xmlTextReaderDepth__internal_alias"))); -#else -#ifndef xmlTextReaderDepth -extern __typeof (xmlTextReaderDepth) xmlTextReaderDepth__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderDepth xmlTextReaderDepth__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderExpand -extern __typeof (xmlTextReaderExpand) xmlTextReaderExpand __attribute((alias("xmlTextReaderExpand__internal_alias"))); -#else -#ifndef xmlTextReaderExpand -extern __typeof (xmlTextReaderExpand) xmlTextReaderExpand__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderExpand xmlTextReaderExpand__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderGetAttribute -extern __typeof (xmlTextReaderGetAttribute) xmlTextReaderGetAttribute __attribute((alias("xmlTextReaderGetAttribute__internal_alias"))); -#else -#ifndef xmlTextReaderGetAttribute -extern __typeof (xmlTextReaderGetAttribute) xmlTextReaderGetAttribute__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderGetAttribute xmlTextReaderGetAttribute__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderGetAttributeNo -extern __typeof (xmlTextReaderGetAttributeNo) xmlTextReaderGetAttributeNo __attribute((alias("xmlTextReaderGetAttributeNo__internal_alias"))); -#else -#ifndef xmlTextReaderGetAttributeNo -extern __typeof (xmlTextReaderGetAttributeNo) xmlTextReaderGetAttributeNo__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderGetAttributeNo xmlTextReaderGetAttributeNo__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderGetAttributeNs -extern __typeof (xmlTextReaderGetAttributeNs) xmlTextReaderGetAttributeNs __attribute((alias("xmlTextReaderGetAttributeNs__internal_alias"))); -#else -#ifndef xmlTextReaderGetAttributeNs -extern __typeof (xmlTextReaderGetAttributeNs) xmlTextReaderGetAttributeNs__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderGetAttributeNs xmlTextReaderGetAttributeNs__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderGetErrorHandler -extern __typeof (xmlTextReaderGetErrorHandler) xmlTextReaderGetErrorHandler __attribute((alias("xmlTextReaderGetErrorHandler__internal_alias"))); -#else -#ifndef xmlTextReaderGetErrorHandler -extern __typeof (xmlTextReaderGetErrorHandler) xmlTextReaderGetErrorHandler__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderGetErrorHandler xmlTextReaderGetErrorHandler__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderGetParserColumnNumber -extern __typeof (xmlTextReaderGetParserColumnNumber) xmlTextReaderGetParserColumnNumber __attribute((alias("xmlTextReaderGetParserColumnNumber__internal_alias"))); -#else -#ifndef xmlTextReaderGetParserColumnNumber -extern __typeof (xmlTextReaderGetParserColumnNumber) xmlTextReaderGetParserColumnNumber__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderGetParserColumnNumber xmlTextReaderGetParserColumnNumber__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderGetParserLineNumber -extern __typeof (xmlTextReaderGetParserLineNumber) xmlTextReaderGetParserLineNumber __attribute((alias("xmlTextReaderGetParserLineNumber__internal_alias"))); -#else -#ifndef xmlTextReaderGetParserLineNumber -extern __typeof (xmlTextReaderGetParserLineNumber) xmlTextReaderGetParserLineNumber__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderGetParserLineNumber xmlTextReaderGetParserLineNumber__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderGetParserProp -extern __typeof (xmlTextReaderGetParserProp) xmlTextReaderGetParserProp __attribute((alias("xmlTextReaderGetParserProp__internal_alias"))); -#else -#ifndef xmlTextReaderGetParserProp -extern __typeof (xmlTextReaderGetParserProp) xmlTextReaderGetParserProp__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderGetParserProp xmlTextReaderGetParserProp__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderGetRemainder -extern __typeof (xmlTextReaderGetRemainder) xmlTextReaderGetRemainder __attribute((alias("xmlTextReaderGetRemainder__internal_alias"))); -#else -#ifndef xmlTextReaderGetRemainder -extern __typeof (xmlTextReaderGetRemainder) xmlTextReaderGetRemainder__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderGetRemainder xmlTextReaderGetRemainder__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderHasAttributes -extern __typeof (xmlTextReaderHasAttributes) xmlTextReaderHasAttributes __attribute((alias("xmlTextReaderHasAttributes__internal_alias"))); -#else -#ifndef xmlTextReaderHasAttributes -extern __typeof (xmlTextReaderHasAttributes) xmlTextReaderHasAttributes__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderHasAttributes xmlTextReaderHasAttributes__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderHasValue -extern __typeof (xmlTextReaderHasValue) xmlTextReaderHasValue __attribute((alias("xmlTextReaderHasValue__internal_alias"))); -#else -#ifndef xmlTextReaderHasValue -extern __typeof (xmlTextReaderHasValue) xmlTextReaderHasValue__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderHasValue xmlTextReaderHasValue__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderIsDefault -extern __typeof (xmlTextReaderIsDefault) xmlTextReaderIsDefault __attribute((alias("xmlTextReaderIsDefault__internal_alias"))); -#else -#ifndef xmlTextReaderIsDefault -extern __typeof (xmlTextReaderIsDefault) xmlTextReaderIsDefault__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderIsDefault xmlTextReaderIsDefault__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderIsEmptyElement -extern __typeof (xmlTextReaderIsEmptyElement) xmlTextReaderIsEmptyElement __attribute((alias("xmlTextReaderIsEmptyElement__internal_alias"))); -#else -#ifndef xmlTextReaderIsEmptyElement -extern __typeof (xmlTextReaderIsEmptyElement) xmlTextReaderIsEmptyElement__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderIsEmptyElement xmlTextReaderIsEmptyElement__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderIsNamespaceDecl -extern __typeof (xmlTextReaderIsNamespaceDecl) xmlTextReaderIsNamespaceDecl __attribute((alias("xmlTextReaderIsNamespaceDecl__internal_alias"))); -#else -#ifndef xmlTextReaderIsNamespaceDecl -extern __typeof (xmlTextReaderIsNamespaceDecl) xmlTextReaderIsNamespaceDecl__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderIsNamespaceDecl xmlTextReaderIsNamespaceDecl__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderIsValid -extern __typeof (xmlTextReaderIsValid) xmlTextReaderIsValid __attribute((alias("xmlTextReaderIsValid__internal_alias"))); -#else -#ifndef xmlTextReaderIsValid -extern __typeof (xmlTextReaderIsValid) xmlTextReaderIsValid__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderIsValid xmlTextReaderIsValid__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderLocalName -extern __typeof (xmlTextReaderLocalName) xmlTextReaderLocalName __attribute((alias("xmlTextReaderLocalName__internal_alias"))); -#else -#ifndef xmlTextReaderLocalName -extern __typeof (xmlTextReaderLocalName) xmlTextReaderLocalName__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderLocalName xmlTextReaderLocalName__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderLocatorBaseURI -extern __typeof (xmlTextReaderLocatorBaseURI) xmlTextReaderLocatorBaseURI __attribute((alias("xmlTextReaderLocatorBaseURI__internal_alias"))); -#else -#ifndef xmlTextReaderLocatorBaseURI -extern __typeof (xmlTextReaderLocatorBaseURI) xmlTextReaderLocatorBaseURI__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderLocatorBaseURI xmlTextReaderLocatorBaseURI__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderLocatorLineNumber -extern __typeof (xmlTextReaderLocatorLineNumber) xmlTextReaderLocatorLineNumber __attribute((alias("xmlTextReaderLocatorLineNumber__internal_alias"))); -#else -#ifndef xmlTextReaderLocatorLineNumber -extern __typeof (xmlTextReaderLocatorLineNumber) xmlTextReaderLocatorLineNumber__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderLocatorLineNumber xmlTextReaderLocatorLineNumber__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderLookupNamespace -extern __typeof (xmlTextReaderLookupNamespace) xmlTextReaderLookupNamespace __attribute((alias("xmlTextReaderLookupNamespace__internal_alias"))); -#else -#ifndef xmlTextReaderLookupNamespace -extern __typeof (xmlTextReaderLookupNamespace) xmlTextReaderLookupNamespace__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderLookupNamespace xmlTextReaderLookupNamespace__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderMoveToAttribute -extern __typeof (xmlTextReaderMoveToAttribute) xmlTextReaderMoveToAttribute __attribute((alias("xmlTextReaderMoveToAttribute__internal_alias"))); -#else -#ifndef xmlTextReaderMoveToAttribute -extern __typeof (xmlTextReaderMoveToAttribute) xmlTextReaderMoveToAttribute__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderMoveToAttribute xmlTextReaderMoveToAttribute__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderMoveToAttributeNo -extern __typeof (xmlTextReaderMoveToAttributeNo) xmlTextReaderMoveToAttributeNo __attribute((alias("xmlTextReaderMoveToAttributeNo__internal_alias"))); -#else -#ifndef xmlTextReaderMoveToAttributeNo -extern __typeof (xmlTextReaderMoveToAttributeNo) xmlTextReaderMoveToAttributeNo__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderMoveToAttributeNo xmlTextReaderMoveToAttributeNo__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderMoveToAttributeNs -extern __typeof (xmlTextReaderMoveToAttributeNs) xmlTextReaderMoveToAttributeNs __attribute((alias("xmlTextReaderMoveToAttributeNs__internal_alias"))); -#else -#ifndef xmlTextReaderMoveToAttributeNs -extern __typeof (xmlTextReaderMoveToAttributeNs) xmlTextReaderMoveToAttributeNs__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderMoveToAttributeNs xmlTextReaderMoveToAttributeNs__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderMoveToElement -extern __typeof (xmlTextReaderMoveToElement) xmlTextReaderMoveToElement __attribute((alias("xmlTextReaderMoveToElement__internal_alias"))); -#else -#ifndef xmlTextReaderMoveToElement -extern __typeof (xmlTextReaderMoveToElement) xmlTextReaderMoveToElement__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderMoveToElement xmlTextReaderMoveToElement__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderMoveToFirstAttribute -extern __typeof (xmlTextReaderMoveToFirstAttribute) xmlTextReaderMoveToFirstAttribute __attribute((alias("xmlTextReaderMoveToFirstAttribute__internal_alias"))); -#else -#ifndef xmlTextReaderMoveToFirstAttribute -extern __typeof (xmlTextReaderMoveToFirstAttribute) xmlTextReaderMoveToFirstAttribute__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderMoveToFirstAttribute xmlTextReaderMoveToFirstAttribute__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderMoveToNextAttribute -extern __typeof (xmlTextReaderMoveToNextAttribute) xmlTextReaderMoveToNextAttribute __attribute((alias("xmlTextReaderMoveToNextAttribute__internal_alias"))); -#else -#ifndef xmlTextReaderMoveToNextAttribute -extern __typeof (xmlTextReaderMoveToNextAttribute) xmlTextReaderMoveToNextAttribute__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderMoveToNextAttribute xmlTextReaderMoveToNextAttribute__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderName -extern __typeof (xmlTextReaderName) xmlTextReaderName __attribute((alias("xmlTextReaderName__internal_alias"))); -#else -#ifndef xmlTextReaderName -extern __typeof (xmlTextReaderName) xmlTextReaderName__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderName xmlTextReaderName__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderNamespaceUri -extern __typeof (xmlTextReaderNamespaceUri) xmlTextReaderNamespaceUri __attribute((alias("xmlTextReaderNamespaceUri__internal_alias"))); -#else -#ifndef xmlTextReaderNamespaceUri -extern __typeof (xmlTextReaderNamespaceUri) xmlTextReaderNamespaceUri__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderNamespaceUri xmlTextReaderNamespaceUri__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderNext -extern __typeof (xmlTextReaderNext) xmlTextReaderNext __attribute((alias("xmlTextReaderNext__internal_alias"))); -#else -#ifndef xmlTextReaderNext -extern __typeof (xmlTextReaderNext) xmlTextReaderNext__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderNext xmlTextReaderNext__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderNextSibling -extern __typeof (xmlTextReaderNextSibling) xmlTextReaderNextSibling __attribute((alias("xmlTextReaderNextSibling__internal_alias"))); -#else -#ifndef xmlTextReaderNextSibling -extern __typeof (xmlTextReaderNextSibling) xmlTextReaderNextSibling__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderNextSibling xmlTextReaderNextSibling__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderNodeType -extern __typeof (xmlTextReaderNodeType) xmlTextReaderNodeType __attribute((alias("xmlTextReaderNodeType__internal_alias"))); -#else -#ifndef xmlTextReaderNodeType -extern __typeof (xmlTextReaderNodeType) xmlTextReaderNodeType__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderNodeType xmlTextReaderNodeType__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderNormalization -extern __typeof (xmlTextReaderNormalization) xmlTextReaderNormalization __attribute((alias("xmlTextReaderNormalization__internal_alias"))); -#else -#ifndef xmlTextReaderNormalization -extern __typeof (xmlTextReaderNormalization) xmlTextReaderNormalization__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderNormalization xmlTextReaderNormalization__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderPrefix -extern __typeof (xmlTextReaderPrefix) xmlTextReaderPrefix __attribute((alias("xmlTextReaderPrefix__internal_alias"))); -#else -#ifndef xmlTextReaderPrefix -extern __typeof (xmlTextReaderPrefix) xmlTextReaderPrefix__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderPrefix xmlTextReaderPrefix__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderPreserve -extern __typeof (xmlTextReaderPreserve) xmlTextReaderPreserve __attribute((alias("xmlTextReaderPreserve__internal_alias"))); -#else -#ifndef xmlTextReaderPreserve -extern __typeof (xmlTextReaderPreserve) xmlTextReaderPreserve__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderPreserve xmlTextReaderPreserve__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_PATTERN_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderPreservePattern -extern __typeof (xmlTextReaderPreservePattern) xmlTextReaderPreservePattern __attribute((alias("xmlTextReaderPreservePattern__internal_alias"))); -#else -#ifndef xmlTextReaderPreservePattern -extern __typeof (xmlTextReaderPreservePattern) xmlTextReaderPreservePattern__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderPreservePattern xmlTextReaderPreservePattern__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderQuoteChar -extern __typeof (xmlTextReaderQuoteChar) xmlTextReaderQuoteChar __attribute((alias("xmlTextReaderQuoteChar__internal_alias"))); -#else -#ifndef xmlTextReaderQuoteChar -extern __typeof (xmlTextReaderQuoteChar) xmlTextReaderQuoteChar__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderQuoteChar xmlTextReaderQuoteChar__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderRead -extern __typeof (xmlTextReaderRead) xmlTextReaderRead __attribute((alias("xmlTextReaderRead__internal_alias"))); -#else -#ifndef xmlTextReaderRead -extern __typeof (xmlTextReaderRead) xmlTextReaderRead__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderRead xmlTextReaderRead__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderReadAttributeValue -extern __typeof (xmlTextReaderReadAttributeValue) xmlTextReaderReadAttributeValue __attribute((alias("xmlTextReaderReadAttributeValue__internal_alias"))); -#else -#ifndef xmlTextReaderReadAttributeValue -extern __typeof (xmlTextReaderReadAttributeValue) xmlTextReaderReadAttributeValue__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderReadAttributeValue xmlTextReaderReadAttributeValue__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderReadInnerXml -extern __typeof (xmlTextReaderReadInnerXml) xmlTextReaderReadInnerXml __attribute((alias("xmlTextReaderReadInnerXml__internal_alias"))); -#else -#ifndef xmlTextReaderReadInnerXml -extern __typeof (xmlTextReaderReadInnerXml) xmlTextReaderReadInnerXml__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderReadInnerXml xmlTextReaderReadInnerXml__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderReadOuterXml -extern __typeof (xmlTextReaderReadOuterXml) xmlTextReaderReadOuterXml __attribute((alias("xmlTextReaderReadOuterXml__internal_alias"))); -#else -#ifndef xmlTextReaderReadOuterXml -extern __typeof (xmlTextReaderReadOuterXml) xmlTextReaderReadOuterXml__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderReadOuterXml xmlTextReaderReadOuterXml__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderReadState -extern __typeof (xmlTextReaderReadState) xmlTextReaderReadState __attribute((alias("xmlTextReaderReadState__internal_alias"))); -#else -#ifndef xmlTextReaderReadState -extern __typeof (xmlTextReaderReadState) xmlTextReaderReadState__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderReadState xmlTextReaderReadState__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderReadString -extern __typeof (xmlTextReaderReadString) xmlTextReaderReadString __attribute((alias("xmlTextReaderReadString__internal_alias"))); -#else -#ifndef xmlTextReaderReadString -extern __typeof (xmlTextReaderReadString) xmlTextReaderReadString__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderReadString xmlTextReaderReadString__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderRelaxNGSetSchema -extern __typeof (xmlTextReaderRelaxNGSetSchema) xmlTextReaderRelaxNGSetSchema __attribute((alias("xmlTextReaderRelaxNGSetSchema__internal_alias"))); -#else -#ifndef xmlTextReaderRelaxNGSetSchema -extern __typeof (xmlTextReaderRelaxNGSetSchema) xmlTextReaderRelaxNGSetSchema__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderRelaxNGSetSchema xmlTextReaderRelaxNGSetSchema__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderRelaxNGValidate -extern __typeof (xmlTextReaderRelaxNGValidate) xmlTextReaderRelaxNGValidate __attribute((alias("xmlTextReaderRelaxNGValidate__internal_alias"))); -#else -#ifndef xmlTextReaderRelaxNGValidate -extern __typeof (xmlTextReaderRelaxNGValidate) xmlTextReaderRelaxNGValidate__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderRelaxNGValidate xmlTextReaderRelaxNGValidate__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderRelaxNGValidateCtxt -extern __typeof (xmlTextReaderRelaxNGValidateCtxt) xmlTextReaderRelaxNGValidateCtxt __attribute((alias("xmlTextReaderRelaxNGValidateCtxt__internal_alias"))); -#else -#ifndef xmlTextReaderRelaxNGValidateCtxt -extern __typeof (xmlTextReaderRelaxNGValidateCtxt) xmlTextReaderRelaxNGValidateCtxt__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderRelaxNGValidateCtxt xmlTextReaderRelaxNGValidateCtxt__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderSchemaValidate -extern __typeof (xmlTextReaderSchemaValidate) xmlTextReaderSchemaValidate __attribute((alias("xmlTextReaderSchemaValidate__internal_alias"))); -#else -#ifndef xmlTextReaderSchemaValidate -extern __typeof (xmlTextReaderSchemaValidate) xmlTextReaderSchemaValidate__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderSchemaValidate xmlTextReaderSchemaValidate__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderSchemaValidateCtxt -extern __typeof (xmlTextReaderSchemaValidateCtxt) xmlTextReaderSchemaValidateCtxt __attribute((alias("xmlTextReaderSchemaValidateCtxt__internal_alias"))); -#else -#ifndef xmlTextReaderSchemaValidateCtxt -extern __typeof (xmlTextReaderSchemaValidateCtxt) xmlTextReaderSchemaValidateCtxt__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderSchemaValidateCtxt xmlTextReaderSchemaValidateCtxt__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderSetErrorHandler -extern __typeof (xmlTextReaderSetErrorHandler) xmlTextReaderSetErrorHandler __attribute((alias("xmlTextReaderSetErrorHandler__internal_alias"))); -#else -#ifndef xmlTextReaderSetErrorHandler -extern __typeof (xmlTextReaderSetErrorHandler) xmlTextReaderSetErrorHandler__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderSetErrorHandler xmlTextReaderSetErrorHandler__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderSetParserProp -extern __typeof (xmlTextReaderSetParserProp) xmlTextReaderSetParserProp __attribute((alias("xmlTextReaderSetParserProp__internal_alias"))); -#else -#ifndef xmlTextReaderSetParserProp -extern __typeof (xmlTextReaderSetParserProp) xmlTextReaderSetParserProp__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderSetParserProp xmlTextReaderSetParserProp__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderSetSchema -extern __typeof (xmlTextReaderSetSchema) xmlTextReaderSetSchema __attribute((alias("xmlTextReaderSetSchema__internal_alias"))); -#else -#ifndef xmlTextReaderSetSchema -extern __typeof (xmlTextReaderSetSchema) xmlTextReaderSetSchema__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderSetSchema xmlTextReaderSetSchema__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderSetStructuredErrorHandler -extern __typeof (xmlTextReaderSetStructuredErrorHandler) xmlTextReaderSetStructuredErrorHandler __attribute((alias("xmlTextReaderSetStructuredErrorHandler__internal_alias"))); -#else -#ifndef xmlTextReaderSetStructuredErrorHandler -extern __typeof (xmlTextReaderSetStructuredErrorHandler) xmlTextReaderSetStructuredErrorHandler__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderSetStructuredErrorHandler xmlTextReaderSetStructuredErrorHandler__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderSetup -extern __typeof (xmlTextReaderSetup) xmlTextReaderSetup __attribute((alias("xmlTextReaderSetup__internal_alias"))); -#else -#ifndef xmlTextReaderSetup -extern __typeof (xmlTextReaderSetup) xmlTextReaderSetup__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderSetup xmlTextReaderSetup__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderStandalone -extern __typeof (xmlTextReaderStandalone) xmlTextReaderStandalone __attribute((alias("xmlTextReaderStandalone__internal_alias"))); -#else -#ifndef xmlTextReaderStandalone -extern __typeof (xmlTextReaderStandalone) xmlTextReaderStandalone__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderStandalone xmlTextReaderStandalone__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderValue -extern __typeof (xmlTextReaderValue) xmlTextReaderValue __attribute((alias("xmlTextReaderValue__internal_alias"))); -#else -#ifndef xmlTextReaderValue -extern __typeof (xmlTextReaderValue) xmlTextReaderValue__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderValue xmlTextReaderValue__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_READER_ENABLED) -#ifdef bottom_xmlreader -#undef xmlTextReaderXmlLang -extern __typeof (xmlTextReaderXmlLang) xmlTextReaderXmlLang __attribute((alias("xmlTextReaderXmlLang__internal_alias"))); -#else -#ifndef xmlTextReaderXmlLang -extern __typeof (xmlTextReaderXmlLang) xmlTextReaderXmlLang__internal_alias __attribute((visibility("hidden"))); -#define xmlTextReaderXmlLang xmlTextReaderXmlLang__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterEndAttribute -extern __typeof (xmlTextWriterEndAttribute) xmlTextWriterEndAttribute __attribute((alias("xmlTextWriterEndAttribute__internal_alias"))); -#else -#ifndef xmlTextWriterEndAttribute -extern __typeof (xmlTextWriterEndAttribute) xmlTextWriterEndAttribute__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterEndAttribute xmlTextWriterEndAttribute__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterEndCDATA -extern __typeof (xmlTextWriterEndCDATA) xmlTextWriterEndCDATA __attribute((alias("xmlTextWriterEndCDATA__internal_alias"))); -#else -#ifndef xmlTextWriterEndCDATA -extern __typeof (xmlTextWriterEndCDATA) xmlTextWriterEndCDATA__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterEndCDATA xmlTextWriterEndCDATA__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterEndComment -extern __typeof (xmlTextWriterEndComment) xmlTextWriterEndComment __attribute((alias("xmlTextWriterEndComment__internal_alias"))); -#else -#ifndef xmlTextWriterEndComment -extern __typeof (xmlTextWriterEndComment) xmlTextWriterEndComment__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterEndComment xmlTextWriterEndComment__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterEndDTD -extern __typeof (xmlTextWriterEndDTD) xmlTextWriterEndDTD __attribute((alias("xmlTextWriterEndDTD__internal_alias"))); -#else -#ifndef xmlTextWriterEndDTD -extern __typeof (xmlTextWriterEndDTD) xmlTextWriterEndDTD__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterEndDTD xmlTextWriterEndDTD__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterEndDTDAttlist -extern __typeof (xmlTextWriterEndDTDAttlist) xmlTextWriterEndDTDAttlist __attribute((alias("xmlTextWriterEndDTDAttlist__internal_alias"))); -#else -#ifndef xmlTextWriterEndDTDAttlist -extern __typeof (xmlTextWriterEndDTDAttlist) xmlTextWriterEndDTDAttlist__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterEndDTDAttlist xmlTextWriterEndDTDAttlist__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterEndDTDElement -extern __typeof (xmlTextWriterEndDTDElement) xmlTextWriterEndDTDElement __attribute((alias("xmlTextWriterEndDTDElement__internal_alias"))); -#else -#ifndef xmlTextWriterEndDTDElement -extern __typeof (xmlTextWriterEndDTDElement) xmlTextWriterEndDTDElement__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterEndDTDElement xmlTextWriterEndDTDElement__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterEndDTDEntity -extern __typeof (xmlTextWriterEndDTDEntity) xmlTextWriterEndDTDEntity __attribute((alias("xmlTextWriterEndDTDEntity__internal_alias"))); -#else -#ifndef xmlTextWriterEndDTDEntity -extern __typeof (xmlTextWriterEndDTDEntity) xmlTextWriterEndDTDEntity__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterEndDTDEntity xmlTextWriterEndDTDEntity__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterEndDocument -extern __typeof (xmlTextWriterEndDocument) xmlTextWriterEndDocument __attribute((alias("xmlTextWriterEndDocument__internal_alias"))); -#else -#ifndef xmlTextWriterEndDocument -extern __typeof (xmlTextWriterEndDocument) xmlTextWriterEndDocument__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterEndDocument xmlTextWriterEndDocument__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterEndElement -extern __typeof (xmlTextWriterEndElement) xmlTextWriterEndElement __attribute((alias("xmlTextWriterEndElement__internal_alias"))); -#else -#ifndef xmlTextWriterEndElement -extern __typeof (xmlTextWriterEndElement) xmlTextWriterEndElement__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterEndElement xmlTextWriterEndElement__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterEndPI -extern __typeof (xmlTextWriterEndPI) xmlTextWriterEndPI __attribute((alias("xmlTextWriterEndPI__internal_alias"))); -#else -#ifndef xmlTextWriterEndPI -extern __typeof (xmlTextWriterEndPI) xmlTextWriterEndPI__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterEndPI xmlTextWriterEndPI__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterFlush -extern __typeof (xmlTextWriterFlush) xmlTextWriterFlush __attribute((alias("xmlTextWriterFlush__internal_alias"))); -#else -#ifndef xmlTextWriterFlush -extern __typeof (xmlTextWriterFlush) xmlTextWriterFlush__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterFlush xmlTextWriterFlush__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterFullEndElement -extern __typeof (xmlTextWriterFullEndElement) xmlTextWriterFullEndElement __attribute((alias("xmlTextWriterFullEndElement__internal_alias"))); -#else -#ifndef xmlTextWriterFullEndElement -extern __typeof (xmlTextWriterFullEndElement) xmlTextWriterFullEndElement__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterFullEndElement xmlTextWriterFullEndElement__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterSetIndent -extern __typeof (xmlTextWriterSetIndent) xmlTextWriterSetIndent __attribute((alias("xmlTextWriterSetIndent__internal_alias"))); -#else -#ifndef xmlTextWriterSetIndent -extern __typeof (xmlTextWriterSetIndent) xmlTextWriterSetIndent__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterSetIndent xmlTextWriterSetIndent__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterSetIndentString -extern __typeof (xmlTextWriterSetIndentString) xmlTextWriterSetIndentString __attribute((alias("xmlTextWriterSetIndentString__internal_alias"))); -#else -#ifndef xmlTextWriterSetIndentString -extern __typeof (xmlTextWriterSetIndentString) xmlTextWriterSetIndentString__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterSetIndentString xmlTextWriterSetIndentString__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterSetQuoteChar -extern __typeof (xmlTextWriterSetQuoteChar) xmlTextWriterSetQuoteChar __attribute((alias("xmlTextWriterSetQuoteChar__internal_alias"))); -#else -#ifndef xmlTextWriterSetQuoteChar -extern __typeof (xmlTextWriterSetQuoteChar) xmlTextWriterSetQuoteChar__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterSetQuoteChar xmlTextWriterSetQuoteChar__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterStartAttribute -extern __typeof (xmlTextWriterStartAttribute) xmlTextWriterStartAttribute __attribute((alias("xmlTextWriterStartAttribute__internal_alias"))); -#else -#ifndef xmlTextWriterStartAttribute -extern __typeof (xmlTextWriterStartAttribute) xmlTextWriterStartAttribute__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterStartAttribute xmlTextWriterStartAttribute__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterStartAttributeNS -extern __typeof (xmlTextWriterStartAttributeNS) xmlTextWriterStartAttributeNS __attribute((alias("xmlTextWriterStartAttributeNS__internal_alias"))); -#else -#ifndef xmlTextWriterStartAttributeNS -extern __typeof (xmlTextWriterStartAttributeNS) xmlTextWriterStartAttributeNS__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterStartAttributeNS xmlTextWriterStartAttributeNS__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterStartCDATA -extern __typeof (xmlTextWriterStartCDATA) xmlTextWriterStartCDATA __attribute((alias("xmlTextWriterStartCDATA__internal_alias"))); -#else -#ifndef xmlTextWriterStartCDATA -extern __typeof (xmlTextWriterStartCDATA) xmlTextWriterStartCDATA__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterStartCDATA xmlTextWriterStartCDATA__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterStartComment -extern __typeof (xmlTextWriterStartComment) xmlTextWriterStartComment __attribute((alias("xmlTextWriterStartComment__internal_alias"))); -#else -#ifndef xmlTextWriterStartComment -extern __typeof (xmlTextWriterStartComment) xmlTextWriterStartComment__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterStartComment xmlTextWriterStartComment__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterStartDTD -extern __typeof (xmlTextWriterStartDTD) xmlTextWriterStartDTD __attribute((alias("xmlTextWriterStartDTD__internal_alias"))); -#else -#ifndef xmlTextWriterStartDTD -extern __typeof (xmlTextWriterStartDTD) xmlTextWriterStartDTD__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterStartDTD xmlTextWriterStartDTD__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterStartDTDAttlist -extern __typeof (xmlTextWriterStartDTDAttlist) xmlTextWriterStartDTDAttlist __attribute((alias("xmlTextWriterStartDTDAttlist__internal_alias"))); -#else -#ifndef xmlTextWriterStartDTDAttlist -extern __typeof (xmlTextWriterStartDTDAttlist) xmlTextWriterStartDTDAttlist__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterStartDTDAttlist xmlTextWriterStartDTDAttlist__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterStartDTDElement -extern __typeof (xmlTextWriterStartDTDElement) xmlTextWriterStartDTDElement __attribute((alias("xmlTextWriterStartDTDElement__internal_alias"))); -#else -#ifndef xmlTextWriterStartDTDElement -extern __typeof (xmlTextWriterStartDTDElement) xmlTextWriterStartDTDElement__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterStartDTDElement xmlTextWriterStartDTDElement__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterStartDTDEntity -extern __typeof (xmlTextWriterStartDTDEntity) xmlTextWriterStartDTDEntity __attribute((alias("xmlTextWriterStartDTDEntity__internal_alias"))); -#else -#ifndef xmlTextWriterStartDTDEntity -extern __typeof (xmlTextWriterStartDTDEntity) xmlTextWriterStartDTDEntity__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterStartDTDEntity xmlTextWriterStartDTDEntity__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterStartDocument -extern __typeof (xmlTextWriterStartDocument) xmlTextWriterStartDocument __attribute((alias("xmlTextWriterStartDocument__internal_alias"))); -#else -#ifndef xmlTextWriterStartDocument -extern __typeof (xmlTextWriterStartDocument) xmlTextWriterStartDocument__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterStartDocument xmlTextWriterStartDocument__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterStartElement -extern __typeof (xmlTextWriterStartElement) xmlTextWriterStartElement __attribute((alias("xmlTextWriterStartElement__internal_alias"))); -#else -#ifndef xmlTextWriterStartElement -extern __typeof (xmlTextWriterStartElement) xmlTextWriterStartElement__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterStartElement xmlTextWriterStartElement__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterStartElementNS -extern __typeof (xmlTextWriterStartElementNS) xmlTextWriterStartElementNS __attribute((alias("xmlTextWriterStartElementNS__internal_alias"))); -#else -#ifndef xmlTextWriterStartElementNS -extern __typeof (xmlTextWriterStartElementNS) xmlTextWriterStartElementNS__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterStartElementNS xmlTextWriterStartElementNS__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterStartPI -extern __typeof (xmlTextWriterStartPI) xmlTextWriterStartPI __attribute((alias("xmlTextWriterStartPI__internal_alias"))); -#else -#ifndef xmlTextWriterStartPI -extern __typeof (xmlTextWriterStartPI) xmlTextWriterStartPI__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterStartPI xmlTextWriterStartPI__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterWriteAttribute -extern __typeof (xmlTextWriterWriteAttribute) xmlTextWriterWriteAttribute __attribute((alias("xmlTextWriterWriteAttribute__internal_alias"))); -#else -#ifndef xmlTextWriterWriteAttribute -extern __typeof (xmlTextWriterWriteAttribute) xmlTextWriterWriteAttribute__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterWriteAttribute xmlTextWriterWriteAttribute__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterWriteAttributeNS -extern __typeof (xmlTextWriterWriteAttributeNS) xmlTextWriterWriteAttributeNS __attribute((alias("xmlTextWriterWriteAttributeNS__internal_alias"))); -#else -#ifndef xmlTextWriterWriteAttributeNS -extern __typeof (xmlTextWriterWriteAttributeNS) xmlTextWriterWriteAttributeNS__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterWriteAttributeNS xmlTextWriterWriteAttributeNS__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterWriteBase64 -extern __typeof (xmlTextWriterWriteBase64) xmlTextWriterWriteBase64 __attribute((alias("xmlTextWriterWriteBase64__internal_alias"))); -#else -#ifndef xmlTextWriterWriteBase64 -extern __typeof (xmlTextWriterWriteBase64) xmlTextWriterWriteBase64__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterWriteBase64 xmlTextWriterWriteBase64__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterWriteBinHex -extern __typeof (xmlTextWriterWriteBinHex) xmlTextWriterWriteBinHex __attribute((alias("xmlTextWriterWriteBinHex__internal_alias"))); -#else -#ifndef xmlTextWriterWriteBinHex -extern __typeof (xmlTextWriterWriteBinHex) xmlTextWriterWriteBinHex__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterWriteBinHex xmlTextWriterWriteBinHex__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterWriteCDATA -extern __typeof (xmlTextWriterWriteCDATA) xmlTextWriterWriteCDATA __attribute((alias("xmlTextWriterWriteCDATA__internal_alias"))); -#else -#ifndef xmlTextWriterWriteCDATA -extern __typeof (xmlTextWriterWriteCDATA) xmlTextWriterWriteCDATA__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterWriteCDATA xmlTextWriterWriteCDATA__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterWriteComment -extern __typeof (xmlTextWriterWriteComment) xmlTextWriterWriteComment __attribute((alias("xmlTextWriterWriteComment__internal_alias"))); -#else -#ifndef xmlTextWriterWriteComment -extern __typeof (xmlTextWriterWriteComment) xmlTextWriterWriteComment__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterWriteComment xmlTextWriterWriteComment__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterWriteDTD -extern __typeof (xmlTextWriterWriteDTD) xmlTextWriterWriteDTD __attribute((alias("xmlTextWriterWriteDTD__internal_alias"))); -#else -#ifndef xmlTextWriterWriteDTD -extern __typeof (xmlTextWriterWriteDTD) xmlTextWriterWriteDTD__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterWriteDTD xmlTextWriterWriteDTD__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterWriteDTDAttlist -extern __typeof (xmlTextWriterWriteDTDAttlist) xmlTextWriterWriteDTDAttlist __attribute((alias("xmlTextWriterWriteDTDAttlist__internal_alias"))); -#else -#ifndef xmlTextWriterWriteDTDAttlist -extern __typeof (xmlTextWriterWriteDTDAttlist) xmlTextWriterWriteDTDAttlist__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterWriteDTDAttlist xmlTextWriterWriteDTDAttlist__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterWriteDTDElement -extern __typeof (xmlTextWriterWriteDTDElement) xmlTextWriterWriteDTDElement __attribute((alias("xmlTextWriterWriteDTDElement__internal_alias"))); -#else -#ifndef xmlTextWriterWriteDTDElement -extern __typeof (xmlTextWriterWriteDTDElement) xmlTextWriterWriteDTDElement__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterWriteDTDElement xmlTextWriterWriteDTDElement__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterWriteDTDEntity -extern __typeof (xmlTextWriterWriteDTDEntity) xmlTextWriterWriteDTDEntity __attribute((alias("xmlTextWriterWriteDTDEntity__internal_alias"))); -#else -#ifndef xmlTextWriterWriteDTDEntity -extern __typeof (xmlTextWriterWriteDTDEntity) xmlTextWriterWriteDTDEntity__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterWriteDTDEntity xmlTextWriterWriteDTDEntity__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterWriteDTDExternalEntity -extern __typeof (xmlTextWriterWriteDTDExternalEntity) xmlTextWriterWriteDTDExternalEntity __attribute((alias("xmlTextWriterWriteDTDExternalEntity__internal_alias"))); -#else -#ifndef xmlTextWriterWriteDTDExternalEntity -extern __typeof (xmlTextWriterWriteDTDExternalEntity) xmlTextWriterWriteDTDExternalEntity__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterWriteDTDExternalEntity xmlTextWriterWriteDTDExternalEntity__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterWriteDTDExternalEntityContents -extern __typeof (xmlTextWriterWriteDTDExternalEntityContents) xmlTextWriterWriteDTDExternalEntityContents __attribute((alias("xmlTextWriterWriteDTDExternalEntityContents__internal_alias"))); -#else -#ifndef xmlTextWriterWriteDTDExternalEntityContents -extern __typeof (xmlTextWriterWriteDTDExternalEntityContents) xmlTextWriterWriteDTDExternalEntityContents__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterWriteDTDExternalEntityContents xmlTextWriterWriteDTDExternalEntityContents__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterWriteDTDInternalEntity -extern __typeof (xmlTextWriterWriteDTDInternalEntity) xmlTextWriterWriteDTDInternalEntity __attribute((alias("xmlTextWriterWriteDTDInternalEntity__internal_alias"))); -#else -#ifndef xmlTextWriterWriteDTDInternalEntity -extern __typeof (xmlTextWriterWriteDTDInternalEntity) xmlTextWriterWriteDTDInternalEntity__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterWriteDTDInternalEntity xmlTextWriterWriteDTDInternalEntity__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterWriteDTDNotation -extern __typeof (xmlTextWriterWriteDTDNotation) xmlTextWriterWriteDTDNotation __attribute((alias("xmlTextWriterWriteDTDNotation__internal_alias"))); -#else -#ifndef xmlTextWriterWriteDTDNotation -extern __typeof (xmlTextWriterWriteDTDNotation) xmlTextWriterWriteDTDNotation__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterWriteDTDNotation xmlTextWriterWriteDTDNotation__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterWriteElement -extern __typeof (xmlTextWriterWriteElement) xmlTextWriterWriteElement __attribute((alias("xmlTextWriterWriteElement__internal_alias"))); -#else -#ifndef xmlTextWriterWriteElement -extern __typeof (xmlTextWriterWriteElement) xmlTextWriterWriteElement__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterWriteElement xmlTextWriterWriteElement__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterWriteElementNS -extern __typeof (xmlTextWriterWriteElementNS) xmlTextWriterWriteElementNS __attribute((alias("xmlTextWriterWriteElementNS__internal_alias"))); -#else -#ifndef xmlTextWriterWriteElementNS -extern __typeof (xmlTextWriterWriteElementNS) xmlTextWriterWriteElementNS__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterWriteElementNS xmlTextWriterWriteElementNS__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterWriteFormatAttribute -extern __typeof (xmlTextWriterWriteFormatAttribute) xmlTextWriterWriteFormatAttribute __attribute((alias("xmlTextWriterWriteFormatAttribute__internal_alias"))); -#else -#ifndef xmlTextWriterWriteFormatAttribute -extern __typeof (xmlTextWriterWriteFormatAttribute) xmlTextWriterWriteFormatAttribute__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterWriteFormatAttribute xmlTextWriterWriteFormatAttribute__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterWriteFormatAttributeNS -extern __typeof (xmlTextWriterWriteFormatAttributeNS) xmlTextWriterWriteFormatAttributeNS __attribute((alias("xmlTextWriterWriteFormatAttributeNS__internal_alias"))); -#else -#ifndef xmlTextWriterWriteFormatAttributeNS -extern __typeof (xmlTextWriterWriteFormatAttributeNS) xmlTextWriterWriteFormatAttributeNS__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterWriteFormatAttributeNS xmlTextWriterWriteFormatAttributeNS__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterWriteFormatCDATA -extern __typeof (xmlTextWriterWriteFormatCDATA) xmlTextWriterWriteFormatCDATA __attribute((alias("xmlTextWriterWriteFormatCDATA__internal_alias"))); -#else -#ifndef xmlTextWriterWriteFormatCDATA -extern __typeof (xmlTextWriterWriteFormatCDATA) xmlTextWriterWriteFormatCDATA__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterWriteFormatCDATA xmlTextWriterWriteFormatCDATA__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterWriteFormatComment -extern __typeof (xmlTextWriterWriteFormatComment) xmlTextWriterWriteFormatComment __attribute((alias("xmlTextWriterWriteFormatComment__internal_alias"))); -#else -#ifndef xmlTextWriterWriteFormatComment -extern __typeof (xmlTextWriterWriteFormatComment) xmlTextWriterWriteFormatComment__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterWriteFormatComment xmlTextWriterWriteFormatComment__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterWriteFormatDTD -extern __typeof (xmlTextWriterWriteFormatDTD) xmlTextWriterWriteFormatDTD __attribute((alias("xmlTextWriterWriteFormatDTD__internal_alias"))); -#else -#ifndef xmlTextWriterWriteFormatDTD -extern __typeof (xmlTextWriterWriteFormatDTD) xmlTextWriterWriteFormatDTD__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterWriteFormatDTD xmlTextWriterWriteFormatDTD__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterWriteFormatDTDAttlist -extern __typeof (xmlTextWriterWriteFormatDTDAttlist) xmlTextWriterWriteFormatDTDAttlist __attribute((alias("xmlTextWriterWriteFormatDTDAttlist__internal_alias"))); -#else -#ifndef xmlTextWriterWriteFormatDTDAttlist -extern __typeof (xmlTextWriterWriteFormatDTDAttlist) xmlTextWriterWriteFormatDTDAttlist__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterWriteFormatDTDAttlist xmlTextWriterWriteFormatDTDAttlist__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterWriteFormatDTDElement -extern __typeof (xmlTextWriterWriteFormatDTDElement) xmlTextWriterWriteFormatDTDElement __attribute((alias("xmlTextWriterWriteFormatDTDElement__internal_alias"))); -#else -#ifndef xmlTextWriterWriteFormatDTDElement -extern __typeof (xmlTextWriterWriteFormatDTDElement) xmlTextWriterWriteFormatDTDElement__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterWriteFormatDTDElement xmlTextWriterWriteFormatDTDElement__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterWriteFormatDTDInternalEntity -extern __typeof (xmlTextWriterWriteFormatDTDInternalEntity) xmlTextWriterWriteFormatDTDInternalEntity __attribute((alias("xmlTextWriterWriteFormatDTDInternalEntity__internal_alias"))); -#else -#ifndef xmlTextWriterWriteFormatDTDInternalEntity -extern __typeof (xmlTextWriterWriteFormatDTDInternalEntity) xmlTextWriterWriteFormatDTDInternalEntity__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterWriteFormatDTDInternalEntity xmlTextWriterWriteFormatDTDInternalEntity__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterWriteFormatElement -extern __typeof (xmlTextWriterWriteFormatElement) xmlTextWriterWriteFormatElement __attribute((alias("xmlTextWriterWriteFormatElement__internal_alias"))); -#else -#ifndef xmlTextWriterWriteFormatElement -extern __typeof (xmlTextWriterWriteFormatElement) xmlTextWriterWriteFormatElement__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterWriteFormatElement xmlTextWriterWriteFormatElement__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterWriteFormatElementNS -extern __typeof (xmlTextWriterWriteFormatElementNS) xmlTextWriterWriteFormatElementNS __attribute((alias("xmlTextWriterWriteFormatElementNS__internal_alias"))); -#else -#ifndef xmlTextWriterWriteFormatElementNS -extern __typeof (xmlTextWriterWriteFormatElementNS) xmlTextWriterWriteFormatElementNS__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterWriteFormatElementNS xmlTextWriterWriteFormatElementNS__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterWriteFormatPI -extern __typeof (xmlTextWriterWriteFormatPI) xmlTextWriterWriteFormatPI __attribute((alias("xmlTextWriterWriteFormatPI__internal_alias"))); -#else -#ifndef xmlTextWriterWriteFormatPI -extern __typeof (xmlTextWriterWriteFormatPI) xmlTextWriterWriteFormatPI__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterWriteFormatPI xmlTextWriterWriteFormatPI__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterWriteFormatRaw -extern __typeof (xmlTextWriterWriteFormatRaw) xmlTextWriterWriteFormatRaw __attribute((alias("xmlTextWriterWriteFormatRaw__internal_alias"))); -#else -#ifndef xmlTextWriterWriteFormatRaw -extern __typeof (xmlTextWriterWriteFormatRaw) xmlTextWriterWriteFormatRaw__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterWriteFormatRaw xmlTextWriterWriteFormatRaw__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterWriteFormatString -extern __typeof (xmlTextWriterWriteFormatString) xmlTextWriterWriteFormatString __attribute((alias("xmlTextWriterWriteFormatString__internal_alias"))); -#else -#ifndef xmlTextWriterWriteFormatString -extern __typeof (xmlTextWriterWriteFormatString) xmlTextWriterWriteFormatString__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterWriteFormatString xmlTextWriterWriteFormatString__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterWritePI -extern __typeof (xmlTextWriterWritePI) xmlTextWriterWritePI __attribute((alias("xmlTextWriterWritePI__internal_alias"))); -#else -#ifndef xmlTextWriterWritePI -extern __typeof (xmlTextWriterWritePI) xmlTextWriterWritePI__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterWritePI xmlTextWriterWritePI__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterWriteRaw -extern __typeof (xmlTextWriterWriteRaw) xmlTextWriterWriteRaw __attribute((alias("xmlTextWriterWriteRaw__internal_alias"))); -#else -#ifndef xmlTextWriterWriteRaw -extern __typeof (xmlTextWriterWriteRaw) xmlTextWriterWriteRaw__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterWriteRaw xmlTextWriterWriteRaw__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterWriteRawLen -extern __typeof (xmlTextWriterWriteRawLen) xmlTextWriterWriteRawLen __attribute((alias("xmlTextWriterWriteRawLen__internal_alias"))); -#else -#ifndef xmlTextWriterWriteRawLen -extern __typeof (xmlTextWriterWriteRawLen) xmlTextWriterWriteRawLen__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterWriteRawLen xmlTextWriterWriteRawLen__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterWriteString -extern __typeof (xmlTextWriterWriteString) xmlTextWriterWriteString __attribute((alias("xmlTextWriterWriteString__internal_alias"))); -#else -#ifndef xmlTextWriterWriteString -extern __typeof (xmlTextWriterWriteString) xmlTextWriterWriteString__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterWriteString xmlTextWriterWriteString__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterWriteVFormatAttribute -extern __typeof (xmlTextWriterWriteVFormatAttribute) xmlTextWriterWriteVFormatAttribute __attribute((alias("xmlTextWriterWriteVFormatAttribute__internal_alias"))); -#else -#ifndef xmlTextWriterWriteVFormatAttribute -extern __typeof (xmlTextWriterWriteVFormatAttribute) xmlTextWriterWriteVFormatAttribute__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterWriteVFormatAttribute xmlTextWriterWriteVFormatAttribute__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterWriteVFormatAttributeNS -extern __typeof (xmlTextWriterWriteVFormatAttributeNS) xmlTextWriterWriteVFormatAttributeNS __attribute((alias("xmlTextWriterWriteVFormatAttributeNS__internal_alias"))); -#else -#ifndef xmlTextWriterWriteVFormatAttributeNS -extern __typeof (xmlTextWriterWriteVFormatAttributeNS) xmlTextWriterWriteVFormatAttributeNS__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterWriteVFormatAttributeNS xmlTextWriterWriteVFormatAttributeNS__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterWriteVFormatCDATA -extern __typeof (xmlTextWriterWriteVFormatCDATA) xmlTextWriterWriteVFormatCDATA __attribute((alias("xmlTextWriterWriteVFormatCDATA__internal_alias"))); -#else -#ifndef xmlTextWriterWriteVFormatCDATA -extern __typeof (xmlTextWriterWriteVFormatCDATA) xmlTextWriterWriteVFormatCDATA__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterWriteVFormatCDATA xmlTextWriterWriteVFormatCDATA__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterWriteVFormatComment -extern __typeof (xmlTextWriterWriteVFormatComment) xmlTextWriterWriteVFormatComment __attribute((alias("xmlTextWriterWriteVFormatComment__internal_alias"))); -#else -#ifndef xmlTextWriterWriteVFormatComment -extern __typeof (xmlTextWriterWriteVFormatComment) xmlTextWriterWriteVFormatComment__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterWriteVFormatComment xmlTextWriterWriteVFormatComment__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterWriteVFormatDTD -extern __typeof (xmlTextWriterWriteVFormatDTD) xmlTextWriterWriteVFormatDTD __attribute((alias("xmlTextWriterWriteVFormatDTD__internal_alias"))); -#else -#ifndef xmlTextWriterWriteVFormatDTD -extern __typeof (xmlTextWriterWriteVFormatDTD) xmlTextWriterWriteVFormatDTD__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterWriteVFormatDTD xmlTextWriterWriteVFormatDTD__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterWriteVFormatDTDAttlist -extern __typeof (xmlTextWriterWriteVFormatDTDAttlist) xmlTextWriterWriteVFormatDTDAttlist __attribute((alias("xmlTextWriterWriteVFormatDTDAttlist__internal_alias"))); -#else -#ifndef xmlTextWriterWriteVFormatDTDAttlist -extern __typeof (xmlTextWriterWriteVFormatDTDAttlist) xmlTextWriterWriteVFormatDTDAttlist__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterWriteVFormatDTDAttlist xmlTextWriterWriteVFormatDTDAttlist__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterWriteVFormatDTDElement -extern __typeof (xmlTextWriterWriteVFormatDTDElement) xmlTextWriterWriteVFormatDTDElement __attribute((alias("xmlTextWriterWriteVFormatDTDElement__internal_alias"))); -#else -#ifndef xmlTextWriterWriteVFormatDTDElement -extern __typeof (xmlTextWriterWriteVFormatDTDElement) xmlTextWriterWriteVFormatDTDElement__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterWriteVFormatDTDElement xmlTextWriterWriteVFormatDTDElement__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterWriteVFormatDTDInternalEntity -extern __typeof (xmlTextWriterWriteVFormatDTDInternalEntity) xmlTextWriterWriteVFormatDTDInternalEntity __attribute((alias("xmlTextWriterWriteVFormatDTDInternalEntity__internal_alias"))); -#else -#ifndef xmlTextWriterWriteVFormatDTDInternalEntity -extern __typeof (xmlTextWriterWriteVFormatDTDInternalEntity) xmlTextWriterWriteVFormatDTDInternalEntity__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterWriteVFormatDTDInternalEntity xmlTextWriterWriteVFormatDTDInternalEntity__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterWriteVFormatElement -extern __typeof (xmlTextWriterWriteVFormatElement) xmlTextWriterWriteVFormatElement __attribute((alias("xmlTextWriterWriteVFormatElement__internal_alias"))); -#else -#ifndef xmlTextWriterWriteVFormatElement -extern __typeof (xmlTextWriterWriteVFormatElement) xmlTextWriterWriteVFormatElement__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterWriteVFormatElement xmlTextWriterWriteVFormatElement__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterWriteVFormatElementNS -extern __typeof (xmlTextWriterWriteVFormatElementNS) xmlTextWriterWriteVFormatElementNS __attribute((alias("xmlTextWriterWriteVFormatElementNS__internal_alias"))); -#else -#ifndef xmlTextWriterWriteVFormatElementNS -extern __typeof (xmlTextWriterWriteVFormatElementNS) xmlTextWriterWriteVFormatElementNS__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterWriteVFormatElementNS xmlTextWriterWriteVFormatElementNS__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterWriteVFormatPI -extern __typeof (xmlTextWriterWriteVFormatPI) xmlTextWriterWriteVFormatPI __attribute((alias("xmlTextWriterWriteVFormatPI__internal_alias"))); -#else -#ifndef xmlTextWriterWriteVFormatPI -extern __typeof (xmlTextWriterWriteVFormatPI) xmlTextWriterWriteVFormatPI__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterWriteVFormatPI xmlTextWriterWriteVFormatPI__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterWriteVFormatRaw -extern __typeof (xmlTextWriterWriteVFormatRaw) xmlTextWriterWriteVFormatRaw __attribute((alias("xmlTextWriterWriteVFormatRaw__internal_alias"))); -#else -#ifndef xmlTextWriterWriteVFormatRaw -extern __typeof (xmlTextWriterWriteVFormatRaw) xmlTextWriterWriteVFormatRaw__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterWriteVFormatRaw xmlTextWriterWriteVFormatRaw__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_WRITER_ENABLED) -#ifdef bottom_xmlwriter -#undef xmlTextWriterWriteVFormatString -extern __typeof (xmlTextWriterWriteVFormatString) xmlTextWriterWriteVFormatString __attribute((alias("xmlTextWriterWriteVFormatString__internal_alias"))); -#else -#ifndef xmlTextWriterWriteVFormatString -extern __typeof (xmlTextWriterWriteVFormatString) xmlTextWriterWriteVFormatString__internal_alias __attribute((visibility("hidden"))); -#define xmlTextWriterWriteVFormatString xmlTextWriterWriteVFormatString__internal_alias -#endif -#endif -#endif - -#ifdef bottom_globals -#undef xmlThrDefBufferAllocScheme -extern __typeof (xmlThrDefBufferAllocScheme) xmlThrDefBufferAllocScheme __attribute((alias("xmlThrDefBufferAllocScheme__internal_alias"))); -#else -#ifndef xmlThrDefBufferAllocScheme -extern __typeof (xmlThrDefBufferAllocScheme) xmlThrDefBufferAllocScheme__internal_alias __attribute((visibility("hidden"))); -#define xmlThrDefBufferAllocScheme xmlThrDefBufferAllocScheme__internal_alias -#endif -#endif - -#ifdef bottom_globals -#undef xmlThrDefDefaultBufferSize -extern __typeof (xmlThrDefDefaultBufferSize) xmlThrDefDefaultBufferSize __attribute((alias("xmlThrDefDefaultBufferSize__internal_alias"))); -#else -#ifndef xmlThrDefDefaultBufferSize -extern __typeof (xmlThrDefDefaultBufferSize) xmlThrDefDefaultBufferSize__internal_alias __attribute((visibility("hidden"))); -#define xmlThrDefDefaultBufferSize xmlThrDefDefaultBufferSize__internal_alias -#endif -#endif - -#ifdef bottom_globals -#undef xmlThrDefDeregisterNodeDefault -extern __typeof (xmlThrDefDeregisterNodeDefault) xmlThrDefDeregisterNodeDefault __attribute((alias("xmlThrDefDeregisterNodeDefault__internal_alias"))); -#else -#ifndef xmlThrDefDeregisterNodeDefault -extern __typeof (xmlThrDefDeregisterNodeDefault) xmlThrDefDeregisterNodeDefault__internal_alias __attribute((visibility("hidden"))); -#define xmlThrDefDeregisterNodeDefault xmlThrDefDeregisterNodeDefault__internal_alias -#endif -#endif - -#ifdef bottom_globals -#undef xmlThrDefDoValidityCheckingDefaultValue -extern __typeof (xmlThrDefDoValidityCheckingDefaultValue) xmlThrDefDoValidityCheckingDefaultValue __attribute((alias("xmlThrDefDoValidityCheckingDefaultValue__internal_alias"))); -#else -#ifndef xmlThrDefDoValidityCheckingDefaultValue -extern __typeof (xmlThrDefDoValidityCheckingDefaultValue) xmlThrDefDoValidityCheckingDefaultValue__internal_alias __attribute((visibility("hidden"))); -#define xmlThrDefDoValidityCheckingDefaultValue xmlThrDefDoValidityCheckingDefaultValue__internal_alias -#endif -#endif - -#ifdef bottom_globals -#undef xmlThrDefGetWarningsDefaultValue -extern __typeof (xmlThrDefGetWarningsDefaultValue) xmlThrDefGetWarningsDefaultValue __attribute((alias("xmlThrDefGetWarningsDefaultValue__internal_alias"))); -#else -#ifndef xmlThrDefGetWarningsDefaultValue -extern __typeof (xmlThrDefGetWarningsDefaultValue) xmlThrDefGetWarningsDefaultValue__internal_alias __attribute((visibility("hidden"))); -#define xmlThrDefGetWarningsDefaultValue xmlThrDefGetWarningsDefaultValue__internal_alias -#endif -#endif - -#ifdef bottom_globals -#undef xmlThrDefIndentTreeOutput -extern __typeof (xmlThrDefIndentTreeOutput) xmlThrDefIndentTreeOutput __attribute((alias("xmlThrDefIndentTreeOutput__internal_alias"))); -#else -#ifndef xmlThrDefIndentTreeOutput -extern __typeof (xmlThrDefIndentTreeOutput) xmlThrDefIndentTreeOutput__internal_alias __attribute((visibility("hidden"))); -#define xmlThrDefIndentTreeOutput xmlThrDefIndentTreeOutput__internal_alias -#endif -#endif - -#ifdef bottom_globals -#undef xmlThrDefKeepBlanksDefaultValue -extern __typeof (xmlThrDefKeepBlanksDefaultValue) xmlThrDefKeepBlanksDefaultValue __attribute((alias("xmlThrDefKeepBlanksDefaultValue__internal_alias"))); -#else -#ifndef xmlThrDefKeepBlanksDefaultValue -extern __typeof (xmlThrDefKeepBlanksDefaultValue) xmlThrDefKeepBlanksDefaultValue__internal_alias __attribute((visibility("hidden"))); -#define xmlThrDefKeepBlanksDefaultValue xmlThrDefKeepBlanksDefaultValue__internal_alias -#endif -#endif - -#ifdef bottom_globals -#undef xmlThrDefLineNumbersDefaultValue -extern __typeof (xmlThrDefLineNumbersDefaultValue) xmlThrDefLineNumbersDefaultValue __attribute((alias("xmlThrDefLineNumbersDefaultValue__internal_alias"))); -#else -#ifndef xmlThrDefLineNumbersDefaultValue -extern __typeof (xmlThrDefLineNumbersDefaultValue) xmlThrDefLineNumbersDefaultValue__internal_alias __attribute((visibility("hidden"))); -#define xmlThrDefLineNumbersDefaultValue xmlThrDefLineNumbersDefaultValue__internal_alias -#endif -#endif - -#ifdef bottom_globals -#undef xmlThrDefLoadExtDtdDefaultValue -extern __typeof (xmlThrDefLoadExtDtdDefaultValue) xmlThrDefLoadExtDtdDefaultValue __attribute((alias("xmlThrDefLoadExtDtdDefaultValue__internal_alias"))); -#else -#ifndef xmlThrDefLoadExtDtdDefaultValue -extern __typeof (xmlThrDefLoadExtDtdDefaultValue) xmlThrDefLoadExtDtdDefaultValue__internal_alias __attribute((visibility("hidden"))); -#define xmlThrDefLoadExtDtdDefaultValue xmlThrDefLoadExtDtdDefaultValue__internal_alias -#endif -#endif - -#ifdef bottom_globals -#undef xmlThrDefOutputBufferCreateFilenameDefault -extern __typeof (xmlThrDefOutputBufferCreateFilenameDefault) xmlThrDefOutputBufferCreateFilenameDefault __attribute((alias("xmlThrDefOutputBufferCreateFilenameDefault__internal_alias"))); -#else -#ifndef xmlThrDefOutputBufferCreateFilenameDefault -extern __typeof (xmlThrDefOutputBufferCreateFilenameDefault) xmlThrDefOutputBufferCreateFilenameDefault__internal_alias __attribute((visibility("hidden"))); -#define xmlThrDefOutputBufferCreateFilenameDefault xmlThrDefOutputBufferCreateFilenameDefault__internal_alias -#endif -#endif - -#ifdef bottom_globals -#undef xmlThrDefParserDebugEntities -extern __typeof (xmlThrDefParserDebugEntities) xmlThrDefParserDebugEntities __attribute((alias("xmlThrDefParserDebugEntities__internal_alias"))); -#else -#ifndef xmlThrDefParserDebugEntities -extern __typeof (xmlThrDefParserDebugEntities) xmlThrDefParserDebugEntities__internal_alias __attribute((visibility("hidden"))); -#define xmlThrDefParserDebugEntities xmlThrDefParserDebugEntities__internal_alias -#endif -#endif - -#ifdef bottom_globals -#undef xmlThrDefParserInputBufferCreateFilenameDefault -extern __typeof (xmlThrDefParserInputBufferCreateFilenameDefault) xmlThrDefParserInputBufferCreateFilenameDefault __attribute((alias("xmlThrDefParserInputBufferCreateFilenameDefault__internal_alias"))); -#else -#ifndef xmlThrDefParserInputBufferCreateFilenameDefault -extern __typeof (xmlThrDefParserInputBufferCreateFilenameDefault) xmlThrDefParserInputBufferCreateFilenameDefault__internal_alias __attribute((visibility("hidden"))); -#define xmlThrDefParserInputBufferCreateFilenameDefault xmlThrDefParserInputBufferCreateFilenameDefault__internal_alias -#endif -#endif - -#ifdef bottom_globals -#undef xmlThrDefPedanticParserDefaultValue -extern __typeof (xmlThrDefPedanticParserDefaultValue) xmlThrDefPedanticParserDefaultValue __attribute((alias("xmlThrDefPedanticParserDefaultValue__internal_alias"))); -#else -#ifndef xmlThrDefPedanticParserDefaultValue -extern __typeof (xmlThrDefPedanticParserDefaultValue) xmlThrDefPedanticParserDefaultValue__internal_alias __attribute((visibility("hidden"))); -#define xmlThrDefPedanticParserDefaultValue xmlThrDefPedanticParserDefaultValue__internal_alias -#endif -#endif - -#ifdef bottom_globals -#undef xmlThrDefRegisterNodeDefault -extern __typeof (xmlThrDefRegisterNodeDefault) xmlThrDefRegisterNodeDefault __attribute((alias("xmlThrDefRegisterNodeDefault__internal_alias"))); -#else -#ifndef xmlThrDefRegisterNodeDefault -extern __typeof (xmlThrDefRegisterNodeDefault) xmlThrDefRegisterNodeDefault__internal_alias __attribute((visibility("hidden"))); -#define xmlThrDefRegisterNodeDefault xmlThrDefRegisterNodeDefault__internal_alias -#endif -#endif - -#ifdef bottom_globals -#undef xmlThrDefSaveNoEmptyTags -extern __typeof (xmlThrDefSaveNoEmptyTags) xmlThrDefSaveNoEmptyTags __attribute((alias("xmlThrDefSaveNoEmptyTags__internal_alias"))); -#else -#ifndef xmlThrDefSaveNoEmptyTags -extern __typeof (xmlThrDefSaveNoEmptyTags) xmlThrDefSaveNoEmptyTags__internal_alias __attribute((visibility("hidden"))); -#define xmlThrDefSaveNoEmptyTags xmlThrDefSaveNoEmptyTags__internal_alias -#endif -#endif - -#ifdef bottom_globals -#undef xmlThrDefSetGenericErrorFunc -extern __typeof (xmlThrDefSetGenericErrorFunc) xmlThrDefSetGenericErrorFunc __attribute((alias("xmlThrDefSetGenericErrorFunc__internal_alias"))); -#else -#ifndef xmlThrDefSetGenericErrorFunc -extern __typeof (xmlThrDefSetGenericErrorFunc) xmlThrDefSetGenericErrorFunc__internal_alias __attribute((visibility("hidden"))); -#define xmlThrDefSetGenericErrorFunc xmlThrDefSetGenericErrorFunc__internal_alias -#endif -#endif - -#ifdef bottom_globals -#undef xmlThrDefSetStructuredErrorFunc -extern __typeof (xmlThrDefSetStructuredErrorFunc) xmlThrDefSetStructuredErrorFunc __attribute((alias("xmlThrDefSetStructuredErrorFunc__internal_alias"))); -#else -#ifndef xmlThrDefSetStructuredErrorFunc -extern __typeof (xmlThrDefSetStructuredErrorFunc) xmlThrDefSetStructuredErrorFunc__internal_alias __attribute((visibility("hidden"))); -#define xmlThrDefSetStructuredErrorFunc xmlThrDefSetStructuredErrorFunc__internal_alias -#endif -#endif - -#ifdef bottom_globals -#undef xmlThrDefSubstituteEntitiesDefaultValue -extern __typeof (xmlThrDefSubstituteEntitiesDefaultValue) xmlThrDefSubstituteEntitiesDefaultValue __attribute((alias("xmlThrDefSubstituteEntitiesDefaultValue__internal_alias"))); -#else -#ifndef xmlThrDefSubstituteEntitiesDefaultValue -extern __typeof (xmlThrDefSubstituteEntitiesDefaultValue) xmlThrDefSubstituteEntitiesDefaultValue__internal_alias __attribute((visibility("hidden"))); -#define xmlThrDefSubstituteEntitiesDefaultValue xmlThrDefSubstituteEntitiesDefaultValue__internal_alias -#endif -#endif - -#ifdef bottom_globals -#undef xmlThrDefTreeIndentString -extern __typeof (xmlThrDefTreeIndentString) xmlThrDefTreeIndentString __attribute((alias("xmlThrDefTreeIndentString__internal_alias"))); -#else -#ifndef xmlThrDefTreeIndentString -extern __typeof (xmlThrDefTreeIndentString) xmlThrDefTreeIndentString__internal_alias __attribute((visibility("hidden"))); -#define xmlThrDefTreeIndentString xmlThrDefTreeIndentString__internal_alias -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsAegeanNumbers -extern __typeof (xmlUCSIsAegeanNumbers) xmlUCSIsAegeanNumbers __attribute((alias("xmlUCSIsAegeanNumbers__internal_alias"))); -#else -#ifndef xmlUCSIsAegeanNumbers -extern __typeof (xmlUCSIsAegeanNumbers) xmlUCSIsAegeanNumbers__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsAegeanNumbers xmlUCSIsAegeanNumbers__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsAlphabeticPresentationForms -extern __typeof (xmlUCSIsAlphabeticPresentationForms) xmlUCSIsAlphabeticPresentationForms __attribute((alias("xmlUCSIsAlphabeticPresentationForms__internal_alias"))); -#else -#ifndef xmlUCSIsAlphabeticPresentationForms -extern __typeof (xmlUCSIsAlphabeticPresentationForms) xmlUCSIsAlphabeticPresentationForms__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsAlphabeticPresentationForms xmlUCSIsAlphabeticPresentationForms__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsArabic -extern __typeof (xmlUCSIsArabic) xmlUCSIsArabic __attribute((alias("xmlUCSIsArabic__internal_alias"))); -#else -#ifndef xmlUCSIsArabic -extern __typeof (xmlUCSIsArabic) xmlUCSIsArabic__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsArabic xmlUCSIsArabic__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsArabicPresentationFormsA -extern __typeof (xmlUCSIsArabicPresentationFormsA) xmlUCSIsArabicPresentationFormsA __attribute((alias("xmlUCSIsArabicPresentationFormsA__internal_alias"))); -#else -#ifndef xmlUCSIsArabicPresentationFormsA -extern __typeof (xmlUCSIsArabicPresentationFormsA) xmlUCSIsArabicPresentationFormsA__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsArabicPresentationFormsA xmlUCSIsArabicPresentationFormsA__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsArabicPresentationFormsB -extern __typeof (xmlUCSIsArabicPresentationFormsB) xmlUCSIsArabicPresentationFormsB __attribute((alias("xmlUCSIsArabicPresentationFormsB__internal_alias"))); -#else -#ifndef xmlUCSIsArabicPresentationFormsB -extern __typeof (xmlUCSIsArabicPresentationFormsB) xmlUCSIsArabicPresentationFormsB__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsArabicPresentationFormsB xmlUCSIsArabicPresentationFormsB__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsArmenian -extern __typeof (xmlUCSIsArmenian) xmlUCSIsArmenian __attribute((alias("xmlUCSIsArmenian__internal_alias"))); -#else -#ifndef xmlUCSIsArmenian -extern __typeof (xmlUCSIsArmenian) xmlUCSIsArmenian__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsArmenian xmlUCSIsArmenian__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsArrows -extern __typeof (xmlUCSIsArrows) xmlUCSIsArrows __attribute((alias("xmlUCSIsArrows__internal_alias"))); -#else -#ifndef xmlUCSIsArrows -extern __typeof (xmlUCSIsArrows) xmlUCSIsArrows__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsArrows xmlUCSIsArrows__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsBasicLatin -extern __typeof (xmlUCSIsBasicLatin) xmlUCSIsBasicLatin __attribute((alias("xmlUCSIsBasicLatin__internal_alias"))); -#else -#ifndef xmlUCSIsBasicLatin -extern __typeof (xmlUCSIsBasicLatin) xmlUCSIsBasicLatin__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsBasicLatin xmlUCSIsBasicLatin__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsBengali -extern __typeof (xmlUCSIsBengali) xmlUCSIsBengali __attribute((alias("xmlUCSIsBengali__internal_alias"))); -#else -#ifndef xmlUCSIsBengali -extern __typeof (xmlUCSIsBengali) xmlUCSIsBengali__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsBengali xmlUCSIsBengali__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsBlock -extern __typeof (xmlUCSIsBlock) xmlUCSIsBlock __attribute((alias("xmlUCSIsBlock__internal_alias"))); -#else -#ifndef xmlUCSIsBlock -extern __typeof (xmlUCSIsBlock) xmlUCSIsBlock__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsBlock xmlUCSIsBlock__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsBlockElements -extern __typeof (xmlUCSIsBlockElements) xmlUCSIsBlockElements __attribute((alias("xmlUCSIsBlockElements__internal_alias"))); -#else -#ifndef xmlUCSIsBlockElements -extern __typeof (xmlUCSIsBlockElements) xmlUCSIsBlockElements__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsBlockElements xmlUCSIsBlockElements__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsBopomofo -extern __typeof (xmlUCSIsBopomofo) xmlUCSIsBopomofo __attribute((alias("xmlUCSIsBopomofo__internal_alias"))); -#else -#ifndef xmlUCSIsBopomofo -extern __typeof (xmlUCSIsBopomofo) xmlUCSIsBopomofo__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsBopomofo xmlUCSIsBopomofo__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsBopomofoExtended -extern __typeof (xmlUCSIsBopomofoExtended) xmlUCSIsBopomofoExtended __attribute((alias("xmlUCSIsBopomofoExtended__internal_alias"))); -#else -#ifndef xmlUCSIsBopomofoExtended -extern __typeof (xmlUCSIsBopomofoExtended) xmlUCSIsBopomofoExtended__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsBopomofoExtended xmlUCSIsBopomofoExtended__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsBoxDrawing -extern __typeof (xmlUCSIsBoxDrawing) xmlUCSIsBoxDrawing __attribute((alias("xmlUCSIsBoxDrawing__internal_alias"))); -#else -#ifndef xmlUCSIsBoxDrawing -extern __typeof (xmlUCSIsBoxDrawing) xmlUCSIsBoxDrawing__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsBoxDrawing xmlUCSIsBoxDrawing__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsBraillePatterns -extern __typeof (xmlUCSIsBraillePatterns) xmlUCSIsBraillePatterns __attribute((alias("xmlUCSIsBraillePatterns__internal_alias"))); -#else -#ifndef xmlUCSIsBraillePatterns -extern __typeof (xmlUCSIsBraillePatterns) xmlUCSIsBraillePatterns__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsBraillePatterns xmlUCSIsBraillePatterns__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsBuhid -extern __typeof (xmlUCSIsBuhid) xmlUCSIsBuhid __attribute((alias("xmlUCSIsBuhid__internal_alias"))); -#else -#ifndef xmlUCSIsBuhid -extern __typeof (xmlUCSIsBuhid) xmlUCSIsBuhid__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsBuhid xmlUCSIsBuhid__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsByzantineMusicalSymbols -extern __typeof (xmlUCSIsByzantineMusicalSymbols) xmlUCSIsByzantineMusicalSymbols __attribute((alias("xmlUCSIsByzantineMusicalSymbols__internal_alias"))); -#else -#ifndef xmlUCSIsByzantineMusicalSymbols -extern __typeof (xmlUCSIsByzantineMusicalSymbols) xmlUCSIsByzantineMusicalSymbols__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsByzantineMusicalSymbols xmlUCSIsByzantineMusicalSymbols__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCJKCompatibility -extern __typeof (xmlUCSIsCJKCompatibility) xmlUCSIsCJKCompatibility __attribute((alias("xmlUCSIsCJKCompatibility__internal_alias"))); -#else -#ifndef xmlUCSIsCJKCompatibility -extern __typeof (xmlUCSIsCJKCompatibility) xmlUCSIsCJKCompatibility__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCJKCompatibility xmlUCSIsCJKCompatibility__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCJKCompatibilityForms -extern __typeof (xmlUCSIsCJKCompatibilityForms) xmlUCSIsCJKCompatibilityForms __attribute((alias("xmlUCSIsCJKCompatibilityForms__internal_alias"))); -#else -#ifndef xmlUCSIsCJKCompatibilityForms -extern __typeof (xmlUCSIsCJKCompatibilityForms) xmlUCSIsCJKCompatibilityForms__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCJKCompatibilityForms xmlUCSIsCJKCompatibilityForms__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCJKCompatibilityIdeographs -extern __typeof (xmlUCSIsCJKCompatibilityIdeographs) xmlUCSIsCJKCompatibilityIdeographs __attribute((alias("xmlUCSIsCJKCompatibilityIdeographs__internal_alias"))); -#else -#ifndef xmlUCSIsCJKCompatibilityIdeographs -extern __typeof (xmlUCSIsCJKCompatibilityIdeographs) xmlUCSIsCJKCompatibilityIdeographs__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCJKCompatibilityIdeographs xmlUCSIsCJKCompatibilityIdeographs__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCJKCompatibilityIdeographsSupplement -extern __typeof (xmlUCSIsCJKCompatibilityIdeographsSupplement) xmlUCSIsCJKCompatibilityIdeographsSupplement __attribute((alias("xmlUCSIsCJKCompatibilityIdeographsSupplement__internal_alias"))); -#else -#ifndef xmlUCSIsCJKCompatibilityIdeographsSupplement -extern __typeof (xmlUCSIsCJKCompatibilityIdeographsSupplement) xmlUCSIsCJKCompatibilityIdeographsSupplement__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCJKCompatibilityIdeographsSupplement xmlUCSIsCJKCompatibilityIdeographsSupplement__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCJKRadicalsSupplement -extern __typeof (xmlUCSIsCJKRadicalsSupplement) xmlUCSIsCJKRadicalsSupplement __attribute((alias("xmlUCSIsCJKRadicalsSupplement__internal_alias"))); -#else -#ifndef xmlUCSIsCJKRadicalsSupplement -extern __typeof (xmlUCSIsCJKRadicalsSupplement) xmlUCSIsCJKRadicalsSupplement__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCJKRadicalsSupplement xmlUCSIsCJKRadicalsSupplement__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCJKSymbolsandPunctuation -extern __typeof (xmlUCSIsCJKSymbolsandPunctuation) xmlUCSIsCJKSymbolsandPunctuation __attribute((alias("xmlUCSIsCJKSymbolsandPunctuation__internal_alias"))); -#else -#ifndef xmlUCSIsCJKSymbolsandPunctuation -extern __typeof (xmlUCSIsCJKSymbolsandPunctuation) xmlUCSIsCJKSymbolsandPunctuation__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCJKSymbolsandPunctuation xmlUCSIsCJKSymbolsandPunctuation__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCJKUnifiedIdeographs -extern __typeof (xmlUCSIsCJKUnifiedIdeographs) xmlUCSIsCJKUnifiedIdeographs __attribute((alias("xmlUCSIsCJKUnifiedIdeographs__internal_alias"))); -#else -#ifndef xmlUCSIsCJKUnifiedIdeographs -extern __typeof (xmlUCSIsCJKUnifiedIdeographs) xmlUCSIsCJKUnifiedIdeographs__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCJKUnifiedIdeographs xmlUCSIsCJKUnifiedIdeographs__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCJKUnifiedIdeographsExtensionA -extern __typeof (xmlUCSIsCJKUnifiedIdeographsExtensionA) xmlUCSIsCJKUnifiedIdeographsExtensionA __attribute((alias("xmlUCSIsCJKUnifiedIdeographsExtensionA__internal_alias"))); -#else -#ifndef xmlUCSIsCJKUnifiedIdeographsExtensionA -extern __typeof (xmlUCSIsCJKUnifiedIdeographsExtensionA) xmlUCSIsCJKUnifiedIdeographsExtensionA__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCJKUnifiedIdeographsExtensionA xmlUCSIsCJKUnifiedIdeographsExtensionA__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCJKUnifiedIdeographsExtensionB -extern __typeof (xmlUCSIsCJKUnifiedIdeographsExtensionB) xmlUCSIsCJKUnifiedIdeographsExtensionB __attribute((alias("xmlUCSIsCJKUnifiedIdeographsExtensionB__internal_alias"))); -#else -#ifndef xmlUCSIsCJKUnifiedIdeographsExtensionB -extern __typeof (xmlUCSIsCJKUnifiedIdeographsExtensionB) xmlUCSIsCJKUnifiedIdeographsExtensionB__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCJKUnifiedIdeographsExtensionB xmlUCSIsCJKUnifiedIdeographsExtensionB__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCat -extern __typeof (xmlUCSIsCat) xmlUCSIsCat __attribute((alias("xmlUCSIsCat__internal_alias"))); -#else -#ifndef xmlUCSIsCat -extern __typeof (xmlUCSIsCat) xmlUCSIsCat__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCat xmlUCSIsCat__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCatC -extern __typeof (xmlUCSIsCatC) xmlUCSIsCatC __attribute((alias("xmlUCSIsCatC__internal_alias"))); -#else -#ifndef xmlUCSIsCatC -extern __typeof (xmlUCSIsCatC) xmlUCSIsCatC__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCatC xmlUCSIsCatC__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCatCc -extern __typeof (xmlUCSIsCatCc) xmlUCSIsCatCc __attribute((alias("xmlUCSIsCatCc__internal_alias"))); -#else -#ifndef xmlUCSIsCatCc -extern __typeof (xmlUCSIsCatCc) xmlUCSIsCatCc__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCatCc xmlUCSIsCatCc__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCatCf -extern __typeof (xmlUCSIsCatCf) xmlUCSIsCatCf __attribute((alias("xmlUCSIsCatCf__internal_alias"))); -#else -#ifndef xmlUCSIsCatCf -extern __typeof (xmlUCSIsCatCf) xmlUCSIsCatCf__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCatCf xmlUCSIsCatCf__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCatCo -extern __typeof (xmlUCSIsCatCo) xmlUCSIsCatCo __attribute((alias("xmlUCSIsCatCo__internal_alias"))); -#else -#ifndef xmlUCSIsCatCo -extern __typeof (xmlUCSIsCatCo) xmlUCSIsCatCo__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCatCo xmlUCSIsCatCo__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCatCs -extern __typeof (xmlUCSIsCatCs) xmlUCSIsCatCs __attribute((alias("xmlUCSIsCatCs__internal_alias"))); -#else -#ifndef xmlUCSIsCatCs -extern __typeof (xmlUCSIsCatCs) xmlUCSIsCatCs__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCatCs xmlUCSIsCatCs__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCatL -extern __typeof (xmlUCSIsCatL) xmlUCSIsCatL __attribute((alias("xmlUCSIsCatL__internal_alias"))); -#else -#ifndef xmlUCSIsCatL -extern __typeof (xmlUCSIsCatL) xmlUCSIsCatL__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCatL xmlUCSIsCatL__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCatLl -extern __typeof (xmlUCSIsCatLl) xmlUCSIsCatLl __attribute((alias("xmlUCSIsCatLl__internal_alias"))); -#else -#ifndef xmlUCSIsCatLl -extern __typeof (xmlUCSIsCatLl) xmlUCSIsCatLl__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCatLl xmlUCSIsCatLl__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCatLm -extern __typeof (xmlUCSIsCatLm) xmlUCSIsCatLm __attribute((alias("xmlUCSIsCatLm__internal_alias"))); -#else -#ifndef xmlUCSIsCatLm -extern __typeof (xmlUCSIsCatLm) xmlUCSIsCatLm__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCatLm xmlUCSIsCatLm__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCatLo -extern __typeof (xmlUCSIsCatLo) xmlUCSIsCatLo __attribute((alias("xmlUCSIsCatLo__internal_alias"))); -#else -#ifndef xmlUCSIsCatLo -extern __typeof (xmlUCSIsCatLo) xmlUCSIsCatLo__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCatLo xmlUCSIsCatLo__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCatLt -extern __typeof (xmlUCSIsCatLt) xmlUCSIsCatLt __attribute((alias("xmlUCSIsCatLt__internal_alias"))); -#else -#ifndef xmlUCSIsCatLt -extern __typeof (xmlUCSIsCatLt) xmlUCSIsCatLt__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCatLt xmlUCSIsCatLt__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCatLu -extern __typeof (xmlUCSIsCatLu) xmlUCSIsCatLu __attribute((alias("xmlUCSIsCatLu__internal_alias"))); -#else -#ifndef xmlUCSIsCatLu -extern __typeof (xmlUCSIsCatLu) xmlUCSIsCatLu__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCatLu xmlUCSIsCatLu__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCatM -extern __typeof (xmlUCSIsCatM) xmlUCSIsCatM __attribute((alias("xmlUCSIsCatM__internal_alias"))); -#else -#ifndef xmlUCSIsCatM -extern __typeof (xmlUCSIsCatM) xmlUCSIsCatM__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCatM xmlUCSIsCatM__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCatMc -extern __typeof (xmlUCSIsCatMc) xmlUCSIsCatMc __attribute((alias("xmlUCSIsCatMc__internal_alias"))); -#else -#ifndef xmlUCSIsCatMc -extern __typeof (xmlUCSIsCatMc) xmlUCSIsCatMc__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCatMc xmlUCSIsCatMc__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCatMe -extern __typeof (xmlUCSIsCatMe) xmlUCSIsCatMe __attribute((alias("xmlUCSIsCatMe__internal_alias"))); -#else -#ifndef xmlUCSIsCatMe -extern __typeof (xmlUCSIsCatMe) xmlUCSIsCatMe__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCatMe xmlUCSIsCatMe__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCatMn -extern __typeof (xmlUCSIsCatMn) xmlUCSIsCatMn __attribute((alias("xmlUCSIsCatMn__internal_alias"))); -#else -#ifndef xmlUCSIsCatMn -extern __typeof (xmlUCSIsCatMn) xmlUCSIsCatMn__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCatMn xmlUCSIsCatMn__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCatN -extern __typeof (xmlUCSIsCatN) xmlUCSIsCatN __attribute((alias("xmlUCSIsCatN__internal_alias"))); -#else -#ifndef xmlUCSIsCatN -extern __typeof (xmlUCSIsCatN) xmlUCSIsCatN__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCatN xmlUCSIsCatN__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCatNd -extern __typeof (xmlUCSIsCatNd) xmlUCSIsCatNd __attribute((alias("xmlUCSIsCatNd__internal_alias"))); -#else -#ifndef xmlUCSIsCatNd -extern __typeof (xmlUCSIsCatNd) xmlUCSIsCatNd__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCatNd xmlUCSIsCatNd__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCatNl -extern __typeof (xmlUCSIsCatNl) xmlUCSIsCatNl __attribute((alias("xmlUCSIsCatNl__internal_alias"))); -#else -#ifndef xmlUCSIsCatNl -extern __typeof (xmlUCSIsCatNl) xmlUCSIsCatNl__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCatNl xmlUCSIsCatNl__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCatNo -extern __typeof (xmlUCSIsCatNo) xmlUCSIsCatNo __attribute((alias("xmlUCSIsCatNo__internal_alias"))); -#else -#ifndef xmlUCSIsCatNo -extern __typeof (xmlUCSIsCatNo) xmlUCSIsCatNo__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCatNo xmlUCSIsCatNo__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCatP -extern __typeof (xmlUCSIsCatP) xmlUCSIsCatP __attribute((alias("xmlUCSIsCatP__internal_alias"))); -#else -#ifndef xmlUCSIsCatP -extern __typeof (xmlUCSIsCatP) xmlUCSIsCatP__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCatP xmlUCSIsCatP__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCatPc -extern __typeof (xmlUCSIsCatPc) xmlUCSIsCatPc __attribute((alias("xmlUCSIsCatPc__internal_alias"))); -#else -#ifndef xmlUCSIsCatPc -extern __typeof (xmlUCSIsCatPc) xmlUCSIsCatPc__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCatPc xmlUCSIsCatPc__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCatPd -extern __typeof (xmlUCSIsCatPd) xmlUCSIsCatPd __attribute((alias("xmlUCSIsCatPd__internal_alias"))); -#else -#ifndef xmlUCSIsCatPd -extern __typeof (xmlUCSIsCatPd) xmlUCSIsCatPd__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCatPd xmlUCSIsCatPd__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCatPe -extern __typeof (xmlUCSIsCatPe) xmlUCSIsCatPe __attribute((alias("xmlUCSIsCatPe__internal_alias"))); -#else -#ifndef xmlUCSIsCatPe -extern __typeof (xmlUCSIsCatPe) xmlUCSIsCatPe__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCatPe xmlUCSIsCatPe__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCatPf -extern __typeof (xmlUCSIsCatPf) xmlUCSIsCatPf __attribute((alias("xmlUCSIsCatPf__internal_alias"))); -#else -#ifndef xmlUCSIsCatPf -extern __typeof (xmlUCSIsCatPf) xmlUCSIsCatPf__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCatPf xmlUCSIsCatPf__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCatPi -extern __typeof (xmlUCSIsCatPi) xmlUCSIsCatPi __attribute((alias("xmlUCSIsCatPi__internal_alias"))); -#else -#ifndef xmlUCSIsCatPi -extern __typeof (xmlUCSIsCatPi) xmlUCSIsCatPi__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCatPi xmlUCSIsCatPi__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCatPo -extern __typeof (xmlUCSIsCatPo) xmlUCSIsCatPo __attribute((alias("xmlUCSIsCatPo__internal_alias"))); -#else -#ifndef xmlUCSIsCatPo -extern __typeof (xmlUCSIsCatPo) xmlUCSIsCatPo__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCatPo xmlUCSIsCatPo__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCatPs -extern __typeof (xmlUCSIsCatPs) xmlUCSIsCatPs __attribute((alias("xmlUCSIsCatPs__internal_alias"))); -#else -#ifndef xmlUCSIsCatPs -extern __typeof (xmlUCSIsCatPs) xmlUCSIsCatPs__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCatPs xmlUCSIsCatPs__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCatS -extern __typeof (xmlUCSIsCatS) xmlUCSIsCatS __attribute((alias("xmlUCSIsCatS__internal_alias"))); -#else -#ifndef xmlUCSIsCatS -extern __typeof (xmlUCSIsCatS) xmlUCSIsCatS__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCatS xmlUCSIsCatS__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCatSc -extern __typeof (xmlUCSIsCatSc) xmlUCSIsCatSc __attribute((alias("xmlUCSIsCatSc__internal_alias"))); -#else -#ifndef xmlUCSIsCatSc -extern __typeof (xmlUCSIsCatSc) xmlUCSIsCatSc__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCatSc xmlUCSIsCatSc__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCatSk -extern __typeof (xmlUCSIsCatSk) xmlUCSIsCatSk __attribute((alias("xmlUCSIsCatSk__internal_alias"))); -#else -#ifndef xmlUCSIsCatSk -extern __typeof (xmlUCSIsCatSk) xmlUCSIsCatSk__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCatSk xmlUCSIsCatSk__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCatSm -extern __typeof (xmlUCSIsCatSm) xmlUCSIsCatSm __attribute((alias("xmlUCSIsCatSm__internal_alias"))); -#else -#ifndef xmlUCSIsCatSm -extern __typeof (xmlUCSIsCatSm) xmlUCSIsCatSm__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCatSm xmlUCSIsCatSm__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCatSo -extern __typeof (xmlUCSIsCatSo) xmlUCSIsCatSo __attribute((alias("xmlUCSIsCatSo__internal_alias"))); -#else -#ifndef xmlUCSIsCatSo -extern __typeof (xmlUCSIsCatSo) xmlUCSIsCatSo__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCatSo xmlUCSIsCatSo__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCatZ -extern __typeof (xmlUCSIsCatZ) xmlUCSIsCatZ __attribute((alias("xmlUCSIsCatZ__internal_alias"))); -#else -#ifndef xmlUCSIsCatZ -extern __typeof (xmlUCSIsCatZ) xmlUCSIsCatZ__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCatZ xmlUCSIsCatZ__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCatZl -extern __typeof (xmlUCSIsCatZl) xmlUCSIsCatZl __attribute((alias("xmlUCSIsCatZl__internal_alias"))); -#else -#ifndef xmlUCSIsCatZl -extern __typeof (xmlUCSIsCatZl) xmlUCSIsCatZl__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCatZl xmlUCSIsCatZl__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCatZp -extern __typeof (xmlUCSIsCatZp) xmlUCSIsCatZp __attribute((alias("xmlUCSIsCatZp__internal_alias"))); -#else -#ifndef xmlUCSIsCatZp -extern __typeof (xmlUCSIsCatZp) xmlUCSIsCatZp__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCatZp xmlUCSIsCatZp__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCatZs -extern __typeof (xmlUCSIsCatZs) xmlUCSIsCatZs __attribute((alias("xmlUCSIsCatZs__internal_alias"))); -#else -#ifndef xmlUCSIsCatZs -extern __typeof (xmlUCSIsCatZs) xmlUCSIsCatZs__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCatZs xmlUCSIsCatZs__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCherokee -extern __typeof (xmlUCSIsCherokee) xmlUCSIsCherokee __attribute((alias("xmlUCSIsCherokee__internal_alias"))); -#else -#ifndef xmlUCSIsCherokee -extern __typeof (xmlUCSIsCherokee) xmlUCSIsCherokee__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCherokee xmlUCSIsCherokee__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCombiningDiacriticalMarks -extern __typeof (xmlUCSIsCombiningDiacriticalMarks) xmlUCSIsCombiningDiacriticalMarks __attribute((alias("xmlUCSIsCombiningDiacriticalMarks__internal_alias"))); -#else -#ifndef xmlUCSIsCombiningDiacriticalMarks -extern __typeof (xmlUCSIsCombiningDiacriticalMarks) xmlUCSIsCombiningDiacriticalMarks__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCombiningDiacriticalMarks xmlUCSIsCombiningDiacriticalMarks__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCombiningDiacriticalMarksforSymbols -extern __typeof (xmlUCSIsCombiningDiacriticalMarksforSymbols) xmlUCSIsCombiningDiacriticalMarksforSymbols __attribute((alias("xmlUCSIsCombiningDiacriticalMarksforSymbols__internal_alias"))); -#else -#ifndef xmlUCSIsCombiningDiacriticalMarksforSymbols -extern __typeof (xmlUCSIsCombiningDiacriticalMarksforSymbols) xmlUCSIsCombiningDiacriticalMarksforSymbols__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCombiningDiacriticalMarksforSymbols xmlUCSIsCombiningDiacriticalMarksforSymbols__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCombiningHalfMarks -extern __typeof (xmlUCSIsCombiningHalfMarks) xmlUCSIsCombiningHalfMarks __attribute((alias("xmlUCSIsCombiningHalfMarks__internal_alias"))); -#else -#ifndef xmlUCSIsCombiningHalfMarks -extern __typeof (xmlUCSIsCombiningHalfMarks) xmlUCSIsCombiningHalfMarks__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCombiningHalfMarks xmlUCSIsCombiningHalfMarks__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCombiningMarksforSymbols -extern __typeof (xmlUCSIsCombiningMarksforSymbols) xmlUCSIsCombiningMarksforSymbols __attribute((alias("xmlUCSIsCombiningMarksforSymbols__internal_alias"))); -#else -#ifndef xmlUCSIsCombiningMarksforSymbols -extern __typeof (xmlUCSIsCombiningMarksforSymbols) xmlUCSIsCombiningMarksforSymbols__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCombiningMarksforSymbols xmlUCSIsCombiningMarksforSymbols__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsControlPictures -extern __typeof (xmlUCSIsControlPictures) xmlUCSIsControlPictures __attribute((alias("xmlUCSIsControlPictures__internal_alias"))); -#else -#ifndef xmlUCSIsControlPictures -extern __typeof (xmlUCSIsControlPictures) xmlUCSIsControlPictures__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsControlPictures xmlUCSIsControlPictures__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCurrencySymbols -extern __typeof (xmlUCSIsCurrencySymbols) xmlUCSIsCurrencySymbols __attribute((alias("xmlUCSIsCurrencySymbols__internal_alias"))); -#else -#ifndef xmlUCSIsCurrencySymbols -extern __typeof (xmlUCSIsCurrencySymbols) xmlUCSIsCurrencySymbols__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCurrencySymbols xmlUCSIsCurrencySymbols__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCypriotSyllabary -extern __typeof (xmlUCSIsCypriotSyllabary) xmlUCSIsCypriotSyllabary __attribute((alias("xmlUCSIsCypriotSyllabary__internal_alias"))); -#else -#ifndef xmlUCSIsCypriotSyllabary -extern __typeof (xmlUCSIsCypriotSyllabary) xmlUCSIsCypriotSyllabary__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCypriotSyllabary xmlUCSIsCypriotSyllabary__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCyrillic -extern __typeof (xmlUCSIsCyrillic) xmlUCSIsCyrillic __attribute((alias("xmlUCSIsCyrillic__internal_alias"))); -#else -#ifndef xmlUCSIsCyrillic -extern __typeof (xmlUCSIsCyrillic) xmlUCSIsCyrillic__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCyrillic xmlUCSIsCyrillic__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsCyrillicSupplement -extern __typeof (xmlUCSIsCyrillicSupplement) xmlUCSIsCyrillicSupplement __attribute((alias("xmlUCSIsCyrillicSupplement__internal_alias"))); -#else -#ifndef xmlUCSIsCyrillicSupplement -extern __typeof (xmlUCSIsCyrillicSupplement) xmlUCSIsCyrillicSupplement__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsCyrillicSupplement xmlUCSIsCyrillicSupplement__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsDeseret -extern __typeof (xmlUCSIsDeseret) xmlUCSIsDeseret __attribute((alias("xmlUCSIsDeseret__internal_alias"))); -#else -#ifndef xmlUCSIsDeseret -extern __typeof (xmlUCSIsDeseret) xmlUCSIsDeseret__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsDeseret xmlUCSIsDeseret__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsDevanagari -extern __typeof (xmlUCSIsDevanagari) xmlUCSIsDevanagari __attribute((alias("xmlUCSIsDevanagari__internal_alias"))); -#else -#ifndef xmlUCSIsDevanagari -extern __typeof (xmlUCSIsDevanagari) xmlUCSIsDevanagari__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsDevanagari xmlUCSIsDevanagari__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsDingbats -extern __typeof (xmlUCSIsDingbats) xmlUCSIsDingbats __attribute((alias("xmlUCSIsDingbats__internal_alias"))); -#else -#ifndef xmlUCSIsDingbats -extern __typeof (xmlUCSIsDingbats) xmlUCSIsDingbats__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsDingbats xmlUCSIsDingbats__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsEnclosedAlphanumerics -extern __typeof (xmlUCSIsEnclosedAlphanumerics) xmlUCSIsEnclosedAlphanumerics __attribute((alias("xmlUCSIsEnclosedAlphanumerics__internal_alias"))); -#else -#ifndef xmlUCSIsEnclosedAlphanumerics -extern __typeof (xmlUCSIsEnclosedAlphanumerics) xmlUCSIsEnclosedAlphanumerics__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsEnclosedAlphanumerics xmlUCSIsEnclosedAlphanumerics__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsEnclosedCJKLettersandMonths -extern __typeof (xmlUCSIsEnclosedCJKLettersandMonths) xmlUCSIsEnclosedCJKLettersandMonths __attribute((alias("xmlUCSIsEnclosedCJKLettersandMonths__internal_alias"))); -#else -#ifndef xmlUCSIsEnclosedCJKLettersandMonths -extern __typeof (xmlUCSIsEnclosedCJKLettersandMonths) xmlUCSIsEnclosedCJKLettersandMonths__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsEnclosedCJKLettersandMonths xmlUCSIsEnclosedCJKLettersandMonths__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsEthiopic -extern __typeof (xmlUCSIsEthiopic) xmlUCSIsEthiopic __attribute((alias("xmlUCSIsEthiopic__internal_alias"))); -#else -#ifndef xmlUCSIsEthiopic -extern __typeof (xmlUCSIsEthiopic) xmlUCSIsEthiopic__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsEthiopic xmlUCSIsEthiopic__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsGeneralPunctuation -extern __typeof (xmlUCSIsGeneralPunctuation) xmlUCSIsGeneralPunctuation __attribute((alias("xmlUCSIsGeneralPunctuation__internal_alias"))); -#else -#ifndef xmlUCSIsGeneralPunctuation -extern __typeof (xmlUCSIsGeneralPunctuation) xmlUCSIsGeneralPunctuation__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsGeneralPunctuation xmlUCSIsGeneralPunctuation__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsGeometricShapes -extern __typeof (xmlUCSIsGeometricShapes) xmlUCSIsGeometricShapes __attribute((alias("xmlUCSIsGeometricShapes__internal_alias"))); -#else -#ifndef xmlUCSIsGeometricShapes -extern __typeof (xmlUCSIsGeometricShapes) xmlUCSIsGeometricShapes__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsGeometricShapes xmlUCSIsGeometricShapes__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsGeorgian -extern __typeof (xmlUCSIsGeorgian) xmlUCSIsGeorgian __attribute((alias("xmlUCSIsGeorgian__internal_alias"))); -#else -#ifndef xmlUCSIsGeorgian -extern __typeof (xmlUCSIsGeorgian) xmlUCSIsGeorgian__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsGeorgian xmlUCSIsGeorgian__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsGothic -extern __typeof (xmlUCSIsGothic) xmlUCSIsGothic __attribute((alias("xmlUCSIsGothic__internal_alias"))); -#else -#ifndef xmlUCSIsGothic -extern __typeof (xmlUCSIsGothic) xmlUCSIsGothic__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsGothic xmlUCSIsGothic__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsGreek -extern __typeof (xmlUCSIsGreek) xmlUCSIsGreek __attribute((alias("xmlUCSIsGreek__internal_alias"))); -#else -#ifndef xmlUCSIsGreek -extern __typeof (xmlUCSIsGreek) xmlUCSIsGreek__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsGreek xmlUCSIsGreek__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsGreekExtended -extern __typeof (xmlUCSIsGreekExtended) xmlUCSIsGreekExtended __attribute((alias("xmlUCSIsGreekExtended__internal_alias"))); -#else -#ifndef xmlUCSIsGreekExtended -extern __typeof (xmlUCSIsGreekExtended) xmlUCSIsGreekExtended__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsGreekExtended xmlUCSIsGreekExtended__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsGreekandCoptic -extern __typeof (xmlUCSIsGreekandCoptic) xmlUCSIsGreekandCoptic __attribute((alias("xmlUCSIsGreekandCoptic__internal_alias"))); -#else -#ifndef xmlUCSIsGreekandCoptic -extern __typeof (xmlUCSIsGreekandCoptic) xmlUCSIsGreekandCoptic__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsGreekandCoptic xmlUCSIsGreekandCoptic__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsGujarati -extern __typeof (xmlUCSIsGujarati) xmlUCSIsGujarati __attribute((alias("xmlUCSIsGujarati__internal_alias"))); -#else -#ifndef xmlUCSIsGujarati -extern __typeof (xmlUCSIsGujarati) xmlUCSIsGujarati__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsGujarati xmlUCSIsGujarati__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsGurmukhi -extern __typeof (xmlUCSIsGurmukhi) xmlUCSIsGurmukhi __attribute((alias("xmlUCSIsGurmukhi__internal_alias"))); -#else -#ifndef xmlUCSIsGurmukhi -extern __typeof (xmlUCSIsGurmukhi) xmlUCSIsGurmukhi__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsGurmukhi xmlUCSIsGurmukhi__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsHalfwidthandFullwidthForms -extern __typeof (xmlUCSIsHalfwidthandFullwidthForms) xmlUCSIsHalfwidthandFullwidthForms __attribute((alias("xmlUCSIsHalfwidthandFullwidthForms__internal_alias"))); -#else -#ifndef xmlUCSIsHalfwidthandFullwidthForms -extern __typeof (xmlUCSIsHalfwidthandFullwidthForms) xmlUCSIsHalfwidthandFullwidthForms__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsHalfwidthandFullwidthForms xmlUCSIsHalfwidthandFullwidthForms__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsHangulCompatibilityJamo -extern __typeof (xmlUCSIsHangulCompatibilityJamo) xmlUCSIsHangulCompatibilityJamo __attribute((alias("xmlUCSIsHangulCompatibilityJamo__internal_alias"))); -#else -#ifndef xmlUCSIsHangulCompatibilityJamo -extern __typeof (xmlUCSIsHangulCompatibilityJamo) xmlUCSIsHangulCompatibilityJamo__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsHangulCompatibilityJamo xmlUCSIsHangulCompatibilityJamo__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsHangulJamo -extern __typeof (xmlUCSIsHangulJamo) xmlUCSIsHangulJamo __attribute((alias("xmlUCSIsHangulJamo__internal_alias"))); -#else -#ifndef xmlUCSIsHangulJamo -extern __typeof (xmlUCSIsHangulJamo) xmlUCSIsHangulJamo__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsHangulJamo xmlUCSIsHangulJamo__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsHangulSyllables -extern __typeof (xmlUCSIsHangulSyllables) xmlUCSIsHangulSyllables __attribute((alias("xmlUCSIsHangulSyllables__internal_alias"))); -#else -#ifndef xmlUCSIsHangulSyllables -extern __typeof (xmlUCSIsHangulSyllables) xmlUCSIsHangulSyllables__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsHangulSyllables xmlUCSIsHangulSyllables__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsHanunoo -extern __typeof (xmlUCSIsHanunoo) xmlUCSIsHanunoo __attribute((alias("xmlUCSIsHanunoo__internal_alias"))); -#else -#ifndef xmlUCSIsHanunoo -extern __typeof (xmlUCSIsHanunoo) xmlUCSIsHanunoo__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsHanunoo xmlUCSIsHanunoo__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsHebrew -extern __typeof (xmlUCSIsHebrew) xmlUCSIsHebrew __attribute((alias("xmlUCSIsHebrew__internal_alias"))); -#else -#ifndef xmlUCSIsHebrew -extern __typeof (xmlUCSIsHebrew) xmlUCSIsHebrew__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsHebrew xmlUCSIsHebrew__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsHighPrivateUseSurrogates -extern __typeof (xmlUCSIsHighPrivateUseSurrogates) xmlUCSIsHighPrivateUseSurrogates __attribute((alias("xmlUCSIsHighPrivateUseSurrogates__internal_alias"))); -#else -#ifndef xmlUCSIsHighPrivateUseSurrogates -extern __typeof (xmlUCSIsHighPrivateUseSurrogates) xmlUCSIsHighPrivateUseSurrogates__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsHighPrivateUseSurrogates xmlUCSIsHighPrivateUseSurrogates__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsHighSurrogates -extern __typeof (xmlUCSIsHighSurrogates) xmlUCSIsHighSurrogates __attribute((alias("xmlUCSIsHighSurrogates__internal_alias"))); -#else -#ifndef xmlUCSIsHighSurrogates -extern __typeof (xmlUCSIsHighSurrogates) xmlUCSIsHighSurrogates__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsHighSurrogates xmlUCSIsHighSurrogates__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsHiragana -extern __typeof (xmlUCSIsHiragana) xmlUCSIsHiragana __attribute((alias("xmlUCSIsHiragana__internal_alias"))); -#else -#ifndef xmlUCSIsHiragana -extern __typeof (xmlUCSIsHiragana) xmlUCSIsHiragana__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsHiragana xmlUCSIsHiragana__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsIPAExtensions -extern __typeof (xmlUCSIsIPAExtensions) xmlUCSIsIPAExtensions __attribute((alias("xmlUCSIsIPAExtensions__internal_alias"))); -#else -#ifndef xmlUCSIsIPAExtensions -extern __typeof (xmlUCSIsIPAExtensions) xmlUCSIsIPAExtensions__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsIPAExtensions xmlUCSIsIPAExtensions__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsIdeographicDescriptionCharacters -extern __typeof (xmlUCSIsIdeographicDescriptionCharacters) xmlUCSIsIdeographicDescriptionCharacters __attribute((alias("xmlUCSIsIdeographicDescriptionCharacters__internal_alias"))); -#else -#ifndef xmlUCSIsIdeographicDescriptionCharacters -extern __typeof (xmlUCSIsIdeographicDescriptionCharacters) xmlUCSIsIdeographicDescriptionCharacters__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsIdeographicDescriptionCharacters xmlUCSIsIdeographicDescriptionCharacters__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsKanbun -extern __typeof (xmlUCSIsKanbun) xmlUCSIsKanbun __attribute((alias("xmlUCSIsKanbun__internal_alias"))); -#else -#ifndef xmlUCSIsKanbun -extern __typeof (xmlUCSIsKanbun) xmlUCSIsKanbun__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsKanbun xmlUCSIsKanbun__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsKangxiRadicals -extern __typeof (xmlUCSIsKangxiRadicals) xmlUCSIsKangxiRadicals __attribute((alias("xmlUCSIsKangxiRadicals__internal_alias"))); -#else -#ifndef xmlUCSIsKangxiRadicals -extern __typeof (xmlUCSIsKangxiRadicals) xmlUCSIsKangxiRadicals__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsKangxiRadicals xmlUCSIsKangxiRadicals__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsKannada -extern __typeof (xmlUCSIsKannada) xmlUCSIsKannada __attribute((alias("xmlUCSIsKannada__internal_alias"))); -#else -#ifndef xmlUCSIsKannada -extern __typeof (xmlUCSIsKannada) xmlUCSIsKannada__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsKannada xmlUCSIsKannada__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsKatakana -extern __typeof (xmlUCSIsKatakana) xmlUCSIsKatakana __attribute((alias("xmlUCSIsKatakana__internal_alias"))); -#else -#ifndef xmlUCSIsKatakana -extern __typeof (xmlUCSIsKatakana) xmlUCSIsKatakana__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsKatakana xmlUCSIsKatakana__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsKatakanaPhoneticExtensions -extern __typeof (xmlUCSIsKatakanaPhoneticExtensions) xmlUCSIsKatakanaPhoneticExtensions __attribute((alias("xmlUCSIsKatakanaPhoneticExtensions__internal_alias"))); -#else -#ifndef xmlUCSIsKatakanaPhoneticExtensions -extern __typeof (xmlUCSIsKatakanaPhoneticExtensions) xmlUCSIsKatakanaPhoneticExtensions__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsKatakanaPhoneticExtensions xmlUCSIsKatakanaPhoneticExtensions__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsKhmer -extern __typeof (xmlUCSIsKhmer) xmlUCSIsKhmer __attribute((alias("xmlUCSIsKhmer__internal_alias"))); -#else -#ifndef xmlUCSIsKhmer -extern __typeof (xmlUCSIsKhmer) xmlUCSIsKhmer__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsKhmer xmlUCSIsKhmer__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsKhmerSymbols -extern __typeof (xmlUCSIsKhmerSymbols) xmlUCSIsKhmerSymbols __attribute((alias("xmlUCSIsKhmerSymbols__internal_alias"))); -#else -#ifndef xmlUCSIsKhmerSymbols -extern __typeof (xmlUCSIsKhmerSymbols) xmlUCSIsKhmerSymbols__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsKhmerSymbols xmlUCSIsKhmerSymbols__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsLao -extern __typeof (xmlUCSIsLao) xmlUCSIsLao __attribute((alias("xmlUCSIsLao__internal_alias"))); -#else -#ifndef xmlUCSIsLao -extern __typeof (xmlUCSIsLao) xmlUCSIsLao__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsLao xmlUCSIsLao__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsLatin1Supplement -extern __typeof (xmlUCSIsLatin1Supplement) xmlUCSIsLatin1Supplement __attribute((alias("xmlUCSIsLatin1Supplement__internal_alias"))); -#else -#ifndef xmlUCSIsLatin1Supplement -extern __typeof (xmlUCSIsLatin1Supplement) xmlUCSIsLatin1Supplement__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsLatin1Supplement xmlUCSIsLatin1Supplement__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsLatinExtendedA -extern __typeof (xmlUCSIsLatinExtendedA) xmlUCSIsLatinExtendedA __attribute((alias("xmlUCSIsLatinExtendedA__internal_alias"))); -#else -#ifndef xmlUCSIsLatinExtendedA -extern __typeof (xmlUCSIsLatinExtendedA) xmlUCSIsLatinExtendedA__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsLatinExtendedA xmlUCSIsLatinExtendedA__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsLatinExtendedAdditional -extern __typeof (xmlUCSIsLatinExtendedAdditional) xmlUCSIsLatinExtendedAdditional __attribute((alias("xmlUCSIsLatinExtendedAdditional__internal_alias"))); -#else -#ifndef xmlUCSIsLatinExtendedAdditional -extern __typeof (xmlUCSIsLatinExtendedAdditional) xmlUCSIsLatinExtendedAdditional__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsLatinExtendedAdditional xmlUCSIsLatinExtendedAdditional__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsLatinExtendedB -extern __typeof (xmlUCSIsLatinExtendedB) xmlUCSIsLatinExtendedB __attribute((alias("xmlUCSIsLatinExtendedB__internal_alias"))); -#else -#ifndef xmlUCSIsLatinExtendedB -extern __typeof (xmlUCSIsLatinExtendedB) xmlUCSIsLatinExtendedB__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsLatinExtendedB xmlUCSIsLatinExtendedB__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsLetterlikeSymbols -extern __typeof (xmlUCSIsLetterlikeSymbols) xmlUCSIsLetterlikeSymbols __attribute((alias("xmlUCSIsLetterlikeSymbols__internal_alias"))); -#else -#ifndef xmlUCSIsLetterlikeSymbols -extern __typeof (xmlUCSIsLetterlikeSymbols) xmlUCSIsLetterlikeSymbols__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsLetterlikeSymbols xmlUCSIsLetterlikeSymbols__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsLimbu -extern __typeof (xmlUCSIsLimbu) xmlUCSIsLimbu __attribute((alias("xmlUCSIsLimbu__internal_alias"))); -#else -#ifndef xmlUCSIsLimbu -extern __typeof (xmlUCSIsLimbu) xmlUCSIsLimbu__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsLimbu xmlUCSIsLimbu__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsLinearBIdeograms -extern __typeof (xmlUCSIsLinearBIdeograms) xmlUCSIsLinearBIdeograms __attribute((alias("xmlUCSIsLinearBIdeograms__internal_alias"))); -#else -#ifndef xmlUCSIsLinearBIdeograms -extern __typeof (xmlUCSIsLinearBIdeograms) xmlUCSIsLinearBIdeograms__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsLinearBIdeograms xmlUCSIsLinearBIdeograms__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsLinearBSyllabary -extern __typeof (xmlUCSIsLinearBSyllabary) xmlUCSIsLinearBSyllabary __attribute((alias("xmlUCSIsLinearBSyllabary__internal_alias"))); -#else -#ifndef xmlUCSIsLinearBSyllabary -extern __typeof (xmlUCSIsLinearBSyllabary) xmlUCSIsLinearBSyllabary__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsLinearBSyllabary xmlUCSIsLinearBSyllabary__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsLowSurrogates -extern __typeof (xmlUCSIsLowSurrogates) xmlUCSIsLowSurrogates __attribute((alias("xmlUCSIsLowSurrogates__internal_alias"))); -#else -#ifndef xmlUCSIsLowSurrogates -extern __typeof (xmlUCSIsLowSurrogates) xmlUCSIsLowSurrogates__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsLowSurrogates xmlUCSIsLowSurrogates__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsMalayalam -extern __typeof (xmlUCSIsMalayalam) xmlUCSIsMalayalam __attribute((alias("xmlUCSIsMalayalam__internal_alias"))); -#else -#ifndef xmlUCSIsMalayalam -extern __typeof (xmlUCSIsMalayalam) xmlUCSIsMalayalam__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsMalayalam xmlUCSIsMalayalam__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsMathematicalAlphanumericSymbols -extern __typeof (xmlUCSIsMathematicalAlphanumericSymbols) xmlUCSIsMathematicalAlphanumericSymbols __attribute((alias("xmlUCSIsMathematicalAlphanumericSymbols__internal_alias"))); -#else -#ifndef xmlUCSIsMathematicalAlphanumericSymbols -extern __typeof (xmlUCSIsMathematicalAlphanumericSymbols) xmlUCSIsMathematicalAlphanumericSymbols__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsMathematicalAlphanumericSymbols xmlUCSIsMathematicalAlphanumericSymbols__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsMathematicalOperators -extern __typeof (xmlUCSIsMathematicalOperators) xmlUCSIsMathematicalOperators __attribute((alias("xmlUCSIsMathematicalOperators__internal_alias"))); -#else -#ifndef xmlUCSIsMathematicalOperators -extern __typeof (xmlUCSIsMathematicalOperators) xmlUCSIsMathematicalOperators__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsMathematicalOperators xmlUCSIsMathematicalOperators__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsMiscellaneousMathematicalSymbolsA -extern __typeof (xmlUCSIsMiscellaneousMathematicalSymbolsA) xmlUCSIsMiscellaneousMathematicalSymbolsA __attribute((alias("xmlUCSIsMiscellaneousMathematicalSymbolsA__internal_alias"))); -#else -#ifndef xmlUCSIsMiscellaneousMathematicalSymbolsA -extern __typeof (xmlUCSIsMiscellaneousMathematicalSymbolsA) xmlUCSIsMiscellaneousMathematicalSymbolsA__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsMiscellaneousMathematicalSymbolsA xmlUCSIsMiscellaneousMathematicalSymbolsA__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsMiscellaneousMathematicalSymbolsB -extern __typeof (xmlUCSIsMiscellaneousMathematicalSymbolsB) xmlUCSIsMiscellaneousMathematicalSymbolsB __attribute((alias("xmlUCSIsMiscellaneousMathematicalSymbolsB__internal_alias"))); -#else -#ifndef xmlUCSIsMiscellaneousMathematicalSymbolsB -extern __typeof (xmlUCSIsMiscellaneousMathematicalSymbolsB) xmlUCSIsMiscellaneousMathematicalSymbolsB__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsMiscellaneousMathematicalSymbolsB xmlUCSIsMiscellaneousMathematicalSymbolsB__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsMiscellaneousSymbols -extern __typeof (xmlUCSIsMiscellaneousSymbols) xmlUCSIsMiscellaneousSymbols __attribute((alias("xmlUCSIsMiscellaneousSymbols__internal_alias"))); -#else -#ifndef xmlUCSIsMiscellaneousSymbols -extern __typeof (xmlUCSIsMiscellaneousSymbols) xmlUCSIsMiscellaneousSymbols__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsMiscellaneousSymbols xmlUCSIsMiscellaneousSymbols__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsMiscellaneousSymbolsandArrows -extern __typeof (xmlUCSIsMiscellaneousSymbolsandArrows) xmlUCSIsMiscellaneousSymbolsandArrows __attribute((alias("xmlUCSIsMiscellaneousSymbolsandArrows__internal_alias"))); -#else -#ifndef xmlUCSIsMiscellaneousSymbolsandArrows -extern __typeof (xmlUCSIsMiscellaneousSymbolsandArrows) xmlUCSIsMiscellaneousSymbolsandArrows__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsMiscellaneousSymbolsandArrows xmlUCSIsMiscellaneousSymbolsandArrows__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsMiscellaneousTechnical -extern __typeof (xmlUCSIsMiscellaneousTechnical) xmlUCSIsMiscellaneousTechnical __attribute((alias("xmlUCSIsMiscellaneousTechnical__internal_alias"))); -#else -#ifndef xmlUCSIsMiscellaneousTechnical -extern __typeof (xmlUCSIsMiscellaneousTechnical) xmlUCSIsMiscellaneousTechnical__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsMiscellaneousTechnical xmlUCSIsMiscellaneousTechnical__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsMongolian -extern __typeof (xmlUCSIsMongolian) xmlUCSIsMongolian __attribute((alias("xmlUCSIsMongolian__internal_alias"))); -#else -#ifndef xmlUCSIsMongolian -extern __typeof (xmlUCSIsMongolian) xmlUCSIsMongolian__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsMongolian xmlUCSIsMongolian__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsMusicalSymbols -extern __typeof (xmlUCSIsMusicalSymbols) xmlUCSIsMusicalSymbols __attribute((alias("xmlUCSIsMusicalSymbols__internal_alias"))); -#else -#ifndef xmlUCSIsMusicalSymbols -extern __typeof (xmlUCSIsMusicalSymbols) xmlUCSIsMusicalSymbols__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsMusicalSymbols xmlUCSIsMusicalSymbols__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsMyanmar -extern __typeof (xmlUCSIsMyanmar) xmlUCSIsMyanmar __attribute((alias("xmlUCSIsMyanmar__internal_alias"))); -#else -#ifndef xmlUCSIsMyanmar -extern __typeof (xmlUCSIsMyanmar) xmlUCSIsMyanmar__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsMyanmar xmlUCSIsMyanmar__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsNumberForms -extern __typeof (xmlUCSIsNumberForms) xmlUCSIsNumberForms __attribute((alias("xmlUCSIsNumberForms__internal_alias"))); -#else -#ifndef xmlUCSIsNumberForms -extern __typeof (xmlUCSIsNumberForms) xmlUCSIsNumberForms__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsNumberForms xmlUCSIsNumberForms__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsOgham -extern __typeof (xmlUCSIsOgham) xmlUCSIsOgham __attribute((alias("xmlUCSIsOgham__internal_alias"))); -#else -#ifndef xmlUCSIsOgham -extern __typeof (xmlUCSIsOgham) xmlUCSIsOgham__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsOgham xmlUCSIsOgham__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsOldItalic -extern __typeof (xmlUCSIsOldItalic) xmlUCSIsOldItalic __attribute((alias("xmlUCSIsOldItalic__internal_alias"))); -#else -#ifndef xmlUCSIsOldItalic -extern __typeof (xmlUCSIsOldItalic) xmlUCSIsOldItalic__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsOldItalic xmlUCSIsOldItalic__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsOpticalCharacterRecognition -extern __typeof (xmlUCSIsOpticalCharacterRecognition) xmlUCSIsOpticalCharacterRecognition __attribute((alias("xmlUCSIsOpticalCharacterRecognition__internal_alias"))); -#else -#ifndef xmlUCSIsOpticalCharacterRecognition -extern __typeof (xmlUCSIsOpticalCharacterRecognition) xmlUCSIsOpticalCharacterRecognition__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsOpticalCharacterRecognition xmlUCSIsOpticalCharacterRecognition__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsOriya -extern __typeof (xmlUCSIsOriya) xmlUCSIsOriya __attribute((alias("xmlUCSIsOriya__internal_alias"))); -#else -#ifndef xmlUCSIsOriya -extern __typeof (xmlUCSIsOriya) xmlUCSIsOriya__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsOriya xmlUCSIsOriya__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsOsmanya -extern __typeof (xmlUCSIsOsmanya) xmlUCSIsOsmanya __attribute((alias("xmlUCSIsOsmanya__internal_alias"))); -#else -#ifndef xmlUCSIsOsmanya -extern __typeof (xmlUCSIsOsmanya) xmlUCSIsOsmanya__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsOsmanya xmlUCSIsOsmanya__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsPhoneticExtensions -extern __typeof (xmlUCSIsPhoneticExtensions) xmlUCSIsPhoneticExtensions __attribute((alias("xmlUCSIsPhoneticExtensions__internal_alias"))); -#else -#ifndef xmlUCSIsPhoneticExtensions -extern __typeof (xmlUCSIsPhoneticExtensions) xmlUCSIsPhoneticExtensions__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsPhoneticExtensions xmlUCSIsPhoneticExtensions__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsPrivateUse -extern __typeof (xmlUCSIsPrivateUse) xmlUCSIsPrivateUse __attribute((alias("xmlUCSIsPrivateUse__internal_alias"))); -#else -#ifndef xmlUCSIsPrivateUse -extern __typeof (xmlUCSIsPrivateUse) xmlUCSIsPrivateUse__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsPrivateUse xmlUCSIsPrivateUse__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsPrivateUseArea -extern __typeof (xmlUCSIsPrivateUseArea) xmlUCSIsPrivateUseArea __attribute((alias("xmlUCSIsPrivateUseArea__internal_alias"))); -#else -#ifndef xmlUCSIsPrivateUseArea -extern __typeof (xmlUCSIsPrivateUseArea) xmlUCSIsPrivateUseArea__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsPrivateUseArea xmlUCSIsPrivateUseArea__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsRunic -extern __typeof (xmlUCSIsRunic) xmlUCSIsRunic __attribute((alias("xmlUCSIsRunic__internal_alias"))); -#else -#ifndef xmlUCSIsRunic -extern __typeof (xmlUCSIsRunic) xmlUCSIsRunic__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsRunic xmlUCSIsRunic__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsShavian -extern __typeof (xmlUCSIsShavian) xmlUCSIsShavian __attribute((alias("xmlUCSIsShavian__internal_alias"))); -#else -#ifndef xmlUCSIsShavian -extern __typeof (xmlUCSIsShavian) xmlUCSIsShavian__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsShavian xmlUCSIsShavian__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsSinhala -extern __typeof (xmlUCSIsSinhala) xmlUCSIsSinhala __attribute((alias("xmlUCSIsSinhala__internal_alias"))); -#else -#ifndef xmlUCSIsSinhala -extern __typeof (xmlUCSIsSinhala) xmlUCSIsSinhala__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsSinhala xmlUCSIsSinhala__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsSmallFormVariants -extern __typeof (xmlUCSIsSmallFormVariants) xmlUCSIsSmallFormVariants __attribute((alias("xmlUCSIsSmallFormVariants__internal_alias"))); -#else -#ifndef xmlUCSIsSmallFormVariants -extern __typeof (xmlUCSIsSmallFormVariants) xmlUCSIsSmallFormVariants__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsSmallFormVariants xmlUCSIsSmallFormVariants__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsSpacingModifierLetters -extern __typeof (xmlUCSIsSpacingModifierLetters) xmlUCSIsSpacingModifierLetters __attribute((alias("xmlUCSIsSpacingModifierLetters__internal_alias"))); -#else -#ifndef xmlUCSIsSpacingModifierLetters -extern __typeof (xmlUCSIsSpacingModifierLetters) xmlUCSIsSpacingModifierLetters__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsSpacingModifierLetters xmlUCSIsSpacingModifierLetters__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsSpecials -extern __typeof (xmlUCSIsSpecials) xmlUCSIsSpecials __attribute((alias("xmlUCSIsSpecials__internal_alias"))); -#else -#ifndef xmlUCSIsSpecials -extern __typeof (xmlUCSIsSpecials) xmlUCSIsSpecials__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsSpecials xmlUCSIsSpecials__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsSuperscriptsandSubscripts -extern __typeof (xmlUCSIsSuperscriptsandSubscripts) xmlUCSIsSuperscriptsandSubscripts __attribute((alias("xmlUCSIsSuperscriptsandSubscripts__internal_alias"))); -#else -#ifndef xmlUCSIsSuperscriptsandSubscripts -extern __typeof (xmlUCSIsSuperscriptsandSubscripts) xmlUCSIsSuperscriptsandSubscripts__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsSuperscriptsandSubscripts xmlUCSIsSuperscriptsandSubscripts__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsSupplementalArrowsA -extern __typeof (xmlUCSIsSupplementalArrowsA) xmlUCSIsSupplementalArrowsA __attribute((alias("xmlUCSIsSupplementalArrowsA__internal_alias"))); -#else -#ifndef xmlUCSIsSupplementalArrowsA -extern __typeof (xmlUCSIsSupplementalArrowsA) xmlUCSIsSupplementalArrowsA__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsSupplementalArrowsA xmlUCSIsSupplementalArrowsA__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsSupplementalArrowsB -extern __typeof (xmlUCSIsSupplementalArrowsB) xmlUCSIsSupplementalArrowsB __attribute((alias("xmlUCSIsSupplementalArrowsB__internal_alias"))); -#else -#ifndef xmlUCSIsSupplementalArrowsB -extern __typeof (xmlUCSIsSupplementalArrowsB) xmlUCSIsSupplementalArrowsB__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsSupplementalArrowsB xmlUCSIsSupplementalArrowsB__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsSupplementalMathematicalOperators -extern __typeof (xmlUCSIsSupplementalMathematicalOperators) xmlUCSIsSupplementalMathematicalOperators __attribute((alias("xmlUCSIsSupplementalMathematicalOperators__internal_alias"))); -#else -#ifndef xmlUCSIsSupplementalMathematicalOperators -extern __typeof (xmlUCSIsSupplementalMathematicalOperators) xmlUCSIsSupplementalMathematicalOperators__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsSupplementalMathematicalOperators xmlUCSIsSupplementalMathematicalOperators__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsSupplementaryPrivateUseAreaA -extern __typeof (xmlUCSIsSupplementaryPrivateUseAreaA) xmlUCSIsSupplementaryPrivateUseAreaA __attribute((alias("xmlUCSIsSupplementaryPrivateUseAreaA__internal_alias"))); -#else -#ifndef xmlUCSIsSupplementaryPrivateUseAreaA -extern __typeof (xmlUCSIsSupplementaryPrivateUseAreaA) xmlUCSIsSupplementaryPrivateUseAreaA__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsSupplementaryPrivateUseAreaA xmlUCSIsSupplementaryPrivateUseAreaA__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsSupplementaryPrivateUseAreaB -extern __typeof (xmlUCSIsSupplementaryPrivateUseAreaB) xmlUCSIsSupplementaryPrivateUseAreaB __attribute((alias("xmlUCSIsSupplementaryPrivateUseAreaB__internal_alias"))); -#else -#ifndef xmlUCSIsSupplementaryPrivateUseAreaB -extern __typeof (xmlUCSIsSupplementaryPrivateUseAreaB) xmlUCSIsSupplementaryPrivateUseAreaB__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsSupplementaryPrivateUseAreaB xmlUCSIsSupplementaryPrivateUseAreaB__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsSyriac -extern __typeof (xmlUCSIsSyriac) xmlUCSIsSyriac __attribute((alias("xmlUCSIsSyriac__internal_alias"))); -#else -#ifndef xmlUCSIsSyriac -extern __typeof (xmlUCSIsSyriac) xmlUCSIsSyriac__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsSyriac xmlUCSIsSyriac__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsTagalog -extern __typeof (xmlUCSIsTagalog) xmlUCSIsTagalog __attribute((alias("xmlUCSIsTagalog__internal_alias"))); -#else -#ifndef xmlUCSIsTagalog -extern __typeof (xmlUCSIsTagalog) xmlUCSIsTagalog__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsTagalog xmlUCSIsTagalog__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsTagbanwa -extern __typeof (xmlUCSIsTagbanwa) xmlUCSIsTagbanwa __attribute((alias("xmlUCSIsTagbanwa__internal_alias"))); -#else -#ifndef xmlUCSIsTagbanwa -extern __typeof (xmlUCSIsTagbanwa) xmlUCSIsTagbanwa__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsTagbanwa xmlUCSIsTagbanwa__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsTags -extern __typeof (xmlUCSIsTags) xmlUCSIsTags __attribute((alias("xmlUCSIsTags__internal_alias"))); -#else -#ifndef xmlUCSIsTags -extern __typeof (xmlUCSIsTags) xmlUCSIsTags__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsTags xmlUCSIsTags__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsTaiLe -extern __typeof (xmlUCSIsTaiLe) xmlUCSIsTaiLe __attribute((alias("xmlUCSIsTaiLe__internal_alias"))); -#else -#ifndef xmlUCSIsTaiLe -extern __typeof (xmlUCSIsTaiLe) xmlUCSIsTaiLe__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsTaiLe xmlUCSIsTaiLe__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsTaiXuanJingSymbols -extern __typeof (xmlUCSIsTaiXuanJingSymbols) xmlUCSIsTaiXuanJingSymbols __attribute((alias("xmlUCSIsTaiXuanJingSymbols__internal_alias"))); -#else -#ifndef xmlUCSIsTaiXuanJingSymbols -extern __typeof (xmlUCSIsTaiXuanJingSymbols) xmlUCSIsTaiXuanJingSymbols__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsTaiXuanJingSymbols xmlUCSIsTaiXuanJingSymbols__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsTamil -extern __typeof (xmlUCSIsTamil) xmlUCSIsTamil __attribute((alias("xmlUCSIsTamil__internal_alias"))); -#else -#ifndef xmlUCSIsTamil -extern __typeof (xmlUCSIsTamil) xmlUCSIsTamil__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsTamil xmlUCSIsTamil__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsTelugu -extern __typeof (xmlUCSIsTelugu) xmlUCSIsTelugu __attribute((alias("xmlUCSIsTelugu__internal_alias"))); -#else -#ifndef xmlUCSIsTelugu -extern __typeof (xmlUCSIsTelugu) xmlUCSIsTelugu__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsTelugu xmlUCSIsTelugu__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsThaana -extern __typeof (xmlUCSIsThaana) xmlUCSIsThaana __attribute((alias("xmlUCSIsThaana__internal_alias"))); -#else -#ifndef xmlUCSIsThaana -extern __typeof (xmlUCSIsThaana) xmlUCSIsThaana__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsThaana xmlUCSIsThaana__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsThai -extern __typeof (xmlUCSIsThai) xmlUCSIsThai __attribute((alias("xmlUCSIsThai__internal_alias"))); -#else -#ifndef xmlUCSIsThai -extern __typeof (xmlUCSIsThai) xmlUCSIsThai__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsThai xmlUCSIsThai__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsTibetan -extern __typeof (xmlUCSIsTibetan) xmlUCSIsTibetan __attribute((alias("xmlUCSIsTibetan__internal_alias"))); -#else -#ifndef xmlUCSIsTibetan -extern __typeof (xmlUCSIsTibetan) xmlUCSIsTibetan__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsTibetan xmlUCSIsTibetan__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsUgaritic -extern __typeof (xmlUCSIsUgaritic) xmlUCSIsUgaritic __attribute((alias("xmlUCSIsUgaritic__internal_alias"))); -#else -#ifndef xmlUCSIsUgaritic -extern __typeof (xmlUCSIsUgaritic) xmlUCSIsUgaritic__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsUgaritic xmlUCSIsUgaritic__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsUnifiedCanadianAboriginalSyllabics -extern __typeof (xmlUCSIsUnifiedCanadianAboriginalSyllabics) xmlUCSIsUnifiedCanadianAboriginalSyllabics __attribute((alias("xmlUCSIsUnifiedCanadianAboriginalSyllabics__internal_alias"))); -#else -#ifndef xmlUCSIsUnifiedCanadianAboriginalSyllabics -extern __typeof (xmlUCSIsUnifiedCanadianAboriginalSyllabics) xmlUCSIsUnifiedCanadianAboriginalSyllabics__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsUnifiedCanadianAboriginalSyllabics xmlUCSIsUnifiedCanadianAboriginalSyllabics__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsVariationSelectors -extern __typeof (xmlUCSIsVariationSelectors) xmlUCSIsVariationSelectors __attribute((alias("xmlUCSIsVariationSelectors__internal_alias"))); -#else -#ifndef xmlUCSIsVariationSelectors -extern __typeof (xmlUCSIsVariationSelectors) xmlUCSIsVariationSelectors__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsVariationSelectors xmlUCSIsVariationSelectors__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsVariationSelectorsSupplement -extern __typeof (xmlUCSIsVariationSelectorsSupplement) xmlUCSIsVariationSelectorsSupplement __attribute((alias("xmlUCSIsVariationSelectorsSupplement__internal_alias"))); -#else -#ifndef xmlUCSIsVariationSelectorsSupplement -extern __typeof (xmlUCSIsVariationSelectorsSupplement) xmlUCSIsVariationSelectorsSupplement__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsVariationSelectorsSupplement xmlUCSIsVariationSelectorsSupplement__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsYiRadicals -extern __typeof (xmlUCSIsYiRadicals) xmlUCSIsYiRadicals __attribute((alias("xmlUCSIsYiRadicals__internal_alias"))); -#else -#ifndef xmlUCSIsYiRadicals -extern __typeof (xmlUCSIsYiRadicals) xmlUCSIsYiRadicals__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsYiRadicals xmlUCSIsYiRadicals__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsYiSyllables -extern __typeof (xmlUCSIsYiSyllables) xmlUCSIsYiSyllables __attribute((alias("xmlUCSIsYiSyllables__internal_alias"))); -#else -#ifndef xmlUCSIsYiSyllables -extern __typeof (xmlUCSIsYiSyllables) xmlUCSIsYiSyllables__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsYiSyllables xmlUCSIsYiSyllables__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_UNICODE_ENABLED) -#ifdef bottom_xmlunicode -#undef xmlUCSIsYijingHexagramSymbols -extern __typeof (xmlUCSIsYijingHexagramSymbols) xmlUCSIsYijingHexagramSymbols __attribute((alias("xmlUCSIsYijingHexagramSymbols__internal_alias"))); -#else -#ifndef xmlUCSIsYijingHexagramSymbols -extern __typeof (xmlUCSIsYijingHexagramSymbols) xmlUCSIsYijingHexagramSymbols__internal_alias __attribute((visibility("hidden"))); -#define xmlUCSIsYijingHexagramSymbols xmlUCSIsYijingHexagramSymbols__internal_alias -#endif -#endif -#endif - -#ifdef bottom_uri -#undef xmlURIEscape -extern __typeof (xmlURIEscape) xmlURIEscape __attribute((alias("xmlURIEscape__internal_alias"))); -#else -#ifndef xmlURIEscape -extern __typeof (xmlURIEscape) xmlURIEscape__internal_alias __attribute((visibility("hidden"))); -#define xmlURIEscape xmlURIEscape__internal_alias -#endif -#endif - -#ifdef bottom_uri -#undef xmlURIEscapeStr -extern __typeof (xmlURIEscapeStr) xmlURIEscapeStr __attribute((alias("xmlURIEscapeStr__internal_alias"))); -#else -#ifndef xmlURIEscapeStr -extern __typeof (xmlURIEscapeStr) xmlURIEscapeStr__internal_alias __attribute((visibility("hidden"))); -#define xmlURIEscapeStr xmlURIEscapeStr__internal_alias -#endif -#endif - -#ifdef bottom_uri -#undef xmlURIUnescapeString -extern __typeof (xmlURIUnescapeString) xmlURIUnescapeString __attribute((alias("xmlURIUnescapeString__internal_alias"))); -#else -#ifndef xmlURIUnescapeString -extern __typeof (xmlURIUnescapeString) xmlURIUnescapeString__internal_alias __attribute((visibility("hidden"))); -#define xmlURIUnescapeString xmlURIUnescapeString__internal_alias -#endif -#endif - -#ifdef bottom_xmlstring -#undef xmlUTF8Charcmp -extern __typeof (xmlUTF8Charcmp) xmlUTF8Charcmp __attribute((alias("xmlUTF8Charcmp__internal_alias"))); -#else -#ifndef xmlUTF8Charcmp -extern __typeof (xmlUTF8Charcmp) xmlUTF8Charcmp__internal_alias __attribute((visibility("hidden"))); -#define xmlUTF8Charcmp xmlUTF8Charcmp__internal_alias -#endif -#endif - -#ifdef bottom_xmlstring -#undef xmlUTF8Size -extern __typeof (xmlUTF8Size) xmlUTF8Size __attribute((alias("xmlUTF8Size__internal_alias"))); -#else -#ifndef xmlUTF8Size -extern __typeof (xmlUTF8Size) xmlUTF8Size__internal_alias __attribute((visibility("hidden"))); -#define xmlUTF8Size xmlUTF8Size__internal_alias -#endif -#endif - -#ifdef bottom_xmlstring -#undef xmlUTF8Strlen -extern __typeof (xmlUTF8Strlen) xmlUTF8Strlen __attribute((alias("xmlUTF8Strlen__internal_alias"))); -#else -#ifndef xmlUTF8Strlen -extern __typeof (xmlUTF8Strlen) xmlUTF8Strlen__internal_alias __attribute((visibility("hidden"))); -#define xmlUTF8Strlen xmlUTF8Strlen__internal_alias -#endif -#endif - -#ifdef bottom_xmlstring -#undef xmlUTF8Strloc -extern __typeof (xmlUTF8Strloc) xmlUTF8Strloc __attribute((alias("xmlUTF8Strloc__internal_alias"))); -#else -#ifndef xmlUTF8Strloc -extern __typeof (xmlUTF8Strloc) xmlUTF8Strloc__internal_alias __attribute((visibility("hidden"))); -#define xmlUTF8Strloc xmlUTF8Strloc__internal_alias -#endif -#endif - -#ifdef bottom_xmlstring -#undef xmlUTF8Strndup -extern __typeof (xmlUTF8Strndup) xmlUTF8Strndup __attribute((alias("xmlUTF8Strndup__internal_alias"))); -#else -#ifndef xmlUTF8Strndup -extern __typeof (xmlUTF8Strndup) xmlUTF8Strndup__internal_alias __attribute((visibility("hidden"))); -#define xmlUTF8Strndup xmlUTF8Strndup__internal_alias -#endif -#endif - -#ifdef bottom_xmlstring -#undef xmlUTF8Strpos -extern __typeof (xmlUTF8Strpos) xmlUTF8Strpos __attribute((alias("xmlUTF8Strpos__internal_alias"))); -#else -#ifndef xmlUTF8Strpos -extern __typeof (xmlUTF8Strpos) xmlUTF8Strpos__internal_alias __attribute((visibility("hidden"))); -#define xmlUTF8Strpos xmlUTF8Strpos__internal_alias -#endif -#endif - -#ifdef bottom_xmlstring -#undef xmlUTF8Strsize -extern __typeof (xmlUTF8Strsize) xmlUTF8Strsize __attribute((alias("xmlUTF8Strsize__internal_alias"))); -#else -#ifndef xmlUTF8Strsize -extern __typeof (xmlUTF8Strsize) xmlUTF8Strsize__internal_alias __attribute((visibility("hidden"))); -#define xmlUTF8Strsize xmlUTF8Strsize__internal_alias -#endif -#endif - -#ifdef bottom_xmlstring -#undef xmlUTF8Strsub -extern __typeof (xmlUTF8Strsub) xmlUTF8Strsub __attribute((alias("xmlUTF8Strsub__internal_alias"))); -#else -#ifndef xmlUTF8Strsub -extern __typeof (xmlUTF8Strsub) xmlUTF8Strsub__internal_alias __attribute((visibility("hidden"))); -#define xmlUTF8Strsub xmlUTF8Strsub__internal_alias -#endif -#endif - -#ifdef bottom_tree -#undef xmlUnlinkNode -extern __typeof (xmlUnlinkNode) xmlUnlinkNode __attribute((alias("xmlUnlinkNode__internal_alias"))); -#else -#ifndef xmlUnlinkNode -extern __typeof (xmlUnlinkNode) xmlUnlinkNode__internal_alias __attribute((visibility("hidden"))); -#define xmlUnlinkNode xmlUnlinkNode__internal_alias -#endif -#endif - -#ifdef bottom_threads -#undef xmlUnlockLibrary -extern __typeof (xmlUnlockLibrary) xmlUnlockLibrary __attribute((alias("xmlUnlockLibrary__internal_alias"))); -#else -#ifndef xmlUnlockLibrary -extern __typeof (xmlUnlockLibrary) xmlUnlockLibrary__internal_alias __attribute((visibility("hidden"))); -#define xmlUnlockLibrary xmlUnlockLibrary__internal_alias -#endif -#endif - -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_tree -#undef xmlUnsetNsProp -extern __typeof (xmlUnsetNsProp) xmlUnsetNsProp __attribute((alias("xmlUnsetNsProp__internal_alias"))); -#else -#ifndef xmlUnsetNsProp -extern __typeof (xmlUnsetNsProp) xmlUnsetNsProp__internal_alias __attribute((visibility("hidden"))); -#define xmlUnsetNsProp xmlUnsetNsProp__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_tree -#undef xmlUnsetProp -extern __typeof (xmlUnsetProp) xmlUnsetProp __attribute((alias("xmlUnsetProp__internal_alias"))); -#else -#ifndef xmlUnsetProp -extern __typeof (xmlUnsetProp) xmlUnsetProp__internal_alias __attribute((visibility("hidden"))); -#define xmlUnsetProp xmlUnsetProp__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED) -#ifdef bottom_valid -#undef xmlValidBuildContentModel -extern __typeof (xmlValidBuildContentModel) xmlValidBuildContentModel __attribute((alias("xmlValidBuildContentModel__internal_alias"))); -#else -#ifndef xmlValidBuildContentModel -extern __typeof (xmlValidBuildContentModel) xmlValidBuildContentModel__internal_alias __attribute((visibility("hidden"))); -#define xmlValidBuildContentModel xmlValidBuildContentModel__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_VALID_ENABLED) -#ifdef bottom_valid -#undef xmlValidCtxtNormalizeAttributeValue -extern __typeof (xmlValidCtxtNormalizeAttributeValue) xmlValidCtxtNormalizeAttributeValue __attribute((alias("xmlValidCtxtNormalizeAttributeValue__internal_alias"))); -#else -#ifndef xmlValidCtxtNormalizeAttributeValue -extern __typeof (xmlValidCtxtNormalizeAttributeValue) xmlValidCtxtNormalizeAttributeValue__internal_alias __attribute((visibility("hidden"))); -#define xmlValidCtxtNormalizeAttributeValue xmlValidCtxtNormalizeAttributeValue__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_VALID_ENABLED) -#ifdef bottom_valid -#undef xmlValidGetPotentialChildren -extern __typeof (xmlValidGetPotentialChildren) xmlValidGetPotentialChildren __attribute((alias("xmlValidGetPotentialChildren__internal_alias"))); -#else -#ifndef xmlValidGetPotentialChildren -extern __typeof (xmlValidGetPotentialChildren) xmlValidGetPotentialChildren__internal_alias __attribute((visibility("hidden"))); -#define xmlValidGetPotentialChildren xmlValidGetPotentialChildren__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_VALID_ENABLED) -#ifdef bottom_valid -#undef xmlValidGetValidElements -extern __typeof (xmlValidGetValidElements) xmlValidGetValidElements __attribute((alias("xmlValidGetValidElements__internal_alias"))); -#else -#ifndef xmlValidGetValidElements -extern __typeof (xmlValidGetValidElements) xmlValidGetValidElements__internal_alias __attribute((visibility("hidden"))); -#define xmlValidGetValidElements xmlValidGetValidElements__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_VALID_ENABLED) -#ifdef bottom_valid -#undef xmlValidNormalizeAttributeValue -extern __typeof (xmlValidNormalizeAttributeValue) xmlValidNormalizeAttributeValue __attribute((alias("xmlValidNormalizeAttributeValue__internal_alias"))); -#else -#ifndef xmlValidNormalizeAttributeValue -extern __typeof (xmlValidNormalizeAttributeValue) xmlValidNormalizeAttributeValue__internal_alias __attribute((visibility("hidden"))); -#define xmlValidNormalizeAttributeValue xmlValidNormalizeAttributeValue__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_VALID_ENABLED) -#ifdef bottom_valid -#undef xmlValidateAttributeDecl -extern __typeof (xmlValidateAttributeDecl) xmlValidateAttributeDecl __attribute((alias("xmlValidateAttributeDecl__internal_alias"))); -#else -#ifndef xmlValidateAttributeDecl -extern __typeof (xmlValidateAttributeDecl) xmlValidateAttributeDecl__internal_alias __attribute((visibility("hidden"))); -#define xmlValidateAttributeDecl xmlValidateAttributeDecl__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_VALID_ENABLED) -#ifdef bottom_valid -#undef xmlValidateAttributeValue -extern __typeof (xmlValidateAttributeValue) xmlValidateAttributeValue __attribute((alias("xmlValidateAttributeValue__internal_alias"))); -#else -#ifndef xmlValidateAttributeValue -extern __typeof (xmlValidateAttributeValue) xmlValidateAttributeValue__internal_alias __attribute((visibility("hidden"))); -#define xmlValidateAttributeValue xmlValidateAttributeValue__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_VALID_ENABLED) -#ifdef bottom_valid -#undef xmlValidateDocument -extern __typeof (xmlValidateDocument) xmlValidateDocument __attribute((alias("xmlValidateDocument__internal_alias"))); -#else -#ifndef xmlValidateDocument -extern __typeof (xmlValidateDocument) xmlValidateDocument__internal_alias __attribute((visibility("hidden"))); -#define xmlValidateDocument xmlValidateDocument__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_VALID_ENABLED) -#ifdef bottom_valid -#undef xmlValidateDocumentFinal -extern __typeof (xmlValidateDocumentFinal) xmlValidateDocumentFinal __attribute((alias("xmlValidateDocumentFinal__internal_alias"))); -#else -#ifndef xmlValidateDocumentFinal -extern __typeof (xmlValidateDocumentFinal) xmlValidateDocumentFinal__internal_alias __attribute((visibility("hidden"))); -#define xmlValidateDocumentFinal xmlValidateDocumentFinal__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_VALID_ENABLED) -#ifdef bottom_valid -#undef xmlValidateDtd -extern __typeof (xmlValidateDtd) xmlValidateDtd __attribute((alias("xmlValidateDtd__internal_alias"))); -#else -#ifndef xmlValidateDtd -extern __typeof (xmlValidateDtd) xmlValidateDtd__internal_alias __attribute((visibility("hidden"))); -#define xmlValidateDtd xmlValidateDtd__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_VALID_ENABLED) -#ifdef bottom_valid -#undef xmlValidateDtdFinal -extern __typeof (xmlValidateDtdFinal) xmlValidateDtdFinal __attribute((alias("xmlValidateDtdFinal__internal_alias"))); -#else -#ifndef xmlValidateDtdFinal -extern __typeof (xmlValidateDtdFinal) xmlValidateDtdFinal__internal_alias __attribute((visibility("hidden"))); -#define xmlValidateDtdFinal xmlValidateDtdFinal__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_VALID_ENABLED) -#ifdef bottom_valid -#undef xmlValidateElement -extern __typeof (xmlValidateElement) xmlValidateElement __attribute((alias("xmlValidateElement__internal_alias"))); -#else -#ifndef xmlValidateElement -extern __typeof (xmlValidateElement) xmlValidateElement__internal_alias __attribute((visibility("hidden"))); -#define xmlValidateElement xmlValidateElement__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_VALID_ENABLED) -#ifdef bottom_valid -#undef xmlValidateElementDecl -extern __typeof (xmlValidateElementDecl) xmlValidateElementDecl __attribute((alias("xmlValidateElementDecl__internal_alias"))); -#else -#ifndef xmlValidateElementDecl -extern __typeof (xmlValidateElementDecl) xmlValidateElementDecl__internal_alias __attribute((visibility("hidden"))); -#define xmlValidateElementDecl xmlValidateElementDecl__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || defined (LIBXML_HTML_ENABLED) || defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) || defined(LIBXML_LEGACY_ENABLED) -#ifdef bottom_tree -#undef xmlValidateNCName -extern __typeof (xmlValidateNCName) xmlValidateNCName __attribute((alias("xmlValidateNCName__internal_alias"))); -#else -#ifndef xmlValidateNCName -extern __typeof (xmlValidateNCName) xmlValidateNCName__internal_alias __attribute((visibility("hidden"))); -#define xmlValidateNCName xmlValidateNCName__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_tree -#undef xmlValidateNMToken -extern __typeof (xmlValidateNMToken) xmlValidateNMToken __attribute((alias("xmlValidateNMToken__internal_alias"))); -#else -#ifndef xmlValidateNMToken -extern __typeof (xmlValidateNMToken) xmlValidateNMToken__internal_alias __attribute((visibility("hidden"))); -#define xmlValidateNMToken xmlValidateNMToken__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_tree -#undef xmlValidateName -extern __typeof (xmlValidateName) xmlValidateName __attribute((alias("xmlValidateName__internal_alias"))); -#else -#ifndef xmlValidateName -extern __typeof (xmlValidateName) xmlValidateName__internal_alias __attribute((visibility("hidden"))); -#define xmlValidateName xmlValidateName__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_VALID_ENABLED) -#ifdef bottom_valid -#undef xmlValidateNameValue -extern __typeof (xmlValidateNameValue) xmlValidateNameValue __attribute((alias("xmlValidateNameValue__internal_alias"))); -#else -#ifndef xmlValidateNameValue -extern __typeof (xmlValidateNameValue) xmlValidateNameValue__internal_alias __attribute((visibility("hidden"))); -#define xmlValidateNameValue xmlValidateNameValue__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_VALID_ENABLED) -#ifdef bottom_valid -#undef xmlValidateNamesValue -extern __typeof (xmlValidateNamesValue) xmlValidateNamesValue __attribute((alias("xmlValidateNamesValue__internal_alias"))); -#else -#ifndef xmlValidateNamesValue -extern __typeof (xmlValidateNamesValue) xmlValidateNamesValue__internal_alias __attribute((visibility("hidden"))); -#define xmlValidateNamesValue xmlValidateNamesValue__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_VALID_ENABLED) -#ifdef bottom_valid -#undef xmlValidateNmtokenValue -extern __typeof (xmlValidateNmtokenValue) xmlValidateNmtokenValue __attribute((alias("xmlValidateNmtokenValue__internal_alias"))); -#else -#ifndef xmlValidateNmtokenValue -extern __typeof (xmlValidateNmtokenValue) xmlValidateNmtokenValue__internal_alias __attribute((visibility("hidden"))); -#define xmlValidateNmtokenValue xmlValidateNmtokenValue__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_VALID_ENABLED) -#ifdef bottom_valid -#undef xmlValidateNmtokensValue -extern __typeof (xmlValidateNmtokensValue) xmlValidateNmtokensValue __attribute((alias("xmlValidateNmtokensValue__internal_alias"))); -#else -#ifndef xmlValidateNmtokensValue -extern __typeof (xmlValidateNmtokensValue) xmlValidateNmtokensValue__internal_alias __attribute((visibility("hidden"))); -#define xmlValidateNmtokensValue xmlValidateNmtokensValue__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_VALID_ENABLED) -#ifdef bottom_valid -#undef xmlValidateNotationDecl -extern __typeof (xmlValidateNotationDecl) xmlValidateNotationDecl __attribute((alias("xmlValidateNotationDecl__internal_alias"))); -#else -#ifndef xmlValidateNotationDecl -extern __typeof (xmlValidateNotationDecl) xmlValidateNotationDecl__internal_alias __attribute((visibility("hidden"))); -#define xmlValidateNotationDecl xmlValidateNotationDecl__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_valid -#undef xmlValidateNotationUse -extern __typeof (xmlValidateNotationUse) xmlValidateNotationUse __attribute((alias("xmlValidateNotationUse__internal_alias"))); -#else -#ifndef xmlValidateNotationUse -extern __typeof (xmlValidateNotationUse) xmlValidateNotationUse__internal_alias __attribute((visibility("hidden"))); -#define xmlValidateNotationUse xmlValidateNotationUse__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_VALID_ENABLED) -#ifdef bottom_valid -#undef xmlValidateOneAttribute -extern __typeof (xmlValidateOneAttribute) xmlValidateOneAttribute __attribute((alias("xmlValidateOneAttribute__internal_alias"))); -#else -#ifndef xmlValidateOneAttribute -extern __typeof (xmlValidateOneAttribute) xmlValidateOneAttribute__internal_alias __attribute((visibility("hidden"))); -#define xmlValidateOneAttribute xmlValidateOneAttribute__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_VALID_ENABLED) -#ifdef bottom_valid -#undef xmlValidateOneElement -extern __typeof (xmlValidateOneElement) xmlValidateOneElement __attribute((alias("xmlValidateOneElement__internal_alias"))); -#else -#ifndef xmlValidateOneElement -extern __typeof (xmlValidateOneElement) xmlValidateOneElement__internal_alias __attribute((visibility("hidden"))); -#define xmlValidateOneElement xmlValidateOneElement__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_VALID_ENABLED) -#ifdef bottom_valid -#undef xmlValidateOneNamespace -extern __typeof (xmlValidateOneNamespace) xmlValidateOneNamespace __attribute((alias("xmlValidateOneNamespace__internal_alias"))); -#else -#ifndef xmlValidateOneNamespace -extern __typeof (xmlValidateOneNamespace) xmlValidateOneNamespace__internal_alias __attribute((visibility("hidden"))); -#define xmlValidateOneNamespace xmlValidateOneNamespace__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED) -#ifdef bottom_valid -#undef xmlValidatePopElement -extern __typeof (xmlValidatePopElement) xmlValidatePopElement __attribute((alias("xmlValidatePopElement__internal_alias"))); -#else -#ifndef xmlValidatePopElement -extern __typeof (xmlValidatePopElement) xmlValidatePopElement__internal_alias __attribute((visibility("hidden"))); -#define xmlValidatePopElement xmlValidatePopElement__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED) -#ifdef bottom_valid -#undef xmlValidatePushCData -extern __typeof (xmlValidatePushCData) xmlValidatePushCData __attribute((alias("xmlValidatePushCData__internal_alias"))); -#else -#ifndef xmlValidatePushCData -extern __typeof (xmlValidatePushCData) xmlValidatePushCData__internal_alias __attribute((visibility("hidden"))); -#define xmlValidatePushCData xmlValidatePushCData__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED) -#ifdef bottom_valid -#undef xmlValidatePushElement -extern __typeof (xmlValidatePushElement) xmlValidatePushElement __attribute((alias("xmlValidatePushElement__internal_alias"))); -#else -#ifndef xmlValidatePushElement -extern __typeof (xmlValidatePushElement) xmlValidatePushElement__internal_alias __attribute((visibility("hidden"))); -#define xmlValidatePushElement xmlValidatePushElement__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_tree -#undef xmlValidateQName -extern __typeof (xmlValidateQName) xmlValidateQName __attribute((alias("xmlValidateQName__internal_alias"))); -#else -#ifndef xmlValidateQName -extern __typeof (xmlValidateQName) xmlValidateQName__internal_alias __attribute((visibility("hidden"))); -#define xmlValidateQName xmlValidateQName__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_VALID_ENABLED) -#ifdef bottom_valid -#undef xmlValidateRoot -extern __typeof (xmlValidateRoot) xmlValidateRoot __attribute((alias("xmlValidateRoot__internal_alias"))); -#else -#ifndef xmlValidateRoot -extern __typeof (xmlValidateRoot) xmlValidateRoot__internal_alias __attribute((visibility("hidden"))); -#define xmlValidateRoot xmlValidateRoot__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XINCLUDE_ENABLED) -#ifdef bottom_xinclude -#undef xmlXIncludeFreeContext -extern __typeof (xmlXIncludeFreeContext) xmlXIncludeFreeContext __attribute((alias("xmlXIncludeFreeContext__internal_alias"))); -#else -#ifndef xmlXIncludeFreeContext -extern __typeof (xmlXIncludeFreeContext) xmlXIncludeFreeContext__internal_alias __attribute((visibility("hidden"))); -#define xmlXIncludeFreeContext xmlXIncludeFreeContext__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XINCLUDE_ENABLED) -#ifdef bottom_xinclude -#undef xmlXIncludeNewContext -extern __typeof (xmlXIncludeNewContext) xmlXIncludeNewContext __attribute((alias("xmlXIncludeNewContext__internal_alias"))); -#else -#ifndef xmlXIncludeNewContext -extern __typeof (xmlXIncludeNewContext) xmlXIncludeNewContext__internal_alias __attribute((visibility("hidden"))); -#define xmlXIncludeNewContext xmlXIncludeNewContext__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XINCLUDE_ENABLED) -#ifdef bottom_xinclude -#undef xmlXIncludeProcess -extern __typeof (xmlXIncludeProcess) xmlXIncludeProcess __attribute((alias("xmlXIncludeProcess__internal_alias"))); -#else -#ifndef xmlXIncludeProcess -extern __typeof (xmlXIncludeProcess) xmlXIncludeProcess__internal_alias __attribute((visibility("hidden"))); -#define xmlXIncludeProcess xmlXIncludeProcess__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XINCLUDE_ENABLED) -#ifdef bottom_xinclude -#undef xmlXIncludeProcessFlags -extern __typeof (xmlXIncludeProcessFlags) xmlXIncludeProcessFlags __attribute((alias("xmlXIncludeProcessFlags__internal_alias"))); -#else -#ifndef xmlXIncludeProcessFlags -extern __typeof (xmlXIncludeProcessFlags) xmlXIncludeProcessFlags__internal_alias __attribute((visibility("hidden"))); -#define xmlXIncludeProcessFlags xmlXIncludeProcessFlags__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XINCLUDE_ENABLED) -#ifdef bottom_xinclude -#undef xmlXIncludeProcessFlagsData -extern __typeof (xmlXIncludeProcessFlagsData) xmlXIncludeProcessFlagsData __attribute((alias("xmlXIncludeProcessFlagsData__internal_alias"))); -#else -#ifndef xmlXIncludeProcessFlagsData -extern __typeof (xmlXIncludeProcessFlagsData) xmlXIncludeProcessFlagsData__internal_alias __attribute((visibility("hidden"))); -#define xmlXIncludeProcessFlagsData xmlXIncludeProcessFlagsData__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XINCLUDE_ENABLED) -#ifdef bottom_xinclude -#undef xmlXIncludeProcessNode -extern __typeof (xmlXIncludeProcessNode) xmlXIncludeProcessNode __attribute((alias("xmlXIncludeProcessNode__internal_alias"))); -#else -#ifndef xmlXIncludeProcessNode -extern __typeof (xmlXIncludeProcessNode) xmlXIncludeProcessNode__internal_alias __attribute((visibility("hidden"))); -#define xmlXIncludeProcessNode xmlXIncludeProcessNode__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XINCLUDE_ENABLED) -#ifdef bottom_xinclude -#undef xmlXIncludeProcessTree -extern __typeof (xmlXIncludeProcessTree) xmlXIncludeProcessTree __attribute((alias("xmlXIncludeProcessTree__internal_alias"))); -#else -#ifndef xmlXIncludeProcessTree -extern __typeof (xmlXIncludeProcessTree) xmlXIncludeProcessTree__internal_alias __attribute((visibility("hidden"))); -#define xmlXIncludeProcessTree xmlXIncludeProcessTree__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XINCLUDE_ENABLED) -#ifdef bottom_xinclude -#undef xmlXIncludeProcessTreeFlags -extern __typeof (xmlXIncludeProcessTreeFlags) xmlXIncludeProcessTreeFlags __attribute((alias("xmlXIncludeProcessTreeFlags__internal_alias"))); -#else -#ifndef xmlXIncludeProcessTreeFlags -extern __typeof (xmlXIncludeProcessTreeFlags) xmlXIncludeProcessTreeFlags__internal_alias __attribute((visibility("hidden"))); -#define xmlXIncludeProcessTreeFlags xmlXIncludeProcessTreeFlags__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XINCLUDE_ENABLED) -#ifdef bottom_xinclude -#undef xmlXIncludeProcessTreeFlagsData -extern __typeof (xmlXIncludeProcessTreeFlagsData) xmlXIncludeProcessTreeFlagsData __attribute((alias("xmlXIncludeProcessTreeFlagsData__internal_alias"))); -#else -#ifndef xmlXIncludeProcessTreeFlagsData -extern __typeof (xmlXIncludeProcessTreeFlagsData) xmlXIncludeProcessTreeFlagsData__internal_alias __attribute((visibility("hidden"))); -#define xmlXIncludeProcessTreeFlagsData xmlXIncludeProcessTreeFlagsData__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XINCLUDE_ENABLED) -#ifdef bottom_xinclude -#undef xmlXIncludeSetFlags -extern __typeof (xmlXIncludeSetFlags) xmlXIncludeSetFlags __attribute((alias("xmlXIncludeSetFlags__internal_alias"))); -#else -#ifndef xmlXIncludeSetFlags -extern __typeof (xmlXIncludeSetFlags) xmlXIncludeSetFlags__internal_alias __attribute((visibility("hidden"))); -#define xmlXIncludeSetFlags xmlXIncludeSetFlags__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathAddValues -extern __typeof (xmlXPathAddValues) xmlXPathAddValues __attribute((alias("xmlXPathAddValues__internal_alias"))); -#else -#ifndef xmlXPathAddValues -extern __typeof (xmlXPathAddValues) xmlXPathAddValues__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathAddValues xmlXPathAddValues__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathBooleanFunction -extern __typeof (xmlXPathBooleanFunction) xmlXPathBooleanFunction __attribute((alias("xmlXPathBooleanFunction__internal_alias"))); -#else -#ifndef xmlXPathBooleanFunction -extern __typeof (xmlXPathBooleanFunction) xmlXPathBooleanFunction__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathBooleanFunction xmlXPathBooleanFunction__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathCastBooleanToNumber -extern __typeof (xmlXPathCastBooleanToNumber) xmlXPathCastBooleanToNumber __attribute((alias("xmlXPathCastBooleanToNumber__internal_alias"))); -#else -#ifndef xmlXPathCastBooleanToNumber -extern __typeof (xmlXPathCastBooleanToNumber) xmlXPathCastBooleanToNumber__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathCastBooleanToNumber xmlXPathCastBooleanToNumber__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathCastBooleanToString -extern __typeof (xmlXPathCastBooleanToString) xmlXPathCastBooleanToString __attribute((alias("xmlXPathCastBooleanToString__internal_alias"))); -#else -#ifndef xmlXPathCastBooleanToString -extern __typeof (xmlXPathCastBooleanToString) xmlXPathCastBooleanToString__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathCastBooleanToString xmlXPathCastBooleanToString__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathCastNodeSetToBoolean -extern __typeof (xmlXPathCastNodeSetToBoolean) xmlXPathCastNodeSetToBoolean __attribute((alias("xmlXPathCastNodeSetToBoolean__internal_alias"))); -#else -#ifndef xmlXPathCastNodeSetToBoolean -extern __typeof (xmlXPathCastNodeSetToBoolean) xmlXPathCastNodeSetToBoolean__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathCastNodeSetToBoolean xmlXPathCastNodeSetToBoolean__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathCastNodeSetToNumber -extern __typeof (xmlXPathCastNodeSetToNumber) xmlXPathCastNodeSetToNumber __attribute((alias("xmlXPathCastNodeSetToNumber__internal_alias"))); -#else -#ifndef xmlXPathCastNodeSetToNumber -extern __typeof (xmlXPathCastNodeSetToNumber) xmlXPathCastNodeSetToNumber__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathCastNodeSetToNumber xmlXPathCastNodeSetToNumber__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathCastNodeSetToString -extern __typeof (xmlXPathCastNodeSetToString) xmlXPathCastNodeSetToString __attribute((alias("xmlXPathCastNodeSetToString__internal_alias"))); -#else -#ifndef xmlXPathCastNodeSetToString -extern __typeof (xmlXPathCastNodeSetToString) xmlXPathCastNodeSetToString__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathCastNodeSetToString xmlXPathCastNodeSetToString__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathCastNodeToNumber -extern __typeof (xmlXPathCastNodeToNumber) xmlXPathCastNodeToNumber __attribute((alias("xmlXPathCastNodeToNumber__internal_alias"))); -#else -#ifndef xmlXPathCastNodeToNumber -extern __typeof (xmlXPathCastNodeToNumber) xmlXPathCastNodeToNumber__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathCastNodeToNumber xmlXPathCastNodeToNumber__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathCastNodeToString -extern __typeof (xmlXPathCastNodeToString) xmlXPathCastNodeToString __attribute((alias("xmlXPathCastNodeToString__internal_alias"))); -#else -#ifndef xmlXPathCastNodeToString -extern __typeof (xmlXPathCastNodeToString) xmlXPathCastNodeToString__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathCastNodeToString xmlXPathCastNodeToString__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathCastNumberToBoolean -extern __typeof (xmlXPathCastNumberToBoolean) xmlXPathCastNumberToBoolean __attribute((alias("xmlXPathCastNumberToBoolean__internal_alias"))); -#else -#ifndef xmlXPathCastNumberToBoolean -extern __typeof (xmlXPathCastNumberToBoolean) xmlXPathCastNumberToBoolean__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathCastNumberToBoolean xmlXPathCastNumberToBoolean__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathCastNumberToString -extern __typeof (xmlXPathCastNumberToString) xmlXPathCastNumberToString __attribute((alias("xmlXPathCastNumberToString__internal_alias"))); -#else -#ifndef xmlXPathCastNumberToString -extern __typeof (xmlXPathCastNumberToString) xmlXPathCastNumberToString__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathCastNumberToString xmlXPathCastNumberToString__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathCastStringToBoolean -extern __typeof (xmlXPathCastStringToBoolean) xmlXPathCastStringToBoolean __attribute((alias("xmlXPathCastStringToBoolean__internal_alias"))); -#else -#ifndef xmlXPathCastStringToBoolean -extern __typeof (xmlXPathCastStringToBoolean) xmlXPathCastStringToBoolean__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathCastStringToBoolean xmlXPathCastStringToBoolean__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathCastStringToNumber -extern __typeof (xmlXPathCastStringToNumber) xmlXPathCastStringToNumber __attribute((alias("xmlXPathCastStringToNumber__internal_alias"))); -#else -#ifndef xmlXPathCastStringToNumber -extern __typeof (xmlXPathCastStringToNumber) xmlXPathCastStringToNumber__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathCastStringToNumber xmlXPathCastStringToNumber__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathCastToBoolean -extern __typeof (xmlXPathCastToBoolean) xmlXPathCastToBoolean __attribute((alias("xmlXPathCastToBoolean__internal_alias"))); -#else -#ifndef xmlXPathCastToBoolean -extern __typeof (xmlXPathCastToBoolean) xmlXPathCastToBoolean__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathCastToBoolean xmlXPathCastToBoolean__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathCastToNumber -extern __typeof (xmlXPathCastToNumber) xmlXPathCastToNumber __attribute((alias("xmlXPathCastToNumber__internal_alias"))); -#else -#ifndef xmlXPathCastToNumber -extern __typeof (xmlXPathCastToNumber) xmlXPathCastToNumber__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathCastToNumber xmlXPathCastToNumber__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathCastToString -extern __typeof (xmlXPathCastToString) xmlXPathCastToString __attribute((alias("xmlXPathCastToString__internal_alias"))); -#else -#ifndef xmlXPathCastToString -extern __typeof (xmlXPathCastToString) xmlXPathCastToString__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathCastToString xmlXPathCastToString__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathCeilingFunction -extern __typeof (xmlXPathCeilingFunction) xmlXPathCeilingFunction __attribute((alias("xmlXPathCeilingFunction__internal_alias"))); -#else -#ifndef xmlXPathCeilingFunction -extern __typeof (xmlXPathCeilingFunction) xmlXPathCeilingFunction__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathCeilingFunction xmlXPathCeilingFunction__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathCmpNodes -extern __typeof (xmlXPathCmpNodes) xmlXPathCmpNodes __attribute((alias("xmlXPathCmpNodes__internal_alias"))); -#else -#ifndef xmlXPathCmpNodes -extern __typeof (xmlXPathCmpNodes) xmlXPathCmpNodes__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathCmpNodes xmlXPathCmpNodes__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathCompareValues -extern __typeof (xmlXPathCompareValues) xmlXPathCompareValues __attribute((alias("xmlXPathCompareValues__internal_alias"))); -#else -#ifndef xmlXPathCompareValues -extern __typeof (xmlXPathCompareValues) xmlXPathCompareValues__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathCompareValues xmlXPathCompareValues__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathCompile -extern __typeof (xmlXPathCompile) xmlXPathCompile __attribute((alias("xmlXPathCompile__internal_alias"))); -#else -#ifndef xmlXPathCompile -extern __typeof (xmlXPathCompile) xmlXPathCompile__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathCompile xmlXPathCompile__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathCompiledEval -extern __typeof (xmlXPathCompiledEval) xmlXPathCompiledEval __attribute((alias("xmlXPathCompiledEval__internal_alias"))); -#else -#ifndef xmlXPathCompiledEval -extern __typeof (xmlXPathCompiledEval) xmlXPathCompiledEval__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathCompiledEval xmlXPathCompiledEval__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathCompiledEvalToBoolean -extern __typeof (xmlXPathCompiledEvalToBoolean) xmlXPathCompiledEvalToBoolean __attribute((alias("xmlXPathCompiledEvalToBoolean__internal_alias"))); -#else -#ifndef xmlXPathCompiledEvalToBoolean -extern __typeof (xmlXPathCompiledEvalToBoolean) xmlXPathCompiledEvalToBoolean__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathCompiledEvalToBoolean xmlXPathCompiledEvalToBoolean__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathConcatFunction -extern __typeof (xmlXPathConcatFunction) xmlXPathConcatFunction __attribute((alias("xmlXPathConcatFunction__internal_alias"))); -#else -#ifndef xmlXPathConcatFunction -extern __typeof (xmlXPathConcatFunction) xmlXPathConcatFunction__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathConcatFunction xmlXPathConcatFunction__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathContainsFunction -extern __typeof (xmlXPathContainsFunction) xmlXPathContainsFunction __attribute((alias("xmlXPathContainsFunction__internal_alias"))); -#else -#ifndef xmlXPathContainsFunction -extern __typeof (xmlXPathContainsFunction) xmlXPathContainsFunction__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathContainsFunction xmlXPathContainsFunction__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathContextSetCache -extern __typeof (xmlXPathContextSetCache) xmlXPathContextSetCache __attribute((alias("xmlXPathContextSetCache__internal_alias"))); -#else -#ifndef xmlXPathContextSetCache -extern __typeof (xmlXPathContextSetCache) xmlXPathContextSetCache__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathContextSetCache xmlXPathContextSetCache__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathConvertBoolean -extern __typeof (xmlXPathConvertBoolean) xmlXPathConvertBoolean __attribute((alias("xmlXPathConvertBoolean__internal_alias"))); -#else -#ifndef xmlXPathConvertBoolean -extern __typeof (xmlXPathConvertBoolean) xmlXPathConvertBoolean__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathConvertBoolean xmlXPathConvertBoolean__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathConvertNumber -extern __typeof (xmlXPathConvertNumber) xmlXPathConvertNumber __attribute((alias("xmlXPathConvertNumber__internal_alias"))); -#else -#ifndef xmlXPathConvertNumber -extern __typeof (xmlXPathConvertNumber) xmlXPathConvertNumber__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathConvertNumber xmlXPathConvertNumber__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathConvertString -extern __typeof (xmlXPathConvertString) xmlXPathConvertString __attribute((alias("xmlXPathConvertString__internal_alias"))); -#else -#ifndef xmlXPathConvertString -extern __typeof (xmlXPathConvertString) xmlXPathConvertString__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathConvertString xmlXPathConvertString__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathCountFunction -extern __typeof (xmlXPathCountFunction) xmlXPathCountFunction __attribute((alias("xmlXPathCountFunction__internal_alias"))); -#else -#ifndef xmlXPathCountFunction -extern __typeof (xmlXPathCountFunction) xmlXPathCountFunction__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathCountFunction xmlXPathCountFunction__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathCtxtCompile -extern __typeof (xmlXPathCtxtCompile) xmlXPathCtxtCompile __attribute((alias("xmlXPathCtxtCompile__internal_alias"))); -#else -#ifndef xmlXPathCtxtCompile -extern __typeof (xmlXPathCtxtCompile) xmlXPathCtxtCompile__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathCtxtCompile xmlXPathCtxtCompile__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathDebugDumpCompExpr -extern __typeof (xmlXPathDebugDumpCompExpr) xmlXPathDebugDumpCompExpr __attribute((alias("xmlXPathDebugDumpCompExpr__internal_alias"))); -#else -#ifndef xmlXPathDebugDumpCompExpr -extern __typeof (xmlXPathDebugDumpCompExpr) xmlXPathDebugDumpCompExpr__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathDebugDumpCompExpr xmlXPathDebugDumpCompExpr__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathDebugDumpObject -extern __typeof (xmlXPathDebugDumpObject) xmlXPathDebugDumpObject __attribute((alias("xmlXPathDebugDumpObject__internal_alias"))); -#else -#ifndef xmlXPathDebugDumpObject -extern __typeof (xmlXPathDebugDumpObject) xmlXPathDebugDumpObject__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathDebugDumpObject xmlXPathDebugDumpObject__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathDifference -extern __typeof (xmlXPathDifference) xmlXPathDifference __attribute((alias("xmlXPathDifference__internal_alias"))); -#else -#ifndef xmlXPathDifference -extern __typeof (xmlXPathDifference) xmlXPathDifference__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathDifference xmlXPathDifference__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathDistinct -extern __typeof (xmlXPathDistinct) xmlXPathDistinct __attribute((alias("xmlXPathDistinct__internal_alias"))); -#else -#ifndef xmlXPathDistinct -extern __typeof (xmlXPathDistinct) xmlXPathDistinct__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathDistinct xmlXPathDistinct__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathDistinctSorted -extern __typeof (xmlXPathDistinctSorted) xmlXPathDistinctSorted __attribute((alias("xmlXPathDistinctSorted__internal_alias"))); -#else -#ifndef xmlXPathDistinctSorted -extern __typeof (xmlXPathDistinctSorted) xmlXPathDistinctSorted__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathDistinctSorted xmlXPathDistinctSorted__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathDivValues -extern __typeof (xmlXPathDivValues) xmlXPathDivValues __attribute((alias("xmlXPathDivValues__internal_alias"))); -#else -#ifndef xmlXPathDivValues -extern __typeof (xmlXPathDivValues) xmlXPathDivValues__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathDivValues xmlXPathDivValues__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathEqualValues -extern __typeof (xmlXPathEqualValues) xmlXPathEqualValues __attribute((alias("xmlXPathEqualValues__internal_alias"))); -#else -#ifndef xmlXPathEqualValues -extern __typeof (xmlXPathEqualValues) xmlXPathEqualValues__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathEqualValues xmlXPathEqualValues__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathErr -extern __typeof (xmlXPathErr) xmlXPathErr __attribute((alias("xmlXPathErr__internal_alias"))); -#else -#ifndef xmlXPathErr -extern __typeof (xmlXPathErr) xmlXPathErr__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathErr xmlXPathErr__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathEval -extern __typeof (xmlXPathEval) xmlXPathEval __attribute((alias("xmlXPathEval__internal_alias"))); -#else -#ifndef xmlXPathEval -extern __typeof (xmlXPathEval) xmlXPathEval__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathEval xmlXPathEval__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathEvalExpr -extern __typeof (xmlXPathEvalExpr) xmlXPathEvalExpr __attribute((alias("xmlXPathEvalExpr__internal_alias"))); -#else -#ifndef xmlXPathEvalExpr -extern __typeof (xmlXPathEvalExpr) xmlXPathEvalExpr__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathEvalExpr xmlXPathEvalExpr__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathEvalExpression -extern __typeof (xmlXPathEvalExpression) xmlXPathEvalExpression __attribute((alias("xmlXPathEvalExpression__internal_alias"))); -#else -#ifndef xmlXPathEvalExpression -extern __typeof (xmlXPathEvalExpression) xmlXPathEvalExpression__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathEvalExpression xmlXPathEvalExpression__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathEvalPredicate -extern __typeof (xmlXPathEvalPredicate) xmlXPathEvalPredicate __attribute((alias("xmlXPathEvalPredicate__internal_alias"))); -#else -#ifndef xmlXPathEvalPredicate -extern __typeof (xmlXPathEvalPredicate) xmlXPathEvalPredicate__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathEvalPredicate xmlXPathEvalPredicate__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathEvaluatePredicateResult -extern __typeof (xmlXPathEvaluatePredicateResult) xmlXPathEvaluatePredicateResult __attribute((alias("xmlXPathEvaluatePredicateResult__internal_alias"))); -#else -#ifndef xmlXPathEvaluatePredicateResult -extern __typeof (xmlXPathEvaluatePredicateResult) xmlXPathEvaluatePredicateResult__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathEvaluatePredicateResult xmlXPathEvaluatePredicateResult__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathFalseFunction -extern __typeof (xmlXPathFalseFunction) xmlXPathFalseFunction __attribute((alias("xmlXPathFalseFunction__internal_alias"))); -#else -#ifndef xmlXPathFalseFunction -extern __typeof (xmlXPathFalseFunction) xmlXPathFalseFunction__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathFalseFunction xmlXPathFalseFunction__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathFloorFunction -extern __typeof (xmlXPathFloorFunction) xmlXPathFloorFunction __attribute((alias("xmlXPathFloorFunction__internal_alias"))); -#else -#ifndef xmlXPathFloorFunction -extern __typeof (xmlXPathFloorFunction) xmlXPathFloorFunction__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathFloorFunction xmlXPathFloorFunction__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathFreeCompExpr -extern __typeof (xmlXPathFreeCompExpr) xmlXPathFreeCompExpr __attribute((alias("xmlXPathFreeCompExpr__internal_alias"))); -#else -#ifndef xmlXPathFreeCompExpr -extern __typeof (xmlXPathFreeCompExpr) xmlXPathFreeCompExpr__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathFreeCompExpr xmlXPathFreeCompExpr__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathFreeContext -extern __typeof (xmlXPathFreeContext) xmlXPathFreeContext __attribute((alias("xmlXPathFreeContext__internal_alias"))); -#else -#ifndef xmlXPathFreeContext -extern __typeof (xmlXPathFreeContext) xmlXPathFreeContext__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathFreeContext xmlXPathFreeContext__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathFreeNodeSet -extern __typeof (xmlXPathFreeNodeSet) xmlXPathFreeNodeSet __attribute((alias("xmlXPathFreeNodeSet__internal_alias"))); -#else -#ifndef xmlXPathFreeNodeSet -extern __typeof (xmlXPathFreeNodeSet) xmlXPathFreeNodeSet__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathFreeNodeSet xmlXPathFreeNodeSet__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathFreeNodeSetList -extern __typeof (xmlXPathFreeNodeSetList) xmlXPathFreeNodeSetList __attribute((alias("xmlXPathFreeNodeSetList__internal_alias"))); -#else -#ifndef xmlXPathFreeNodeSetList -extern __typeof (xmlXPathFreeNodeSetList) xmlXPathFreeNodeSetList__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathFreeNodeSetList xmlXPathFreeNodeSetList__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathFreeObject -extern __typeof (xmlXPathFreeObject) xmlXPathFreeObject __attribute((alias("xmlXPathFreeObject__internal_alias"))); -#else -#ifndef xmlXPathFreeObject -extern __typeof (xmlXPathFreeObject) xmlXPathFreeObject__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathFreeObject xmlXPathFreeObject__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathFreeParserContext -extern __typeof (xmlXPathFreeParserContext) xmlXPathFreeParserContext __attribute((alias("xmlXPathFreeParserContext__internal_alias"))); -#else -#ifndef xmlXPathFreeParserContext -extern __typeof (xmlXPathFreeParserContext) xmlXPathFreeParserContext__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathFreeParserContext xmlXPathFreeParserContext__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathFunctionLookup -extern __typeof (xmlXPathFunctionLookup) xmlXPathFunctionLookup __attribute((alias("xmlXPathFunctionLookup__internal_alias"))); -#else -#ifndef xmlXPathFunctionLookup -extern __typeof (xmlXPathFunctionLookup) xmlXPathFunctionLookup__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathFunctionLookup xmlXPathFunctionLookup__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathFunctionLookupNS -extern __typeof (xmlXPathFunctionLookupNS) xmlXPathFunctionLookupNS __attribute((alias("xmlXPathFunctionLookupNS__internal_alias"))); -#else -#ifndef xmlXPathFunctionLookupNS -extern __typeof (xmlXPathFunctionLookupNS) xmlXPathFunctionLookupNS__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathFunctionLookupNS xmlXPathFunctionLookupNS__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathHasSameNodes -extern __typeof (xmlXPathHasSameNodes) xmlXPathHasSameNodes __attribute((alias("xmlXPathHasSameNodes__internal_alias"))); -#else -#ifndef xmlXPathHasSameNodes -extern __typeof (xmlXPathHasSameNodes) xmlXPathHasSameNodes__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathHasSameNodes xmlXPathHasSameNodes__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathIdFunction -extern __typeof (xmlXPathIdFunction) xmlXPathIdFunction __attribute((alias("xmlXPathIdFunction__internal_alias"))); -#else -#ifndef xmlXPathIdFunction -extern __typeof (xmlXPathIdFunction) xmlXPathIdFunction__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathIdFunction xmlXPathIdFunction__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathInit -extern __typeof (xmlXPathInit) xmlXPathInit __attribute((alias("xmlXPathInit__internal_alias"))); -#else -#ifndef xmlXPathInit -extern __typeof (xmlXPathInit) xmlXPathInit__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathInit xmlXPathInit__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathIntersection -extern __typeof (xmlXPathIntersection) xmlXPathIntersection __attribute((alias("xmlXPathIntersection__internal_alias"))); -#else -#ifndef xmlXPathIntersection -extern __typeof (xmlXPathIntersection) xmlXPathIntersection__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathIntersection xmlXPathIntersection__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathIsInf -extern __typeof (xmlXPathIsInf) xmlXPathIsInf __attribute((alias("xmlXPathIsInf__internal_alias"))); -#else -#ifndef xmlXPathIsInf -extern __typeof (xmlXPathIsInf) xmlXPathIsInf__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathIsInf xmlXPathIsInf__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathIsNaN -extern __typeof (xmlXPathIsNaN) xmlXPathIsNaN __attribute((alias("xmlXPathIsNaN__internal_alias"))); -#else -#ifndef xmlXPathIsNaN -extern __typeof (xmlXPathIsNaN) xmlXPathIsNaN__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathIsNaN xmlXPathIsNaN__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathIsNodeType -extern __typeof (xmlXPathIsNodeType) xmlXPathIsNodeType __attribute((alias("xmlXPathIsNodeType__internal_alias"))); -#else -#ifndef xmlXPathIsNodeType -extern __typeof (xmlXPathIsNodeType) xmlXPathIsNodeType__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathIsNodeType xmlXPathIsNodeType__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathLangFunction -extern __typeof (xmlXPathLangFunction) xmlXPathLangFunction __attribute((alias("xmlXPathLangFunction__internal_alias"))); -#else -#ifndef xmlXPathLangFunction -extern __typeof (xmlXPathLangFunction) xmlXPathLangFunction__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathLangFunction xmlXPathLangFunction__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathLastFunction -extern __typeof (xmlXPathLastFunction) xmlXPathLastFunction __attribute((alias("xmlXPathLastFunction__internal_alias"))); -#else -#ifndef xmlXPathLastFunction -extern __typeof (xmlXPathLastFunction) xmlXPathLastFunction__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathLastFunction xmlXPathLastFunction__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathLeading -extern __typeof (xmlXPathLeading) xmlXPathLeading __attribute((alias("xmlXPathLeading__internal_alias"))); -#else -#ifndef xmlXPathLeading -extern __typeof (xmlXPathLeading) xmlXPathLeading__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathLeading xmlXPathLeading__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathLeadingSorted -extern __typeof (xmlXPathLeadingSorted) xmlXPathLeadingSorted __attribute((alias("xmlXPathLeadingSorted__internal_alias"))); -#else -#ifndef xmlXPathLeadingSorted -extern __typeof (xmlXPathLeadingSorted) xmlXPathLeadingSorted__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathLeadingSorted xmlXPathLeadingSorted__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathLocalNameFunction -extern __typeof (xmlXPathLocalNameFunction) xmlXPathLocalNameFunction __attribute((alias("xmlXPathLocalNameFunction__internal_alias"))); -#else -#ifndef xmlXPathLocalNameFunction -extern __typeof (xmlXPathLocalNameFunction) xmlXPathLocalNameFunction__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathLocalNameFunction xmlXPathLocalNameFunction__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathModValues -extern __typeof (xmlXPathModValues) xmlXPathModValues __attribute((alias("xmlXPathModValues__internal_alias"))); -#else -#ifndef xmlXPathModValues -extern __typeof (xmlXPathModValues) xmlXPathModValues__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathModValues xmlXPathModValues__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathMultValues -extern __typeof (xmlXPathMultValues) xmlXPathMultValues __attribute((alias("xmlXPathMultValues__internal_alias"))); -#else -#ifndef xmlXPathMultValues -extern __typeof (xmlXPathMultValues) xmlXPathMultValues__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathMultValues xmlXPathMultValues__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathNamespaceURIFunction -extern __typeof (xmlXPathNamespaceURIFunction) xmlXPathNamespaceURIFunction __attribute((alias("xmlXPathNamespaceURIFunction__internal_alias"))); -#else -#ifndef xmlXPathNamespaceURIFunction -extern __typeof (xmlXPathNamespaceURIFunction) xmlXPathNamespaceURIFunction__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathNamespaceURIFunction xmlXPathNamespaceURIFunction__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathNewBoolean -extern __typeof (xmlXPathNewBoolean) xmlXPathNewBoolean __attribute((alias("xmlXPathNewBoolean__internal_alias"))); -#else -#ifndef xmlXPathNewBoolean -extern __typeof (xmlXPathNewBoolean) xmlXPathNewBoolean__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathNewBoolean xmlXPathNewBoolean__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathNewCString -extern __typeof (xmlXPathNewCString) xmlXPathNewCString __attribute((alias("xmlXPathNewCString__internal_alias"))); -#else -#ifndef xmlXPathNewCString -extern __typeof (xmlXPathNewCString) xmlXPathNewCString__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathNewCString xmlXPathNewCString__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathNewContext -extern __typeof (xmlXPathNewContext) xmlXPathNewContext __attribute((alias("xmlXPathNewContext__internal_alias"))); -#else -#ifndef xmlXPathNewContext -extern __typeof (xmlXPathNewContext) xmlXPathNewContext__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathNewContext xmlXPathNewContext__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathNewFloat -extern __typeof (xmlXPathNewFloat) xmlXPathNewFloat __attribute((alias("xmlXPathNewFloat__internal_alias"))); -#else -#ifndef xmlXPathNewFloat -extern __typeof (xmlXPathNewFloat) xmlXPathNewFloat__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathNewFloat xmlXPathNewFloat__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathNewNodeSet -extern __typeof (xmlXPathNewNodeSet) xmlXPathNewNodeSet __attribute((alias("xmlXPathNewNodeSet__internal_alias"))); -#else -#ifndef xmlXPathNewNodeSet -extern __typeof (xmlXPathNewNodeSet) xmlXPathNewNodeSet__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathNewNodeSet xmlXPathNewNodeSet__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathNewNodeSetList -extern __typeof (xmlXPathNewNodeSetList) xmlXPathNewNodeSetList __attribute((alias("xmlXPathNewNodeSetList__internal_alias"))); -#else -#ifndef xmlXPathNewNodeSetList -extern __typeof (xmlXPathNewNodeSetList) xmlXPathNewNodeSetList__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathNewNodeSetList xmlXPathNewNodeSetList__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathNewParserContext -extern __typeof (xmlXPathNewParserContext) xmlXPathNewParserContext __attribute((alias("xmlXPathNewParserContext__internal_alias"))); -#else -#ifndef xmlXPathNewParserContext -extern __typeof (xmlXPathNewParserContext) xmlXPathNewParserContext__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathNewParserContext xmlXPathNewParserContext__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathNewString -extern __typeof (xmlXPathNewString) xmlXPathNewString __attribute((alias("xmlXPathNewString__internal_alias"))); -#else -#ifndef xmlXPathNewString -extern __typeof (xmlXPathNewString) xmlXPathNewString__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathNewString xmlXPathNewString__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathNewValueTree -extern __typeof (xmlXPathNewValueTree) xmlXPathNewValueTree __attribute((alias("xmlXPathNewValueTree__internal_alias"))); -#else -#ifndef xmlXPathNewValueTree -extern __typeof (xmlXPathNewValueTree) xmlXPathNewValueTree__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathNewValueTree xmlXPathNewValueTree__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathNextAncestor -extern __typeof (xmlXPathNextAncestor) xmlXPathNextAncestor __attribute((alias("xmlXPathNextAncestor__internal_alias"))); -#else -#ifndef xmlXPathNextAncestor -extern __typeof (xmlXPathNextAncestor) xmlXPathNextAncestor__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathNextAncestor xmlXPathNextAncestor__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathNextAncestorOrSelf -extern __typeof (xmlXPathNextAncestorOrSelf) xmlXPathNextAncestorOrSelf __attribute((alias("xmlXPathNextAncestorOrSelf__internal_alias"))); -#else -#ifndef xmlXPathNextAncestorOrSelf -extern __typeof (xmlXPathNextAncestorOrSelf) xmlXPathNextAncestorOrSelf__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathNextAncestorOrSelf xmlXPathNextAncestorOrSelf__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathNextAttribute -extern __typeof (xmlXPathNextAttribute) xmlXPathNextAttribute __attribute((alias("xmlXPathNextAttribute__internal_alias"))); -#else -#ifndef xmlXPathNextAttribute -extern __typeof (xmlXPathNextAttribute) xmlXPathNextAttribute__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathNextAttribute xmlXPathNextAttribute__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathNextChild -extern __typeof (xmlXPathNextChild) xmlXPathNextChild __attribute((alias("xmlXPathNextChild__internal_alias"))); -#else -#ifndef xmlXPathNextChild -extern __typeof (xmlXPathNextChild) xmlXPathNextChild__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathNextChild xmlXPathNextChild__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathNextDescendant -extern __typeof (xmlXPathNextDescendant) xmlXPathNextDescendant __attribute((alias("xmlXPathNextDescendant__internal_alias"))); -#else -#ifndef xmlXPathNextDescendant -extern __typeof (xmlXPathNextDescendant) xmlXPathNextDescendant__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathNextDescendant xmlXPathNextDescendant__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathNextDescendantOrSelf -extern __typeof (xmlXPathNextDescendantOrSelf) xmlXPathNextDescendantOrSelf __attribute((alias("xmlXPathNextDescendantOrSelf__internal_alias"))); -#else -#ifndef xmlXPathNextDescendantOrSelf -extern __typeof (xmlXPathNextDescendantOrSelf) xmlXPathNextDescendantOrSelf__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathNextDescendantOrSelf xmlXPathNextDescendantOrSelf__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathNextFollowing -extern __typeof (xmlXPathNextFollowing) xmlXPathNextFollowing __attribute((alias("xmlXPathNextFollowing__internal_alias"))); -#else -#ifndef xmlXPathNextFollowing -extern __typeof (xmlXPathNextFollowing) xmlXPathNextFollowing__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathNextFollowing xmlXPathNextFollowing__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathNextFollowingSibling -extern __typeof (xmlXPathNextFollowingSibling) xmlXPathNextFollowingSibling __attribute((alias("xmlXPathNextFollowingSibling__internal_alias"))); -#else -#ifndef xmlXPathNextFollowingSibling -extern __typeof (xmlXPathNextFollowingSibling) xmlXPathNextFollowingSibling__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathNextFollowingSibling xmlXPathNextFollowingSibling__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathNextNamespace -extern __typeof (xmlXPathNextNamespace) xmlXPathNextNamespace __attribute((alias("xmlXPathNextNamespace__internal_alias"))); -#else -#ifndef xmlXPathNextNamespace -extern __typeof (xmlXPathNextNamespace) xmlXPathNextNamespace__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathNextNamespace xmlXPathNextNamespace__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathNextParent -extern __typeof (xmlXPathNextParent) xmlXPathNextParent __attribute((alias("xmlXPathNextParent__internal_alias"))); -#else -#ifndef xmlXPathNextParent -extern __typeof (xmlXPathNextParent) xmlXPathNextParent__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathNextParent xmlXPathNextParent__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathNextPreceding -extern __typeof (xmlXPathNextPreceding) xmlXPathNextPreceding __attribute((alias("xmlXPathNextPreceding__internal_alias"))); -#else -#ifndef xmlXPathNextPreceding -extern __typeof (xmlXPathNextPreceding) xmlXPathNextPreceding__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathNextPreceding xmlXPathNextPreceding__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathNextPrecedingSibling -extern __typeof (xmlXPathNextPrecedingSibling) xmlXPathNextPrecedingSibling __attribute((alias("xmlXPathNextPrecedingSibling__internal_alias"))); -#else -#ifndef xmlXPathNextPrecedingSibling -extern __typeof (xmlXPathNextPrecedingSibling) xmlXPathNextPrecedingSibling__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathNextPrecedingSibling xmlXPathNextPrecedingSibling__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathNextSelf -extern __typeof (xmlXPathNextSelf) xmlXPathNextSelf __attribute((alias("xmlXPathNextSelf__internal_alias"))); -#else -#ifndef xmlXPathNextSelf -extern __typeof (xmlXPathNextSelf) xmlXPathNextSelf__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathNextSelf xmlXPathNextSelf__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathNodeEval -extern __typeof (xmlXPathNodeEval) xmlXPathNodeEval __attribute((alias("xmlXPathNodeEval__internal_alias"))); -#else -#ifndef xmlXPathNodeEval -extern __typeof (xmlXPathNodeEval) xmlXPathNodeEval__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathNodeEval xmlXPathNodeEval__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathNodeLeading -extern __typeof (xmlXPathNodeLeading) xmlXPathNodeLeading __attribute((alias("xmlXPathNodeLeading__internal_alias"))); -#else -#ifndef xmlXPathNodeLeading -extern __typeof (xmlXPathNodeLeading) xmlXPathNodeLeading__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathNodeLeading xmlXPathNodeLeading__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathNodeLeadingSorted -extern __typeof (xmlXPathNodeLeadingSorted) xmlXPathNodeLeadingSorted __attribute((alias("xmlXPathNodeLeadingSorted__internal_alias"))); -#else -#ifndef xmlXPathNodeLeadingSorted -extern __typeof (xmlXPathNodeLeadingSorted) xmlXPathNodeLeadingSorted__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathNodeLeadingSorted xmlXPathNodeLeadingSorted__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathNodeSetAdd -extern __typeof (xmlXPathNodeSetAdd) xmlXPathNodeSetAdd __attribute((alias("xmlXPathNodeSetAdd__internal_alias"))); -#else -#ifndef xmlXPathNodeSetAdd -extern __typeof (xmlXPathNodeSetAdd) xmlXPathNodeSetAdd__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathNodeSetAdd xmlXPathNodeSetAdd__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathNodeSetAddNs -extern __typeof (xmlXPathNodeSetAddNs) xmlXPathNodeSetAddNs __attribute((alias("xmlXPathNodeSetAddNs__internal_alias"))); -#else -#ifndef xmlXPathNodeSetAddNs -extern __typeof (xmlXPathNodeSetAddNs) xmlXPathNodeSetAddNs__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathNodeSetAddNs xmlXPathNodeSetAddNs__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathNodeSetAddUnique -extern __typeof (xmlXPathNodeSetAddUnique) xmlXPathNodeSetAddUnique __attribute((alias("xmlXPathNodeSetAddUnique__internal_alias"))); -#else -#ifndef xmlXPathNodeSetAddUnique -extern __typeof (xmlXPathNodeSetAddUnique) xmlXPathNodeSetAddUnique__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathNodeSetAddUnique xmlXPathNodeSetAddUnique__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathNodeSetContains -extern __typeof (xmlXPathNodeSetContains) xmlXPathNodeSetContains __attribute((alias("xmlXPathNodeSetContains__internal_alias"))); -#else -#ifndef xmlXPathNodeSetContains -extern __typeof (xmlXPathNodeSetContains) xmlXPathNodeSetContains__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathNodeSetContains xmlXPathNodeSetContains__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathNodeSetCreate -extern __typeof (xmlXPathNodeSetCreate) xmlXPathNodeSetCreate __attribute((alias("xmlXPathNodeSetCreate__internal_alias"))); -#else -#ifndef xmlXPathNodeSetCreate -extern __typeof (xmlXPathNodeSetCreate) xmlXPathNodeSetCreate__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathNodeSetCreate xmlXPathNodeSetCreate__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathNodeSetDel -extern __typeof (xmlXPathNodeSetDel) xmlXPathNodeSetDel __attribute((alias("xmlXPathNodeSetDel__internal_alias"))); -#else -#ifndef xmlXPathNodeSetDel -extern __typeof (xmlXPathNodeSetDel) xmlXPathNodeSetDel__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathNodeSetDel xmlXPathNodeSetDel__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathNodeSetFreeNs -extern __typeof (xmlXPathNodeSetFreeNs) xmlXPathNodeSetFreeNs __attribute((alias("xmlXPathNodeSetFreeNs__internal_alias"))); -#else -#ifndef xmlXPathNodeSetFreeNs -extern __typeof (xmlXPathNodeSetFreeNs) xmlXPathNodeSetFreeNs__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathNodeSetFreeNs xmlXPathNodeSetFreeNs__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathNodeSetMerge -extern __typeof (xmlXPathNodeSetMerge) xmlXPathNodeSetMerge __attribute((alias("xmlXPathNodeSetMerge__internal_alias"))); -#else -#ifndef xmlXPathNodeSetMerge -extern __typeof (xmlXPathNodeSetMerge) xmlXPathNodeSetMerge__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathNodeSetMerge xmlXPathNodeSetMerge__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathNodeSetRemove -extern __typeof (xmlXPathNodeSetRemove) xmlXPathNodeSetRemove __attribute((alias("xmlXPathNodeSetRemove__internal_alias"))); -#else -#ifndef xmlXPathNodeSetRemove -extern __typeof (xmlXPathNodeSetRemove) xmlXPathNodeSetRemove__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathNodeSetRemove xmlXPathNodeSetRemove__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathNodeSetSort -extern __typeof (xmlXPathNodeSetSort) xmlXPathNodeSetSort __attribute((alias("xmlXPathNodeSetSort__internal_alias"))); -#else -#ifndef xmlXPathNodeSetSort -extern __typeof (xmlXPathNodeSetSort) xmlXPathNodeSetSort__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathNodeSetSort xmlXPathNodeSetSort__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathNodeTrailing -extern __typeof (xmlXPathNodeTrailing) xmlXPathNodeTrailing __attribute((alias("xmlXPathNodeTrailing__internal_alias"))); -#else -#ifndef xmlXPathNodeTrailing -extern __typeof (xmlXPathNodeTrailing) xmlXPathNodeTrailing__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathNodeTrailing xmlXPathNodeTrailing__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathNodeTrailingSorted -extern __typeof (xmlXPathNodeTrailingSorted) xmlXPathNodeTrailingSorted __attribute((alias("xmlXPathNodeTrailingSorted__internal_alias"))); -#else -#ifndef xmlXPathNodeTrailingSorted -extern __typeof (xmlXPathNodeTrailingSorted) xmlXPathNodeTrailingSorted__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathNodeTrailingSorted xmlXPathNodeTrailingSorted__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathNormalizeFunction -extern __typeof (xmlXPathNormalizeFunction) xmlXPathNormalizeFunction __attribute((alias("xmlXPathNormalizeFunction__internal_alias"))); -#else -#ifndef xmlXPathNormalizeFunction -extern __typeof (xmlXPathNormalizeFunction) xmlXPathNormalizeFunction__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathNormalizeFunction xmlXPathNormalizeFunction__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathNotEqualValues -extern __typeof (xmlXPathNotEqualValues) xmlXPathNotEqualValues __attribute((alias("xmlXPathNotEqualValues__internal_alias"))); -#else -#ifndef xmlXPathNotEqualValues -extern __typeof (xmlXPathNotEqualValues) xmlXPathNotEqualValues__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathNotEqualValues xmlXPathNotEqualValues__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathNotFunction -extern __typeof (xmlXPathNotFunction) xmlXPathNotFunction __attribute((alias("xmlXPathNotFunction__internal_alias"))); -#else -#ifndef xmlXPathNotFunction -extern __typeof (xmlXPathNotFunction) xmlXPathNotFunction__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathNotFunction xmlXPathNotFunction__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathNsLookup -extern __typeof (xmlXPathNsLookup) xmlXPathNsLookup __attribute((alias("xmlXPathNsLookup__internal_alias"))); -#else -#ifndef xmlXPathNsLookup -extern __typeof (xmlXPathNsLookup) xmlXPathNsLookup__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathNsLookup xmlXPathNsLookup__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathNumberFunction -extern __typeof (xmlXPathNumberFunction) xmlXPathNumberFunction __attribute((alias("xmlXPathNumberFunction__internal_alias"))); -#else -#ifndef xmlXPathNumberFunction -extern __typeof (xmlXPathNumberFunction) xmlXPathNumberFunction__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathNumberFunction xmlXPathNumberFunction__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathObjectCopy -extern __typeof (xmlXPathObjectCopy) xmlXPathObjectCopy __attribute((alias("xmlXPathObjectCopy__internal_alias"))); -#else -#ifndef xmlXPathObjectCopy -extern __typeof (xmlXPathObjectCopy) xmlXPathObjectCopy__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathObjectCopy xmlXPathObjectCopy__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathOrderDocElems -extern __typeof (xmlXPathOrderDocElems) xmlXPathOrderDocElems __attribute((alias("xmlXPathOrderDocElems__internal_alias"))); -#else -#ifndef xmlXPathOrderDocElems -extern __typeof (xmlXPathOrderDocElems) xmlXPathOrderDocElems__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathOrderDocElems xmlXPathOrderDocElems__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathParseNCName -extern __typeof (xmlXPathParseNCName) xmlXPathParseNCName __attribute((alias("xmlXPathParseNCName__internal_alias"))); -#else -#ifndef xmlXPathParseNCName -extern __typeof (xmlXPathParseNCName) xmlXPathParseNCName__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathParseNCName xmlXPathParseNCName__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathParseName -extern __typeof (xmlXPathParseName) xmlXPathParseName __attribute((alias("xmlXPathParseName__internal_alias"))); -#else -#ifndef xmlXPathParseName -extern __typeof (xmlXPathParseName) xmlXPathParseName__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathParseName xmlXPathParseName__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathPopBoolean -extern __typeof (xmlXPathPopBoolean) xmlXPathPopBoolean __attribute((alias("xmlXPathPopBoolean__internal_alias"))); -#else -#ifndef xmlXPathPopBoolean -extern __typeof (xmlXPathPopBoolean) xmlXPathPopBoolean__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathPopBoolean xmlXPathPopBoolean__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathPopExternal -extern __typeof (xmlXPathPopExternal) xmlXPathPopExternal __attribute((alias("xmlXPathPopExternal__internal_alias"))); -#else -#ifndef xmlXPathPopExternal -extern __typeof (xmlXPathPopExternal) xmlXPathPopExternal__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathPopExternal xmlXPathPopExternal__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathPopNodeSet -extern __typeof (xmlXPathPopNodeSet) xmlXPathPopNodeSet __attribute((alias("xmlXPathPopNodeSet__internal_alias"))); -#else -#ifndef xmlXPathPopNodeSet -extern __typeof (xmlXPathPopNodeSet) xmlXPathPopNodeSet__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathPopNodeSet xmlXPathPopNodeSet__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathPopNumber -extern __typeof (xmlXPathPopNumber) xmlXPathPopNumber __attribute((alias("xmlXPathPopNumber__internal_alias"))); -#else -#ifndef xmlXPathPopNumber -extern __typeof (xmlXPathPopNumber) xmlXPathPopNumber__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathPopNumber xmlXPathPopNumber__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathPopString -extern __typeof (xmlXPathPopString) xmlXPathPopString __attribute((alias("xmlXPathPopString__internal_alias"))); -#else -#ifndef xmlXPathPopString -extern __typeof (xmlXPathPopString) xmlXPathPopString__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathPopString xmlXPathPopString__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathPositionFunction -extern __typeof (xmlXPathPositionFunction) xmlXPathPositionFunction __attribute((alias("xmlXPathPositionFunction__internal_alias"))); -#else -#ifndef xmlXPathPositionFunction -extern __typeof (xmlXPathPositionFunction) xmlXPathPositionFunction__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathPositionFunction xmlXPathPositionFunction__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathRegisterAllFunctions -extern __typeof (xmlXPathRegisterAllFunctions) xmlXPathRegisterAllFunctions __attribute((alias("xmlXPathRegisterAllFunctions__internal_alias"))); -#else -#ifndef xmlXPathRegisterAllFunctions -extern __typeof (xmlXPathRegisterAllFunctions) xmlXPathRegisterAllFunctions__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathRegisterAllFunctions xmlXPathRegisterAllFunctions__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathRegisterFunc -extern __typeof (xmlXPathRegisterFunc) xmlXPathRegisterFunc __attribute((alias("xmlXPathRegisterFunc__internal_alias"))); -#else -#ifndef xmlXPathRegisterFunc -extern __typeof (xmlXPathRegisterFunc) xmlXPathRegisterFunc__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathRegisterFunc xmlXPathRegisterFunc__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathRegisterFuncLookup -extern __typeof (xmlXPathRegisterFuncLookup) xmlXPathRegisterFuncLookup __attribute((alias("xmlXPathRegisterFuncLookup__internal_alias"))); -#else -#ifndef xmlXPathRegisterFuncLookup -extern __typeof (xmlXPathRegisterFuncLookup) xmlXPathRegisterFuncLookup__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathRegisterFuncLookup xmlXPathRegisterFuncLookup__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathRegisterFuncNS -extern __typeof (xmlXPathRegisterFuncNS) xmlXPathRegisterFuncNS __attribute((alias("xmlXPathRegisterFuncNS__internal_alias"))); -#else -#ifndef xmlXPathRegisterFuncNS -extern __typeof (xmlXPathRegisterFuncNS) xmlXPathRegisterFuncNS__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathRegisterFuncNS xmlXPathRegisterFuncNS__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathRegisterNs -extern __typeof (xmlXPathRegisterNs) xmlXPathRegisterNs __attribute((alias("xmlXPathRegisterNs__internal_alias"))); -#else -#ifndef xmlXPathRegisterNs -extern __typeof (xmlXPathRegisterNs) xmlXPathRegisterNs__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathRegisterNs xmlXPathRegisterNs__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathRegisterVariable -extern __typeof (xmlXPathRegisterVariable) xmlXPathRegisterVariable __attribute((alias("xmlXPathRegisterVariable__internal_alias"))); -#else -#ifndef xmlXPathRegisterVariable -extern __typeof (xmlXPathRegisterVariable) xmlXPathRegisterVariable__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathRegisterVariable xmlXPathRegisterVariable__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathRegisterVariableLookup -extern __typeof (xmlXPathRegisterVariableLookup) xmlXPathRegisterVariableLookup __attribute((alias("xmlXPathRegisterVariableLookup__internal_alias"))); -#else -#ifndef xmlXPathRegisterVariableLookup -extern __typeof (xmlXPathRegisterVariableLookup) xmlXPathRegisterVariableLookup__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathRegisterVariableLookup xmlXPathRegisterVariableLookup__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathRegisterVariableNS -extern __typeof (xmlXPathRegisterVariableNS) xmlXPathRegisterVariableNS __attribute((alias("xmlXPathRegisterVariableNS__internal_alias"))); -#else -#ifndef xmlXPathRegisterVariableNS -extern __typeof (xmlXPathRegisterVariableNS) xmlXPathRegisterVariableNS__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathRegisterVariableNS xmlXPathRegisterVariableNS__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathRegisteredFuncsCleanup -extern __typeof (xmlXPathRegisteredFuncsCleanup) xmlXPathRegisteredFuncsCleanup __attribute((alias("xmlXPathRegisteredFuncsCleanup__internal_alias"))); -#else -#ifndef xmlXPathRegisteredFuncsCleanup -extern __typeof (xmlXPathRegisteredFuncsCleanup) xmlXPathRegisteredFuncsCleanup__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathRegisteredFuncsCleanup xmlXPathRegisteredFuncsCleanup__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathRegisteredNsCleanup -extern __typeof (xmlXPathRegisteredNsCleanup) xmlXPathRegisteredNsCleanup __attribute((alias("xmlXPathRegisteredNsCleanup__internal_alias"))); -#else -#ifndef xmlXPathRegisteredNsCleanup -extern __typeof (xmlXPathRegisteredNsCleanup) xmlXPathRegisteredNsCleanup__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathRegisteredNsCleanup xmlXPathRegisteredNsCleanup__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathRegisteredVariablesCleanup -extern __typeof (xmlXPathRegisteredVariablesCleanup) xmlXPathRegisteredVariablesCleanup __attribute((alias("xmlXPathRegisteredVariablesCleanup__internal_alias"))); -#else -#ifndef xmlXPathRegisteredVariablesCleanup -extern __typeof (xmlXPathRegisteredVariablesCleanup) xmlXPathRegisteredVariablesCleanup__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathRegisteredVariablesCleanup xmlXPathRegisteredVariablesCleanup__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathRoot -extern __typeof (xmlXPathRoot) xmlXPathRoot __attribute((alias("xmlXPathRoot__internal_alias"))); -#else -#ifndef xmlXPathRoot -extern __typeof (xmlXPathRoot) xmlXPathRoot__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathRoot xmlXPathRoot__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathRoundFunction -extern __typeof (xmlXPathRoundFunction) xmlXPathRoundFunction __attribute((alias("xmlXPathRoundFunction__internal_alias"))); -#else -#ifndef xmlXPathRoundFunction -extern __typeof (xmlXPathRoundFunction) xmlXPathRoundFunction__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathRoundFunction xmlXPathRoundFunction__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathSetContextNode -extern __typeof (xmlXPathSetContextNode) xmlXPathSetContextNode __attribute((alias("xmlXPathSetContextNode__internal_alias"))); -#else -#ifndef xmlXPathSetContextNode -extern __typeof (xmlXPathSetContextNode) xmlXPathSetContextNode__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathSetContextNode xmlXPathSetContextNode__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathStartsWithFunction -extern __typeof (xmlXPathStartsWithFunction) xmlXPathStartsWithFunction __attribute((alias("xmlXPathStartsWithFunction__internal_alias"))); -#else -#ifndef xmlXPathStartsWithFunction -extern __typeof (xmlXPathStartsWithFunction) xmlXPathStartsWithFunction__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathStartsWithFunction xmlXPathStartsWithFunction__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathStringEvalNumber -extern __typeof (xmlXPathStringEvalNumber) xmlXPathStringEvalNumber __attribute((alias("xmlXPathStringEvalNumber__internal_alias"))); -#else -#ifndef xmlXPathStringEvalNumber -extern __typeof (xmlXPathStringEvalNumber) xmlXPathStringEvalNumber__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathStringEvalNumber xmlXPathStringEvalNumber__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathStringFunction -extern __typeof (xmlXPathStringFunction) xmlXPathStringFunction __attribute((alias("xmlXPathStringFunction__internal_alias"))); -#else -#ifndef xmlXPathStringFunction -extern __typeof (xmlXPathStringFunction) xmlXPathStringFunction__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathStringFunction xmlXPathStringFunction__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathStringLengthFunction -extern __typeof (xmlXPathStringLengthFunction) xmlXPathStringLengthFunction __attribute((alias("xmlXPathStringLengthFunction__internal_alias"))); -#else -#ifndef xmlXPathStringLengthFunction -extern __typeof (xmlXPathStringLengthFunction) xmlXPathStringLengthFunction__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathStringLengthFunction xmlXPathStringLengthFunction__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathSubValues -extern __typeof (xmlXPathSubValues) xmlXPathSubValues __attribute((alias("xmlXPathSubValues__internal_alias"))); -#else -#ifndef xmlXPathSubValues -extern __typeof (xmlXPathSubValues) xmlXPathSubValues__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathSubValues xmlXPathSubValues__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathSubstringAfterFunction -extern __typeof (xmlXPathSubstringAfterFunction) xmlXPathSubstringAfterFunction __attribute((alias("xmlXPathSubstringAfterFunction__internal_alias"))); -#else -#ifndef xmlXPathSubstringAfterFunction -extern __typeof (xmlXPathSubstringAfterFunction) xmlXPathSubstringAfterFunction__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathSubstringAfterFunction xmlXPathSubstringAfterFunction__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathSubstringBeforeFunction -extern __typeof (xmlXPathSubstringBeforeFunction) xmlXPathSubstringBeforeFunction __attribute((alias("xmlXPathSubstringBeforeFunction__internal_alias"))); -#else -#ifndef xmlXPathSubstringBeforeFunction -extern __typeof (xmlXPathSubstringBeforeFunction) xmlXPathSubstringBeforeFunction__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathSubstringBeforeFunction xmlXPathSubstringBeforeFunction__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathSubstringFunction -extern __typeof (xmlXPathSubstringFunction) xmlXPathSubstringFunction __attribute((alias("xmlXPathSubstringFunction__internal_alias"))); -#else -#ifndef xmlXPathSubstringFunction -extern __typeof (xmlXPathSubstringFunction) xmlXPathSubstringFunction__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathSubstringFunction xmlXPathSubstringFunction__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathSumFunction -extern __typeof (xmlXPathSumFunction) xmlXPathSumFunction __attribute((alias("xmlXPathSumFunction__internal_alias"))); -#else -#ifndef xmlXPathSumFunction -extern __typeof (xmlXPathSumFunction) xmlXPathSumFunction__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathSumFunction xmlXPathSumFunction__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathTrailing -extern __typeof (xmlXPathTrailing) xmlXPathTrailing __attribute((alias("xmlXPathTrailing__internal_alias"))); -#else -#ifndef xmlXPathTrailing -extern __typeof (xmlXPathTrailing) xmlXPathTrailing__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathTrailing xmlXPathTrailing__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathTrailingSorted -extern __typeof (xmlXPathTrailingSorted) xmlXPathTrailingSorted __attribute((alias("xmlXPathTrailingSorted__internal_alias"))); -#else -#ifndef xmlXPathTrailingSorted -extern __typeof (xmlXPathTrailingSorted) xmlXPathTrailingSorted__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathTrailingSorted xmlXPathTrailingSorted__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathTranslateFunction -extern __typeof (xmlXPathTranslateFunction) xmlXPathTranslateFunction __attribute((alias("xmlXPathTranslateFunction__internal_alias"))); -#else -#ifndef xmlXPathTranslateFunction -extern __typeof (xmlXPathTranslateFunction) xmlXPathTranslateFunction__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathTranslateFunction xmlXPathTranslateFunction__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathTrueFunction -extern __typeof (xmlXPathTrueFunction) xmlXPathTrueFunction __attribute((alias("xmlXPathTrueFunction__internal_alias"))); -#else -#ifndef xmlXPathTrueFunction -extern __typeof (xmlXPathTrueFunction) xmlXPathTrueFunction__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathTrueFunction xmlXPathTrueFunction__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathValueFlipSign -extern __typeof (xmlXPathValueFlipSign) xmlXPathValueFlipSign __attribute((alias("xmlXPathValueFlipSign__internal_alias"))); -#else -#ifndef xmlXPathValueFlipSign -extern __typeof (xmlXPathValueFlipSign) xmlXPathValueFlipSign__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathValueFlipSign xmlXPathValueFlipSign__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathVariableLookup -extern __typeof (xmlXPathVariableLookup) xmlXPathVariableLookup __attribute((alias("xmlXPathVariableLookup__internal_alias"))); -#else -#ifndef xmlXPathVariableLookup -extern __typeof (xmlXPathVariableLookup) xmlXPathVariableLookup__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathVariableLookup xmlXPathVariableLookup__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathVariableLookupNS -extern __typeof (xmlXPathVariableLookupNS) xmlXPathVariableLookupNS __attribute((alias("xmlXPathVariableLookupNS__internal_alias"))); -#else -#ifndef xmlXPathVariableLookupNS -extern __typeof (xmlXPathVariableLookupNS) xmlXPathVariableLookupNS__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathVariableLookupNS xmlXPathVariableLookupNS__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathWrapCString -extern __typeof (xmlXPathWrapCString) xmlXPathWrapCString __attribute((alias("xmlXPathWrapCString__internal_alias"))); -#else -#ifndef xmlXPathWrapCString -extern __typeof (xmlXPathWrapCString) xmlXPathWrapCString__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathWrapCString xmlXPathWrapCString__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathWrapExternal -extern __typeof (xmlXPathWrapExternal) xmlXPathWrapExternal __attribute((alias("xmlXPathWrapExternal__internal_alias"))); -#else -#ifndef xmlXPathWrapExternal -extern __typeof (xmlXPathWrapExternal) xmlXPathWrapExternal__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathWrapExternal xmlXPathWrapExternal__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathWrapNodeSet -extern __typeof (xmlXPathWrapNodeSet) xmlXPathWrapNodeSet __attribute((alias("xmlXPathWrapNodeSet__internal_alias"))); -#else -#ifndef xmlXPathWrapNodeSet -extern __typeof (xmlXPathWrapNodeSet) xmlXPathWrapNodeSet__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathWrapNodeSet xmlXPathWrapNodeSet__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPathWrapString -extern __typeof (xmlXPathWrapString) xmlXPathWrapString __attribute((alias("xmlXPathWrapString__internal_alias"))); -#else -#ifndef xmlXPathWrapString -extern __typeof (xmlXPathWrapString) xmlXPathWrapString__internal_alias __attribute((visibility("hidden"))); -#define xmlXPathWrapString xmlXPathWrapString__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPATH_ENABLED) -#ifdef bottom_xpath -#undef xmlXPatherror -extern __typeof (xmlXPatherror) xmlXPatherror __attribute((alias("xmlXPatherror__internal_alias"))); -#else -#ifndef xmlXPatherror -extern __typeof (xmlXPatherror) xmlXPatherror__internal_alias __attribute((visibility("hidden"))); -#define xmlXPatherror xmlXPatherror__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPTR_ENABLED) -#ifdef bottom_xpointer -#undef xmlXPtrBuildNodeList -extern __typeof (xmlXPtrBuildNodeList) xmlXPtrBuildNodeList __attribute((alias("xmlXPtrBuildNodeList__internal_alias"))); -#else -#ifndef xmlXPtrBuildNodeList -extern __typeof (xmlXPtrBuildNodeList) xmlXPtrBuildNodeList__internal_alias __attribute((visibility("hidden"))); -#define xmlXPtrBuildNodeList xmlXPtrBuildNodeList__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPTR_ENABLED) -#ifdef bottom_xpointer -#undef xmlXPtrEval -extern __typeof (xmlXPtrEval) xmlXPtrEval __attribute((alias("xmlXPtrEval__internal_alias"))); -#else -#ifndef xmlXPtrEval -extern __typeof (xmlXPtrEval) xmlXPtrEval__internal_alias __attribute((visibility("hidden"))); -#define xmlXPtrEval xmlXPtrEval__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPTR_ENABLED) -#ifdef bottom_xpointer -#undef xmlXPtrEvalRangePredicate -extern __typeof (xmlXPtrEvalRangePredicate) xmlXPtrEvalRangePredicate __attribute((alias("xmlXPtrEvalRangePredicate__internal_alias"))); -#else -#ifndef xmlXPtrEvalRangePredicate -extern __typeof (xmlXPtrEvalRangePredicate) xmlXPtrEvalRangePredicate__internal_alias __attribute((visibility("hidden"))); -#define xmlXPtrEvalRangePredicate xmlXPtrEvalRangePredicate__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPTR_ENABLED) -#ifdef bottom_xpointer -#undef xmlXPtrFreeLocationSet -extern __typeof (xmlXPtrFreeLocationSet) xmlXPtrFreeLocationSet __attribute((alias("xmlXPtrFreeLocationSet__internal_alias"))); -#else -#ifndef xmlXPtrFreeLocationSet -extern __typeof (xmlXPtrFreeLocationSet) xmlXPtrFreeLocationSet__internal_alias __attribute((visibility("hidden"))); -#define xmlXPtrFreeLocationSet xmlXPtrFreeLocationSet__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPTR_ENABLED) -#ifdef bottom_xpointer -#undef xmlXPtrLocationSetAdd -extern __typeof (xmlXPtrLocationSetAdd) xmlXPtrLocationSetAdd __attribute((alias("xmlXPtrLocationSetAdd__internal_alias"))); -#else -#ifndef xmlXPtrLocationSetAdd -extern __typeof (xmlXPtrLocationSetAdd) xmlXPtrLocationSetAdd__internal_alias __attribute((visibility("hidden"))); -#define xmlXPtrLocationSetAdd xmlXPtrLocationSetAdd__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPTR_ENABLED) -#ifdef bottom_xpointer -#undef xmlXPtrLocationSetCreate -extern __typeof (xmlXPtrLocationSetCreate) xmlXPtrLocationSetCreate __attribute((alias("xmlXPtrLocationSetCreate__internal_alias"))); -#else -#ifndef xmlXPtrLocationSetCreate -extern __typeof (xmlXPtrLocationSetCreate) xmlXPtrLocationSetCreate__internal_alias __attribute((visibility("hidden"))); -#define xmlXPtrLocationSetCreate xmlXPtrLocationSetCreate__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPTR_ENABLED) -#ifdef bottom_xpointer -#undef xmlXPtrLocationSetDel -extern __typeof (xmlXPtrLocationSetDel) xmlXPtrLocationSetDel __attribute((alias("xmlXPtrLocationSetDel__internal_alias"))); -#else -#ifndef xmlXPtrLocationSetDel -extern __typeof (xmlXPtrLocationSetDel) xmlXPtrLocationSetDel__internal_alias __attribute((visibility("hidden"))); -#define xmlXPtrLocationSetDel xmlXPtrLocationSetDel__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPTR_ENABLED) -#ifdef bottom_xpointer -#undef xmlXPtrLocationSetMerge -extern __typeof (xmlXPtrLocationSetMerge) xmlXPtrLocationSetMerge __attribute((alias("xmlXPtrLocationSetMerge__internal_alias"))); -#else -#ifndef xmlXPtrLocationSetMerge -extern __typeof (xmlXPtrLocationSetMerge) xmlXPtrLocationSetMerge__internal_alias __attribute((visibility("hidden"))); -#define xmlXPtrLocationSetMerge xmlXPtrLocationSetMerge__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPTR_ENABLED) -#ifdef bottom_xpointer -#undef xmlXPtrLocationSetRemove -extern __typeof (xmlXPtrLocationSetRemove) xmlXPtrLocationSetRemove __attribute((alias("xmlXPtrLocationSetRemove__internal_alias"))); -#else -#ifndef xmlXPtrLocationSetRemove -extern __typeof (xmlXPtrLocationSetRemove) xmlXPtrLocationSetRemove__internal_alias __attribute((visibility("hidden"))); -#define xmlXPtrLocationSetRemove xmlXPtrLocationSetRemove__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPTR_ENABLED) -#ifdef bottom_xpointer -#undef xmlXPtrNewCollapsedRange -extern __typeof (xmlXPtrNewCollapsedRange) xmlXPtrNewCollapsedRange __attribute((alias("xmlXPtrNewCollapsedRange__internal_alias"))); -#else -#ifndef xmlXPtrNewCollapsedRange -extern __typeof (xmlXPtrNewCollapsedRange) xmlXPtrNewCollapsedRange__internal_alias __attribute((visibility("hidden"))); -#define xmlXPtrNewCollapsedRange xmlXPtrNewCollapsedRange__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPTR_ENABLED) -#ifdef bottom_xpointer -#undef xmlXPtrNewContext -extern __typeof (xmlXPtrNewContext) xmlXPtrNewContext __attribute((alias("xmlXPtrNewContext__internal_alias"))); -#else -#ifndef xmlXPtrNewContext -extern __typeof (xmlXPtrNewContext) xmlXPtrNewContext__internal_alias __attribute((visibility("hidden"))); -#define xmlXPtrNewContext xmlXPtrNewContext__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPTR_ENABLED) -#ifdef bottom_xpointer -#undef xmlXPtrNewLocationSetNodeSet -extern __typeof (xmlXPtrNewLocationSetNodeSet) xmlXPtrNewLocationSetNodeSet __attribute((alias("xmlXPtrNewLocationSetNodeSet__internal_alias"))); -#else -#ifndef xmlXPtrNewLocationSetNodeSet -extern __typeof (xmlXPtrNewLocationSetNodeSet) xmlXPtrNewLocationSetNodeSet__internal_alias __attribute((visibility("hidden"))); -#define xmlXPtrNewLocationSetNodeSet xmlXPtrNewLocationSetNodeSet__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPTR_ENABLED) -#ifdef bottom_xpointer -#undef xmlXPtrNewLocationSetNodes -extern __typeof (xmlXPtrNewLocationSetNodes) xmlXPtrNewLocationSetNodes __attribute((alias("xmlXPtrNewLocationSetNodes__internal_alias"))); -#else -#ifndef xmlXPtrNewLocationSetNodes -extern __typeof (xmlXPtrNewLocationSetNodes) xmlXPtrNewLocationSetNodes__internal_alias __attribute((visibility("hidden"))); -#define xmlXPtrNewLocationSetNodes xmlXPtrNewLocationSetNodes__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPTR_ENABLED) -#ifdef bottom_xpointer -#undef xmlXPtrNewRange -extern __typeof (xmlXPtrNewRange) xmlXPtrNewRange __attribute((alias("xmlXPtrNewRange__internal_alias"))); -#else -#ifndef xmlXPtrNewRange -extern __typeof (xmlXPtrNewRange) xmlXPtrNewRange__internal_alias __attribute((visibility("hidden"))); -#define xmlXPtrNewRange xmlXPtrNewRange__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPTR_ENABLED) -#ifdef bottom_xpointer -#undef xmlXPtrNewRangeNodeObject -extern __typeof (xmlXPtrNewRangeNodeObject) xmlXPtrNewRangeNodeObject __attribute((alias("xmlXPtrNewRangeNodeObject__internal_alias"))); -#else -#ifndef xmlXPtrNewRangeNodeObject -extern __typeof (xmlXPtrNewRangeNodeObject) xmlXPtrNewRangeNodeObject__internal_alias __attribute((visibility("hidden"))); -#define xmlXPtrNewRangeNodeObject xmlXPtrNewRangeNodeObject__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPTR_ENABLED) -#ifdef bottom_xpointer -#undef xmlXPtrNewRangeNodePoint -extern __typeof (xmlXPtrNewRangeNodePoint) xmlXPtrNewRangeNodePoint __attribute((alias("xmlXPtrNewRangeNodePoint__internal_alias"))); -#else -#ifndef xmlXPtrNewRangeNodePoint -extern __typeof (xmlXPtrNewRangeNodePoint) xmlXPtrNewRangeNodePoint__internal_alias __attribute((visibility("hidden"))); -#define xmlXPtrNewRangeNodePoint xmlXPtrNewRangeNodePoint__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPTR_ENABLED) -#ifdef bottom_xpointer -#undef xmlXPtrNewRangeNodes -extern __typeof (xmlXPtrNewRangeNodes) xmlXPtrNewRangeNodes __attribute((alias("xmlXPtrNewRangeNodes__internal_alias"))); -#else -#ifndef xmlXPtrNewRangeNodes -extern __typeof (xmlXPtrNewRangeNodes) xmlXPtrNewRangeNodes__internal_alias __attribute((visibility("hidden"))); -#define xmlXPtrNewRangeNodes xmlXPtrNewRangeNodes__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPTR_ENABLED) -#ifdef bottom_xpointer -#undef xmlXPtrNewRangePointNode -extern __typeof (xmlXPtrNewRangePointNode) xmlXPtrNewRangePointNode __attribute((alias("xmlXPtrNewRangePointNode__internal_alias"))); -#else -#ifndef xmlXPtrNewRangePointNode -extern __typeof (xmlXPtrNewRangePointNode) xmlXPtrNewRangePointNode__internal_alias __attribute((visibility("hidden"))); -#define xmlXPtrNewRangePointNode xmlXPtrNewRangePointNode__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPTR_ENABLED) -#ifdef bottom_xpointer -#undef xmlXPtrNewRangePoints -extern __typeof (xmlXPtrNewRangePoints) xmlXPtrNewRangePoints __attribute((alias("xmlXPtrNewRangePoints__internal_alias"))); -#else -#ifndef xmlXPtrNewRangePoints -extern __typeof (xmlXPtrNewRangePoints) xmlXPtrNewRangePoints__internal_alias __attribute((visibility("hidden"))); -#define xmlXPtrNewRangePoints xmlXPtrNewRangePoints__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPTR_ENABLED) -#ifdef bottom_xpointer -#undef xmlXPtrRangeToFunction -extern __typeof (xmlXPtrRangeToFunction) xmlXPtrRangeToFunction __attribute((alias("xmlXPtrRangeToFunction__internal_alias"))); -#else -#ifndef xmlXPtrRangeToFunction -extern __typeof (xmlXPtrRangeToFunction) xmlXPtrRangeToFunction__internal_alias __attribute((visibility("hidden"))); -#define xmlXPtrRangeToFunction xmlXPtrRangeToFunction__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_XPTR_ENABLED) -#ifdef bottom_xpointer -#undef xmlXPtrWrapLocationSet -extern __typeof (xmlXPtrWrapLocationSet) xmlXPtrWrapLocationSet __attribute((alias("xmlXPtrWrapLocationSet__internal_alias"))); -#else -#ifndef xmlXPtrWrapLocationSet -extern __typeof (xmlXPtrWrapLocationSet) xmlXPtrWrapLocationSet__internal_alias __attribute((visibility("hidden"))); -#define xmlXPtrWrapLocationSet xmlXPtrWrapLocationSet__internal_alias -#endif -#endif -#endif - - -#endif -#endif -#endif -#endif -#endif -
diff --git a/third_party/libxml/src/encoding.c b/third_party/libxml/src/encoding.c index 3741c94..8b01b96 100644 --- a/third_party/libxml/src/encoding.c +++ b/third_party/libxml/src/encoding.c
@@ -25,18 +25,13 @@ #include <string.h> #include <limits.h> - -#ifdef HAVE_CTYPE_H #include <ctype.h> -#endif -#ifdef HAVE_STDLIB_H #include <stdlib.h> -#endif + #ifdef LIBXML_ICONV_ENABLED -#ifdef HAVE_ERRNO_H #include <errno.h> #endif -#endif + #include <libxml/encoding.h> #include <libxml/xmlmemory.h> #ifdef LIBXML_HTML_ENABLED @@ -48,6 +43,20 @@ #include "buf.h" #include "enc.h" +#ifdef LIBXML_ICU_ENABLED +#include <unicode/ucnv.h> +/* Size of pivot buffer, same as icu/source/common/ucnv.cpp CHUNK_SIZE */ +#define ICU_PIVOT_BUF_SIZE 1024 +typedef struct _uconv_t uconv_t; +struct _uconv_t { + UConverter *uconv; /* for conversion between an encoding and UTF-16 */ + UConverter *utf8; /* for conversion between UTF-8 and UTF-16 */ + UChar pivot_buf[ICU_PIVOT_BUF_SIZE]; + UChar *pivot_source; + UChar *pivot_target; +}; +#endif + static xmlCharEncodingHandlerPtr xmlUTF16LEHandler = NULL; static xmlCharEncodingHandlerPtr xmlUTF16BEHandler = NULL; @@ -2780,6 +2789,9 @@ int tofree = 0; int i, handler_in_list = 0; + /* Avoid unused variable warning if features are disabled. */ + (void) handler_in_list; + if (handler == NULL) return(-1); if (handler->name == NULL) return(-1); if (handlers != NULL) { @@ -3972,5 +3984,3 @@ #endif #endif -#define bottom_encoding -#include "elfgcchack.h"
diff --git a/third_party/libxml/src/entities.c b/third_party/libxml/src/entities.c index 8307471..147a7f7 100644 --- a/third_party/libxml/src/entities.c +++ b/third_party/libxml/src/entities.c
@@ -15,9 +15,8 @@ #include "libxml.h" #include <string.h> -#ifdef HAVE_STDLIB_H #include <stdlib.h> -#endif + #include <libxml/xmlmemory.h> #include <libxml/hash.h> #include <libxml/entities.h> @@ -86,7 +85,7 @@ * @code: the error code * @msg: the message * - * Handle an out of memory condition + * Raise an error. */ static void LIBXML_ATTR_FORMAT(2,0) xmlEntitiesErr(xmlParserErrors code, const char *msg) @@ -94,6 +93,23 @@ __xmlSimpleError(XML_FROM_TREE, code, NULL, msg, NULL); } +/** + * xmlEntitiesWarn: + * @code: the error code + * @msg: the message + * + * Raise a warning. + */ +static void LIBXML_ATTR_FORMAT(2,0) +xmlEntitiesWarn(xmlParserErrors code, const char *msg, const xmlChar *str1) +{ + __xmlRaiseError(NULL, NULL, NULL, + NULL, NULL, XML_FROM_TREE, code, + XML_ERR_WARNING, NULL, 0, + (const char *)str1, NULL, NULL, 0, 0, + msg, (const char *)str1, NULL); +} + /* * xmlFreeEntity : clean-up an entity record. */ @@ -256,9 +272,9 @@ } } if (!valid) { - xmlEntitiesErr(XML_ERR_ENTITY_PROCESSING, + xmlEntitiesWarn(XML_ERR_ENTITY_PROCESSING, "xmlAddEntity: invalid redeclaration of predefined" - " entity"); + " entity '%s'", name); return(NULL); } } @@ -1161,5 +1177,3 @@ xmlHashScan(table, xmlDumpEntityDeclScan, buf); } #endif /* LIBXML_OUTPUT_ENABLED */ -#define bottom_entities -#include "elfgcchack.h"
diff --git a/third_party/libxml/src/error.c b/third_party/libxml/src/error.c index 9ff1c2ba..5f42eadc 100644 --- a/third_party/libxml/src/error.c +++ b/third_party/libxml/src/error.c
@@ -994,5 +994,3 @@ return 0; } -#define bottom_error -#include "elfgcchack.h"
diff --git a/third_party/libxml/src/fuzz/Makefile.am b/third_party/libxml/src/fuzz/Makefile.am index 6f487137..69410bc 100644 --- a/third_party/libxml/src/fuzz/Makefile.am +++ b/third_party/libxml/src/fuzz/Makefile.am
@@ -2,11 +2,11 @@ EXTRA_PROGRAMS = genSeed html regexp schema uri xml xpath check_PROGRAMS = testFuzzer EXTRA_DIST = html.dict regexp.dict schema.dict xml.dict xpath.dict \ - seed/uri seed/regexp fuzz.h + static_seed/uri static_seed/regexp fuzz.h CLEANFILES = $(EXTRA_PROGRAMS) -AM_CPPFLAGS = -I$(top_srcdir)/include +AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include DEPENDENCIES = $(top_builddir)/libxml2.la -LDADD = $(STATIC_BINARIES) $(top_builddir)/libxml2.la $(THREAD_LIBS) $(Z_LIBS) $(LZMA_LIBS) $(ICONV_LIBS) $(M_LIBS) $(WIN32_EXTRA_LIBADD) +LDADD = $(top_builddir)/libxml2.la $(THREAD_LIBS) $(Z_LIBS) $(LZMA_LIBS) $(ICONV_LIBS) $(M_LIBS) $(WIN32_EXTRA_LIBADD) XML_MAX_LEN = 80000 # Single quotes to avoid wildcard expansion by the shell @@ -25,17 +25,17 @@ .PHONY: tests corpus clean-corpus -corpus: seed/html.stamp seed/schema.stamp seed/xml.stamp seed/xpath.stamp +corpus: seed/html.stamp seed/regexp.stamp seed/schema.stamp seed/uri.stamp \ + seed/xml.stamp seed/xpath.stamp tests: testFuzzer$(EXEEXT) corpus @echo "## Running fuzzer tests" @./testFuzzer$(EXEEXT) clean-corpus: - rm -rf seed/html.stamp seed/html - rm -rf seed/schema.stamp seed/schema - rm -rf seed/xml.stamp seed/xml - rm -rf seed/xpath.stamp seed/xpath + rm -rf seed + +clean-local: clean-corpus # Seed corpus @@ -45,7 +45,7 @@ seed/xml.stamp: genSeed$(EXEEXT) @mkdir -p seed/xml - @./genSeed$(EXEEXT) xml $(XML_SEED_CORPUS_SRC) + ./genSeed$(EXEEXT) xml $(XML_SEED_CORPUS_SRC) @touch seed/xml.stamp xml_SOURCES = xml.c fuzz.c @@ -63,7 +63,7 @@ seed/html.stamp: genSeed$(EXEEXT) @mkdir -p seed/html - @./genSeed$(EXEEXT) html '$(top_srcdir)/test/HTML/*' + ./genSeed$(EXEEXT) html '$(top_srcdir)/test/HTML/*' @touch seed/html.stamp html_SOURCES = html.c fuzz.c @@ -79,6 +79,11 @@ # Regexp fuzzer +seed/regexp.stamp: + @mkdir -p seed/regexp + cp -r $(srcdir)/static_seed/regexp seed + @touch seed/regexp.stamp + regexp_SOURCES = regexp.c fuzz.c regexp_LDFLAGS = -fsanitize=fuzzer @@ -88,10 +93,15 @@ -dict=regexp.dict \ -max_len=200 \ -timeout=5 \ - corpus/regexp $(srcdir)/seed/regexp + corpus/regexp seed/regexp # URI fuzzer +seed/uri.stamp: + @mkdir -p seed/uri + cp -r $(srcdir)/static_seed/uri seed + @touch seed/uri.stamp + uri_SOURCES = uri.c fuzz.c uri_LDFLAGS = -fsanitize=fuzzer @@ -100,13 +110,13 @@ ./uri$(EXEEXT) \ -max_len=10000 \ -timeout=2 \ - corpus/uri $(srcdir)/seed/uri + corpus/uri seed/uri # XML Schema fuzzer seed/schema.stamp: genSeed$(EXEEXT) @mkdir -p seed/schema - @./genSeed$(EXEEXT) schema '$(top_srcdir)/test/schemas/*.xsd' + ./genSeed$(EXEEXT) schema '$(top_srcdir)/test/schemas/*.xsd' @touch seed/schema.stamp schema_SOURCES = schema.c fuzz.c @@ -124,7 +134,7 @@ seed/xpath.stamp: genSeed$(EXEEXT) @mkdir -p seed/xpath - @./genSeed$(EXEEXT) xpath "$(top_builddir)/test/XPath" + ./genSeed$(EXEEXT) xpath '$(top_srcdir)/test/XPath' @touch seed/xpath.stamp xpath_SOURCES = xpath.c fuzz.c
diff --git a/third_party/libxml/src/fuzz/Makefile.in b/third_party/libxml/src/fuzz/Makefile.in index 8e724f7..95ba6a9 100644 --- a/third_party/libxml/src/fuzz/Makefile.in +++ b/third_party/libxml/src/fuzz/Makefile.in
@@ -107,11 +107,10 @@ genSeed_OBJECTS = $(am_genSeed_OBJECTS) genSeed_LDADD = $(LDADD) am__DEPENDENCIES_1 = -genSeed_DEPENDENCIES = $(am__DEPENDENCIES_1) \ - $(top_builddir)/libxml2.la $(am__DEPENDENCIES_1) \ +genSeed_DEPENDENCIES = $(top_builddir)/libxml2.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent @@ -119,68 +118,67 @@ am_html_OBJECTS = html.$(OBJEXT) fuzz.$(OBJEXT) html_OBJECTS = $(am_html_OBJECTS) html_LDADD = $(LDADD) -html_DEPENDENCIES = $(am__DEPENDENCIES_1) $(top_builddir)/libxml2.la \ +html_DEPENDENCIES = $(top_builddir)/libxml2.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) html_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(html_LDFLAGS) $(LDFLAGS) -o $@ am_regexp_OBJECTS = regexp.$(OBJEXT) fuzz.$(OBJEXT) regexp_OBJECTS = $(am_regexp_OBJECTS) regexp_LDADD = $(LDADD) -regexp_DEPENDENCIES = $(am__DEPENDENCIES_1) $(top_builddir)/libxml2.la \ +regexp_DEPENDENCIES = $(top_builddir)/libxml2.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) regexp_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(regexp_LDFLAGS) $(LDFLAGS) -o $@ am_schema_OBJECTS = schema.$(OBJEXT) fuzz.$(OBJEXT) schema_OBJECTS = $(am_schema_OBJECTS) schema_LDADD = $(LDADD) -schema_DEPENDENCIES = $(am__DEPENDENCIES_1) $(top_builddir)/libxml2.la \ +schema_DEPENDENCIES = $(top_builddir)/libxml2.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) schema_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(schema_LDFLAGS) $(LDFLAGS) -o $@ am_testFuzzer_OBJECTS = testFuzzer.$(OBJEXT) fuzz.$(OBJEXT) testFuzzer_OBJECTS = $(am_testFuzzer_OBJECTS) testFuzzer_LDADD = $(LDADD) -testFuzzer_DEPENDENCIES = $(am__DEPENDENCIES_1) \ - $(top_builddir)/libxml2.la $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) -am_uri_OBJECTS = uri.$(OBJEXT) fuzz.$(OBJEXT) -uri_OBJECTS = $(am_uri_OBJECTS) -uri_LDADD = $(LDADD) -uri_DEPENDENCIES = $(am__DEPENDENCIES_1) $(top_builddir)/libxml2.la \ +testFuzzer_DEPENDENCIES = $(top_builddir)/libxml2.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +am_uri_OBJECTS = uri.$(OBJEXT) fuzz.$(OBJEXT) +uri_OBJECTS = $(am_uri_OBJECTS) +uri_LDADD = $(LDADD) +uri_DEPENDENCIES = $(top_builddir)/libxml2.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) uri_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(uri_LDFLAGS) $(LDFLAGS) -o $@ am_xml_OBJECTS = xml.$(OBJEXT) fuzz.$(OBJEXT) xml_OBJECTS = $(am_xml_OBJECTS) xml_LDADD = $(LDADD) -xml_DEPENDENCIES = $(am__DEPENDENCIES_1) $(top_builddir)/libxml2.la \ +xml_DEPENDENCIES = $(top_builddir)/libxml2.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) xml_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(xml_LDFLAGS) $(LDFLAGS) -o $@ am_xpath_OBJECTS = xpath.$(OBJEXT) fuzz.$(OBJEXT) xpath_OBJECTS = $(am_xpath_OBJECTS) xpath_LDADD = $(LDADD) -xpath_DEPENDENCIES = $(am__DEPENDENCIES_1) $(top_builddir)/libxml2.la \ +xpath_DEPENDENCIES = $(top_builddir)/libxml2.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) xpath_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(xpath_LDFLAGS) $(LDFLAGS) -o $@ @@ -359,7 +357,6 @@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ -STATIC_BINARIES = @STATIC_BINARIES@ STRIP = @STRIP@ TAR = @TAR@ TEST_C14N = @TEST_C14N@ @@ -490,12 +487,12 @@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = -Wno-syntax EXTRA_DIST = html.dict regexp.dict schema.dict xml.dict xpath.dict \ - seed/uri seed/regexp fuzz.h + static_seed/uri static_seed/regexp fuzz.h CLEANFILES = $(EXTRA_PROGRAMS) -AM_CPPFLAGS = -I$(top_srcdir)/include +AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include DEPENDENCIES = $(top_builddir)/libxml2.la -LDADD = $(STATIC_BINARIES) $(top_builddir)/libxml2.la $(THREAD_LIBS) $(Z_LIBS) $(LZMA_LIBS) $(ICONV_LIBS) $(M_LIBS) $(WIN32_EXTRA_LIBADD) +LDADD = $(top_builddir)/libxml2.la $(THREAD_LIBS) $(Z_LIBS) $(LZMA_LIBS) $(ICONV_LIBS) $(M_LIBS) $(WIN32_EXTRA_LIBADD) XML_MAX_LEN = 80000 # Single quotes to avoid wildcard expansion by the shell XML_SEED_CORPUS_SRC = \ @@ -517,12 +514,8 @@ xml_LDFLAGS = -fsanitize=fuzzer html_SOURCES = html.c fuzz.c html_LDFLAGS = -fsanitize=fuzzer - -# Regexp fuzzer regexp_SOURCES = regexp.c fuzz.c regexp_LDFLAGS = -fsanitize=fuzzer - -# URI fuzzer uri_SOURCES = uri.c fuzz.c uri_LDFLAGS = -fsanitize=fuzzer schema_SOURCES = schema.c fuzz.c @@ -775,7 +768,7 @@ @echo "it deletes files that may require special tools to rebuild." clean: clean-am -clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ +clean-am: clean-checkPROGRAMS clean-generic clean-libtool clean-local \ mostlyclean-am distclean: distclean-am @@ -861,15 +854,15 @@ .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ - clean-checkPROGRAMS clean-generic clean-libtool cscopelist-am \ - ctags ctags-am distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ + clean-checkPROGRAMS clean-generic clean-libtool clean-local \ + cscopelist-am ctags ctags-am distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am @@ -879,23 +872,23 @@ .PHONY: tests corpus clean-corpus -corpus: seed/html.stamp seed/schema.stamp seed/xml.stamp seed/xpath.stamp +corpus: seed/html.stamp seed/regexp.stamp seed/schema.stamp seed/uri.stamp \ + seed/xml.stamp seed/xpath.stamp tests: testFuzzer$(EXEEXT) corpus @echo "## Running fuzzer tests" @./testFuzzer$(EXEEXT) clean-corpus: - rm -rf seed/html.stamp seed/html - rm -rf seed/schema.stamp seed/schema - rm -rf seed/xml.stamp seed/xml - rm -rf seed/xpath.stamp seed/xpath + rm -rf seed + +clean-local: clean-corpus # XML fuzzer seed/xml.stamp: genSeed$(EXEEXT) @mkdir -p seed/xml - @./genSeed$(EXEEXT) xml $(XML_SEED_CORPUS_SRC) + ./genSeed$(EXEEXT) xml $(XML_SEED_CORPUS_SRC) @touch seed/xml.stamp fuzz-xml: xml$(EXEEXT) seed/xml.stamp @@ -910,7 +903,7 @@ seed/html.stamp: genSeed$(EXEEXT) @mkdir -p seed/html - @./genSeed$(EXEEXT) html '$(top_srcdir)/test/HTML/*' + ./genSeed$(EXEEXT) html '$(top_srcdir)/test/HTML/*' @touch seed/html.stamp fuzz-html: html$(EXEEXT) seed/html.stamp @@ -921,26 +914,40 @@ -timeout=10 \ corpus/html seed/html +# Regexp fuzzer + +seed/regexp.stamp: + @mkdir -p seed/regexp + cp -r $(srcdir)/static_seed/regexp seed + @touch seed/regexp.stamp + fuzz-regexp: regexp$(EXEEXT) @mkdir -p corpus/regexp ./regexp$(EXEEXT) \ -dict=regexp.dict \ -max_len=200 \ -timeout=5 \ - corpus/regexp $(srcdir)/seed/regexp + corpus/regexp seed/regexp + +# URI fuzzer + +seed/uri.stamp: + @mkdir -p seed/uri + cp -r $(srcdir)/static_seed/uri seed + @touch seed/uri.stamp fuzz-uri: uri$(EXEEXT) @mkdir -p corpus/uri ./uri$(EXEEXT) \ -max_len=10000 \ -timeout=2 \ - corpus/uri $(srcdir)/seed/uri + corpus/uri seed/uri # XML Schema fuzzer seed/schema.stamp: genSeed$(EXEEXT) @mkdir -p seed/schema - @./genSeed$(EXEEXT) schema '$(top_srcdir)/test/schemas/*.xsd' + ./genSeed$(EXEEXT) schema '$(top_srcdir)/test/schemas/*.xsd' @touch seed/schema.stamp fuzz-schema: schema$(EXEEXT) seed/schema.stamp @@ -955,7 +962,7 @@ seed/xpath.stamp: genSeed$(EXEEXT) @mkdir -p seed/xpath - @./genSeed$(EXEEXT) xpath "$(top_builddir)/test/XPath" + ./genSeed$(EXEEXT) xpath '$(top_srcdir)/test/XPath' @touch seed/xpath.stamp fuzz-xpath: xpath$(EXEEXT) seed/xpath.stamp
diff --git a/third_party/libxml/src/fuzz/fuzz.c b/third_party/libxml/src/fuzz/fuzz.c index 212136ac..be2f065 100644 --- a/third_party/libxml/src/fuzz/fuzz.c +++ b/third_party/libxml/src/fuzz/fuzz.c
@@ -185,6 +185,7 @@ return(out); } + *size = 0; return(NULL); }
diff --git a/third_party/libxml/src/fuzz/seed/regexp/branch-1 b/third_party/libxml/src/fuzz/static_seed/regexp/branch-1 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/branch-1 rename to third_party/libxml/src/fuzz/static_seed/regexp/branch-1 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/branch-10 b/third_party/libxml/src/fuzz/static_seed/regexp/branch-10 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/branch-10 rename to third_party/libxml/src/fuzz/static_seed/regexp/branch-10 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/branch-11 b/third_party/libxml/src/fuzz/static_seed/regexp/branch-11 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/branch-11 rename to third_party/libxml/src/fuzz/static_seed/regexp/branch-11 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/branch-12 b/third_party/libxml/src/fuzz/static_seed/regexp/branch-12 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/branch-12 rename to third_party/libxml/src/fuzz/static_seed/regexp/branch-12 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/branch-13 b/third_party/libxml/src/fuzz/static_seed/regexp/branch-13 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/branch-13 rename to third_party/libxml/src/fuzz/static_seed/regexp/branch-13 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/branch-2 b/third_party/libxml/src/fuzz/static_seed/regexp/branch-2 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/branch-2 rename to third_party/libxml/src/fuzz/static_seed/regexp/branch-2 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/branch-3 b/third_party/libxml/src/fuzz/static_seed/regexp/branch-3 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/branch-3 rename to third_party/libxml/src/fuzz/static_seed/regexp/branch-3 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/branch-4 b/third_party/libxml/src/fuzz/static_seed/regexp/branch-4 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/branch-4 rename to third_party/libxml/src/fuzz/static_seed/regexp/branch-4 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/branch-5 b/third_party/libxml/src/fuzz/static_seed/regexp/branch-5 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/branch-5 rename to third_party/libxml/src/fuzz/static_seed/regexp/branch-5 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/branch-6 b/third_party/libxml/src/fuzz/static_seed/regexp/branch-6 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/branch-6 rename to third_party/libxml/src/fuzz/static_seed/regexp/branch-6 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/branch-7 b/third_party/libxml/src/fuzz/static_seed/regexp/branch-7 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/branch-7 rename to third_party/libxml/src/fuzz/static_seed/regexp/branch-7 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/branch-8 b/third_party/libxml/src/fuzz/static_seed/regexp/branch-8 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/branch-8 rename to third_party/libxml/src/fuzz/static_seed/regexp/branch-8 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/branch-9 b/third_party/libxml/src/fuzz/static_seed/regexp/branch-9 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/branch-9 rename to third_party/libxml/src/fuzz/static_seed/regexp/branch-9 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/bug316338-1 b/third_party/libxml/src/fuzz/static_seed/regexp/bug316338-1 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/bug316338-1 rename to third_party/libxml/src/fuzz/static_seed/regexp/bug316338-1 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/bug316338-10 b/third_party/libxml/src/fuzz/static_seed/regexp/bug316338-10 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/bug316338-10 rename to third_party/libxml/src/fuzz/static_seed/regexp/bug316338-10 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/bug316338-11 b/third_party/libxml/src/fuzz/static_seed/regexp/bug316338-11 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/bug316338-11 rename to third_party/libxml/src/fuzz/static_seed/regexp/bug316338-11 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/bug316338-12 b/third_party/libxml/src/fuzz/static_seed/regexp/bug316338-12 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/bug316338-12 rename to third_party/libxml/src/fuzz/static_seed/regexp/bug316338-12 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/bug316338-13 b/third_party/libxml/src/fuzz/static_seed/regexp/bug316338-13 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/bug316338-13 rename to third_party/libxml/src/fuzz/static_seed/regexp/bug316338-13 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/bug316338-14 b/third_party/libxml/src/fuzz/static_seed/regexp/bug316338-14 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/bug316338-14 rename to third_party/libxml/src/fuzz/static_seed/regexp/bug316338-14 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/bug316338-15 b/third_party/libxml/src/fuzz/static_seed/regexp/bug316338-15 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/bug316338-15 rename to third_party/libxml/src/fuzz/static_seed/regexp/bug316338-15 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/bug316338-16 b/third_party/libxml/src/fuzz/static_seed/regexp/bug316338-16 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/bug316338-16 rename to third_party/libxml/src/fuzz/static_seed/regexp/bug316338-16 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/bug316338-2 b/third_party/libxml/src/fuzz/static_seed/regexp/bug316338-2 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/bug316338-2 rename to third_party/libxml/src/fuzz/static_seed/regexp/bug316338-2 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/bug316338-3 b/third_party/libxml/src/fuzz/static_seed/regexp/bug316338-3 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/bug316338-3 rename to third_party/libxml/src/fuzz/static_seed/regexp/bug316338-3 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/bug316338-4 b/third_party/libxml/src/fuzz/static_seed/regexp/bug316338-4 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/bug316338-4 rename to third_party/libxml/src/fuzz/static_seed/regexp/bug316338-4 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/bug316338-5 b/third_party/libxml/src/fuzz/static_seed/regexp/bug316338-5 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/bug316338-5 rename to third_party/libxml/src/fuzz/static_seed/regexp/bug316338-5 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/bug316338-6 b/third_party/libxml/src/fuzz/static_seed/regexp/bug316338-6 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/bug316338-6 rename to third_party/libxml/src/fuzz/static_seed/regexp/bug316338-6 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/bug316338-7 b/third_party/libxml/src/fuzz/static_seed/regexp/bug316338-7 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/bug316338-7 rename to third_party/libxml/src/fuzz/static_seed/regexp/bug316338-7 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/bug316338-8 b/third_party/libxml/src/fuzz/static_seed/regexp/bug316338-8 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/bug316338-8 rename to third_party/libxml/src/fuzz/static_seed/regexp/bug316338-8 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/bug316338-9 b/third_party/libxml/src/fuzz/static_seed/regexp/bug316338-9 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/bug316338-9 rename to third_party/libxml/src/fuzz/static_seed/regexp/bug316338-9 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/bug420596-1 b/third_party/libxml/src/fuzz/static_seed/regexp/bug420596-1 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/bug420596-1 rename to third_party/libxml/src/fuzz/static_seed/regexp/bug420596-1 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/bug420596-2 b/third_party/libxml/src/fuzz/static_seed/regexp/bug420596-2 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/bug420596-2 rename to third_party/libxml/src/fuzz/static_seed/regexp/bug420596-2 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/bug420596-3 b/third_party/libxml/src/fuzz/static_seed/regexp/bug420596-3 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/bug420596-3 rename to third_party/libxml/src/fuzz/static_seed/regexp/bug420596-3 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/bug420596-4 b/third_party/libxml/src/fuzz/static_seed/regexp/bug420596-4 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/bug420596-4 rename to third_party/libxml/src/fuzz/static_seed/regexp/bug420596-4 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/bug420596-5 b/third_party/libxml/src/fuzz/static_seed/regexp/bug420596-5 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/bug420596-5 rename to third_party/libxml/src/fuzz/static_seed/regexp/bug420596-5 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/bug420596-6 b/third_party/libxml/src/fuzz/static_seed/regexp/bug420596-6 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/bug420596-6 rename to third_party/libxml/src/fuzz/static_seed/regexp/bug420596-6 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/bug420596-7 b/third_party/libxml/src/fuzz/static_seed/regexp/bug420596-7 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/bug420596-7 rename to third_party/libxml/src/fuzz/static_seed/regexp/bug420596-7 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/bug420596-8 b/third_party/libxml/src/fuzz/static_seed/regexp/bug420596-8 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/bug420596-8 rename to third_party/libxml/src/fuzz/static_seed/regexp/bug420596-8 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/content-1 b/third_party/libxml/src/fuzz/static_seed/regexp/content-1 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/content-1 rename to third_party/libxml/src/fuzz/static_seed/regexp/content-1 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/content-10 b/third_party/libxml/src/fuzz/static_seed/regexp/content-10 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/content-10 rename to third_party/libxml/src/fuzz/static_seed/regexp/content-10 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/content-2 b/third_party/libxml/src/fuzz/static_seed/regexp/content-2 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/content-2 rename to third_party/libxml/src/fuzz/static_seed/regexp/content-2 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/content-3 b/third_party/libxml/src/fuzz/static_seed/regexp/content-3 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/content-3 rename to third_party/libxml/src/fuzz/static_seed/regexp/content-3 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/content-4 b/third_party/libxml/src/fuzz/static_seed/regexp/content-4 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/content-4 rename to third_party/libxml/src/fuzz/static_seed/regexp/content-4 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/content-5 b/third_party/libxml/src/fuzz/static_seed/regexp/content-5 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/content-5 rename to third_party/libxml/src/fuzz/static_seed/regexp/content-5 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/content-6 b/third_party/libxml/src/fuzz/static_seed/regexp/content-6 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/content-6 rename to third_party/libxml/src/fuzz/static_seed/regexp/content-6 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/content-7 b/third_party/libxml/src/fuzz/static_seed/regexp/content-7 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/content-7 rename to third_party/libxml/src/fuzz/static_seed/regexp/content-7 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/content-8 b/third_party/libxml/src/fuzz/static_seed/regexp/content-8 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/content-8 rename to third_party/libxml/src/fuzz/static_seed/regexp/content-8 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/content-9 b/third_party/libxml/src/fuzz/static_seed/regexp/content-9 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/content-9 rename to third_party/libxml/src/fuzz/static_seed/regexp/content-9 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/hard-1 b/third_party/libxml/src/fuzz/static_seed/regexp/hard-1 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/hard-1 rename to third_party/libxml/src/fuzz/static_seed/regexp/hard-1 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/hard-10 b/third_party/libxml/src/fuzz/static_seed/regexp/hard-10 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/hard-10 rename to third_party/libxml/src/fuzz/static_seed/regexp/hard-10 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/hard-2 b/third_party/libxml/src/fuzz/static_seed/regexp/hard-2 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/hard-2 rename to third_party/libxml/src/fuzz/static_seed/regexp/hard-2 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/hard-3 b/third_party/libxml/src/fuzz/static_seed/regexp/hard-3 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/hard-3 rename to third_party/libxml/src/fuzz/static_seed/regexp/hard-3 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/hard-4 b/third_party/libxml/src/fuzz/static_seed/regexp/hard-4 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/hard-4 rename to third_party/libxml/src/fuzz/static_seed/regexp/hard-4 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/hard-5 b/third_party/libxml/src/fuzz/static_seed/regexp/hard-5 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/hard-5 rename to third_party/libxml/src/fuzz/static_seed/regexp/hard-5 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/hard-6 b/third_party/libxml/src/fuzz/static_seed/regexp/hard-6 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/hard-6 rename to third_party/libxml/src/fuzz/static_seed/regexp/hard-6 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/hard-7 b/third_party/libxml/src/fuzz/static_seed/regexp/hard-7 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/hard-7 rename to third_party/libxml/src/fuzz/static_seed/regexp/hard-7 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/hard-8 b/third_party/libxml/src/fuzz/static_seed/regexp/hard-8 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/hard-8 rename to third_party/libxml/src/fuzz/static_seed/regexp/hard-8 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/hard-9 b/third_party/libxml/src/fuzz/static_seed/regexp/hard-9 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/hard-9 rename to third_party/libxml/src/fuzz/static_seed/regexp/hard-9 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/ncname-1 b/third_party/libxml/src/fuzz/static_seed/regexp/ncname-1 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/ncname-1 rename to third_party/libxml/src/fuzz/static_seed/regexp/ncname-1 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/ncname-2 b/third_party/libxml/src/fuzz/static_seed/regexp/ncname-2 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/ncname-2 rename to third_party/libxml/src/fuzz/static_seed/regexp/ncname-2 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/ncname-3 b/third_party/libxml/src/fuzz/static_seed/regexp/ncname-3 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/ncname-3 rename to third_party/libxml/src/fuzz/static_seed/regexp/ncname-3 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/ncname-4 b/third_party/libxml/src/fuzz/static_seed/regexp/ncname-4 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/ncname-4 rename to third_party/libxml/src/fuzz/static_seed/regexp/ncname-4 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/ncname-5 b/third_party/libxml/src/fuzz/static_seed/regexp/ncname-5 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/ncname-5 rename to third_party/libxml/src/fuzz/static_seed/regexp/ncname-5 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/ranges-1 b/third_party/libxml/src/fuzz/static_seed/regexp/ranges-1 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/ranges-1 rename to third_party/libxml/src/fuzz/static_seed/regexp/ranges-1 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/ranges-10 b/third_party/libxml/src/fuzz/static_seed/regexp/ranges-10 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/ranges-10 rename to third_party/libxml/src/fuzz/static_seed/regexp/ranges-10 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/ranges-11 b/third_party/libxml/src/fuzz/static_seed/regexp/ranges-11 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/ranges-11 rename to third_party/libxml/src/fuzz/static_seed/regexp/ranges-11 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/ranges-12 b/third_party/libxml/src/fuzz/static_seed/regexp/ranges-12 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/ranges-12 rename to third_party/libxml/src/fuzz/static_seed/regexp/ranges-12 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/ranges-2 b/third_party/libxml/src/fuzz/static_seed/regexp/ranges-2 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/ranges-2 rename to third_party/libxml/src/fuzz/static_seed/regexp/ranges-2 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/ranges-3 b/third_party/libxml/src/fuzz/static_seed/regexp/ranges-3 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/ranges-3 rename to third_party/libxml/src/fuzz/static_seed/regexp/ranges-3 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/ranges-4 b/third_party/libxml/src/fuzz/static_seed/regexp/ranges-4 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/ranges-4 rename to third_party/libxml/src/fuzz/static_seed/regexp/ranges-4 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/ranges-5 b/third_party/libxml/src/fuzz/static_seed/regexp/ranges-5 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/ranges-5 rename to third_party/libxml/src/fuzz/static_seed/regexp/ranges-5 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/ranges-6 b/third_party/libxml/src/fuzz/static_seed/regexp/ranges-6 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/ranges-6 rename to third_party/libxml/src/fuzz/static_seed/regexp/ranges-6 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/ranges-7 b/third_party/libxml/src/fuzz/static_seed/regexp/ranges-7 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/ranges-7 rename to third_party/libxml/src/fuzz/static_seed/regexp/ranges-7 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/ranges-8 b/third_party/libxml/src/fuzz/static_seed/regexp/ranges-8 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/ranges-8 rename to third_party/libxml/src/fuzz/static_seed/regexp/ranges-8 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/ranges-9 b/third_party/libxml/src/fuzz/static_seed/regexp/ranges-9 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/ranges-9 rename to third_party/libxml/src/fuzz/static_seed/regexp/ranges-9 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/ranges2-1 b/third_party/libxml/src/fuzz/static_seed/regexp/ranges2-1 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/ranges2-1 rename to third_party/libxml/src/fuzz/static_seed/regexp/ranges2-1 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/ranges2-10 b/third_party/libxml/src/fuzz/static_seed/regexp/ranges2-10 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/ranges2-10 rename to third_party/libxml/src/fuzz/static_seed/regexp/ranges2-10 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/ranges2-11 b/third_party/libxml/src/fuzz/static_seed/regexp/ranges2-11 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/ranges2-11 rename to third_party/libxml/src/fuzz/static_seed/regexp/ranges2-11 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/ranges2-12 b/third_party/libxml/src/fuzz/static_seed/regexp/ranges2-12 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/ranges2-12 rename to third_party/libxml/src/fuzz/static_seed/regexp/ranges2-12 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/ranges2-2 b/third_party/libxml/src/fuzz/static_seed/regexp/ranges2-2 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/ranges2-2 rename to third_party/libxml/src/fuzz/static_seed/regexp/ranges2-2 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/ranges2-3 b/third_party/libxml/src/fuzz/static_seed/regexp/ranges2-3 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/ranges2-3 rename to third_party/libxml/src/fuzz/static_seed/regexp/ranges2-3 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/ranges2-4 b/third_party/libxml/src/fuzz/static_seed/regexp/ranges2-4 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/ranges2-4 rename to third_party/libxml/src/fuzz/static_seed/regexp/ranges2-4 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/ranges2-5 b/third_party/libxml/src/fuzz/static_seed/regexp/ranges2-5 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/ranges2-5 rename to third_party/libxml/src/fuzz/static_seed/regexp/ranges2-5 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/ranges2-6 b/third_party/libxml/src/fuzz/static_seed/regexp/ranges2-6 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/ranges2-6 rename to third_party/libxml/src/fuzz/static_seed/regexp/ranges2-6 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/ranges2-7 b/third_party/libxml/src/fuzz/static_seed/regexp/ranges2-7 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/ranges2-7 rename to third_party/libxml/src/fuzz/static_seed/regexp/ranges2-7 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/ranges2-8 b/third_party/libxml/src/fuzz/static_seed/regexp/ranges2-8 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/ranges2-8 rename to third_party/libxml/src/fuzz/static_seed/regexp/ranges2-8 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/ranges2-9 b/third_party/libxml/src/fuzz/static_seed/regexp/ranges2-9 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/ranges2-9 rename to third_party/libxml/src/fuzz/static_seed/regexp/ranges2-9 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/xpath-1 b/third_party/libxml/src/fuzz/static_seed/regexp/xpath-1 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/xpath-1 rename to third_party/libxml/src/fuzz/static_seed/regexp/xpath-1 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/xpath-10 b/third_party/libxml/src/fuzz/static_seed/regexp/xpath-10 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/xpath-10 rename to third_party/libxml/src/fuzz/static_seed/regexp/xpath-10 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/xpath-11 b/third_party/libxml/src/fuzz/static_seed/regexp/xpath-11 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/xpath-11 rename to third_party/libxml/src/fuzz/static_seed/regexp/xpath-11 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/xpath-12 b/third_party/libxml/src/fuzz/static_seed/regexp/xpath-12 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/xpath-12 rename to third_party/libxml/src/fuzz/static_seed/regexp/xpath-12 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/xpath-13 b/third_party/libxml/src/fuzz/static_seed/regexp/xpath-13 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/xpath-13 rename to third_party/libxml/src/fuzz/static_seed/regexp/xpath-13 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/xpath-14 b/third_party/libxml/src/fuzz/static_seed/regexp/xpath-14 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/xpath-14 rename to third_party/libxml/src/fuzz/static_seed/regexp/xpath-14 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/xpath-15 b/third_party/libxml/src/fuzz/static_seed/regexp/xpath-15 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/xpath-15 rename to third_party/libxml/src/fuzz/static_seed/regexp/xpath-15 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/xpath-16 b/third_party/libxml/src/fuzz/static_seed/regexp/xpath-16 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/xpath-16 rename to third_party/libxml/src/fuzz/static_seed/regexp/xpath-16 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/xpath-17 b/third_party/libxml/src/fuzz/static_seed/regexp/xpath-17 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/xpath-17 rename to third_party/libxml/src/fuzz/static_seed/regexp/xpath-17 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/xpath-18 b/third_party/libxml/src/fuzz/static_seed/regexp/xpath-18 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/xpath-18 rename to third_party/libxml/src/fuzz/static_seed/regexp/xpath-18 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/xpath-19 b/third_party/libxml/src/fuzz/static_seed/regexp/xpath-19 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/xpath-19 rename to third_party/libxml/src/fuzz/static_seed/regexp/xpath-19 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/xpath-2 b/third_party/libxml/src/fuzz/static_seed/regexp/xpath-2 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/xpath-2 rename to third_party/libxml/src/fuzz/static_seed/regexp/xpath-2 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/xpath-20 b/third_party/libxml/src/fuzz/static_seed/regexp/xpath-20 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/xpath-20 rename to third_party/libxml/src/fuzz/static_seed/regexp/xpath-20 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/xpath-21 b/third_party/libxml/src/fuzz/static_seed/regexp/xpath-21 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/xpath-21 rename to third_party/libxml/src/fuzz/static_seed/regexp/xpath-21 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/xpath-22 b/third_party/libxml/src/fuzz/static_seed/regexp/xpath-22 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/xpath-22 rename to third_party/libxml/src/fuzz/static_seed/regexp/xpath-22 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/xpath-23 b/third_party/libxml/src/fuzz/static_seed/regexp/xpath-23 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/xpath-23 rename to third_party/libxml/src/fuzz/static_seed/regexp/xpath-23 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/xpath-24 b/third_party/libxml/src/fuzz/static_seed/regexp/xpath-24 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/xpath-24 rename to third_party/libxml/src/fuzz/static_seed/regexp/xpath-24 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/xpath-25 b/third_party/libxml/src/fuzz/static_seed/regexp/xpath-25 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/xpath-25 rename to third_party/libxml/src/fuzz/static_seed/regexp/xpath-25 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/xpath-26 b/third_party/libxml/src/fuzz/static_seed/regexp/xpath-26 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/xpath-26 rename to third_party/libxml/src/fuzz/static_seed/regexp/xpath-26 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/xpath-27 b/third_party/libxml/src/fuzz/static_seed/regexp/xpath-27 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/xpath-27 rename to third_party/libxml/src/fuzz/static_seed/regexp/xpath-27 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/xpath-28 b/third_party/libxml/src/fuzz/static_seed/regexp/xpath-28 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/xpath-28 rename to third_party/libxml/src/fuzz/static_seed/regexp/xpath-28 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/xpath-29 b/third_party/libxml/src/fuzz/static_seed/regexp/xpath-29 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/xpath-29 rename to third_party/libxml/src/fuzz/static_seed/regexp/xpath-29 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/xpath-3 b/third_party/libxml/src/fuzz/static_seed/regexp/xpath-3 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/xpath-3 rename to third_party/libxml/src/fuzz/static_seed/regexp/xpath-3 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/xpath-30 b/third_party/libxml/src/fuzz/static_seed/regexp/xpath-30 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/xpath-30 rename to third_party/libxml/src/fuzz/static_seed/regexp/xpath-30 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/xpath-31 b/third_party/libxml/src/fuzz/static_seed/regexp/xpath-31 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/xpath-31 rename to third_party/libxml/src/fuzz/static_seed/regexp/xpath-31 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/xpath-32 b/third_party/libxml/src/fuzz/static_seed/regexp/xpath-32 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/xpath-32 rename to third_party/libxml/src/fuzz/static_seed/regexp/xpath-32 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/xpath-33 b/third_party/libxml/src/fuzz/static_seed/regexp/xpath-33 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/xpath-33 rename to third_party/libxml/src/fuzz/static_seed/regexp/xpath-33 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/xpath-34 b/third_party/libxml/src/fuzz/static_seed/regexp/xpath-34 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/xpath-34 rename to third_party/libxml/src/fuzz/static_seed/regexp/xpath-34 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/xpath-35 b/third_party/libxml/src/fuzz/static_seed/regexp/xpath-35 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/xpath-35 rename to third_party/libxml/src/fuzz/static_seed/regexp/xpath-35 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/xpath-4 b/third_party/libxml/src/fuzz/static_seed/regexp/xpath-4 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/xpath-4 rename to third_party/libxml/src/fuzz/static_seed/regexp/xpath-4 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/xpath-5 b/third_party/libxml/src/fuzz/static_seed/regexp/xpath-5 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/xpath-5 rename to third_party/libxml/src/fuzz/static_seed/regexp/xpath-5 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/xpath-6 b/third_party/libxml/src/fuzz/static_seed/regexp/xpath-6 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/xpath-6 rename to third_party/libxml/src/fuzz/static_seed/regexp/xpath-6 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/xpath-7 b/third_party/libxml/src/fuzz/static_seed/regexp/xpath-7 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/xpath-7 rename to third_party/libxml/src/fuzz/static_seed/regexp/xpath-7 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/xpath-8 b/third_party/libxml/src/fuzz/static_seed/regexp/xpath-8 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/xpath-8 rename to third_party/libxml/src/fuzz/static_seed/regexp/xpath-8 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/regexp/xpath-9 b/third_party/libxml/src/fuzz/static_seed/regexp/xpath-9 similarity index 100% rename from third_party/libxml/src/fuzz/seed/regexp/xpath-9 rename to third_party/libxml/src/fuzz/static_seed/regexp/xpath-9 Binary files differ
diff --git a/third_party/libxml/src/fuzz/seed/uri/dot b/third_party/libxml/src/fuzz/static_seed/uri/dot similarity index 100% rename from third_party/libxml/src/fuzz/seed/uri/dot rename to third_party/libxml/src/fuzz/static_seed/uri/dot
diff --git a/third_party/libxml/src/fuzz/seed/uri/full b/third_party/libxml/src/fuzz/static_seed/uri/full similarity index 100% rename from third_party/libxml/src/fuzz/seed/uri/full rename to third_party/libxml/src/fuzz/static_seed/uri/full Binary files differ
diff --git a/third_party/libxml/src/genUnicode.py b/third_party/libxml/src/genUnicode.py index 4487eeb..f431201 100755 --- a/third_party/libxml/src/genUnicode.py +++ b/third_party/libxml/src/genUnicode.py
@@ -459,8 +459,6 @@ return (func(code)); } -#define bottom_xmlunicode -#include "elfgcchack.h" #endif /* LIBXML_UNICODE_ENABLED */ """)
diff --git a/third_party/libxml/src/gentest.py b/third_party/libxml/src/gentest.py index b6cd866..88f88f18 100755 --- a/third_party/libxml/src/gentest.py +++ b/third_party/libxml/src/gentest.py
@@ -58,11 +58,6 @@ "xmlSAX2StartElement" : "LIBXML_SAX1_ENABLED", "xmlSAXDefaultVersion" : "LIBXML_SAX1_ENABLED", "UTF8Toisolat1" : "LIBXML_OUTPUT_ENABLED", - "xmlCleanupPredefinedEntities": "LIBXML_LEGACY_ENABLED", - "xmlInitializePredefinedEntities": "LIBXML_LEGACY_ENABLED", - "xmlSetFeature": "LIBXML_LEGACY_ENABLED", - "xmlGetFeature": "LIBXML_LEGACY_ENABLED", - "xmlGetFeaturesList": "LIBXML_LEGACY_ENABLED", "xmlIOParseDTD": "LIBXML_VALID_ENABLED", "xmlParseDTD": "LIBXML_VALID_ENABLED", "xmlParseDoc": "LIBXML_SAX1_ENABLED", @@ -161,6 +156,9 @@ "xmlParseXMLDecl", "xmlParseTextDecl", "xmlParseMisc", "xmlParseExternalSubset", "xmlParserHandlePEReference", "xmlSkipBlankChars", +# Legacy +"xmlCleanupPredefinedEntities", "xmlInitializePredefinedEntities", +"xmlSetFeature", "xmlGetFeature", "xmlGetFeaturesList", ] #
diff --git a/third_party/libxml/src/globals.c b/third_party/libxml/src/globals.c index 0c0bdb44..4aec812 100644 --- a/third_party/libxml/src/globals.c +++ b/third_party/libxml/src/globals.c
@@ -14,9 +14,7 @@ #define IN_LIBXML #include "libxml.h" -#ifdef HAVE_STDLIB_H #include <stdlib.h> -#endif #include <string.h> #include <libxml/globals.h> @@ -50,20 +48,6 @@ xmlThrDefMutex = xmlNewMutex(); } -/** - * xmlCleanupGlobals: - * - * Additional cleanup for multi-threading - */ -void xmlCleanupGlobals(void) -{ - if (xmlThrDefMutex != NULL) { - xmlFreeMutex(xmlThrDefMutex); - xmlThrDefMutex = NULL; - } - __xmlGlobalInitMutexDestroy(); -} - /************************************************************************ * * * All the user accessible global variables of the library * @@ -1122,5 +1106,19 @@ return (&xmlGetGlobalState()->xmlOutputBufferCreateFilenameValue); } -#define bottom_globals -#include "elfgcchack.h" +/** + * xmlCleanupGlobals: + * + * Additional cleanup for multi-threading + */ +void xmlCleanupGlobals(void) +{ + xmlResetError(&xmlLastError); + + if (xmlThrDefMutex != NULL) { + xmlFreeMutex(xmlThrDefMutex); + xmlThrDefMutex = NULL; + } + __xmlGlobalInitMutexDestroy(); +} +
diff --git a/third_party/libxml/src/hash.c b/third_party/libxml/src/hash.c index 7b82d2f..894174f 100644 --- a/third_party/libxml/src/hash.c +++ b/third_party/libxml/src/hash.c
@@ -21,20 +21,15 @@ #include "libxml.h" #include <string.h> -#ifdef HAVE_STDLIB_H #include <stdlib.h> -#endif -#ifdef HAVE_TIME_H #include <time.h> -#endif /* * Following http://www.ocert.org/advisories/ocert-2011-003.html * it seems that having hash randomization might be a good idea * when using XML with untrusted data */ -#if defined(HAVE_RAND) && defined(HAVE_SRAND) && defined(HAVE_TIME) && \ - !defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) +#if !defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) #define HASH_RANDOMIZATION #endif @@ -1142,5 +1137,3 @@ } } -#define bottom_hash -#include "elfgcchack.h"
diff --git a/third_party/libxml/src/include/libxml/DOCBparser.h b/third_party/libxml/src/include/libxml/DOCBparser.h index 9394fa71..748e1ab35d 100644 --- a/third_party/libxml/src/include/libxml/DOCBparser.h +++ b/third_party/libxml/src/include/libxml/DOCBparser.h
@@ -41,25 +41,30 @@ /* * There is only few public functions. */ +XML_DEPRECATED XMLPUBFUN int XMLCALL docbEncodeEntities(unsigned char *out, int *outlen, const unsigned char *in, int *inlen, int quoteChar); +XML_DEPRECATED XMLPUBFUN docbDocPtr XMLCALL docbSAXParseDoc (xmlChar *cur, const char *encoding, docbSAXHandlerPtr sax, void *userData); +XML_DEPRECATED XMLPUBFUN docbDocPtr XMLCALL docbParseDoc (xmlChar *cur, const char *encoding); +XML_DEPRECATED XMLPUBFUN docbDocPtr XMLCALL docbSAXParseFile (const char *filename, const char *encoding, docbSAXHandlerPtr sax, void *userData); +XML_DEPRECATED XMLPUBFUN docbDocPtr XMLCALL docbParseFile (const char *filename, const char *encoding); @@ -67,8 +72,10 @@ /** * Interfaces for the Push mode. */ +XML_DEPRECATED XMLPUBFUN void XMLCALL docbFreeParserCtxt (docbParserCtxtPtr ctxt); +XML_DEPRECATED XMLPUBFUN docbParserCtxtPtr XMLCALL docbCreatePushParserCtxt(docbSAXHandlerPtr sax, void *user_data, @@ -76,14 +83,17 @@ int size, const char *filename, xmlCharEncoding enc); +XML_DEPRECATED XMLPUBFUN int XMLCALL docbParseChunk (docbParserCtxtPtr ctxt, const char *chunk, int size, int terminate); +XML_DEPRECATED XMLPUBFUN docbParserCtxtPtr XMLCALL docbCreateFileParserCtxt(const char *filename, const char *encoding); +XML_DEPRECATED XMLPUBFUN int XMLCALL docbParseDocument (docbParserCtxtPtr ctxt);
diff --git a/third_party/libxml/src/include/libxml/Makefile.am b/third_party/libxml/src/include/libxml/Makefile.am index 328c1800..cf9297a 100644 --- a/third_party/libxml/src/include/libxml/Makefile.am +++ b/third_party/libxml/src/include/libxml/Makefile.am
@@ -51,4 +51,4 @@ xmlsave.h \ schematron.h -EXTRA_DIST = xmlversion.h.in xmlwin32version.h.in +EXTRA_DIST = xmlversion.h.in
diff --git a/third_party/libxml/src/include/libxml/SAX.h b/third_party/libxml/src/include/libxml/SAX.h index 20093ce..61876d1 100644 --- a/third_party/libxml/src/include/libxml/SAX.h +++ b/third_party/libxml/src/include/libxml/SAX.h
@@ -23,47 +23,61 @@ #ifdef __cplusplus extern "C" { #endif +XML_DEPRECATED XMLPUBFUN const xmlChar * XMLCALL getPublicId (void *ctx); +XML_DEPRECATED XMLPUBFUN const xmlChar * XMLCALL getSystemId (void *ctx); +XML_DEPRECATED XMLPUBFUN void XMLCALL setDocumentLocator (void *ctx, xmlSAXLocatorPtr loc); +XML_DEPRECATED XMLPUBFUN int XMLCALL getLineNumber (void *ctx); +XML_DEPRECATED XMLPUBFUN int XMLCALL getColumnNumber (void *ctx); +XML_DEPRECATED XMLPUBFUN int XMLCALL isStandalone (void *ctx); +XML_DEPRECATED XMLPUBFUN int XMLCALL hasInternalSubset (void *ctx); +XML_DEPRECATED XMLPUBFUN int XMLCALL hasExternalSubset (void *ctx); +XML_DEPRECATED XMLPUBFUN void XMLCALL internalSubset (void *ctx, const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID); +XML_DEPRECATED XMLPUBFUN void XMLCALL externalSubset (void *ctx, const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID); +XML_DEPRECATED XMLPUBFUN xmlEntityPtr XMLCALL getEntity (void *ctx, const xmlChar *name); +XML_DEPRECATED XMLPUBFUN xmlEntityPtr XMLCALL getParameterEntity (void *ctx, const xmlChar *name); +XML_DEPRECATED XMLPUBFUN xmlParserInputPtr XMLCALL resolveEntity (void *ctx, const xmlChar *publicId, const xmlChar *systemId); +XML_DEPRECATED XMLPUBFUN void XMLCALL entityDecl (void *ctx, const xmlChar *name, @@ -71,6 +85,7 @@ const xmlChar *publicId, const xmlChar *systemId, xmlChar *content); +XML_DEPRECATED XMLPUBFUN void XMLCALL attributeDecl (void *ctx, const xmlChar *elem, @@ -79,16 +94,19 @@ int def, const xmlChar *defaultValue, xmlEnumerationPtr tree); +XML_DEPRECATED XMLPUBFUN void XMLCALL elementDecl (void *ctx, const xmlChar *name, int type, xmlElementContentPtr content); +XML_DEPRECATED XMLPUBFUN void XMLCALL notationDecl (void *ctx, const xmlChar *name, const xmlChar *publicId, const xmlChar *systemId); +XML_DEPRECATED XMLPUBFUN void XMLCALL unparsedEntityDecl (void *ctx, const xmlChar *name, @@ -96,69 +114,88 @@ const xmlChar *systemId, const xmlChar *notationName); +XML_DEPRECATED XMLPUBFUN void XMLCALL startDocument (void *ctx); +XML_DEPRECATED XMLPUBFUN void XMLCALL endDocument (void *ctx); +XML_DEPRECATED XMLPUBFUN void XMLCALL attribute (void *ctx, const xmlChar *fullname, const xmlChar *value); +XML_DEPRECATED XMLPUBFUN void XMLCALL startElement (void *ctx, const xmlChar *fullname, const xmlChar **atts); +XML_DEPRECATED XMLPUBFUN void XMLCALL endElement (void *ctx, const xmlChar *name); +XML_DEPRECATED XMLPUBFUN void XMLCALL reference (void *ctx, const xmlChar *name); +XML_DEPRECATED XMLPUBFUN void XMLCALL characters (void *ctx, const xmlChar *ch, int len); +XML_DEPRECATED XMLPUBFUN void XMLCALL ignorableWhitespace (void *ctx, const xmlChar *ch, int len); +XML_DEPRECATED XMLPUBFUN void XMLCALL processingInstruction (void *ctx, const xmlChar *target, const xmlChar *data); +XML_DEPRECATED XMLPUBFUN void XMLCALL globalNamespace (void *ctx, const xmlChar *href, const xmlChar *prefix); +XML_DEPRECATED XMLPUBFUN void XMLCALL setNamespace (void *ctx, const xmlChar *name); +XML_DEPRECATED XMLPUBFUN xmlNsPtr XMLCALL getNamespace (void *ctx); +XML_DEPRECATED XMLPUBFUN int XMLCALL checkNamespace (void *ctx, xmlChar *nameSpace); +XML_DEPRECATED XMLPUBFUN void XMLCALL namespaceDecl (void *ctx, const xmlChar *href, const xmlChar *prefix); +XML_DEPRECATED XMLPUBFUN void XMLCALL comment (void *ctx, const xmlChar *value); +XML_DEPRECATED XMLPUBFUN void XMLCALL cdataBlock (void *ctx, const xmlChar *value, int len); #ifdef LIBXML_SAX1_ENABLED +XML_DEPRECATED XMLPUBFUN void XMLCALL initxmlDefaultSAXHandler (xmlSAXHandlerV1 *hdlr, int warning); #ifdef LIBXML_HTML_ENABLED +XML_DEPRECATED XMLPUBFUN void XMLCALL inithtmlDefaultSAXHandler (xmlSAXHandlerV1 *hdlr); #endif #ifdef LIBXML_DOCB_ENABLED +XML_DEPRECATED XMLPUBFUN void XMLCALL initdocbDefaultSAXHandler (xmlSAXHandlerV1 *hdlr); #endif
diff --git a/third_party/libxml/src/include/libxml/encoding.h b/third_party/libxml/src/include/libxml/encoding.h index c875af6..77f137f4 100644 --- a/third_party/libxml/src/include/libxml/encoding.h +++ b/third_party/libxml/src/include/libxml/encoding.h
@@ -27,9 +27,7 @@ #ifdef LIBXML_ICONV_ENABLED #include <iconv.h> #endif -#ifdef LIBXML_ICU_ENABLED -#include <unicode/ucnv.h> -#endif + #ifdef __cplusplus extern "C" { #endif @@ -128,19 +126,6 @@ * Block defining the handlers for non UTF-8 encodings. * If iconv is supported, there are two extra fields. */ -#ifdef LIBXML_ICU_ENABLED -/* Size of pivot buffer, same as icu/source/common/ucnv.cpp CHUNK_SIZE */ -#define ICU_PIVOT_BUF_SIZE 1024 -struct _uconv_t { - UConverter *uconv; /* for conversion between an encoding and UTF-16 */ - UConverter *utf8; /* for conversion between UTF-8 and UTF-16 */ - UChar pivot_buf[ICU_PIVOT_BUF_SIZE]; - UChar *pivot_source; - UChar *pivot_target; -}; -typedef struct _uconv_t uconv_t; -#endif - typedef struct _xmlCharEncodingHandler xmlCharEncodingHandler; typedef xmlCharEncodingHandler *xmlCharEncodingHandlerPtr; struct _xmlCharEncodingHandler { @@ -152,8 +137,8 @@ iconv_t iconv_out; #endif /* LIBXML_ICONV_ENABLED */ #ifdef LIBXML_ICU_ENABLED - uconv_t *uconv_in; - uconv_t *uconv_out; + struct _uconv_t *uconv_in; + struct _uconv_t *uconv_out; #endif /* LIBXML_ICU_ENABLED */ };
diff --git a/third_party/libxml/src/include/libxml/entities.h b/third_party/libxml/src/include/libxml/entities.h index 012efab2..2aca52b 100644 --- a/third_party/libxml/src/include/libxml/entities.h +++ b/third_party/libxml/src/include/libxml/entities.h
@@ -81,6 +81,7 @@ */ #ifdef LIBXML_LEGACY_ENABLED +XML_DEPRECATED XMLPUBFUN void XMLCALL xmlInitializePredefinedEntities (void); #endif /* LIBXML_LEGACY_ENABLED */ @@ -118,6 +119,7 @@ xmlGetParameterEntity (xmlDocPtr doc, const xmlChar *name); #ifdef LIBXML_LEGACY_ENABLED +XML_DEPRECATED XMLPUBFUN const xmlChar * XMLCALL xmlEncodeEntities (xmlDocPtr doc, const xmlChar *input);
diff --git a/third_party/libxml/src/include/libxml/nanoftp.h b/third_party/libxml/src/include/libxml/nanoftp.h index 7335faf1..f39bde5 100644 --- a/third_party/libxml/src/include/libxml/nanoftp.h +++ b/third_party/libxml/src/include/libxml/nanoftp.h
@@ -1,7 +1,8 @@ /* * Summary: minimal FTP implementation * Description: minimal FTP implementation allowing to fetch resources - * like external subset. + * like external subset. This module is DEPRECATED, do not + * use any of its functions. * * Copy: See Copyright for the status of this software. * @@ -16,7 +17,7 @@ #ifdef LIBXML_FTP_ENABLED /* Needed for portability to Windows 64 bits */ -#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) #include <winsock2.h> #else /** @@ -78,40 +79,52 @@ /* * Init */ +XML_DEPRECATED XMLPUBFUN void XMLCALL xmlNanoFTPInit (void); +XML_DEPRECATED XMLPUBFUN void XMLCALL xmlNanoFTPCleanup (void); /* * Creating/freeing contexts. */ +XML_DEPRECATED XMLPUBFUN void * XMLCALL xmlNanoFTPNewCtxt (const char *URL); +XML_DEPRECATED XMLPUBFUN void XMLCALL xmlNanoFTPFreeCtxt (void * ctx); +XML_DEPRECATED XMLPUBFUN void * XMLCALL xmlNanoFTPConnectTo (const char *server, int port); /* * Opening/closing session connections. */ +XML_DEPRECATED XMLPUBFUN void * XMLCALL xmlNanoFTPOpen (const char *URL); +XML_DEPRECATED XMLPUBFUN int XMLCALL xmlNanoFTPConnect (void *ctx); +XML_DEPRECATED XMLPUBFUN int XMLCALL xmlNanoFTPClose (void *ctx); +XML_DEPRECATED XMLPUBFUN int XMLCALL xmlNanoFTPQuit (void *ctx); +XML_DEPRECATED XMLPUBFUN void XMLCALL xmlNanoFTPScanProxy (const char *URL); +XML_DEPRECATED XMLPUBFUN void XMLCALL xmlNanoFTPProxy (const char *host, int port, const char *user, const char *passwd, int type); +XML_DEPRECATED XMLPUBFUN int XMLCALL xmlNanoFTPUpdateURL (void *ctx, const char *URL); @@ -119,38 +132,48 @@ /* * Rather internal commands. */ +XML_DEPRECATED XMLPUBFUN int XMLCALL xmlNanoFTPGetResponse (void *ctx); +XML_DEPRECATED XMLPUBFUN int XMLCALL xmlNanoFTPCheckResponse (void *ctx); /* * CD/DIR/GET handlers. */ +XML_DEPRECATED XMLPUBFUN int XMLCALL xmlNanoFTPCwd (void *ctx, const char *directory); +XML_DEPRECATED XMLPUBFUN int XMLCALL xmlNanoFTPDele (void *ctx, const char *file); +XML_DEPRECATED XMLPUBFUN SOCKET XMLCALL xmlNanoFTPGetConnection (void *ctx); +XML_DEPRECATED XMLPUBFUN int XMLCALL xmlNanoFTPCloseConnection(void *ctx); +XML_DEPRECATED XMLPUBFUN int XMLCALL xmlNanoFTPList (void *ctx, ftpListCallback callback, void *userData, const char *filename); +XML_DEPRECATED XMLPUBFUN SOCKET XMLCALL xmlNanoFTPGetSocket (void *ctx, const char *filename); +XML_DEPRECATED XMLPUBFUN int XMLCALL xmlNanoFTPGet (void *ctx, ftpDataCallback callback, void *userData, const char *filename); +XML_DEPRECATED XMLPUBFUN int XMLCALL xmlNanoFTPRead (void *ctx, void *dest,
diff --git a/third_party/libxml/src/include/libxml/parser.h b/third_party/libxml/src/include/libxml/parser.h index 0ba1c387..5dad587 100644 --- a/third_party/libxml/src/include/libxml/parser.h +++ b/third_party/libxml/src/include/libxml/parser.h
@@ -996,13 +996,16 @@ /* * Reading/setting optional parsing features. */ +XML_DEPRECATED XMLPUBFUN int XMLCALL xmlGetFeaturesList (int *len, const char **result); +XML_DEPRECATED XMLPUBFUN int XMLCALL xmlGetFeature (xmlParserCtxtPtr ctxt, const char *name, void *result); +XML_DEPRECATED XMLPUBFUN int XMLCALL xmlSetFeature (xmlParserCtxtPtr ctxt, const char *name,
diff --git a/third_party/libxml/src/include/libxml/parserInternals.h b/third_party/libxml/src/include/libxml/parserInternals.h index 1f26ce208..9f3c76f 100644 --- a/third_party/libxml/src/include/libxml/parserInternals.h +++ b/third_party/libxml/src/include/libxml/parserInternals.h
@@ -597,25 +597,34 @@ xmlNodePtr firstNode, xmlNodePtr lastNode); +XML_DEPRECATED XMLPUBFUN void XMLCALL xmlSetEntityReferenceFunc (xmlEntityReferenceFunc func); +XML_DEPRECATED XMLPUBFUN xmlChar * XMLCALL xmlParseQuotedString (xmlParserCtxtPtr ctxt); +XML_DEPRECATED XMLPUBFUN void XMLCALL xmlParseNamespace (xmlParserCtxtPtr ctxt); +XML_DEPRECATED XMLPUBFUN xmlChar * XMLCALL xmlNamespaceParseNSDef (xmlParserCtxtPtr ctxt); +XML_DEPRECATED XMLPUBFUN xmlChar * XMLCALL xmlScanName (xmlParserCtxtPtr ctxt); +XML_DEPRECATED XMLPUBFUN xmlChar * XMLCALL xmlNamespaceParseNCName (xmlParserCtxtPtr ctxt); +XML_DEPRECATED XMLPUBFUN void XMLCALL xmlParserHandleReference(xmlParserCtxtPtr ctxt); +XML_DEPRECATED XMLPUBFUN xmlChar * XMLCALL xmlNamespaceParseQName (xmlParserCtxtPtr ctxt, xmlChar **prefix); /** * Entities */ +XML_DEPRECATED XMLPUBFUN xmlChar * XMLCALL xmlDecodeEntities (xmlParserCtxtPtr ctxt, int len, @@ -623,6 +632,7 @@ xmlChar end, xmlChar end2, xmlChar end3); +XML_DEPRECATED XMLPUBFUN void XMLCALL xmlHandleEntity (xmlParserCtxtPtr ctxt, xmlEntityPtr entity);
diff --git a/third_party/libxml/src/include/libxml/tree.h b/third_party/libxml/src/include/libxml/tree.h index 1e79be92..9823654 100644 --- a/third_party/libxml/src/include/libxml/tree.h +++ b/third_party/libxml/src/include/libxml/tree.h
@@ -763,6 +763,7 @@ XMLPUBFUN void XMLCALL xmlFreeDtd (xmlDtdPtr cur); #ifdef LIBXML_LEGACY_ENABLED +XML_DEPRECATED XMLPUBFUN xmlNsPtr XMLCALL xmlNewGlobalNs (xmlDocPtr doc, const xmlChar *href,
diff --git a/third_party/libxml/src/include/libxml/valid.h b/third_party/libxml/src/include/libxml/valid.h index 2bc7b38..3eaf84ad 100644 --- a/third_party/libxml/src/include/libxml/valid.h +++ b/third_party/libxml/src/include/libxml/valid.h
@@ -60,17 +60,17 @@ #ifdef IN_LIBXML /** - * XML_CTXT_FINISH_DTD_0: + * XML_VCTXT_DTD_VALIDATED: * - * Special value for finishDtd field when embedded in an xmlParserCtxt + * Set after xmlValidateDtdFinal was called. */ -#define XML_CTXT_FINISH_DTD_0 0xabcd1234 +#define XML_VCTXT_DTD_VALIDATED (1u << 0) /** - * XML_CTXT_FINISH_DTD_1: + * XML_VCTXT_USE_PCTXT: * - * Special value for finishDtd field when embedded in an xmlParserCtxt + * Set if the validation context is part of a parser context. */ -#define XML_CTXT_FINISH_DTD_1 0xabcd1235 +#define XML_VCTXT_USE_PCTXT (1u << 1) #endif /* @@ -90,7 +90,7 @@ int nodeMax; /* Max depth of the parsing stack */ xmlNodePtr *nodeTab; /* array of nodes */ - unsigned int finishDtd; /* finished validating the Dtd ? */ + unsigned int flags; /* internal flags */ xmlDocPtr doc; /* the document */ int valid; /* temporary validity check result */ @@ -283,20 +283,25 @@ xmlAttrPtr attr); /* IDREFs */ +XML_DEPRECATED XMLPUBFUN xmlRefPtr XMLCALL xmlAddRef (xmlValidCtxtPtr ctxt, xmlDocPtr doc, const xmlChar *value, xmlAttrPtr attr); +XML_DEPRECATED XMLPUBFUN void XMLCALL xmlFreeRefTable (xmlRefTablePtr table); +XML_DEPRECATED XMLPUBFUN int XMLCALL xmlIsRef (xmlDocPtr doc, xmlNodePtr elem, xmlAttrPtr attr); +XML_DEPRECATED XMLPUBFUN int XMLCALL xmlRemoveRef (xmlDocPtr doc, xmlAttrPtr attr); +XML_DEPRECATED XMLPUBFUN xmlListPtr XMLCALL xmlGetRefs (xmlDocPtr doc, const xmlChar *ID);
diff --git a/third_party/libxml/src/include/libxml/xmlerror.h b/third_party/libxml/src/include/libxml/xmlerror.h index c101997..7b68e40 100644 --- a/third_party/libxml/src/include/libxml/xmlerror.h +++ b/third_party/libxml/src/include/libxml/xmlerror.h
@@ -209,6 +209,7 @@ XML_ERR_VERSION_MISMATCH, /* 109 */ XML_ERR_NAME_TOO_LONG, /* 110 */ XML_ERR_USER_STOP, /* 111 */ + XML_ERR_COMMENT_ABRUPTLY_ENDED, /* 112 */ XML_NS_ERR_XML_NAMESPACE = 200, XML_NS_ERR_UNDEFINED_NAMESPACE, /* 201 */ XML_NS_ERR_QNAME, /* 202 */
diff --git a/third_party/libxml/src/include/libxml/xmlversion.h.in b/third_party/libxml/src/include/libxml/xmlversion.h.in index c995fe5..b1d2a20 100644 --- a/third_party/libxml/src/include/libxml/xmlversion.h.in +++ b/third_party/libxml/src/include/libxml/xmlversion.h.in
@@ -48,7 +48,7 @@ /** * LIBXML_VERSION_EXTRA: * - * extra version information, used to show a CVS compilation + * extra version information, used to show a git commit description */ #define LIBXML_VERSION_EXTRA "@LIBXML_VERSION_EXTRA@" @@ -456,6 +456,15 @@ # define LIBXML_ATTR_FORMAT(fmt,args) #endif +#ifndef XML_DEPRECATED +# ifdef IN_LIBXML +# define XML_DEPRECATED +# else +/* Available since at least GCC 3.1 */ +# define XML_DEPRECATED __attribute__((deprecated)) +# endif +#endif + #else /* ! __GNUC__ */ /** * ATTRIBUTE_UNUSED: @@ -475,6 +484,15 @@ * Macro used to indicate to GCC the parameter are printf like */ #define LIBXML_ATTR_FORMAT(fmt,args) +/** + * XML_DEPRECATED: + * + * Macro used to indicate that a function, variable, type or struct member + * is deprecated. + */ +#ifndef XML_DEPRECATED +#define XML_DEPRECATED +#endif #endif /* __GNUC__ */ #ifdef __cplusplus
diff --git a/third_party/libxml/src/include/win32config.h b/third_party/libxml/src/include/win32config.h index 54392f49..d804404a 100644 --- a/third_party/libxml/src/include/win32config.h +++ b/third_party/libxml/src/include/win32config.h
@@ -1,25 +1,14 @@ #ifndef __LIBXML_WIN32_CONFIG__ #define __LIBXML_WIN32_CONFIG__ -#define HAVE_CTYPE_H -#define HAVE_STDARG_H -#define HAVE_MALLOC_H -#define HAVE_ERRNO_H #define SEND_ARG2_CAST #define GETHOSTBYNAME_ARG_CAST -#if defined(_WIN32_WCE) -#undef HAVE_ERRNO_H -#include "wincecompat.h" -#else #define HAVE_SYS_STAT_H #define HAVE_STAT -#define HAVE_STDLIB_H -#define HAVE_TIME_H #define HAVE_FCNTL_H #include <io.h> #include <direct.h> -#endif #include <libxml/xmlversion.h>
diff --git a/third_party/libxml/src/include/wsockcompat.h b/third_party/libxml/src/include/wsockcompat.h index e57ca8e..85b9e7d 100644 --- a/third_party/libxml/src/include/wsockcompat.h +++ b/third_party/libxml/src/include/wsockcompat.h
@@ -5,9 +5,6 @@ #if !defined __XML_WSOCKCOMPAT_H__ #define __XML_WSOCKCOMPAT_H__ -#ifdef _WIN32_WCE -#include <winsock.h> -#else #include <errno.h> #include <winsock2.h> @@ -30,7 +27,6 @@ #include <wspiapi.h> #define HAVE_GETADDRINFO #endif -#endif #undef XML_SOCKLEN_T #define XML_SOCKLEN_T int
diff --git a/third_party/libxml/src/libxml.h b/third_party/libxml/src/libxml.h index 1090729c6..1330552 100644 --- a/third_party/libxml/src/libxml.h +++ b/third_party/libxml/src/libxml.h
@@ -20,17 +20,6 @@ #endif #endif -#if defined(macintosh) -#include "config-mac.h" -#elif defined(_WIN32_WCE) -/* - * Windows CE compatibility definitions and functions - * This is needed to compile libxml2 for Windows CE. - * At least I tested it with WinCE 5.0 for Emulator and WinCE 4.2/SH4 target - */ -#include <win32config.h> -#include <libxml/xmlversion.h> -#else /* * Currently supported platforms use either autoconf or * copy to config.h own "preset" configuration file. @@ -38,7 +27,6 @@ */ #include "config.h" #include <libxml/xmlversion.h> -#endif #if defined(__Lynx__) #include <stdio.h> /* pull definition of size_t */ @@ -107,27 +95,14 @@ int __xmlInitializeDict(void); -#if defined(HAVE_RAND) && defined(HAVE_SRAND) && defined(HAVE_TIME) /* * internal thread safe random function */ int __xmlRandom(void); -#endif XMLPUBFUN xmlChar * XMLCALL xmlEscapeFormatString(xmlChar **msg); int xmlInputReadCallbackNop(void *context, char *buffer, int len); -#ifdef IN_LIBXML -#ifdef __GNUC__ -#ifdef PIC -#ifdef __linux__ -#if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (__GNUC__ > 3) -#include "elfgcchack.h" -#endif -#endif -#endif -#endif -#endif #if !defined(PIC) && !defined(NOLIBTOOL) && !defined(LIBXML_STATIC) # define LIBXML_STATIC #endif
diff --git a/third_party/libxml/src/libxml.m4 b/third_party/libxml/src/libxml.m4 index 09de9fe..fc7790c 100644 --- a/third_party/libxml/src/libxml.m4 +++ b/third_party/libxml/src/libxml.m4
@@ -122,9 +122,8 @@ { printf("\n*** An old version of libxml (%d.%d.%d) was found.\n", xml_major_version, xml_minor_version, xml_micro_version); - printf("*** You need a version of libxml newer than %d.%d.%d. The latest version of\n", + printf("*** You need a version of libxml newer than %d.%d.%d.\n", major, minor, micro); - printf("*** libxml is always available from ftp://ftp.xmlsoft.org.\n"); printf("***\n"); printf("*** If you have already installed a sufficiently new version, this error\n"); printf("*** probably means that the wrong copy of the xml2-config shell script is\n");
diff --git a/third_party/libxml/src/libxml.spec.in b/third_party/libxml/src/libxml.spec.in index 11c29ea..73c6fd9 100644 --- a/third_party/libxml/src/libxml.spec.in +++ b/third_party/libxml/src/libxml.spec.in
@@ -6,7 +6,7 @@ Release: 1%{?dist}%{?extra_release} License: MIT Group: Development/Libraries -Source: ftp://xmlsoft.org/libxml2/libxml2-%{version}.tar.gz +Source: https://download.gnome.org/sources/libxml2/@LIBXML_MAJOR_VERSION@.@LIBXML_MINOR_VERSION@/libxml2-%{version}.tar.xz BuildRoot: %{_tmppath}/%{name}-%{version}-root BuildRequires: python-devel %if 0%{?with_python3} @@ -15,7 +15,7 @@ BuildRequires: zlib-devel BuildRequires: pkgconfig BuildRequires: xz-devel -URL: http://xmlsoft.org/ +URL: https://gitlab.gnome.org/GNOME/libxml2 %description This library allows to manipulate XML files. It includes support @@ -141,7 +141,7 @@ %files %defattr(-, root, root) -%doc AUTHORS NEWS README Copyright TODO +%doc NEWS README.md Copyright TODO %doc %{_mandir}/man1/xmllint.1* %doc %{_mandir}/man1/xmlcatalog.1* %doc %{_mandir}/man3/libxml.3* @@ -154,7 +154,7 @@ %defattr(-, root, root) %doc %{_mandir}/man1/xml2-config.1* -%doc AUTHORS NEWS README Copyright +%doc NEWS README.md Copyright %doc doc/*.html doc/html doc/*.gif doc/*.png %doc doc/tutorial doc/libxml2-api.xml.gz %doc doc/examples @@ -205,5 +205,5 @@ %changelog * @RELDATE@ Daniel Veillard <veillard@redhat.com> -- upstream release @VERSION@ see http://xmlsoft.org/news.html +- upstream release @VERSION@
diff --git a/third_party/libxml/src/libxml2.spec b/third_party/libxml/src/libxml2.spec index 8a8165b..13820db 100644 --- a/third_party/libxml/src/libxml2.spec +++ b/third_party/libxml/src/libxml2.spec
@@ -2,11 +2,11 @@ Summary: Library providing XML and HTML support Name: libxml2 -Version: 2.9.12 +Version: 2.9.13 Release: 1%{?dist}%{?extra_release} License: MIT Group: Development/Libraries -Source: ftp://xmlsoft.org/libxml2/libxml2-%{version}.tar.gz +Source: https://download.gnome.org/sources/libxml2/2.9/libxml2-%{version}.tar.xz BuildRoot: %{_tmppath}/%{name}-%{version}-root BuildRequires: python-devel %if 0%{?with_python3} @@ -15,7 +15,7 @@ BuildRequires: zlib-devel BuildRequires: pkgconfig BuildRequires: xz-devel -URL: http://xmlsoft.org/ +URL: https://gitlab.gnome.org/GNOME/libxml2 %description This library allows to manipulate XML files. It includes support @@ -141,7 +141,7 @@ %files %defattr(-, root, root) -%doc AUTHORS NEWS README Copyright TODO +%doc NEWS README.md Copyright TODO %doc %{_mandir}/man1/xmllint.1* %doc %{_mandir}/man1/xmlcatalog.1* %doc %{_mandir}/man3/libxml.3* @@ -154,7 +154,7 @@ %defattr(-, root, root) %doc %{_mandir}/man1/xml2-config.1* -%doc AUTHORS NEWS README Copyright +%doc NEWS README.md Copyright %doc doc/*.html doc/html doc/*.gif doc/*.png %doc doc/tutorial doc/libxml2-api.xml.gz %doc doc/examples @@ -204,6 +204,6 @@ %endif # with_python3 %changelog -* Mon Jan 31 2022 Daniel Veillard <veillard@redhat.com> -- upstream release 2.9.12 see http://xmlsoft.org/news.html +* Fri Mar 4 2022 Daniel Veillard <veillard@redhat.com> +- upstream release 2.9.13
diff --git a/third_party/libxml/src/list.c b/third_party/libxml/src/list.c index 2020715..12a7c00 100644 --- a/third_party/libxml/src/list.c +++ b/third_party/libxml/src/list.c
@@ -775,5 +775,3 @@ } /* xmlListUnique() */ /* xmlListSwap */ -#define bottom_list -#include "elfgcchack.h"
diff --git a/third_party/libxml/src/macos/README b/third_party/libxml/src/macos/README deleted file mode 100644 index 434aece..0000000 --- a/third_party/libxml/src/macos/README +++ /dev/null
@@ -1,8 +0,0 @@ -This is a MacOS port contribution (not to be used for MacOS-X) -for the CodeWarrior environment. -Please contact the author directly in case of problems: - Eric <erlavigne@wanadoo.fr> - - thanks, - -Daniel
diff --git a/third_party/libxml/src/macos/src/XMLTestPrefix.h b/third_party/libxml/src/macos/src/XMLTestPrefix.h deleted file mode 100644 index 3e84255..0000000 --- a/third_party/libxml/src/macos/src/XMLTestPrefix.h +++ /dev/null Binary files differ
diff --git a/third_party/libxml/src/macos/src/XMLTestPrefix2.h b/third_party/libxml/src/macos/src/XMLTestPrefix2.h deleted file mode 100644 index 55df51e..0000000 --- a/third_party/libxml/src/macos/src/XMLTestPrefix2.h +++ /dev/null Binary files differ
diff --git a/third_party/libxml/src/macos/src/config-mac.h b/third_party/libxml/src/macos/src/config-mac.h deleted file mode 100644 index c82d2b9a..0000000 --- a/third_party/libxml/src/macos/src/config-mac.h +++ /dev/null
@@ -1,131 +0,0 @@ -/* config.h generated manually for macos. */ - -/* Define if you have the strftime function. */ -#define HAVE_STRFTIME - -/* Define if you have the ANSI C header files. */ -#define STDC_HEADERS - -#define PACKAGE -#define VERSION - -#undef HAVE_LIBM -#undef HAVE_LIBHISTORY -#undef HAVE_LIBREADLINE - -#define XML_SOCKLEN_T socklen_t -#define HAVE_PTHREAD_H -#define LIBXML_THREAD_ENABLED - -/* Define if you have the fprintf function. */ -#define HAVE_FPRINTF - -/* Define if you have the localtime function. */ -#define HAVE_LOCALTIME - -/* Define if you have the printf function. */ -#define HAVE_PRINTF - -/* Define if you have the snprintf function. */ -#define HAVE_SNPRINTF - -/* Define if you have the sprintf function. */ -#define HAVE_SPRINTF - -/* Define if you have the sscanf function. */ -#define HAVE_SSCANF - -/* Define if you have the stat function. */ -#define HAVE_STAT - -/* Define if you have the strftime function. */ -#define HAVE_STRFTIME - -/* Define if you have the vfprintf function. */ -#define HAVE_VFPRINTF - -/* Define if you have the vsnprintf function. */ -#define HAVE_VSNPRINTF - -/* Define if you have the vsprintf function. */ -#define HAVE_VSPRINTF - -/* Define if you have the <arpa/inet.h> header file. */ -#define HAVE_ARPA_INET_H - -/* Define if you have the <ctype.h> header file. */ -#define HAVE_CTYPE_H - -/* Define if you have the <dlfcn.h> header file. */ -#define HAVE_DLFCN_H - -/* Define if you have the <errno.h> header file. */ -#define HAVE_ERRNO_H - -/* Define if you have the <fcntl.h> header file. */ -#define HAVE_FCNTL_H - -/* Define if you have the <float.h> header file. */ -#define HAVE_FLOAT_H - -/* Define if you have the <malloc.h> header file. */ -#undef HAVE_MALLOC_H - -/* Define if you have the <math.h> header file. */ -#define HAVE_MATH_H - -/* Define if you have the <netdb.h> header file. */ -#define HAVE_NETDB_H - -/* Define if you have the <netinet/in.h> header file. */ -#define HAVE_NETINET_IN_H - -/* Define if you have the <signal.h> header file. */ -#define HAVE_SIGNAL_H - -/* Define if you have the <stdarg.h> header file. */ -#define HAVE_STDARG_H - -/* Define if you have the <stdlib.h> header file. */ -#define HAVE_STDLIB_H - -/* Define if you have the <string.h> header file. */ -#define HAVE_STRING_H - -/* Define if you have the <sys/mman.h> header file. */ -#undef HAVE_SYS_MMAN_H - -/* Define if you have the <sys/select.h> header file. */ -#define HAVE_SYS_SELECT_H - -/* Define if you have the <sys/socket.h> header file. */ -#define HAVE_SYS_SOCKET_H - -/* Define if you have the <sys/stat.h> header file. */ -#define HAVE_SYS_STAT_H - -/* Define if you have the <sys/time.h> header file. */ -#define HAVE_SYS_TIME_H - -/* Define if you have the <sys/types.h> header file. */ -#define HAVE_SYS_TYPES_H - -/* Define if you have the <time.h> header file. */ -#define HAVE_TIME_H - -/* Define if you have the <unistd.h> header file. */ -#define HAVE_UNISTD_H - -/* Name of package */ -#define PACKAGE - -/* Version number of package */ -#define VERSION - -/* Define if compiler has function prototypes */ -#define PROTOTYPES - -#include <libxml/xmlversion.h> -#include <sys/types.h> -#include <extra/stricmp.h> -#include <extra/strdup.h>
diff --git a/third_party/libxml/src/macos/src/libxml2_GUSIConfig.cp b/third_party/libxml/src/macos/src/libxml2_GUSIConfig.cp deleted file mode 100644 index 77d0c93..0000000 --- a/third_party/libxml/src/macos/src/libxml2_GUSIConfig.cp +++ /dev/null Binary files differ
diff --git a/third_party/libxml/src/macos/src/macos_main.c b/third_party/libxml/src/macos/src/macos_main.c deleted file mode 100644 index 2625000..0000000 --- a/third_party/libxml/src/macos/src/macos_main.c +++ /dev/null Binary files differ
diff --git a/third_party/libxml/src/nanoftp.c b/third_party/libxml/src/nanoftp.c index 18c1ce43..6de7d30 100644 --- a/third_party/libxml/src/nanoftp.c +++ b/third_party/libxml/src/nanoftp.c
@@ -6,7 +6,6 @@ #ifdef TESTING #define STANDALONE -#define HAVE_STDLIB_H #define HAVE_UNISTD_H #define HAVE_SYS_SOCKET_H #define HAVE_NETINET_IN_H @@ -19,10 +18,9 @@ #ifdef LIBXML_FTP_ENABLED #include <string.h> - -#ifdef HAVE_STDLIB_H #include <stdlib.h> -#endif +#include <errno.h> + #ifdef HAVE_UNISTD_H #include <unistd.h> #endif @@ -41,9 +39,6 @@ #ifdef HAVE_FCNTL_H #include <fcntl.h> #endif -#ifdef HAVE_ERRNO_H -#include <errno.h> -#endif #ifdef HAVE_SYS_TIME_H #include <sys/time.h> #endif @@ -56,9 +51,6 @@ #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> #endif -#ifdef HAVE_STRINGS_H -#include <strings.h> -#endif #include <libxml/xmlmemory.h> #include <libxml/parser.h> @@ -75,7 +67,7 @@ #endif -#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) #include <wsockcompat.h> #endif @@ -2114,5 +2106,3 @@ } #endif /* STANDALONE */ #endif /* LIBXML_FTP_ENABLED */ -#define bottom_nanoftp -#include "elfgcchack.h"
diff --git a/third_party/libxml/src/nanohttp.c b/third_party/libxml/src/nanohttp.c index 8e840f5..2eafd3f 100644 --- a/third_party/libxml/src/nanohttp.c +++ b/third_party/libxml/src/nanohttp.c
@@ -16,10 +16,9 @@ #ifdef LIBXML_HTTP_ENABLED #include <string.h> - -#ifdef HAVE_STDLIB_H #include <stdlib.h> -#endif +#include <errno.h> + #ifdef HAVE_UNISTD_H #include <unistd.h> #endif @@ -47,9 +46,6 @@ #ifdef HAVE_FCNTL_H #include <fcntl.h> #endif -#ifdef HAVE_ERRNO_H -#include <errno.h> -#endif #ifdef HAVE_SYS_TIME_H #include <sys/time.h> #endif @@ -60,9 +56,6 @@ #else #include <poll.h> #endif -#ifdef HAVE_STRINGS_H -#include <strings.h> -#endif #ifdef LIBXML_ZLIB_ENABLED #include <zlib.h> #endif @@ -73,7 +66,7 @@ #define XML_SOCKLEN_T unsigned int #endif -#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) #include <wsockcompat.h> #endif @@ -1895,5 +1888,3 @@ } #endif /* STANDALONE */ #endif /* LIBXML_HTTP_ENABLED */ -#define bottom_nanohttp -#include "elfgcchack.h"
diff --git a/third_party/libxml/src/parser.c b/third_party/libxml/src/parser.c index 304f3be..ce20bd12 100644 --- a/third_party/libxml/src/parser.c +++ b/third_party/libxml/src/parser.c
@@ -38,7 +38,7 @@ #define IN_LIBXML #include "libxml.h" -#if defined(_WIN32) && !defined (__CYGWIN__) +#if defined(_WIN32) #define XML_DIR_SEP '\\' #else #define XML_DIR_SEP '/' @@ -49,6 +49,8 @@ #include <string.h> #include <stdarg.h> #include <stddef.h> +#include <ctype.h> +#include <stdlib.h> #include <libxml/xmlmemory.h> #include <libxml/threads.h> #include <libxml/globals.h> @@ -68,12 +70,6 @@ #include <libxml/xmlschemastypes.h> #include <libxml/relaxng.h> #endif -#ifdef HAVE_CTYPE_H -#include <ctype.h> -#endif -#ifdef HAVE_STDLIB_H -#include <stdlib.h> -#endif #ifdef HAVE_SYS_STAT_H #include <sys/stat.h> #endif @@ -1111,6 +1107,10 @@ static void xmlDetectSAX2(xmlParserCtxtPtr ctxt) { xmlSAXHandlerPtr sax; + + /* Avoid unused variable warning if features are disabled. */ + (void) sax; + if (ctxt == NULL) return; sax = ctxt->sax; #ifdef LIBXML_SAX1_ENABLED @@ -4989,7 +4989,7 @@ ctxt->input->cur = in; in++; ctxt->input->line++; ctxt->input->col = 1; - continue; /* while */ + goto get_more; } in--; } @@ -10677,16 +10677,16 @@ void xmlParseMisc(xmlParserCtxtPtr ctxt) { - while ((ctxt->instate != XML_PARSER_EOF) && - (((RAW == '<') && (NXT(1) == '?')) || - (CMP4(CUR_PTR, '<', '!', '-', '-')) || - IS_BLANK_CH(CUR))) { + while (ctxt->instate != XML_PARSER_EOF) { + SKIP_BLANKS; + GROW; if ((RAW == '<') && (NXT(1) == '?')) { xmlParsePI(ctxt); - } else if (IS_BLANK_CH(CUR)) { - NEXT; - } else + } else if (CMP4(CUR_PTR, '<', '!', '-', '-')) { xmlParseComment(ctxt); + } else { + break; + } } } @@ -10792,7 +10792,6 @@ /* * The Misc part of the Prolog */ - GROW; xmlParseMisc(ctxt); /* @@ -14768,7 +14767,6 @@ xmlSchemaCleanupTypes(); xmlRelaxNGCleanupTypes(); #endif - xmlResetLastError(); xmlCleanupGlobals(); xmlCleanupThreads(); /* must be last if called not from the main thread */ xmlCleanupMemory(); @@ -15570,5 +15568,3 @@ return (xmlDoRead(ctxt, URL, encoding, options, 1)); } -#define bottom_parser -#include "elfgcchack.h"
diff --git a/third_party/libxml/src/parserInternals.c b/third_party/libxml/src/parserInternals.c index 08c6faf..7d3d13b 100644 --- a/third_party/libxml/src/parserInternals.c +++ b/third_party/libxml/src/parserInternals.c
@@ -10,19 +10,16 @@ #define IN_LIBXML #include "libxml.h" -#if defined(_WIN32) && !defined (__CYGWIN__) +#if defined(_WIN32) #define XML_DIR_SEP '\\' #else #define XML_DIR_SEP '/' #endif #include <string.h> -#ifdef HAVE_CTYPE_H #include <ctype.h> -#endif -#ifdef HAVE_STDLIB_H #include <stdlib.h> -#endif + #ifdef HAVE_SYS_STAT_H #include <sys/stat.h> #endif @@ -1738,7 +1735,7 @@ ctxt->options |= XML_PARSE_NOBLANKS; } - ctxt->vctxt.finishDtd = XML_CTXT_FINISH_DTD_0; + ctxt->vctxt.flags = XML_VCTXT_USE_PCTXT; ctxt->vctxt.userData = ctxt; ctxt->vctxt.error = xmlParserValidityError; ctxt->vctxt.warning = xmlParserValidityWarning; @@ -2167,5 +2164,3 @@ return(old); } -#define bottom_parserInternals -#include "elfgcchack.h"
diff --git a/third_party/libxml/src/pattern.c b/third_party/libxml/src/pattern.c index 27e9694..73851a1f 100644 --- a/third_party/libxml/src/pattern.c +++ b/third_party/libxml/src/pattern.c
@@ -2616,6 +2616,4 @@ } -#define bottom_pattern -#include "elfgcchack.h" #endif /* LIBXML_PATTERN_ENABLED */
diff --git a/third_party/libxml/src/runsuite.c b/third_party/libxml/src/runsuite.c index d24b5ec..f7957ce 100644 --- a/third_party/libxml/src/runsuite.c +++ b/third_party/libxml/src/runsuite.c
@@ -9,7 +9,7 @@ #include "libxml.h" #include <stdio.h> -#if !defined(_WIN32) || defined(__CYGWIN__) +#if !defined(_WIN32) #include <unistd.h> #endif #include <string.h> @@ -48,7 +48,7 @@ if (stat(filename, &buf) == -1) return(0); -#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) if (!(buf.st_mode & _S_IFREG)) return(0); #else
diff --git a/third_party/libxml/src/runtest.c b/third_party/libxml/src/runtest.c index 62b362d..2644348 100644 --- a/third_party/libxml/src/runtest.c +++ b/third_party/libxml/src/runtest.c
@@ -14,7 +14,7 @@ #include "libxml.h" #include <stdio.h> -#if !defined(_WIN32) || defined(__CYGWIN__) +#if !defined(_WIN32) #include <unistd.h> #endif #include <string.h> @@ -108,7 +108,7 @@ static char* temp_directory = NULL; static int checkTestFile(const char *filename); -#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) #include <windows.h> #include <io.h> @@ -599,7 +599,7 @@ if (stat(filename, &buf) == -1) return(0); -#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) if (!(buf.st_mode & _S_IFREG)) return(0); #else @@ -2647,6 +2647,7 @@ } #endif /* LIBXML_XPTR_ENABLED */ +#ifdef LIBXML_VALID_ENABLED /** * xmlidDocTest: * @filename: the file to parse @@ -2714,6 +2715,7 @@ } return(res); } +#endif /* LIBXML_VALID_ENABLED */ #endif /* LIBXML_DEBUG_ENABLED */ #endif /* XPATH */ @@ -4103,7 +4105,7 @@ return(NULL); } -#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) #include <windows.h> #include <string.h> @@ -4315,6 +4317,7 @@ { "XML Namespaces regression tests", errParseTest, "./test/namespaces/*", "result/namespaces/", "", ".err", 0 }, +#ifdef LIBXML_VALID_ENABLED { "Error cases regression tests", errParseTest, "./test/errors/*.xml", "result/errors/", "", ".err", 0 }, @@ -4327,10 +4330,13 @@ { "Error cases regression tests (old 1.0)", errParseTest, "./test/errors10/*.xml", "result/errors10/", "", ".err", XML_PARSE_OLD10 }, +#endif #ifdef LIBXML_READER_ENABLED +#ifdef LIBXML_VALID_ENABLED { "Error cases stream regression tests", streamParseTest, "./test/errors/*.xml", "result/errors/", NULL, ".str", 0 }, +#endif { "Reader regression tests", streamParseTest, "./test/*", "result/", ".rdr", NULL, 0 }, @@ -4430,11 +4436,13 @@ xptrDocTest, "./test/XPath/docs/*", NULL, NULL, NULL, 0 }, #endif +#ifdef LIBXML_VALID_ENABLED { "xml:id regression tests" , xmlidDocTest, "./test/xmlid/*", "result/xmlid/", "", ".err", 0 }, #endif #endif +#endif { "URI parsing tests" , uriParseTest, "./test/URI/*.uri", "result/URI/", "", NULL, 0 }, @@ -4623,7 +4631,7 @@ int i, a, ret = 0; int subset = 0; -#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) setvbuf(stdout, NULL, _IONBF, 0); setvbuf(stderr, NULL, _IONBF, 0); #endif
diff --git a/third_party/libxml/src/runxmlconf.c b/third_party/libxml/src/runxmlconf.c index 8a37aa8f..7196c28 100644 --- a/third_party/libxml/src/runxmlconf.c +++ b/third_party/libxml/src/runxmlconf.c
@@ -11,7 +11,7 @@ #ifdef LIBXML_XPATH_ENABLED -#if !defined(_WIN32) || defined(__CYGWIN__) +#if !defined(_WIN32) #include <unistd.h> #endif #include <string.h> @@ -53,7 +53,7 @@ if (stat(filename, &buf) == -1) return(0); -#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) if (!(buf.st_mode & _S_IFREG)) return(0); #else
diff --git a/third_party/libxml/src/testAutomata.c b/third_party/libxml/src/testAutomata.c index 13213c6..b89611c 100644 --- a/third_party/libxml/src/testAutomata.c +++ b/third_party/libxml/src/testAutomata.c
@@ -41,7 +41,7 @@ for (i = 0;i<1000;i++) states[i] = NULL; - input = fopen(filename, "r"); + input = fopen(filename, "rb"); if (input == NULL) { xmlGenericError(xmlGenericErrorContext, "Cannot open %s for reading\n", filename);
diff --git a/third_party/libxml/src/testC14N.c b/third_party/libxml/src/testC14N.c index addc800..ebd9fe0 100644 --- a/third_party/libxml/src/testC14N.c +++ b/third_party/libxml/src/testC14N.c
@@ -11,6 +11,8 @@ #include <stdio.h> #include <string.h> +#include <stdlib.h> + #ifndef STDOUT_FILENO #ifdef HAVE_UNISTD_H #include <unistd.h> @@ -21,9 +23,6 @@ #ifdef _WIN32 #include <io.h> #endif -#ifdef HAVE_STDLIB_H -#include <stdlib.h> -#endif #include <libxml/xmlmemory.h> #include <libxml/parser.h>
diff --git a/third_party/libxml/src/testHTML.c b/third_party/libxml/src/testHTML.c index 9b42778..5d175904 100644 --- a/third_party/libxml/src/testHTML.c +++ b/third_party/libxml/src/testHTML.c
@@ -12,7 +12,7 @@ #include <string.h> #include <stdarg.h> - +#include <stdlib.h> #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> @@ -26,9 +26,6 @@ #ifdef HAVE_UNISTD_H #include <unistd.h> #endif -#ifdef HAVE_STDLIB_H -#include <stdlib.h> -#endif #include <libxml/xmlmemory.h> #include <libxml/HTMLparser.h> @@ -627,11 +624,7 @@ if (push) { FILE *f; -#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) f = fopen(filename, "rb"); -#else - f = fopen(filename, "r"); -#endif if (f != NULL) { int res, size = 3; char chars[4096]; @@ -657,11 +650,7 @@ fclose(f); } if (!noout) { -#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) - f = fopen(filename, "rb"); -#else - f = fopen(filename, "r"); -#endif + f = fopen(filename, "rb"); if (f != NULL) { int res, size = 3; char chars[4096]; @@ -721,11 +710,7 @@ if (push) { FILE *f; -#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) f = fopen(filename, "rb"); -#else - f = fopen(filename, "r"); -#endif if (f != NULL) { int res, size = 3; char chars[4096];
diff --git a/third_party/libxml/src/testReader.c b/third_party/libxml/src/testReader.c index da2f1b0..70d5ee7e 100644 --- a/third_party/libxml/src/testReader.c +++ b/third_party/libxml/src/testReader.c
@@ -11,6 +11,7 @@ #ifdef LIBXML_READER_ENABLED #include <string.h> #include <stdarg.h> +#include <stdlib.h> #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> @@ -24,13 +25,6 @@ #ifdef HAVE_UNISTD_H #include <unistd.h> #endif -#ifdef HAVE_STDLIB_H -#include <stdlib.h> -#endif -#ifdef HAVE_STRING_H -#include <string.h> -#endif - #include <libxml/xmlreader.h>
diff --git a/third_party/libxml/src/testRegexp.c b/third_party/libxml/src/testRegexp.c index 21817414..2511b210 100644 --- a/third_party/libxml/src/testRegexp.c +++ b/third_party/libxml/src/testRegexp.c
@@ -40,7 +40,7 @@ char expression[5000]; int len; - input = fopen(filename, "r"); + input = fopen(filename, "rb"); if (input == NULL) { xmlGenericError(xmlGenericErrorContext, "Cannot open %s for reading\n", filename); @@ -94,7 +94,7 @@ char expression[5000]; int len; - input = fopen(filename, "r"); + input = fopen(filename, "rb"); if (input == NULL) { xmlGenericError(xmlGenericErrorContext, "Cannot open %s for reading\n", filename);
diff --git a/third_party/libxml/src/testRelax.c b/third_party/libxml/src/testRelax.c index 3549f93..ad801b1 100644 --- a/third_party/libxml/src/testRelax.c +++ b/third_party/libxml/src/testRelax.c
@@ -15,7 +15,7 @@ #include <stdio.h> #include <string.h> #include <stdarg.h> - +#include <stdlib.h> #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> @@ -29,9 +29,6 @@ #ifdef HAVE_UNISTD_H #include <unistd.h> #endif -#ifdef HAVE_STDLIB_H -#include <stdlib.h> -#endif #ifdef HAVE_SYS_MMAN_H #include <sys/mman.h> /* seems needed for Solaris */
diff --git a/third_party/libxml/src/testSAX.c b/third_party/libxml/src/testSAX.c index 81c4b93..9cc72f21 100644 --- a/third_party/libxml/src/testSAX.c +++ b/third_party/libxml/src/testSAX.c
@@ -8,20 +8,20 @@ #include "libxml.h" +#ifdef LIBXML_SAX1_ENABLED + +#include <string.h> +#include <stdarg.h> +#include <stdlib.h> +#include <string.h> +#include <time.h> + #ifdef HAVE_SYS_TIME_H #include <sys/time.h> #endif #ifdef HAVE_SYS_TIMEB_H #include <sys/timeb.h> #endif -#ifdef HAVE_TIME_H -#include <time.h> -#endif - -#ifdef LIBXML_SAX1_ENABLED -#include <string.h> -#include <stdarg.h> - #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> #endif @@ -34,13 +34,6 @@ #ifdef HAVE_UNISTD_H #include <unistd.h> #endif -#ifdef HAVE_STDLIB_H -#include <stdlib.h> -#endif -#ifdef HAVE_STRING_H -#include <string.h> -#endif - #include <libxml/globals.h> #include <libxml/xmlerror.h> @@ -124,16 +117,13 @@ msec *= 1000; msec += (end.tv_usec - begin.tv_usec) / 1000; -#ifndef HAVE_STDARG_H -#error "endTimer required stdarg functions" -#endif va_start(ap, fmt); vfprintf(stderr, fmt, ap); va_end(ap); fprintf(stderr, " took %ld ms\n", msec); } -#elif defined(HAVE_TIME_H) +#else /* * No gettimeofday function, so we have to make do with calling clock. * This is obviously less accurate, but there's little we can do about @@ -158,43 +148,11 @@ end = clock(); msec = ((end - begin) * 1000) / CLOCKS_PER_SEC; -#ifndef HAVE_STDARG_H -#error "endTimer required stdarg functions" -#endif va_start(ap, fmt); vfprintf(stderr, fmt, ap); va_end(ap); fprintf(stderr, " took %ld ms\n", msec); } -#else - -/* - * We don't have a gettimeofday or time.h, so we just don't do timing - */ -static void -startTimer(void) -{ - /* - * Do nothing - */ -} -static void XMLCDECL -endTimer(char *format, ...) -{ - /* - * We cannot do anything because we don't have a timing function - */ -#ifdef HAVE_STDARG_H - va_start(ap, format); - vfprintf(stderr, format, ap); - va_end(ap); - fprintf(stderr, " was not timed\n", msec); -#else - /* We don't have gettimeofday, time or stdarg.h, what crazy world is - * this ?! - */ -#endif -} #endif /* @@ -1012,11 +970,7 @@ /* * Empty callbacks for checking */ -#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) f = fopen(filename, "rb"); -#else - f = fopen(filename, "r"); -#endif if (f != NULL) { int ret; char chars[10]; @@ -1041,11 +995,7 @@ /* * Debug callback */ -#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) f = fopen(filename, "rb"); -#else - f = fopen(filename, "r"); -#endif if (f != NULL) { int ret; char chars[10];
diff --git a/third_party/libxml/src/testSchemas.c b/third_party/libxml/src/testSchemas.c index fc39862c..f79adf04 100644 --- a/third_party/libxml/src/testSchemas.c +++ b/third_party/libxml/src/testSchemas.c
@@ -15,7 +15,7 @@ #include <stdio.h> #include <string.h> #include <stdarg.h> - +#include <stdlib.h> #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> @@ -29,9 +29,6 @@ #ifdef HAVE_UNISTD_H #include <unistd.h> #endif -#ifdef HAVE_STDLIB_H -#include <stdlib.h> -#endif #ifdef HAVE_SYS_MMAN_H #include <sys/mman.h> /* seems needed for Solaris */
diff --git a/third_party/libxml/src/testXPath.c b/third_party/libxml/src/testXPath.c index ebb9ff7..0e37723 100644 --- a/third_party/libxml/src/testXPath.c +++ b/third_party/libxml/src/testXPath.c
@@ -10,6 +10,7 @@ #if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED) #include <string.h> +#include <stdlib.h> #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> @@ -23,10 +24,6 @@ #ifdef HAVE_UNISTD_H #include <unistd.h> #endif -#ifdef HAVE_STDLIB_H -#include <stdlib.h> -#endif - #include <libxml/xpath.h> #include <libxml/tree.h> @@ -118,7 +115,7 @@ char expression[5000]; int len; - input = fopen(filename, "r"); + input = fopen(filename, "rb"); if (input == NULL) { xmlGenericError(xmlGenericErrorContext, "Cannot open %s for reading\n", filename);
diff --git a/third_party/libxml/src/testapi.c b/third_party/libxml/src/testapi.c index 6f19c6fc..54a8092b 100644 --- a/third_party/libxml/src/testapi.c +++ b/third_party/libxml/src/testapi.c
@@ -8,6 +8,9 @@ * daniel@veillard.com */ +/* Disable deprecation warnings */ +#define XML_DEPRECATED + #include "libxml.h" #include <stdio.h> @@ -382,6 +385,7 @@ if (val != NULL) fclose(val); } +#ifdef LIBXML_DEBUG_ENABLED #define gen_nb_debug_FILE_ptr 2 static FILE *gen_debug_FILE_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { return(fopen("test.out", "a+")); @@ -389,6 +393,7 @@ static void des_debug_FILE_ptr(int no ATTRIBUTE_UNUSED, FILE *val, int nr ATTRIBUTE_UNUSED) { if (val != NULL) fclose(val); } +#endif #define gen_nb_const_xmlChar_ptr 5 @@ -9308,33 +9313,6 @@ static int -test_xmlCleanupPredefinedEntities(void) { - int test_ret = 0; - -#if defined(LIBXML_LEGACY_ENABLED) -#ifdef LIBXML_LEGACY_ENABLED - int mem_base; - - mem_base = xmlMemBlocks(); - - xmlCleanupPredefinedEntities(); - call_tests++; - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCleanupPredefinedEntities", - xmlMemBlocks() - mem_base); - test_ret++; - printf("\n"); - } - function_tests++; -#endif -#endif - - return(test_ret); -} - - -static int test_xmlCopyEntitiesTable(void) { int test_ret = 0; @@ -9681,33 +9659,6 @@ static int -test_xmlInitializePredefinedEntities(void) { - int test_ret = 0; - -#if defined(LIBXML_LEGACY_ENABLED) -#ifdef LIBXML_LEGACY_ENABLED - int mem_base; - - mem_base = xmlMemBlocks(); - - xmlInitializePredefinedEntities(); - call_tests++; - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlInitializePredefinedEntities", - xmlMemBlocks() - mem_base); - test_ret++; - printf("\n"); - } - function_tests++; -#endif -#endif - - return(test_ret); -} - - -static int test_xmlNewEntity(void) { int test_ret = 0; @@ -9777,10 +9728,9 @@ test_entities(void) { int test_ret = 0; - if (quiet == 0) printf("Testing entities : 13 of 17 functions ...\n"); + if (quiet == 0) printf("Testing entities : 11 of 17 functions ...\n"); test_ret += test_xmlAddDocEntity(); test_ret += test_xmlAddDtdEntity(); - test_ret += test_xmlCleanupPredefinedEntities(); test_ret += test_xmlCopyEntitiesTable(); test_ret += test_xmlCreateEntitiesTable(); test_ret += test_xmlDumpEntitiesTable(); @@ -9791,7 +9741,6 @@ test_ret += test_xmlGetDtdEntity(); test_ret += test_xmlGetParameterEntity(); test_ret += test_xmlGetPredefinedEntity(); - test_ret += test_xmlInitializePredefinedEntities(); test_ret += test_xmlNewEntity(); if (test_ret != 0) @@ -13158,106 +13107,6 @@ static int -test_xmlGetFeature(void) { - int test_ret = 0; - -#if defined(LIBXML_LEGACY_ENABLED) -#ifdef LIBXML_LEGACY_ENABLED - int mem_base; - int ret_val; - xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */ - int n_ctxt; - char * name; /* the feature name */ - int n_name; - void * result; /* location to store the result */ - int n_result; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { - for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) { - for (n_result = 0;n_result < gen_nb_void_ptr;n_result++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); - name = gen_const_char_ptr(n_name, 1); - result = gen_void_ptr(n_result, 2); - - ret_val = xmlGetFeature(ctxt, (const char *)name, result); - desret_int(ret_val); - call_tests++; - des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); - des_const_char_ptr(n_name, (const char *)name, 1); - des_void_ptr(n_result, result, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlGetFeature", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_name); - printf(" %d", n_result); - printf("\n"); - } - } - } - } - function_tests++; -#endif -#endif - - return(test_ret); -} - - -#define gen_nb_const_char_ptr_ptr 1 -static char ** gen_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, const char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -static int -test_xmlGetFeaturesList(void) { - int test_ret = 0; - -#if defined(LIBXML_LEGACY_ENABLED) -#ifdef LIBXML_LEGACY_ENABLED - int mem_base; - int ret_val; - int * len; /* the length of the features name array (input/output) */ - int n_len; - char ** result; /* an array of string to be filled with the features name. */ - int n_result; - - for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) { - for (n_result = 0;n_result < gen_nb_const_char_ptr_ptr;n_result++) { - mem_base = xmlMemBlocks(); - len = gen_int_ptr(n_len, 0); - result = gen_const_char_ptr_ptr(n_result, 1); - - ret_val = xmlGetFeaturesList(len, (const char **)result); - desret_int(ret_val); - call_tests++; - des_int_ptr(n_len, len, 0); - des_const_char_ptr_ptr(n_result, (const char **)result, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlGetFeaturesList", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_len); - printf(" %d", n_result); - printf("\n"); - } - } - } - function_tests++; -#endif -#endif - - return(test_ret); -} - - -static int test_xmlHasFeature(void) { int test_ret = 0; @@ -15323,56 +15172,6 @@ static int -test_xmlSetFeature(void) { - int test_ret = 0; - -#if defined(LIBXML_LEGACY_ENABLED) -#ifdef LIBXML_LEGACY_ENABLED - int mem_base; - int ret_val; - xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */ - int n_ctxt; - char * name; /* the feature name */ - int n_name; - void * value; /* pointer to the location of the new value */ - int n_value; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { - for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) { - for (n_value = 0;n_value < gen_nb_void_ptr;n_value++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); - name = gen_const_char_ptr(n_name, 1); - value = gen_void_ptr(n_value, 2); - - ret_val = xmlSetFeature(ctxt, (const char *)name, value); - desret_int(ret_val); - call_tests++; - des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); - des_const_char_ptr(n_name, (const char *)name, 1); - des_void_ptr(n_value, value, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSetFeature", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_name); - printf(" %d", n_value); - printf("\n"); - } - } - } - } - function_tests++; -#endif -#endif - - return(test_ret); -} - - -static int test_xmlSetupParserForBuffer(void) { int test_ret = 0; @@ -15487,7 +15286,7 @@ test_parser(void) { int test_ret = 0; - if (quiet == 0) printf("Testing parser : 61 of 70 functions ...\n"); + if (quiet == 0) printf("Testing parser : 58 of 70 functions ...\n"); test_ret += test_xmlByteConsumed(); test_ret += test_xmlClearNodeInfoSeq(); test_ret += test_xmlClearParserCtxt(); @@ -15500,8 +15299,6 @@ test_ret += test_xmlCtxtResetPush(); test_ret += test_xmlCtxtUseOptions(); test_ret += test_xmlGetExternalEntityLoader(); - test_ret += test_xmlGetFeature(); - test_ret += test_xmlGetFeaturesList(); test_ret += test_xmlHasFeature(); test_ret += test_xmlIOParseDTD(); test_ret += test_xmlInitNodeInfoSeq(); @@ -15547,7 +15344,6 @@ test_ret += test_xmlSAXUserParseFile(); test_ret += test_xmlSAXUserParseMemory(); test_ret += test_xmlSetExternalEntityLoader(); - test_ret += test_xmlSetFeature(); test_ret += test_xmlSetupParserForBuffer(); test_ret += test_xmlStopParser(); test_ret += test_xmlSubstituteEntitiesDefault();
diff --git a/third_party/libxml/src/testlimits.c b/third_party/libxml/src/testlimits.c index 059116a..0b045eac 100644 --- a/third_party/libxml/src/testlimits.c +++ b/third_party/libxml/src/testlimits.c
@@ -13,7 +13,7 @@ #include "libxml.h" #include <stdio.h> -#if !defined(_WIN32) || defined(__CYGWIN__) +#if !defined(_WIN32) #include <unistd.h> #endif #include <string.h>
diff --git a/third_party/libxml/src/testrecurse.c b/third_party/libxml/src/testrecurse.c index 0cbe25a..fabc513 100644 --- a/third_party/libxml/src/testrecurse.c +++ b/third_party/libxml/src/testrecurse.c
@@ -13,7 +13,7 @@ #include "libxml.h" #include <stdio.h> -#if !defined(_WIN32) || defined(__CYGWIN__) +#if !defined(_WIN32) #include <unistd.h> #endif #include <string.h> @@ -56,7 +56,7 @@ static int checkTestFile(const char *filename); -#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) #include <windows.h> #include <io.h> @@ -643,7 +643,7 @@ if (stat(filename, &buf) == -1) return(0); -#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) if (!(buf.st_mode & _S_IFREG)) return(0); #else
diff --git a/third_party/libxml/src/threads.c b/third_party/libxml/src/threads.c index 503d2bf..5e4db16 100644 --- a/third_party/libxml/src/threads.c +++ b/third_party/libxml/src/threads.c
@@ -11,6 +11,7 @@ #include "libxml.h" #include <string.h> +#include <stdlib.h> #include <libxml/threads.h> #include <libxml/globals.h> @@ -21,9 +22,6 @@ #ifdef HAVE_UNISTD_H #include <unistd.h> #endif -#ifdef HAVE_STDLIB_H -#include <stdlib.h> -#endif #ifdef HAVE_PTHREAD_H #include <pthread.h> #elif defined HAVE_WIN32_THREADS @@ -1045,5 +1043,3 @@ return TRUE; } #endif -#define bottom_threads -#include "elfgcchack.h"
diff --git a/third_party/libxml/src/tree.c b/third_party/libxml/src/tree.c index 50b6763..1253274 100644 --- a/third_party/libxml/src/tree.c +++ b/third_party/libxml/src/tree.c
@@ -21,12 +21,9 @@ #include <string.h> /* for memset() only ! */ #include <stddef.h> #include <limits.h> -#ifdef HAVE_CTYPE_H #include <ctype.h> -#endif -#ifdef HAVE_STDLIB_H #include <stdlib.h> -#endif + #ifdef LIBXML_ZLIB_ENABLED #include <zlib.h> #endif @@ -2856,8 +2853,15 @@ prop = prop->next; } } - if (tree->children != NULL) + if (tree->type == XML_ENTITY_REF_NODE) { + /* + * Clear 'children' which points to the entity declaration + * from the original document. + */ + tree->children = NULL; + } else if (tree->children != NULL) { xmlSetListDoc(tree->children, doc); + } tree->doc = doc; } } @@ -3695,17 +3699,14 @@ xmlFreeNsList((xmlNsPtr) cur); return; } - if ((cur->type == XML_DOCUMENT_NODE) || -#ifdef LIBXML_DOCB_ENABLED - (cur->type == XML_DOCB_DOCUMENT_NODE) || -#endif - (cur->type == XML_HTML_DOCUMENT_NODE)) { - xmlFreeDoc((xmlDocPtr) cur); - return; - } if (cur->doc != NULL) dict = cur->doc->dict; while (1) { while ((cur->children != NULL) && + (cur->type != XML_DOCUMENT_NODE) && +#ifdef LIBXML_DOCB_ENABLED + (cur->type != XML_DOCB_DOCUMENT_NODE) && +#endif + (cur->type != XML_HTML_DOCUMENT_NODE) && (cur->type != XML_DTD_NODE) && (cur->type != XML_ENTITY_REF_NODE)) { cur = cur->children; @@ -3714,7 +3715,13 @@ next = cur->next; parent = cur->parent; - if (cur->type != XML_DTD_NODE) { + if ((cur->type == XML_DOCUMENT_NODE) || +#ifdef LIBXML_DOCB_ENABLED + (cur->type == XML_DOCB_DOCUMENT_NODE) || +#endif + (cur->type == XML_HTML_DOCUMENT_NODE)) { + xmlFreeDoc((xmlDocPtr) cur); + } else if (cur->type != XML_DTD_NODE) { if ((__xmlRegisterCallbacks) && (xmlDeregisterNodeDefaultValue)) xmlDeregisterNodeDefaultValue(cur); @@ -3728,11 +3735,6 @@ (cur->type != XML_XINCLUDE_START) && (cur->type != XML_XINCLUDE_END) && (cur->type != XML_ENTITY_REF_NODE) && - (cur->type != XML_DOCUMENT_NODE) && -#ifdef LIBXML_DOCB_ENABLED - (cur->type != XML_DOCB_DOCUMENT_NODE) && -#endif - (cur->type != XML_HTML_DOCUMENT_NODE) && (cur->content != (xmlChar *) &(cur->properties))) { DICT_FREE(cur->content) } @@ -6529,6 +6531,9 @@ { xmlAttrPtr prop; + /* Avoid unused variable warning if features are disabled. */ + (void) useDTD; + if ((node == NULL) || (node->type != XML_ELEMENT_NODE) || (name == NULL)) return(NULL); @@ -10183,5 +10188,3 @@ return (0); } -#define bottom_tree -#include "elfgcchack.h"
diff --git a/third_party/libxml/src/uri.c b/third_party/libxml/src/uri.c index ccc26aa5..e5c790e 100644 --- a/third_party/libxml/src/uri.c +++ b/third_party/libxml/src/uri.c
@@ -2383,7 +2383,7 @@ * For Windows implementations, additional work needs to be done to * replace backslashes in pathnames with "forward slashes" */ -#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) int len = 0; char *p = NULL; #endif @@ -2455,7 +2455,7 @@ path_processing: /* For Windows implementations, replace backslashes with 'forward slashes' */ -#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) /* * Create a URI structure */ @@ -2534,7 +2534,7 @@ cal = xmlCanonicPath(path); if (cal == NULL) return(NULL); -#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) /* xmlCanonicPath can return an URI on Windows (is that the intended behaviour?) If 'cal' is a valid URI already then we are done here, as continuing would make it invalid. */ @@ -2558,5 +2558,3 @@ xmlFree(cal); return(ret); } -#define bottom_uri -#include "elfgcchack.h"
diff --git a/third_party/libxml/src/valid.c b/third_party/libxml/src/valid.c index 5ee391c..16fa923 100644 --- a/third_party/libxml/src/valid.c +++ b/third_party/libxml/src/valid.c
@@ -11,10 +11,7 @@ #include "libxml.h" #include <string.h> - -#ifdef HAVE_STDLIB_H #include <stdlib.h> -#endif #include <libxml/xmlmemory.h> #include <libxml/hash.h> @@ -64,10 +61,9 @@ if (ctxt != NULL) { channel = ctxt->error; data = ctxt->userData; - /* Use the special values to detect if it is part of a parsing + /* Look up flag to detect if it is part of a parsing context */ - if ((ctxt->finishDtd == XML_CTXT_FINISH_DTD_0) || - (ctxt->finishDtd == XML_CTXT_FINISH_DTD_1)) { + if (ctxt->flags & XML_VCTXT_USE_PCTXT) { long delta = (char *) ctxt - (char *) ctxt->userData; if ((delta > 0) && (delta < 250)) pctxt = ctxt->userData; @@ -104,10 +100,9 @@ if (ctxt != NULL) { channel = ctxt->error; data = ctxt->userData; - /* Use the special values to detect if it is part of a parsing + /* Look up flag to detect if it is part of a parsing context */ - if ((ctxt->finishDtd == XML_CTXT_FINISH_DTD_0) || - (ctxt->finishDtd == XML_CTXT_FINISH_DTD_1)) { + if (ctxt->flags & XML_VCTXT_USE_PCTXT) { long delta = (char *) ctxt - (char *) ctxt->userData; if ((delta > 0) && (delta < 250)) pctxt = ctxt->userData; @@ -151,10 +146,9 @@ if (ctxt != NULL) { channel = ctxt->error; data = ctxt->userData; - /* Use the special values to detect if it is part of a parsing + /* Look up flag to detect if it is part of a parsing context */ - if ((ctxt->finishDtd == XML_CTXT_FINISH_DTD_0) || - (ctxt->finishDtd == XML_CTXT_FINISH_DTD_1)) { + if (ctxt->flags & XML_VCTXT_USE_PCTXT) { long delta = (char *) ctxt - (char *) ctxt->userData; if ((delta > 0) && (delta < 250)) pctxt = ctxt->userData; @@ -194,10 +188,9 @@ if (ctxt != NULL) { channel = ctxt->error; data = ctxt->userData; - /* Use the special values to detect if it is part of a parsing + /* Look up flag to detect if it is part of a parsing context */ - if ((ctxt->finishDtd == XML_CTXT_FINISH_DTD_0) || - (ctxt->finishDtd == XML_CTXT_FINISH_DTD_1)) { + if (ctxt->flags & XML_VCTXT_USE_PCTXT) { long delta = (char *) ctxt - (char *) ctxt->userData; if ((delta > 0) && (delta < 250)) pctxt = ctxt->userData; @@ -235,10 +228,9 @@ if (ctxt != NULL) { channel = ctxt->warning; data = ctxt->userData; - /* Use the special values to detect if it is part of a parsing + /* Look up flag to detect if it is part of a parsing context */ - if ((ctxt->finishDtd == XML_CTXT_FINISH_DTD_0) || - (ctxt->finishDtd == XML_CTXT_FINISH_DTD_1)) { + if (ctxt->flags & XML_VCTXT_USE_PCTXT) { long delta = (char *) ctxt - (char *) ctxt->userData; if ((delta > 0) && (delta < 250)) pctxt = ctxt->userData; @@ -1613,9 +1605,7 @@ * and flag it by setting a special parent value * so the parser doesn't unallocate it. */ - if ((ctxt != NULL) && - ((ctxt->finishDtd == XML_CTXT_FINISH_DTD_0) || - (ctxt->finishDtd == XML_CTXT_FINISH_DTD_1))) { + if ((ctxt != NULL) && (ctxt->flags & XML_VCTXT_USE_PCTXT)) { ret->content = content; if (content != NULL) content->parent = (xmlElementContentPtr) 1; @@ -2608,6 +2598,47 @@ xmlFree((char *)(str)); /** + * xmlValidNormalizeString: + * @str: a string + * + * Normalize a string in-place. + */ +static void +xmlValidNormalizeString(xmlChar *str) { + xmlChar *dst; + const xmlChar *src; + + if (str == NULL) + return; + src = str; + dst = str; + + while (*src == 0x20) src++; + while (*src != 0) { + if (*src == 0x20) { + while (*src == 0x20) src++; + if (*src != 0) + *dst++ = 0x20; + } else { + *dst++ = *src++; + } + } + *dst = 0; +} + +static int +xmlIsStreaming(xmlValidCtxtPtr ctxt) { + xmlParserCtxtPtr pctxt; + + if (ctxt == NULL) + return(0); + if ((ctxt->flags & XML_VCTXT_USE_PCTXT) == 0) + return(0); + pctxt = ctxt->userData; + return(pctxt->parseMode == XML_PARSE_READER); +} + +/** * xmlFreeID: * @not: A id * @@ -2650,7 +2681,7 @@ if (doc == NULL) { return(NULL); } - if (value == NULL) { + if ((value == NULL) || (value[0] == 0)) { return(NULL); } if (attr == NULL) { @@ -2681,7 +2712,7 @@ */ ret->value = xmlStrdup(value); ret->doc = doc; - if ((ctxt != NULL) && (ctxt->vstateNr != 0)) { + if (xmlIsStreaming(ctxt)) { /* * Operating in streaming mode, attr is gonna disappear */ @@ -2820,6 +2851,7 @@ ID = xmlNodeListGetString(doc, attr->children, 1); if (ID == NULL) return(-1); + xmlValidNormalizeString(ID); id = xmlHashLookup(table, ID); if (id == NULL || id->attr != attr) { @@ -2965,6 +2997,8 @@ * @value: the value name * @attr: the attribute holding the Ref * + * DEPRECATED, do not use. This function will be removed from the public API. + * * Register a new ref declaration * * Returns NULL if not, otherwise the new xmlRefPtr @@ -3009,7 +3043,7 @@ * fill the structure. */ ret->value = xmlStrdup(value); - if ((ctxt != NULL) && (ctxt->vstateNr != 0)) { + if (xmlIsStreaming(ctxt)) { /* * Operating in streaming mode, attr is gonna disappear */ @@ -3065,6 +3099,8 @@ * xmlFreeRefTable: * @table: An ref table * + * DEPRECATED, do not use. This function will be removed from the public API. + * * Deallocate the memory used by an Ref hash table. */ void @@ -3078,6 +3114,8 @@ * @elem: the element carrying the attribute * @attr: the attribute * + * DEPRECATED, do not use. This function will be removed from the public API. + * * Determine whether an attribute is of type Ref. In case we have DTD(s) * then this is simple, otherwise we use an heuristic: name Ref (upper * or lowercase). @@ -3120,6 +3158,8 @@ * @doc: the document * @attr: the attribute * + * DEPRECATED, do not use. This function will be removed from the public API. + * * Remove the given attribute from the Ref table maintained internally. * * Returns -1 if the lookup failed and 0 otherwise @@ -3176,6 +3216,8 @@ * @doc: pointer to the document * @ID: the ID value * + * DEPRECATED, do not use. This function will be removed from the public API. + * * Find the set of references for the supplied ID. * * Returns NULL if not found, otherwise node set for the ID. @@ -4028,8 +4070,7 @@ xmlChar * xmlValidCtxtNormalizeAttributeValue(xmlValidCtxtPtr ctxt, xmlDocPtr doc, xmlNodePtr elem, const xmlChar *name, const xmlChar *value) { - xmlChar *ret, *dst; - const xmlChar *src; + xmlChar *ret; xmlAttributePtr attrDecl = NULL; int extsubset = 0; @@ -4070,19 +4111,7 @@ ret = xmlStrdup(value); if (ret == NULL) return(NULL); - src = value; - dst = ret; - while (*src == 0x20) src++; - while (*src != 0) { - if (*src == 0x20) { - while (*src == 0x20) src++; - if (*src != 0) - *dst++ = 0x20; - } else { - *dst++ = *src++; - } - } - *dst = 0; + xmlValidNormalizeString(ret); if ((doc->standalone) && (extsubset == 1) && (!xmlStrEqual(value, ret))) { xmlErrValidNode(ctxt, elem, XML_DTD_NOT_STANDALONE, "standalone: %s on %s value had to be normalized based on external subset declaration\n", @@ -4114,8 +4143,7 @@ xmlChar * xmlValidNormalizeAttributeValue(xmlDocPtr doc, xmlNodePtr elem, const xmlChar *name, const xmlChar *value) { - xmlChar *ret, *dst; - const xmlChar *src; + xmlChar *ret; xmlAttributePtr attrDecl = NULL; if (doc == NULL) return(NULL); @@ -4145,19 +4173,7 @@ ret = xmlStrdup(value); if (ret == NULL) return(NULL); - src = value; - dst = ret; - while (*src == 0x20) src++; - while (*src != 0) { - if (*src == 0x20) { - while (*src == 0x20) src++; - if (*src != 0) - *dst++ = 0x20; - } else { - *dst++ = *src++; - } - } - *dst = 0; + xmlValidNormalizeString(ret); return(ret); } @@ -6655,8 +6671,8 @@ } /* trick to get correct line id report */ - save = ctxt->finishDtd; - ctxt->finishDtd = 0; + save = ctxt->flags; + ctxt->flags &= ~XML_VCTXT_USE_PCTXT; /* * Check all the NOTATION/NOTATIONS attributes @@ -6672,7 +6688,7 @@ ctxt->valid = 1; xmlHashScan(table, xmlValidateCheckRefCallback, ctxt); - ctxt->finishDtd = save; + ctxt->flags = save; return(ctxt->valid); } @@ -7134,5 +7150,3 @@ } #endif /* LIBXML_VALID_ENABLED */ -#define bottom_valid -#include "elfgcchack.h"
diff --git a/third_party/libxml/src/win32/VC10/README.vc10 b/third_party/libxml/src/win32/VC10/README.vc10 deleted file mode 100644 index 25c385b..0000000 --- a/third_party/libxml/src/win32/VC10/README.vc10 +++ /dev/null
@@ -1,27 +0,0 @@ - -README file for VC10 project files for libxml2 ----------------------------------------------- - -to clarify: This is not the readme file for the whole libxml2 project. -Rather, it's a readme for the VC10 project files, attached to the libxml2 project. - -Quick Start ------------ - -1) To use, load the libxml2.sln solution file into visual studio -2) check and correct paths for dependent "iconv" project which most certainly -are wrong on your environment. -3) Compile all projects - - -Background Info ---------------- - -Running of "configure.sh" won't make sense since VS doesn't support -this kind of build system and the environment is pretty much known already -if you're using Visual Studio. Instead, a preconfigured "config.h" file -is provided in the "win32\VC10" directory and referenced by the project -files already. - -The compile process is not completely warning-free: Some warnings will -appear during compile which can be ignored.
diff --git a/third_party/libxml/src/win32/VC10/RuleSet1.ruleset b/third_party/libxml/src/win32/VC10/RuleSet1.ruleset deleted file mode 100644 index 9985a6c6..0000000 --- a/third_party/libxml/src/win32/VC10/RuleSet1.ruleset +++ /dev/null
@@ -1,3 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<RuleSet Name="New Rule Set" Description=" " ToolsVersion="10.0"> -</RuleSet> \ No newline at end of file
diff --git a/third_party/libxml/src/win32/configure.js b/third_party/libxml/src/win32/configure.js index 8f03b464..d784f3b 100644 --- a/third_party/libxml/src/win32/configure.js +++ b/third_party/libxml/src/win32/configure.js
@@ -180,20 +180,6 @@ var fso, cf, vf, ln, s, iDot, iSlash; fso = new ActiveXObject("Scripting.FileSystemObject"); verCvs = ""; - if (useCvsVer && fso.FileExists("..\\CVS\\Entries")) { - cf = fso.OpenTextFile("..\\CVS\\Entries", 1); - while (cf.AtEndOfStream != true) { - ln = cf.ReadLine(); - s = new String(ln); - if (s.search(/^\/ChangeLog\//) != -1) { - iDot = s.indexOf("."); - iSlash = s.indexOf("/", iDot); - verCvs = "CVS" + s.substring(iDot + 1, iSlash); - break; - } - } - cf.Close(); - } cf = fso.OpenTextFile(configFile, 1); if (compiler == "msvc") versionFile = ".\\config.msvc";
diff --git a/third_party/libxml/src/win32/libxml2.def.src b/third_party/libxml/src/win32/libxml2.def.src index 1e771e85..c50d649 100644 --- a/third_party/libxml/src/win32/libxml2.def.src +++ b/third_party/libxml/src/win32/libxml2.def.src
@@ -1410,6 +1410,7 @@ xmlPedanticParserDefault xmlPopInput xmlPopInputCallbacks +xmlPopOutputCallbacks xmlPreviousElementSibling xmlPrintURI xmlPushInput
diff --git a/third_party/libxml/src/win32/libxml2.rc b/third_party/libxml/src/win32/libxml2.rc index c774a5e..39480f4 100644 --- a/third_party/libxml/src/win32/libxml2.rc +++ b/third_party/libxml/src/win32/libxml2.rc
@@ -26,7 +26,7 @@ VALUE "OriginalFilename", "libxml2.dll\0" VALUE "ProductName", "libxml2\0" VALUE "ProductVersion", LIBXML_DOTTED_VERSION "\0" - VALUE "Comments", "For more information visit http://xmlsoft.org/\0" + VALUE "Comments", "For more information visit https://gitlab.gnome.org/GNOME/libxml2\0" END END BLOCK "VarFileInfo"
diff --git a/third_party/libxml/src/xmlIO.c b/third_party/libxml/src/xmlIO.c index 007144c..a80ef11f 100644 --- a/third_party/libxml/src/xmlIO.c +++ b/third_party/libxml/src/xmlIO.c
@@ -12,11 +12,8 @@ #include "libxml.h" #include <string.h> -#include <stddef.h> -#ifdef HAVE_ERRNO_H +#include <stdlib.h> #include <errno.h> -#endif - #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> @@ -30,9 +27,6 @@ #ifdef HAVE_UNISTD_H #include <unistd.h> #endif -#ifdef HAVE_STDLIB_H -#include <stdlib.h> -#endif #ifdef LIBXML_ZLIB_ENABLED #include <zlib.h> #endif @@ -40,15 +34,11 @@ #include <lzma.h> #endif -#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) #define WIN32_LEAN_AND_MEAN #include <windows.h> #endif -#if defined(_WIN32_WCE) -#include <winnls.h> /* for CP_UTF8 */ -#endif - #ifndef S_ISDIR # ifdef _S_ISDIR # define S_ISDIR(x) _S_ISDIR(x) @@ -190,7 +180,7 @@ "unknown address family", /* EAFNOSUPPORT */ }; -#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) +#if defined(_WIN32) /** * __xmlIOWin32UTF8ToWChar: * @u8String: uft-8 string @@ -248,7 +238,6 @@ unsigned int idx; if (code == 0) { -#ifdef HAVE_ERRNO_H if (errno == 0) code = 0; #ifdef EACCES else if (errno == EACCES) code = XML_IO_EACCES; @@ -404,7 +393,6 @@ else if (errno == EAFNOSUPPORT) code = XML_IO_EAFNOSUPPORT; #endif else code = XML_IO_UNKNOWN; -#endif /* HAVE_ERRNO_H */ } idx = 0; if (code >= XML_IO_UNKNOWN) idx = code - XML_IO_UNKNOWN; @@ -595,7 +583,7 @@ * * ************************************************************************/ -#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) +#if defined(_WIN32) /** * xmlWrapOpenUtf8: @@ -696,7 +684,7 @@ xmlCheckFilename (const char *path) { #ifdef HAVE_STAT -#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) +#if defined(_WIN32) struct _stat stat_buffer; #else struct stat stat_buffer; @@ -706,7 +694,7 @@ return(0); #ifdef HAVE_STAT -#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) +#if defined(_WIN32) /* * On Windows stat and wstat do not work with long pathname, * which start with '\\?\' @@ -837,20 +825,20 @@ } if (!xmlStrncasecmp(BAD_CAST filename, BAD_CAST "file://localhost/", 17)) { -#if defined (_WIN32) || defined (__DJGPP__) && !defined(__CYGWIN__) +#if defined (_WIN32) path = &filename[17]; #else path = &filename[16]; #endif } else if (!xmlStrncasecmp(BAD_CAST filename, BAD_CAST "file:///", 8)) { -#if defined (_WIN32) || defined (__DJGPP__) && !defined(__CYGWIN__) +#if defined (_WIN32) path = &filename[8]; #else path = &filename[7]; #endif } else if (!xmlStrncasecmp(BAD_CAST filename, BAD_CAST "file:/", 6)) { /* lots of generators seems to lazy to read RFC 1738 */ -#if defined (_WIN32) || defined (__DJGPP__) && !defined(__CYGWIN__) +#if defined (_WIN32) path = &filename[6]; #else path = &filename[5]; @@ -863,10 +851,10 @@ return(NULL); #endif -#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) +#if defined(_WIN32) fd = xmlWrapOpenUtf8(path, 0); #else - fd = fopen(path, "r"); + fd = fopen(path, "rb"); #endif /* WIN32 */ if (fd == NULL) xmlIOErr(0, path); return((void *) fd); @@ -919,13 +907,13 @@ } if (!xmlStrncasecmp(BAD_CAST filename, BAD_CAST "file://localhost/", 17)) -#if defined (_WIN32) || defined (__DJGPP__) && !defined(__CYGWIN__) +#if defined (_WIN32) path = &filename[17]; #else path = &filename[16]; #endif else if (!xmlStrncasecmp(BAD_CAST filename, BAD_CAST "file:///", 8)) { -#if defined (_WIN32) || defined (__DJGPP__) && !defined(__CYGWIN__) +#if defined (_WIN32) path = &filename[8]; #else path = &filename[7]; @@ -936,7 +924,7 @@ if (path == NULL) return(NULL); -#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) +#if defined(_WIN32) fd = xmlWrapOpenUtf8(path, 1); #elif(__MVS__) fd = fopen(path, "w"); @@ -1109,13 +1097,13 @@ } if (!xmlStrncasecmp(BAD_CAST filename, BAD_CAST "file://localhost/", 17)) -#if defined (_WIN32) || defined (__DJGPP__) && !defined(__CYGWIN__) +#if defined (_WIN32) path = &filename[17]; #else path = &filename[16]; #endif else if (!xmlStrncasecmp(BAD_CAST filename, BAD_CAST "file:///", 8)) { -#if defined (_WIN32) || defined (__DJGPP__) && !defined(__CYGWIN__) +#if defined (_WIN32) path = &filename[8]; #else path = &filename[7]; @@ -1128,7 +1116,7 @@ if (!xmlCheckFilename(path)) return(NULL); -#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) +#if defined(_WIN32) fd = xmlWrapGzOpenUtf8(path, "rb"); #else fd = gzopen(path, "rb"); @@ -1188,13 +1176,13 @@ } if (!xmlStrncasecmp(BAD_CAST filename, BAD_CAST "file://localhost/", 17)) -#if defined (_WIN32) || defined (__DJGPP__) && !defined(__CYGWIN__) +#if defined (_WIN32) path = &filename[17]; #else path = &filename[16]; #endif else if (!xmlStrncasecmp(BAD_CAST filename, BAD_CAST "file:///", 8)) { -#if defined (_WIN32) || defined (__DJGPP__) && !defined(__CYGWIN__) +#if defined (_WIN32) path = &filename[8]; #else path = &filename[7]; @@ -1205,7 +1193,7 @@ if (path == NULL) return(NULL); -#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) +#if defined(_WIN32) fd = xmlWrapGzOpenUtf8(path, mode); #else fd = gzopen(path, mode); @@ -3765,16 +3753,12 @@ char dir[1024]; char *cur; -#ifdef _WIN32_WCE /* easy way by now ... wince does not have dirs! */ - return NULL; -#endif - if (xmlInputCallbackInitialized == 0) xmlRegisterDefaultInputCallbacks(); if (filename == NULL) return(NULL); -#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) # define IS_XMLPGD_SEP(ch) ((ch=='/')||(ch=='\\')) #else # define IS_XMLPGD_SEP(ch) (ch=='/') @@ -3821,6 +3805,9 @@ */ xmlParserInputPtr xmlCheckHTTPInput(xmlParserCtxtPtr ctxt, xmlParserInputPtr ret) { + /* Avoid unused variable warning if features are disabled. */ + (void) ctxt; + #ifdef LIBXML_HTTP_ENABLED if ((ret != NULL) && (ret->buf != NULL) && (ret->buf->readcallback == xmlIOHTTPRead) && @@ -3888,13 +3875,13 @@ return(0); if (!xmlStrncasecmp(BAD_CAST URL, BAD_CAST "file://localhost/", 17)) -#if defined (_WIN32) || defined (__DJGPP__) && !defined(__CYGWIN__) +#if defined (_WIN32) path = &URL[17]; #else path = &URL[16]; #endif else if (!xmlStrncasecmp(BAD_CAST URL, BAD_CAST "file:///", 8)) { -#if defined (_WIN32) || defined (__DJGPP__) && !defined(__CYGWIN__) +#if defined (_WIN32) path = &URL[8]; #else path = &URL[7]; @@ -4133,5 +4120,3 @@ return(input); } -#define bottom_xmlIO -#include "elfgcchack.h"
diff --git a/third_party/libxml/src/xmlmemory.c b/third_party/libxml/src/xmlmemory.c index e0b2531..eeb76c37 100644 --- a/third_party/libxml/src/xmlmemory.c +++ b/third_party/libxml/src/xmlmemory.c
@@ -8,27 +8,14 @@ #include "libxml.h" #include <string.h> +#include <stdlib.h> +#include <ctype.h> +#include <time.h> #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> #endif -#ifdef HAVE_TIME_H -#include <time.h> -#endif - -#ifdef HAVE_STDLIB_H -#include <stdlib.h> -#else -#ifdef HAVE_MALLOC_H -#include <malloc.h> -#endif -#endif - -#ifdef HAVE_CTYPE_H -#include <ctype.h> -#endif - /* #define DEBUG_MEMORY */ /** @@ -759,12 +746,10 @@ MEMHDR *p; unsigned idx; int nb = 0; -#if defined(HAVE_LOCALTIME) && defined(HAVE_STRFTIME) time_t currentTime; char buf[500]; struct tm * tstruct; #endif -#endif FILE *old_fp = fp; if (fp == NULL) { @@ -774,12 +759,10 @@ } #ifdef MEM_LIST -#if defined(HAVE_LOCALTIME) && defined(HAVE_STRFTIME) currentTime = time(NULL); tstruct = localtime(¤tTime); strftime(buf, sizeof(buf) - 1, "%I:%M:%S %p", tstruct); fprintf(fp," %s\n\n", buf); -#endif fprintf(fp," MEMORY ALLOCATED : %lu, MAX was %lu\n", @@ -963,9 +946,7 @@ int xmlInitMemory(void) { -#ifdef HAVE_STDLIB_H char *breakpoint; -#endif #ifdef DEBUG_MEMORY xmlGenericError(xmlGenericErrorContext, "xmlInitMemory()\n"); @@ -978,18 +959,14 @@ xmlMemInitialized = 1; xmlMemMutex = xmlNewMutex(); -#ifdef HAVE_STDLIB_H breakpoint = getenv("XML_MEM_BREAKPOINT"); if (breakpoint != NULL) { sscanf(breakpoint, "%ud", &xmlMemStopAtBlock); } -#endif -#ifdef HAVE_STDLIB_H breakpoint = getenv("XML_MEM_TRACE"); if (breakpoint != NULL) { sscanf(breakpoint, "%p", &xmlMemTraceBlockAt); } -#endif #ifdef DEBUG_MEMORY xmlGenericError(xmlGenericErrorContext, @@ -1159,5 +1136,3 @@ return(0); } -#define bottom_xmlmemory -#include "elfgcchack.h"
diff --git a/third_party/libxml/src/xmlreader.c b/third_party/libxml/src/xmlreader.c index 72e40b0..45062a4 100644 --- a/third_party/libxml/src/xmlreader.c +++ b/third_party/libxml/src/xmlreader.c
@@ -20,13 +20,8 @@ #ifdef LIBXML_READER_ENABLED #include <string.h> /* for memset() only ! */ #include <stdarg.h> - -#ifdef HAVE_CTYPE_H #include <ctype.h> -#endif -#ifdef HAVE_STDLIB_H #include <stdlib.h> -#endif #include <libxml/xmlmemory.h> #include <libxml/xmlIO.h> @@ -229,116 +224,6 @@ static void xmlTextReaderFreeNodeList(xmlTextReaderPtr reader, xmlNodePtr cur); /** - * xmlFreeID: - * @not: A id - * - * Deallocate the memory used by an id definition - */ -static void -xmlFreeID(xmlIDPtr id) { - xmlDictPtr dict = NULL; - - if (id == NULL) return; - - if (id->doc != NULL) - dict = id->doc->dict; - - if (id->value != NULL) - DICT_FREE(id->value) - if (id->name != NULL) - DICT_FREE(id->name) - xmlFree(id); -} - -/** - * xmlTextReaderRemoveID: - * @doc: the document - * @attr: the attribute - * - * Remove the given attribute from the ID table maintained internally. - * - * Returns -1 if the lookup failed and 0 otherwise - */ -static int -xmlTextReaderRemoveID(xmlDocPtr doc, xmlAttrPtr attr) { - xmlIDTablePtr table; - xmlIDPtr id; - xmlChar *ID; - - if (doc == NULL) return(-1); - if (attr == NULL) return(-1); - table = (xmlIDTablePtr) doc->ids; - if (table == NULL) - return(-1); - - ID = xmlNodeListGetString(doc, attr->children, 1); - if (ID == NULL) - return(-1); - id = xmlHashLookup(table, ID); - xmlFree(ID); - if (id == NULL || id->attr != attr) { - return(-1); - } - id->name = attr->name; - attr->name = NULL; - id->attr = NULL; - return(0); -} - -/** - * xmlTextReaderWalkRemoveRef: - * @data: Contents of current link - * @user: Value supplied by the user - * - * Returns 0 to abort the walk or 1 to continue - */ -static int -xmlTextReaderWalkRemoveRef(const void *data, void *user) -{ - xmlRefPtr ref = (xmlRefPtr)data; - xmlAttrPtr attr = (xmlAttrPtr)user; - - if (ref->attr == attr) { /* Matched: remove and terminate walk */ - ref->name = xmlStrdup(attr->name); - ref->attr = NULL; - return 0; - } - return 1; -} - -/** - * xmlTextReaderRemoveRef: - * @doc: the document - * @attr: the attribute - * - * Remove the given attribute from the Ref table maintained internally. - * - * Returns -1 if the lookup failed and 0 otherwise - */ -static int -xmlTextReaderRemoveRef(xmlDocPtr doc, xmlAttrPtr attr) { - xmlListPtr ref_list; - xmlRefTablePtr table; - xmlChar *ID; - - if (doc == NULL) return(-1); - if (attr == NULL) return(-1); - table = (xmlRefTablePtr) doc->refs; - if (table == NULL) - return(-1); - - ID = xmlNodeListGetString(doc, attr->children, 1); - if (ID == NULL) - return(-1); - ref_list = xmlHashLookup(table, ID); - xmlFree(ID); - if(ref_list == NULL) - return (-1); - xmlListWalk(ref_list, xmlTextReaderWalkRemoveRef, attr); - return(0); -} - -/** * xmlTextReaderFreeProp: * @reader: the xmlTextReaderPtr used * @cur: the node @@ -358,15 +243,6 @@ if ((__xmlRegisterCallbacks) && (xmlDeregisterNodeDefaultValue)) xmlDeregisterNodeDefaultValue((xmlNodePtr) cur); - /* Check for ID removal -> leading to invalid references ! */ - if ((cur->parent != NULL) && (cur->parent->doc != NULL)) { - if (xmlIsID(cur->parent->doc, cur->parent, cur)) - xmlTextReaderRemoveID(cur->parent->doc, cur); - if (((cur->parent->doc->intSubset != NULL) || - (cur->parent->doc->extSubset != NULL)) && - (xmlIsRef(cur->parent->doc, cur->parent, cur))) - xmlTextReaderRemoveRef(cur->parent->doc, cur); - } if (cur->children != NULL) xmlTextReaderFreeNodeList(reader, cur->children); @@ -570,22 +446,6 @@ } } -static void -xmlTextReaderFreeIDTableEntry(void *id, const xmlChar *name ATTRIBUTE_UNUSED) { - xmlFreeID((xmlIDPtr) id); -} - -/** - * xmlTextReaderFreeIDTable: - * @table: An id table - * - * Deallocate the memory used by an ID hash table. - */ -static void -xmlTextReaderFreeIDTable(xmlIDTablePtr table) { - xmlHashFree(table, xmlTextReaderFreeIDTableEntry); -} - /** * xmlTextReaderFreeDoc: * @reader: the xmlTextReaderPtr used @@ -605,7 +465,7 @@ /* * Do this before freeing the children list to avoid ID lookups */ - if (cur->ids != NULL) xmlTextReaderFreeIDTable((xmlIDTablePtr) cur->ids); + if (cur->ids != NULL) xmlFreeIDTable((xmlIDTablePtr) cur->ids); cur->ids = NULL; if (cur->refs != NULL) xmlFreeRefTable((xmlRefTablePtr) cur->refs); cur->refs = NULL; @@ -6028,6 +5888,5 @@ } #endif #endif /* NOT_USED_YET */ -#define bottom_xmlreader -#include "elfgcchack.h" + #endif /* LIBXML_READER_ENABLED */
diff --git a/third_party/libxml/src/xmlsave.c b/third_party/libxml/src/xmlsave.c index 489505f..3addd65 100644 --- a/third_party/libxml/src/xmlsave.c +++ b/third_party/libxml/src/xmlsave.c
@@ -2731,5 +2731,3 @@ #endif /* LIBXML_OUTPUT_ENABLED */ -#define bottom_xmlsave -#include "elfgcchack.h"
diff --git a/third_party/libxml/src/xmlstring.c b/third_party/libxml/src/xmlstring.c index 5a6875f5..46301c3 100644 --- a/third_party/libxml/src/xmlstring.c +++ b/third_party/libxml/src/xmlstring.c
@@ -424,13 +424,7 @@ int xmlStrlen(const xmlChar *str) { - size_t len = 0; - - if (str == NULL) return(0); - while (*str != 0) { /* non input consuming */ - str++; - len++; - } + size_t len = str ? strlen((const char *)str) : 0; return(len > INT_MAX ? 0 : len); } @@ -1051,5 +1045,3 @@ return *msg; } -#define bottom_xmlstring -#include "elfgcchack.h"
diff --git a/third_party/libxml/src/xmlunicode.c b/third_party/libxml/src/xmlunicode.c index 6d0a96a..d34ba8f 100644 --- a/third_party/libxml/src/xmlunicode.c +++ b/third_party/libxml/src/xmlunicode.c
@@ -3174,6 +3174,4 @@ return (func(code)); } -#define bottom_xmlunicode -#include "elfgcchack.h" #endif /* LIBXML_UNICODE_ENABLED */
diff --git a/third_party/libxml/src/xmlwriter.c b/third_party/libxml/src/xmlwriter.c index 58445c8..2ca2056 100644 --- a/third_party/libxml/src/xmlwriter.c +++ b/third_party/libxml/src/xmlwriter.c
@@ -4733,6 +4733,4 @@ return sum; } -#define bottom_xmlwriter -#include "elfgcchack.h" #endif
diff --git a/third_party/libxml/src/xpath.c b/third_party/libxml/src/xpath.c index 6735395..982fc83 100644 --- a/third_party/libxml/src/xpath.c +++ b/third_party/libxml/src/xpath.c
@@ -25,22 +25,13 @@ #include <limits.h> #include <string.h> #include <stddef.h> +#include <math.h> +#include <float.h> +#include <ctype.h> #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> #endif -#ifdef HAVE_MATH_H -#include <math.h> -#endif -#ifdef HAVE_FLOAT_H -#include <float.h> -#endif -#ifdef HAVE_CTYPE_H -#include <ctype.h> -#endif -#ifdef HAVE_SIGNAL_H -#include <signal.h> -#endif #include <libxml/xmlmemory.h> #include <libxml/tree.h> @@ -14732,5 +14723,3 @@ } #endif /* LIBXML_XPATH_ENABLED */ -#define bottom_xpath -#include "elfgcchack.h"
diff --git a/third_party/libxml/win32/config.h b/third_party/libxml/win32/config.h index 54392f49..d804404a 100644 --- a/third_party/libxml/win32/config.h +++ b/third_party/libxml/win32/config.h
@@ -1,25 +1,14 @@ #ifndef __LIBXML_WIN32_CONFIG__ #define __LIBXML_WIN32_CONFIG__ -#define HAVE_CTYPE_H -#define HAVE_STDARG_H -#define HAVE_MALLOC_H -#define HAVE_ERRNO_H #define SEND_ARG2_CAST #define GETHOSTBYNAME_ARG_CAST -#if defined(_WIN32_WCE) -#undef HAVE_ERRNO_H -#include "wincecompat.h" -#else #define HAVE_SYS_STAT_H #define HAVE_STAT -#define HAVE_STDLIB_H -#define HAVE_TIME_H #define HAVE_FCNTL_H #include <io.h> #include <direct.h> -#endif #include <libxml/xmlversion.h>
diff --git a/third_party/libxml/win32/include/libxml/xmlversion.h b/third_party/libxml/win32/include/libxml/xmlversion.h index 31593ed..72883c8 100644 --- a/third_party/libxml/win32/include/libxml/xmlversion.h +++ b/third_party/libxml/win32/include/libxml/xmlversion.h
@@ -29,26 +29,26 @@ * * the version string like "1.2.3" */ -#define LIBXML_DOTTED_VERSION "2.9.12" +#define LIBXML_DOTTED_VERSION "2.9.13" /** * LIBXML_VERSION: * * the version number: 1.2.3 value is 10203 */ -#define LIBXML_VERSION 20912 +#define LIBXML_VERSION 20913 /** * LIBXML_VERSION_STRING: * * the version number string, 1.2.3 value is "10203" */ -#define LIBXML_VERSION_STRING "20912" +#define LIBXML_VERSION_STRING "20913" /** * LIBXML_VERSION_EXTRA: * - * extra version information, used to show a CVS compilation + * extra version information, used to show a git commit description */ #define LIBXML_VERSION_EXTRA "" @@ -58,7 +58,7 @@ * Macro to check that the libxml version in use is compatible with * the version the software has been compiled against */ -#define LIBXML_TEST_VERSION xmlCheckVersion(20912); +#define LIBXML_TEST_VERSION xmlCheckVersion(20913); #ifndef VMS #if 0 @@ -456,6 +456,15 @@ # define LIBXML_ATTR_FORMAT(fmt,args) #endif +#ifndef XML_DEPRECATED +# ifdef IN_LIBXML +# define XML_DEPRECATED +# else +/* Available since at least GCC 3.1 */ +# define XML_DEPRECATED __attribute__((deprecated)) +# endif +#endif + #else /* ! __GNUC__ */ /** * ATTRIBUTE_UNUSED: @@ -475,6 +484,15 @@ * Macro used to indicate to GCC the parameter are printf like */ #define LIBXML_ATTR_FORMAT(fmt,args) +/** + * XML_DEPRECATED: + * + * Macro used to indicate that a function, variable, type or struct member + * is deprecated. + */ +#ifndef XML_DEPRECATED +#define XML_DEPRECATED +#endif #endif /* __GNUC__ */ #ifdef __cplusplus
diff --git a/third_party/tflite_support/README.chromium b/third_party/tflite_support/README.chromium index 2a607e5..7792da1 100644 --- a/third_party/tflite_support/README.chromium +++ b/third_party/tflite_support/README.chromium
@@ -1,8 +1,8 @@ Name: TensorFlow Lite Support Short Name: tflite-support URL: https://github.com/tensorflow/tflite-support -Version: 27decd8a9f30004d01b1cd5f40f27e7b1be20fa5 -Date: 2022/02/07 +Version: 71db695ff9b4118b042892745ae5cdf49420abf8 +Date: 2022/03/09 License: Apache 2.0 License File: LICENSE Security Critical: Yes @@ -23,23 +23,32 @@ 01) Use re2::StringPiece instead of absl::string_view in regex_tokenizer.cc 02) Remove support for sentencepiece tokenization because the required overhead isn't worth adding this functionality, esp since no feature team needs it. -03) [To Be Upstreamed] Remove unused functions. -04) Remove the ABSL_DEPRECATED annotation from a deprecated struct since this +03) Remove the ABSL_DEPRECATED annotation from a deprecated struct since this is a no-op in chromium builds and upsets clang. -05) [To Be Upstreamed] Use size_t in for loop in nl_classifier.h -06) [To Be Upstreamed] Remove unused variable in task_utils.h -07) Do not use absl::any since it is not supported in chromium -08) [To Be Upstreamed] Remove unused stl include in tokenizer_jni_lib.h -09) Remove memory mapped file support in external_file_handler.cc since it is +04) Do not use absl::any since it is not supported in chromium +05) Remove memory mapped file support in external_file_handler.cc since it is only available on POSIX systems. -10) Run clang-format. -11) Remove unbuilt files that triggered checkdeps warnings, and fix file perms. -12) Remove an unneeded static initializer. -13) Surface the error from NLClassifier::Classify. +06) Remove an unneeded static initializer. +07) Surface the error from NLClassifier::Classify. +08) Remove unbuilt files that triggered checkdeps warnings, and fix file perms. + * Note that this patch might not apply cleanly, so just do everything that + `git cl presubmit` tells you to do. +09) Run clang-format. + * This patch might not apply cleanly, so run `git cl format` and commit the + changes. Update Process (internal: http://shortn/_nwz8liqimy): -1) Clone the tflite-support github repo at the desired commit into src/ -2) Apply each patch listed above residing in patches/ using `git apply patches/$PATCHFILE` +1) Run these commands: +``` +pushd third_party/tflite_support/ +rm -rf src/ +git clone https://github.com/tensorflow/tflite-support/ +mv tflite-support/ src/ +rm -rf src/.git/ +popd +``` +2) Apply each patch listed above residing in patches/ using `git apply +third_party/tflite_support/patches/$PATCHFILE`. 3) Get the build working. 4) Record the patches made with `git format-patches HEAD -<number of changes>`
diff --git a/third_party/tflite_support/patches/0001-use-re2-StringPiece-for-RegexTokenizer-Tokenize.patch b/third_party/tflite_support/patches/0001-use-re2-StringPiece-for-RegexTokenizer-Tokenize.patch index b051f7b..eb5540b 100644 --- a/third_party/tflite_support/patches/0001-use-re2-StringPiece-for-RegexTokenizer-Tokenize.patch +++ b/third_party/tflite_support/patches/0001-use-re2-StringPiece-for-RegexTokenizer-Tokenize.patch
@@ -1,7 +1,7 @@ -From d421ebb9f37d777ab5315eb2c59a5e21e06459e0 Mon Sep 17 00:00:00 2001 +From 8b3d288ee3814836676b0f91d5ddb5468b900482 Mon Sep 17 00:00:00 2001 From: Robert Ogden <robertogden@chromium.org> -Date: Mon, 7 Feb 2022 12:09:19 -0800 -Subject: [PATCH 01/13] use re2 StringPiece for RegexTokenizer Tokenize +Date: Wed, 9 Mar 2022 10:27:31 -0800 +Subject: [PATCH 1/9] use re2 StringPiece for RegexTokenizer Tokenize --- .../cc/text/tokenizers/regex_tokenizer.cc | 8 ++++---- @@ -32,5 +32,5 @@ bool has_non_empty_token = token.length() > 0; -- -2.35.0.263.gb82422642f-goog +2.35.1.616.g0bdcbb4464-goog
diff --git a/third_party/tflite_support/patches/0002-sentencepiece-tokenization-not-supported.patch b/third_party/tflite_support/patches/0002-sentencepiece-tokenization-not-supported.patch index 6108d2f..b82e3c1 100644 --- a/third_party/tflite_support/patches/0002-sentencepiece-tokenization-not-supported.patch +++ b/third_party/tflite_support/patches/0002-sentencepiece-tokenization-not-supported.patch
@@ -1,7 +1,7 @@ -From 82dbaee5458261aea38947c38193f1e47ba553df Mon Sep 17 00:00:00 2001 +From 6b4fe6d8b5f064f534ec1edafa5b4e710d2f6b6d Mon Sep 17 00:00:00 2001 From: Robert Ogden <robertogden@chromium.org> -Date: Mon, 7 Feb 2022 12:09:37 -0800 -Subject: [PATCH 02/13] sentencepiece tokenization not supported +Date: Wed, 9 Mar 2022 10:28:11 -0800 +Subject: [PATCH 2/9] sentencepiece tokenization not supported --- .../cc/text/tokenizers/tokenizer_utils.cc | 14 ++++---------- @@ -47,5 +47,5 @@ case ProcessUnitOptions_RegexTokenizerOptions: { const tflite::RegexTokenizerOptions* options = -- -2.35.0.263.gb82422642f-goog +2.35.1.616.g0bdcbb4464-goog
diff --git a/third_party/tflite_support/patches/0004-rm-noop-deprecated-attribute.patch b/third_party/tflite_support/patches/0003-rm-noop-deprecated-attribute.patch similarity index 80% rename from third_party/tflite_support/patches/0004-rm-noop-deprecated-attribute.patch rename to third_party/tflite_support/patches/0003-rm-noop-deprecated-attribute.patch index 7141e09..406ae5a3 100644 --- a/third_party/tflite_support/patches/0004-rm-noop-deprecated-attribute.patch +++ b/third_party/tflite_support/patches/0003-rm-noop-deprecated-attribute.patch
@@ -1,14 +1,14 @@ -From b868bbc904b8ae8ff84ce8f96af6b9db13d138cb Mon Sep 17 00:00:00 2001 +From c2a246349d5b24fead94f71e4168fbff17e5d156 Mon Sep 17 00:00:00 2001 From: Robert Ogden <robertogden@chromium.org> -Date: Mon, 7 Feb 2022 12:10:28 -0800 -Subject: [PATCH 04/13] rm noop deprecated attribute +Date: Wed, 9 Mar 2022 10:29:00 -0800 +Subject: [PATCH 3/9] rm noop deprecated attribute --- .../cc/task/text/nlclassifier/nl_classifier.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/nlclassifier/nl_classifier.h b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/nlclassifier/nl_classifier.h -index 74baa99f2752a..d97b2feb4d915 100644 +index d92a274f85a68..ab5126348f380 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/nlclassifier/nl_classifier.h +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/nlclassifier/nl_classifier.h @@ -43,9 +43,6 @@ namespace text { @@ -22,5 +22,5 @@ int input_tensor_index = 0; int output_score_tensor_index = 0; -- -2.35.0.263.gb82422642f-goog +2.35.1.616.g0bdcbb4464-goog
diff --git a/third_party/tflite_support/patches/0003-rm-unused-func.patch b/third_party/tflite_support/patches/0003-rm-unused-func.patch deleted file mode 100644 index 58be7a6f..0000000 --- a/third_party/tflite_support/patches/0003-rm-unused-func.patch +++ /dev/null
@@ -1,224 +0,0 @@ -From 9a8667b3d3be2ef20a88dfe9d50a1345d136da3e Mon Sep 17 00:00:00 2001 -From: Robert Ogden <robertogden@chromium.org> -Date: Mon, 7 Feb 2022 12:09:58 -0800 -Subject: [PATCH 03/13] rm unused func - ---- - .../vision/utils/libyuv_frame_buffer_utils.cc | 201 +----------------- - 1 file changed, 1 insertion(+), 200 deletions(-) - -diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/vision/utils/libyuv_frame_buffer_utils.cc b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/vision/utils/libyuv_frame_buffer_utils.cc -index 0ece48636504e..6fd3ca81c984c 100644 ---- a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/vision/utils/libyuv_frame_buffer_utils.cc -+++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/vision/utils/libyuv_frame_buffer_utils.cc -@@ -1326,206 +1326,7 @@ absl::Status CropResize(const FrameBuffer& buffer, int x0, int y0, int x1, - } - } - --// Returns the scaled dimension of the input_size best fit within the --// output_size bound while respecting the aspect ratio. --FrameBuffer::Dimension GetScaledDimension(FrameBuffer::Dimension input_size, -- FrameBuffer::Dimension output_size) { -- int original_width = input_size.width; -- int original_height = input_size.height; -- int bound_width = output_size.width; -- int bound_height = output_size.height; -- int new_width = original_width; -- int new_height = original_height; -- -- // Try to fit the width first. -- new_width = bound_width; -- new_height = (new_width * original_height) / original_width; -- -- // Try to fit the height if needed. -- if (new_height > bound_height) { -- new_height = bound_height; -- new_width = (new_height * original_width) / original_height; -- } -- return FrameBuffer::Dimension{.width = new_width, .height = new_height}; --} -- --// This method only supports kGRAY, kRGBA, and kRGB formats. --absl::Status UniformCropResizePlane(const FrameBuffer& buffer, -- std::vector<int> crop_coordinates, -- FrameBuffer* output_buffer) { -- int x0 = 0, y0 = 0; -- FrameBuffer::Dimension input_dimension = buffer.dimension(); -- if (!crop_coordinates.empty()) { -- x0 = crop_coordinates[0]; -- y0 = crop_coordinates[1]; -- input_dimension = -- GetCropDimension(x0, crop_coordinates[2], y0, crop_coordinates[3]); -- } -- if (input_dimension == output_buffer->dimension()) { -- // Cropping only case. -- return CropPlane(buffer, x0, y0, crop_coordinates[2], crop_coordinates[3], -- output_buffer); -- } -- -- // Cropping is achieved by adjusting origin to (x0, y0). -- ASSIGN_OR_RETURN(int pixel_stride, GetPixelStrides(buffer.format())); -- int adjusted_offset = -- buffer.plane(0).stride.row_stride_bytes * y0 + x0 * pixel_stride; -- FrameBuffer::Plane plane = { -- /*buffer=*/buffer.plane(0).buffer + adjusted_offset, -- /*stride=*/{buffer.plane(0).stride.row_stride_bytes, pixel_stride}}; -- auto adjusted_buffer = -- FrameBuffer::Create({plane}, input_dimension, buffer.format(), -- buffer.orientation(), buffer.timestamp()); -- -- // Uniform resize is achieved by adjusting the resize dimension to fit the -- // output_buffer and respect the input aspect ratio at the same time. We -- // create an intermediate output buffer with adjusted dimension and point its -- // backing buffer to the output_buffer. Note the stride information on the -- // adjusted_output_buffer is not used in the Resize* methods. -- FrameBuffer::Dimension adjusted_dimension = -- GetScaledDimension(input_dimension, output_buffer->dimension()); -- FrameBuffer::Plane output_plane = {/*buffer=*/output_buffer->plane(0).buffer, -- /*stride=*/output_buffer->plane(0).stride}; -- auto adjusted_output_buffer = FrameBuffer::Create( -- {output_plane}, adjusted_dimension, output_buffer->format(), -- output_buffer->orientation(), output_buffer->timestamp()); -- -- switch (buffer.format()) { -- case FrameBuffer::Format::kRGB: -- return ResizeRgb(*adjusted_buffer, adjusted_output_buffer.get()); -- case FrameBuffer::Format::kRGBA: -- return ResizeRgba(*adjusted_buffer, adjusted_output_buffer.get()); -- case FrameBuffer::Format::kGRAY: -- return ResizeGray(*adjusted_buffer, adjusted_output_buffer.get()); -- default: -- return CreateStatusWithPayload( -- StatusCode::kInternal, -- absl::StrFormat("Format %i is not supported.", buffer.format()), -- TfLiteSupportStatus::kImageProcessingError); -- } --} -- --absl::Status UniformCropResizeYuv(const FrameBuffer& buffer, -- std::vector<int> crop_coordinates, -- FrameBuffer* output_buffer) { -- int x0 = 0, y0 = 0; -- FrameBuffer::Dimension input_dimension = buffer.dimension(); -- if (!crop_coordinates.empty()) { -- x0 = crop_coordinates[0]; -- y0 = crop_coordinates[1]; -- input_dimension = -- GetCropDimension(x0, crop_coordinates[2], y0, crop_coordinates[3]); -- } -- if (input_dimension == output_buffer->dimension()) { -- // Cropping only case. -- int x1 = crop_coordinates[2]; -- int y1 = crop_coordinates[3]; -- switch (buffer.format()) { -- case FrameBuffer::Format::kNV12: -- case FrameBuffer::Format::kNV21: -- return CropNv(buffer, x0, y0, x1, y1, output_buffer); -- case FrameBuffer::Format::kYV12: -- case FrameBuffer::Format::kYV21: -- return CropYv(buffer, x0, y0, x1, y1, output_buffer); -- default: -- return CreateStatusWithPayload( -- StatusCode::kInternal, -- absl::StrFormat("Format %i is not supported.", buffer.format()), -- TfLiteSupportStatus::kImageProcessingError); -- } -- } -- -- // Cropping is achieved by adjusting origin to (x0, y0). -- ASSIGN_OR_RETURN(FrameBuffer::YuvData input_data, -- FrameBuffer::GetYuvDataFromFrameBuffer(buffer)); -- // Cropping YUV planes by offsetting the origins of each plane. -- // TODO(b/152629712): Investigate the impact of color shifting caused by the -- // bounding box with odd X or Y starting positions. -- const int plane_y_offset = input_data.y_row_stride * y0 + x0; -- const int plane_uv_offset = input_data.uv_row_stride * (y0 / 2) + -- input_data.uv_pixel_stride * (x0 / 2); -- FrameBuffer::Plane adjusted_plane_y = { -- /*buffer=*/input_data.y_buffer + plane_y_offset, -- /*stride=*/{input_data.y_row_stride, /*pixel_stride_bytes=*/1}}; -- FrameBuffer::Plane adjusted_plane_u = { -- /*buffer=*/input_data.u_buffer + plane_uv_offset, -- /*stride=*/{input_data.uv_row_stride, input_data.uv_pixel_stride}}; -- FrameBuffer::Plane adjusted_plane_v = { -- /*buffer=*/input_data.v_buffer + plane_uv_offset, -- /*stride=*/{input_data.uv_row_stride, input_data.uv_pixel_stride}}; -- -- // Uniform resize is achieved by adjusting the resize dimension to fit the -- // output_buffer and respect the input aspect ratio at the same time. For -- // YUV formats, we need access to the actual output dimension to get the -- // correct address of each plane. For this, we are not calling ResizeNv or -- // ResizeYv but the libyuv scale methods directly. -- FrameBuffer::Dimension adjusted_dimension = -- GetScaledDimension(input_dimension, output_buffer->dimension()); -- ASSIGN_OR_RETURN(FrameBuffer::YuvData output_data, -- FrameBuffer::GetYuvDataFromFrameBuffer(*output_buffer)); -- -- switch (buffer.format()) { -- case FrameBuffer::Format::kNV12: { -- int ret = libyuv::NV12Scale( -- adjusted_plane_y.buffer, adjusted_plane_y.stride.row_stride_bytes, -- adjusted_plane_u.buffer, adjusted_plane_u.stride.row_stride_bytes, -- input_dimension.width, input_dimension.height, -- const_cast<uint8_t*>(output_data.y_buffer), output_data.y_row_stride, -- const_cast<uint8_t*>(output_data.u_buffer), output_data.uv_row_stride, -- adjusted_dimension.width, adjusted_dimension.height, -- libyuv::FilterMode::kFilterBilinear); -- if (ret != 0) { -- return CreateStatusWithPayload( -- StatusCode::kUnknown, "Libyuv NV12Scale operation failed.", -- TfLiteSupportStatus::kImageProcessingBackendError); -- } -- return absl::OkStatus(); -- } -- case FrameBuffer::Format::kNV21: { -- int ret = libyuv::NV12Scale( -- adjusted_plane_y.buffer, adjusted_plane_y.stride.row_stride_bytes, -- adjusted_plane_v.buffer, adjusted_plane_v.stride.row_stride_bytes, -- input_dimension.width, input_dimension.height, -- const_cast<uint8_t*>(output_data.y_buffer), output_data.y_row_stride, -- const_cast<uint8_t*>(output_data.v_buffer), output_data.uv_row_stride, -- adjusted_dimension.width, adjusted_dimension.height, -- libyuv::FilterMode::kFilterBilinear); -- if (ret != 0) { -- return CreateStatusWithPayload( -- StatusCode::kUnknown, "Libyuv NV12Scale operation failed.", -- TfLiteSupportStatus::kImageProcessingBackendError); -- } -- return absl::OkStatus(); -- } -- case FrameBuffer::Format::kYV12: -- case FrameBuffer::Format::kYV21: { -- int ret = libyuv::I420Scale( -- adjusted_plane_y.buffer, adjusted_plane_y.stride.row_stride_bytes, -- adjusted_plane_u.buffer, adjusted_plane_u.stride.row_stride_bytes, -- adjusted_plane_v.buffer, adjusted_plane_v.stride.row_stride_bytes, -- input_dimension.width, input_dimension.height, -- const_cast<uint8_t*>(output_data.y_buffer), output_data.y_row_stride, -- const_cast<uint8_t*>(output_data.u_buffer), output_data.uv_row_stride, -- const_cast<uint8_t*>(output_data.v_buffer), output_data.uv_row_stride, -- adjusted_dimension.width, adjusted_dimension.height, -- libyuv::FilterMode::kFilterBilinear); -- if (ret != 0) { -- return CreateStatusWithPayload( -- StatusCode::kUnknown, "Libyuv I420Scale operation failed.", -- TfLiteSupportStatus::kImageProcessingBackendError); -- } -- return absl::OkStatus(); -- } -- default: -- return CreateStatusWithPayload( -- StatusCode::kInternal, -- absl::StrFormat("Format %i is not supported.", buffer.format()), -- TfLiteSupportStatus::kImageProcessingError); -- } -- return absl::OkStatus(); --} --} // namespace -+} // namespace - - absl::Status LibyuvFrameBufferUtils::Crop(const FrameBuffer& buffer, int x0, - int y0, int x1, int y1, --- -2.35.0.263.gb82422642f-goog -
diff --git a/third_party/tflite_support/patches/0007-do-not-use-absl-any.patch b/third_party/tflite_support/patches/0004-do-not-use-absl-any.patch similarity index 93% rename from third_party/tflite_support/patches/0007-do-not-use-absl-any.patch rename to third_party/tflite_support/patches/0004-do-not-use-absl-any.patch index bec9916..45fe8db 100644 --- a/third_party/tflite_support/patches/0007-do-not-use-absl-any.patch +++ b/third_party/tflite_support/patches/0004-do-not-use-absl-any.patch
@@ -1,7 +1,7 @@ -From 6ccec4e3baea4b7c14dcf404c97c68634c912910 Mon Sep 17 00:00:00 2001 +From 7a59442f1bed00b4ec5b6b400d1d987e1bc286b7 Mon Sep 17 00:00:00 2001 From: Robert Ogden <robertogden@chromium.org> -Date: Mon, 7 Feb 2022 12:13:34 -0800 -Subject: [PATCH 07/13] do not use absl any +Date: Wed, 9 Mar 2022 10:29:33 -0800 +Subject: [PATCH 4/9] do not use absl any --- .../cc/task/vision/core/frame_buffer.h | 27 ------------------- @@ -60,5 +60,5 @@ Format format_; Orientation orientation_; -- -2.35.0.263.gb82422642f-goog +2.35.1.616.g0bdcbb4464-goog
diff --git a/third_party/tflite_support/patches/0009-only-support-model-file-passed-in-from-mem.patch b/third_party/tflite_support/patches/0005-only-support-model-file-passed-in-from-mem.patch similarity index 98% rename from third_party/tflite_support/patches/0009-only-support-model-file-passed-in-from-mem.patch rename to third_party/tflite_support/patches/0005-only-support-model-file-passed-in-from-mem.patch index 4d33de6a..0f50cb4 100644 --- a/third_party/tflite_support/patches/0009-only-support-model-file-passed-in-from-mem.patch +++ b/third_party/tflite_support/patches/0005-only-support-model-file-passed-in-from-mem.patch
@@ -1,7 +1,7 @@ -From b5c9f0bb86abe933cada611e9d43f73280c5b227 Mon Sep 17 00:00:00 2001 +From 5dd33d3c08d36202b4d555b1056974c4e4195834 Mon Sep 17 00:00:00 2001 From: Robert Ogden <robertogden@chromium.org> -Date: Mon, 7 Feb 2022 12:14:41 -0800 -Subject: [PATCH 09/13] only support model file passed in from mem +Date: Wed, 9 Mar 2022 10:31:19 -0800 +Subject: [PATCH 5/9] only support model file passed in from mem --- .../cc/task/core/external_file_handler.cc | 143 ++---------------- @@ -261,5 +261,5 @@ #include "absl/memory/memory.h" // from @com_google_absl -- -2.35.0.263.gb82422642f-goog +2.35.1.616.g0bdcbb4464-goog
diff --git a/third_party/tflite_support/patches/0005-use-size_t-in-for-loop.patch b/third_party/tflite_support/patches/0005-use-size_t-in-for-loop.patch deleted file mode 100644 index 5239393b..0000000 --- a/third_party/tflite_support/patches/0005-use-size_t-in-for-loop.patch +++ /dev/null
@@ -1,25 +0,0 @@ -From 5272c338771a1057bc52d830c85ec325cf545b0e Mon Sep 17 00:00:00 2001 -From: Robert Ogden <robertogden@chromium.org> -Date: Mon, 7 Feb 2022 12:12:50 -0800 -Subject: [PATCH 05/13] use size_t in for loop - ---- - .../cc/task/text/nlclassifier/nl_classifier.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/nlclassifier/nl_classifier.h b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/nlclassifier/nl_classifier.h -index d97b2feb4d915..ab5126348f380 100644 ---- a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/nlclassifier/nl_classifier.h -+++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/nlclassifier/nl_classifier.h -@@ -194,7 +194,7 @@ class NLClassifier : public core::BaseTaskApi<std::vector<core::Category>, - metadata_array, - const std::string& name, int default_index) { - if (metadata_array != nullptr && metadata_array->size() == tensors.size()) { -- for (int i = 0; i < metadata_array->size(); i++) { -+ for (size_t i = 0; i < metadata_array->size(); i++) { - if (strcmp(name.data(), metadata_array->Get(i)->name()->c_str()) == 0) { - return i; - } --- -2.35.0.263.gb82422642f-goog -
diff --git a/third_party/tflite_support/patches/0012-rm-stdio-static-init.patch b/third_party/tflite_support/patches/0006-rm-stdio-static-init.patch similarity index 86% rename from third_party/tflite_support/patches/0012-rm-stdio-static-init.patch rename to third_party/tflite_support/patches/0006-rm-stdio-static-init.patch index 7631db79..12f2bf73 100644 --- a/third_party/tflite_support/patches/0012-rm-stdio-static-init.patch +++ b/third_party/tflite_support/patches/0006-rm-stdio-static-init.patch
@@ -1,14 +1,14 @@ -From 4ba6e88fc7aced0d8e7dd4ea033902025788439e Mon Sep 17 00:00:00 2001 +From 1677951181c5885fe77c8903694a34dd7fd2b0fb Mon Sep 17 00:00:00 2001 From: Robert Ogden <robertogden@chromium.org> -Date: Mon, 7 Feb 2022 12:15:03 -0800 -Subject: [PATCH 12/13] rm stdio static init +Date: Wed, 9 Mar 2022 10:32:22 -0800 +Subject: [PATCH 6/9] rm stdio static init --- .../cc/task/core/tflite_engine.cc | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/core/tflite_engine.cc b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/core/tflite_engine.cc -index 0b34bad4f18f7..41e06389af80b 100644 +index 484b9a099ecdc..5999090cab973 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/core/tflite_engine.cc +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/core/tflite_engine.cc @@ -32,21 +32,6 @@ namespace tflite { @@ -34,5 +34,5 @@ using ::tflite::proto::ComputeSettings; using ::tflite::support::CreateStatusWithPayload; -- -2.35.0.263.gb82422642f-goog +2.35.1.616.g0bdcbb4464-goog
diff --git a/third_party/tflite_support/patches/0006-unused-variable.patch b/third_party/tflite_support/patches/0006-unused-variable.patch deleted file mode 100644 index 67dd209..0000000 --- a/third_party/tflite_support/patches/0006-unused-variable.patch +++ /dev/null
@@ -1,29 +0,0 @@ -From 09f5083d0c3b06b2cb32da9aa8eab503197015cb Mon Sep 17 00:00:00 2001 -From: Robert Ogden <robertogden@chromium.org> -Date: Mon, 7 Feb 2022 12:13:17 -0800 -Subject: [PATCH 06/13] unused variable - ---- - .../src/tensorflow_lite_support/cc/task/core/task_utils.h | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/core/task_utils.h b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/core/task_utils.h -index 540d3c2e7c7d4..b9438a576ee5b 100644 ---- a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/core/task_utils.h -+++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/core/task_utils.h -@@ -145,8 +145,10 @@ inline absl::Status PopulateVector(const TfLiteTensor* tensor, - template <> - inline absl::Status PopulateVector<std::string>( - const TfLiteTensor* tensor, std::vector<std::string>* data) { -- std::string* v; -- ASSIGN_OR_RETURN(v, AssertAndReturnTypedTensor<std::string>(tensor)); -+ if (tensor->type != typeToTfLiteType<std::string>()) { -+ return absl::InvalidArgumentError("not of type string"); -+ } -+ - int num = GetStringCount(tensor); - data->reserve(num); - for (int i = 0; i < num; i++) { --- -2.35.0.263.gb82422642f-goog -
diff --git a/third_party/tflite_support/patches/0013-surface-error-from-NL-Classify.patch b/third_party/tflite_support/patches/0007-surface-error-from-NL-Classify.patch similarity index 86% rename from third_party/tflite_support/patches/0013-surface-error-from-NL-Classify.patch rename to third_party/tflite_support/patches/0007-surface-error-from-NL-Classify.patch index 1fe1d75..45a1b566 100644 --- a/third_party/tflite_support/patches/0013-surface-error-from-NL-Classify.patch +++ b/third_party/tflite_support/patches/0007-surface-error-from-NL-Classify.patch
@@ -1,7 +1,7 @@ -From fcb313c8e990c28b6e2d931cb14904de5f4f9800 Mon Sep 17 00:00:00 2001 +From 6e8d05cb3923bc1ba2ebfa3860f44c7a25b98edf Mon Sep 17 00:00:00 2001 From: Robert Ogden <robertogden@chromium.org> -Date: Fri, 4 Mar 2022 11:44:57 -0800 -Subject: [PATCH 13/13] surface error from NL Classify +Date: Wed, 9 Mar 2022 10:33:16 -0800 +Subject: [PATCH 7/9] surface error from NL Classify --- .../cc/task/text/nlclassifier/nl_classifier.cc | 7 +++---- @@ -9,7 +9,7 @@ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/nlclassifier/nl_classifier.cc b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/nlclassifier/nl_classifier.cc -index 542d153cb1262..2409dfd4c7c8e 100644 +index d03296d2d09b5..6d80966ce89ec 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/nlclassifier/nl_classifier.cc +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/nlclassifier/nl_classifier.cc @@ -113,10 +113,9 @@ absl::Status NLClassifier::TrySetLabelFromMetadata( @@ -27,10 +27,10 @@ absl::Status NLClassifier::Preprocess( diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/nlclassifier/nl_classifier.h b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/nlclassifier/nl_classifier.h -index 30fa25044e1cf..be1547cf536d3 100644 +index ab5126348f380..815bbf92840e2 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/nlclassifier/nl_classifier.h +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/nlclassifier/nl_classifier.h -@@ -134,7 +134,8 @@ class NLClassifier : public core::BaseTaskApi<std::vector<core::Category>, +@@ -131,7 +131,8 @@ class NLClassifier : public core::BaseTaskApi<std::vector<core::Category>, absl::make_unique<tflite_shims::ops::builtin::BuiltinOpResolver>()); // Performs classification on a string input, returns classified results.
diff --git a/third_party/tflite_support/patches/0011-remove-unbuilt-files-and-change-exec-bit-where-neede.patch b/third_party/tflite_support/patches/0008-remove-unbuilt-files-and-change-exec-bit-where-neede.patch similarity index 80% rename from third_party/tflite_support/patches/0011-remove-unbuilt-files-and-change-exec-bit-where-neede.patch rename to third_party/tflite_support/patches/0008-remove-unbuilt-files-and-change-exec-bit-where-neede.patch index 3ae5ddb..02f1038 100644 --- a/third_party/tflite_support/patches/0011-remove-unbuilt-files-and-change-exec-bit-where-neede.patch +++ b/third_party/tflite_support/patches/0008-remove-unbuilt-files-and-change-exec-bit-where-neede.patch
@@ -1,7 +1,7 @@ -From d4667e60fd70c1f3dd51d8df9917007b8ffd05c4 Mon Sep 17 00:00:00 2001 +From 55955613ac71fa3af75a76562a00f9b4a7b0c053 Mon Sep 17 00:00:00 2001 From: Robert Ogden <robertogden@chromium.org> -Date: Mon, 7 Feb 2022 12:14:12 -0800 -Subject: [PATCH 11/13] remove unbuilt files and change exec bit where needed +Date: Wed, 9 Mar 2022 10:48:08 -0800 +Subject: [PATCH 8/9] remove unbuilt files and change exec bit where needed --- .../cc/port/benchmark.h | 21 --- @@ -21,16 +21,17 @@ .../metadata/cc/utils/zip_mem_file.cc | 124 --------------- .../metadata/cc/utils/zip_mem_file.h | 71 --------- .../odml/ios/image/resources/grace_hopper.jpg | Bin + .../text/pybinds/_pywrap_text_embedder.cc | 47 ------ .../task/vision/core/pybinds/image_utils.cc | 68 -------- - .../task/vision/pybinds/image_embedder.cc | 68 -------- + .../pybinds/_pywrap_image_classifier.cc | 63 -------- + .../vision/pybinds/_pywrap_image_embedder.cc | 68 -------- + .../vision/pybinds/_pywrap_object_detector.cc | 53 ------- .../tools/ci_build/build_all.sh | 0 .../ci_build/builds/build_ios_framework.sh | 0 .../tools/ci_build/builds/pip_smoke_test.sh | 0 .../tools/ci_build/common.sh | 0 .../tools/ci_build/common_win.bat | 0 - .../pip_package/rpi/build_arm_pip_package.sh | 0 - .../tools/pip_package/rpi/install_bazel.sh | 0 - 26 files changed, 654 deletions(-) + 27 files changed, 817 deletions(-) delete mode 100644 third_party/tflite_support/src/tensorflow_lite_support/cc/port/benchmark.h delete mode 100644 third_party/tflite_support/src/tensorflow_lite_support/cc/port/default/status_matchers.h delete mode 100644 third_party/tflite_support/src/tensorflow_lite_support/cc/port/gmock.h @@ -48,15 +49,16 @@ delete mode 100644 third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_mem_file.cc delete mode 100644 third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_mem_file.h mode change 100755 => 100644 third_party/tflite_support/src/tensorflow_lite_support/odml/ios/image/resources/grace_hopper.jpg + delete mode 100644 third_party/tflite_support/src/tensorflow_lite_support/python/task/text/pybinds/_pywrap_text_embedder.cc delete mode 100644 third_party/tflite_support/src/tensorflow_lite_support/python/task/vision/core/pybinds/image_utils.cc - delete mode 100644 third_party/tflite_support/src/tensorflow_lite_support/python/task/vision/pybinds/image_embedder.cc + delete mode 100644 third_party/tflite_support/src/tensorflow_lite_support/python/task/vision/pybinds/_pywrap_image_classifier.cc + delete mode 100644 third_party/tflite_support/src/tensorflow_lite_support/python/task/vision/pybinds/_pywrap_image_embedder.cc + delete mode 100644 third_party/tflite_support/src/tensorflow_lite_support/python/task/vision/pybinds/_pywrap_object_detector.cc mode change 100644 => 100755 third_party/tflite_support/src/tensorflow_lite_support/tools/ci_build/build_all.sh mode change 100644 => 100755 third_party/tflite_support/src/tensorflow_lite_support/tools/ci_build/builds/build_ios_framework.sh mode change 100644 => 100755 third_party/tflite_support/src/tensorflow_lite_support/tools/ci_build/builds/pip_smoke_test.sh mode change 100644 => 100755 third_party/tflite_support/src/tensorflow_lite_support/tools/ci_build/common.sh mode change 100644 => 100755 third_party/tflite_support/src/tensorflow_lite_support/tools/ci_build/common_win.bat - mode change 100644 => 100755 third_party/tflite_support/src/tensorflow_lite_support/tools/pip_package/rpi/build_arm_pip_package.sh - mode change 100644 => 100755 third_party/tflite_support/src/tensorflow_lite_support/tools/pip_package/rpi/install_bazel.sh diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/port/benchmark.h b/third_party/tflite_support/src/tensorflow_lite_support/cc/port/benchmark.h deleted file mode 100644 @@ -654,6 +656,59 @@ diff --git a/third_party/tflite_support/src/tensorflow_lite_support/odml/ios/image/resources/grace_hopper.jpg b/third_party/tflite_support/src/tensorflow_lite_support/odml/ios/image/resources/grace_hopper.jpg old mode 100755 new mode 100644 +diff --git a/third_party/tflite_support/src/tensorflow_lite_support/python/task/text/pybinds/_pywrap_text_embedder.cc b/third_party/tflite_support/src/tensorflow_lite_support/python/task/text/pybinds/_pywrap_text_embedder.cc +deleted file mode 100644 +index 6cdb4d4d70137..0000000000000 +--- a/third_party/tflite_support/src/tensorflow_lite_support/python/task/text/pybinds/_pywrap_text_embedder.cc ++++ /dev/null +@@ -1,47 +0,0 @@ +-/* Copyright 2022 The TensorFlow Authors. All Rights Reserved. +- +-Licensed under the Apache License, Version 2.0 (the "License"); +-you may not use this file except in compliance with the License. +-You may obtain a copy of the License at +- +- http://www.apache.org/licenses/LICENSE-2.0 +- +-Unless required by applicable law or agreed to in writing, software +-distributed under the License is distributed on an "AS IS" BASIS, +-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-See the License for the specific language governing permissions and +-limitations under the License. +-==============================================================================*/ +- +-#include "tensorflow_lite_support/cc/task/text/text_embedder.h" +- +-#include "pybind11/pybind11.h" +-#include "pybind11_abseil/status_casters.h" // from @pybind11_abseil +-#include "pybind11_protobuf/native_proto_caster.h" // from @pybind11_protobuf +- +-namespace tflite { +-namespace task { +-namespace text { +- +-PYBIND11_MODULE(_pywrap_text_embedder, m) { +- // python wrapper for C++ TextEmbeder class which shouldn't be directly used +- // by the users. +- +- pybind11::google::ImportStatusModule(); +- pybind11_protobuf::ImportNativeProtoCasters(); +- +- pybind11::class_<TextEmbedder>(m, "TextEmbedder") +- .def_static("create_from_options", +- [](const TextEmbedderOptions& options) { +- return TextEmbedder::CreateFromOptions(options); +- }) +- .def("embed", &TextEmbedder::Embed) +- .def("get_embedding_dimension", &TextEmbedder::GetEmbeddingDimension) +- .def("get_number_of_output_layers", +- &TextEmbedder::GetNumberOfOutputLayers) +- .def_static("cosine_similarity", &TextEmbedder::CosineSimilarity); +-} +- +-} // namespace text +-} // namespace task +-} // namespace tflite diff --git a/third_party/tflite_support/src/tensorflow_lite_support/python/task/vision/core/pybinds/image_utils.cc b/third_party/tflite_support/src/tensorflow_lite_support/python/task/vision/core/pybinds/image_utils.cc deleted file mode 100644 index 8834d0e36816d..0000000000000 @@ -728,10 +783,79 @@ -} // namespace vision -} // namespace task -} // namespace tflite -diff --git a/third_party/tflite_support/src/tensorflow_lite_support/python/task/vision/pybinds/image_embedder.cc b/third_party/tflite_support/src/tensorflow_lite_support/python/task/vision/pybinds/image_embedder.cc +diff --git a/third_party/tflite_support/src/tensorflow_lite_support/python/task/vision/pybinds/_pywrap_image_classifier.cc b/third_party/tflite_support/src/tensorflow_lite_support/python/task/vision/pybinds/_pywrap_image_classifier.cc +deleted file mode 100644 +index 61167fcaf2c4b..0000000000000 +--- a/third_party/tflite_support/src/tensorflow_lite_support/python/task/vision/pybinds/_pywrap_image_classifier.cc ++++ /dev/null +@@ -1,63 +0,0 @@ +-/* Copyright 2021 The TensorFlow Authors. All Rights Reserved. +- +-Licensed under the Apache License, Version 2.0 (the "License"); +-you may not use this file except in compliance with the License. +-You may obtain a copy of the License at +- +- http://www.apache.org/licenses/LICENSE-2.0 +- +-Unless required by applicable law or agreed to in writing, software +-distributed under the License is distributed on an "AS IS" BASIS, +-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-See the License for the specific language governing permissions and +-limitations under the License. +-==============================================================================*/ +- +-#include "tensorflow_lite_support/cc/task/vision/image_classifier.h" +- +-#include "pybind11/pybind11.h" +-#include "pybind11_abseil/status_casters.h" // from @pybind11_abseil +-#include "pybind11_protobuf/native_proto_caster.h" // from @pybind11_protobuf +-#include "tensorflow_lite_support/cc/port/statusor.h" +-#include "tensorflow_lite_support/examples/task/vision/desktop/utils/image_utils.h" +- +-namespace tflite { +-namespace task { +-namespace vision { +- +-namespace { +-namespace py = ::pybind11; +-} // namespace +- +-PYBIND11_MODULE(_pywrap_image_classifier, m) { +- // python wrapper for C++ ImageClassifier class which shouldn't be directly +- // used by the users. +- pybind11::google::ImportStatusModule(); +- pybind11_protobuf::ImportNativeProtoCasters(); +- +- py::class_<ImageClassifier>(m, "ImageClassifier") +- .def_static( +- "create_from_options", +- [](const ImageClassifierOptions& options) { +- return ImageClassifier::CreateFromOptions(options); +- }) +- .def("classify", +- [](ImageClassifier& self, const ImageData& image_data) +- -> tflite::support::StatusOr<ClassificationResult> { +- ASSIGN_OR_RETURN(std::unique_ptr<FrameBuffer> frame_buffer, +- CreateFrameBufferFromImageData(image_data)); +- return self.Classify(*frame_buffer); +- }) +- .def("classify", +- [](ImageClassifier& self, const ImageData& image_data, +- const BoundingBox& bounding_box) +- -> tflite::support::StatusOr<ClassificationResult> { +- ASSIGN_OR_RETURN(std::unique_ptr<FrameBuffer> frame_buffer, +- CreateFrameBufferFromImageData(image_data)); +- return self.Classify(*frame_buffer, bounding_box); +- }); +-} +- +-} // namespace vision +-} // namespace task +-} // namespace tflite +diff --git a/third_party/tflite_support/src/tensorflow_lite_support/python/task/vision/pybinds/_pywrap_image_embedder.cc b/third_party/tflite_support/src/tensorflow_lite_support/python/task/vision/pybinds/_pywrap_image_embedder.cc deleted file mode 100644 index 073a688780ca0..0000000000000 ---- a/third_party/tflite_support/src/tensorflow_lite_support/python/task/vision/pybinds/image_embedder.cc +--- a/third_party/tflite_support/src/tensorflow_lite_support/python/task/vision/pybinds/_pywrap_image_embedder.cc +++ /dev/null @@ -1,68 +0,0 @@ -/* Copyright 2021 The TensorFlow Authors. All Rights Reserved. @@ -802,6 +926,65 @@ -} // namespace vision -} // namespace task -} // namespace tflite +diff --git a/third_party/tflite_support/src/tensorflow_lite_support/python/task/vision/pybinds/_pywrap_object_detector.cc b/third_party/tflite_support/src/tensorflow_lite_support/python/task/vision/pybinds/_pywrap_object_detector.cc +deleted file mode 100644 +index aa2a625a33828..0000000000000 +--- a/third_party/tflite_support/src/tensorflow_lite_support/python/task/vision/pybinds/_pywrap_object_detector.cc ++++ /dev/null +@@ -1,53 +0,0 @@ +-/* Copyright 2021 The TensorFlow Authors. All Rights Reserved. +- +-Licensed under the Apache License, Version 2.0 (the "License"); +-you may not use this file except in compliance with the License. +-You may obtain a copy of the License at +- +- http://www.apache.org/licenses/LICENSE-2.0 +- +-Unless required by applicable law or agreed to in writing, software +-distributed under the License is distributed on an "AS IS" BASIS, +-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-See the License for the specific language governing permissions and +-limitations under the License. +-==============================================================================*/ +- +-#include "pybind11/pybind11.h" +-#include "pybind11_abseil/status_casters.h" // from @pybind11_abseil +-#include "pybind11_protobuf/native_proto_caster.h" // from @pybind11_protobuf +-#include "tensorflow_lite_support/cc/port/statusor.h" +-#include "tensorflow_lite_support/cc/task/vision/object_detector.h" +-#include "tensorflow_lite_support/examples/task/vision/desktop/utils/image_utils.h" +- +-namespace tflite { +-namespace task { +-namespace vision { +- +-namespace { +-namespace py = ::pybind11; +-} // namespace +- +-PYBIND11_MODULE(_pywrap_object_detector, m) { +- // python wrapper for C++ ObjectDetector class which shouldn't be directly +- // used by the users. +- pybind11::google::ImportStatusModule(); +- pybind11_protobuf::ImportNativeProtoCasters(); +- +- py::class_<ObjectDetector>(m, "ObjectDetector") +- .def_static("create_from_options", +- [](const ObjectDetectorOptions& options) { +- return ObjectDetector::CreateFromOptions(options); +- }) +- .def("detect", +- [](ObjectDetector& self, const ImageData& image_data) +- -> tflite::support::StatusOr<DetectionResult> { +- ASSIGN_OR_RETURN(std::unique_ptr<FrameBuffer> frame_buffer, +- CreateFrameBufferFromImageData(image_data)); +- return self.Detect(*frame_buffer); +- }); +-} +- +-} // namespace vision +-} // namespace task +-} // namespace tflite diff --git a/third_party/tflite_support/src/tensorflow_lite_support/tools/ci_build/build_all.sh b/third_party/tflite_support/src/tensorflow_lite_support/tools/ci_build/build_all.sh old mode 100644 new mode 100755 @@ -817,12 +1000,6 @@ diff --git a/third_party/tflite_support/src/tensorflow_lite_support/tools/ci_build/common_win.bat b/third_party/tflite_support/src/tensorflow_lite_support/tools/ci_build/common_win.bat old mode 100644 new mode 100755 -diff --git a/third_party/tflite_support/src/tensorflow_lite_support/tools/pip_package/rpi/build_arm_pip_package.sh b/third_party/tflite_support/src/tensorflow_lite_support/tools/pip_package/rpi/build_arm_pip_package.sh -old mode 100644 -new mode 100755 -diff --git a/third_party/tflite_support/src/tensorflow_lite_support/tools/pip_package/rpi/install_bazel.sh b/third_party/tflite_support/src/tensorflow_lite_support/tools/pip_package/rpi/install_bazel.sh -old mode 100644 -new mode 100755 -- -2.35.0.263.gb82422642f-goog +2.35.1.616.g0bdcbb4464-goog
diff --git a/third_party/tflite_support/patches/0008-unused-string-include.patch b/third_party/tflite_support/patches/0008-unused-string-include.patch deleted file mode 100644 index 3b354cd..0000000 --- a/third_party/tflite_support/patches/0008-unused-string-include.patch +++ /dev/null
@@ -1,25 +0,0 @@ -From 731c17145b6421250793e49c72d384edc49edce4 Mon Sep 17 00:00:00 2001 -From: Robert Ogden <robertogden@chromium.org> -Date: Mon, 7 Feb 2022 12:13:50 -0800 -Subject: [PATCH 08/13] unused string include - ---- - .../cc/text/tokenizers/tokenizer_jni_lib.h | 2 -- - 1 file changed, 2 deletions(-) - -diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/text/tokenizers/tokenizer_jni_lib.h b/third_party/tflite_support/src/tensorflow_lite_support/cc/text/tokenizers/tokenizer_jni_lib.h -index fc7285c6807b0..33677d305a853 100644 ---- a/third_party/tflite_support/src/tensorflow_lite_support/cc/text/tokenizers/tokenizer_jni_lib.h -+++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/text/tokenizers/tokenizer_jni_lib.h -@@ -17,8 +17,6 @@ limitations under the License. - - #include <jni.h> - --#include <string> -- - #include "tensorflow_lite_support/cc/text/tokenizers/tokenizer.h" - #include "tensorflow_lite_support/cc/utils/jni_utils.h" - --- -2.35.0.263.gb82422642f-goog -
diff --git a/third_party/tflite_support/patches/0010-run-clang-format.patch b/third_party/tflite_support/patches/0009-run-clang-format.patch similarity index 97% rename from third_party/tflite_support/patches/0010-run-clang-format.patch rename to third_party/tflite_support/patches/0009-run-clang-format.patch index 54b7ce8..b7482eb 100644 --- a/third_party/tflite_support/patches/0010-run-clang-format.patch +++ b/third_party/tflite_support/patches/0009-run-clang-format.patch
@@ -1,7 +1,7 @@ -From 7cfcaacefdb45b518ac5808eebbffe6cc7131121 Mon Sep 17 00:00:00 2001 +From 55a61c623d26d2e31704a905a04c19da39032ca2 Mon Sep 17 00:00:00 2001 From: Robert Ogden <robertogden@chromium.org> -Date: Mon, 7 Feb 2022 12:20:58 -0800 -Subject: [PATCH 10/13] run clang format +Date: Wed, 9 Mar 2022 10:50:47 -0800 +Subject: [PATCH 9/9] run clang format --- .../configuration/edgetpu_coral_plugin.cc | 20 +- @@ -18,10 +18,12 @@ .../c/task/text/nl_classifier.h | 3 +- .../c/task/vision/image_classifier.cc | 9 +- .../c/task/vision/image_classifier.h | 9 +- + .../c/task/vision/image_segmenter.cc | 6 +- .../c/task/vision/image_segmenter.h | 6 +- .../c/task/vision/object_detector.cc | 6 +- .../c/task/vision/object_detector.h | 6 +- .../test/task/vision/image_classifier_test.cc | 84 +- + .../test/task/vision/image_segmenter_test.cc | 62 +- .../test/task/vision/object_detector_test.cc | 90 +- .../src/tensorflow_lite_support/cc/common.cc | 2 +- .../src/tensorflow_lite_support/cc/common.h | 5 +- @@ -53,10 +55,23 @@ .../cc/task/processor/processor.h | 5 +- .../cc/task/processor/regex_preprocessor.cc | 3 +- .../cc/task/processor/regex_preprocessor.h | 3 +- + .../cc/task/text/bert_clu_annotator.cc | 4 +- .../cc/task/text/bert_nl_classifier.cc | 3 +- .../cc/task/text/bert_nl_classifier.h | 2 +- - .../cc/task/text/bert_question_answerer.cc | 34 +- + .../cc/task/text/bert_question_answerer.cc | 32 +- .../cc/task/text/bert_question_answerer.h | 7 +- + .../cc/task/text/clu_lib/bert_utils.cc | 14 +- + .../cc/task/text/clu_lib/bert_utils.h | 7 +- + .../cc/task/text/clu_lib/intent_repr.cc | 18 +- + .../cc/task/text/clu_lib/intent_repr.h | 5 +- + .../cc/task/text/clu_lib/slot_repr.cc | 32 +- + .../cc/task/text/clu_lib/slot_repr.h | 9 +- + .../task/text/clu_lib/slot_tagging_output.cc | 24 +- + .../task/text/clu_lib/slot_tagging_output.h | 6 +- + .../cc/task/text/clu_lib/tflite_modules.cc | 41 +- + .../cc/task/text/clu_lib/tflite_modules.h | 17 +- + .../cc/task/text/clu_lib/tflite_test_utils.cc | 14 +- + .../cc/task/text/clu_lib/tflite_test_utils.h | 6 +- .../task/text/nlclassifier/nl_classifier.cc | 18 +- .../cc/task/text/nlclassifier/nl_classifier.h | 19 +- .../cc/task/text/question_answerer.h | 6 +- @@ -75,14 +90,14 @@ .../cc/task/vision/image_embedder.h | 9 +- .../cc/task/vision/image_segmenter.cc | 17 +- .../cc/task/vision/image_segmenter.h | 8 +- - .../cc/task/vision/object_detector.cc | 16 +- + .../cc/task/vision/object_detector.cc | 14 +- .../cc/task/vision/object_detector.h | 5 +- .../vision/utils/frame_buffer_common_utils.cc | 59 +- .../vision/utils/frame_buffer_common_utils.h | 37 +- .../task/vision/utils/frame_buffer_utils.cc | 50 +- .../cc/task/vision/utils/frame_buffer_utils.h | 40 +- .../utils/frame_buffer_utils_interface.h | 11 +- - .../vision/utils/libyuv_frame_buffer_utils.cc | 81 +- + .../vision/utils/libyuv_frame_buffer_utils.cc | 79 +- .../vision/utils/libyuv_frame_buffer_utils.h | 9 +- .../cc/task/vision/utils/score_calibration.cc | 8 +- .../cc/task/vision/utils/score_calibration.h | 11 +- @@ -90,6 +105,8 @@ .../task/processor/image_preprocessor_test.cc | 13 +- .../test/task/text/bert_nl_classifier_test.cc | 36 +- .../task/text/bert_question_answerer_test.cc | 7 +- + .../test/task/text/clu_lib/bert_utils_test.cc | 32 +- + .../task/text/clu_lib/intent_repr_test.cc | 2 +- .../text/nlclassifier/nl_classifier_test.cc | 83 +- .../cc/test/task/text/text_embedder_test.cc | 16 +- .../test/task/vision/image_classifier_test.cc | 158 +- @@ -139,7 +156,7 @@ .../sentencepiece_tokenizer_tflite.cc | 7 +- .../custom_ops/kernel/whitespace_tokenizer.cc | 13 +- .../whitespace_tokenizer_op_resolver.cc | 2 +- - .../audio/desktop/audio_classifier_demo.cc | 18 +- + .../audio/desktop/audio_classifier_demo.cc | 16 +- .../audio/desktop/audio_classifier_lib.cc | 11 +- .../task/audio/desktop/audio_classifier_lib.h | 3 +- .../text/desktop/bert_nl_classifier_demo.cc | 14 +- @@ -164,10 +181,13 @@ .../sources/TFLClassificationResult.h | 15 +- .../sources/TFLDetectionResult+Helpers.h | 12 +- .../processor/sources/TFLDetectionResult.h | 15 +- + .../sources/TFLSegmentationResult+Helpers.h | 4 +- + .../processor/sources/TFLSegmentationResult.h | 23 +- .../Sources/TFLBertNLClassifier.h | 21 +- .../nlclassifier/Sources/TFLNLClassifier.h | 47 +- .../text/qa/Sources/TFLBertQuestionAnswerer.h | 4 +- .../task/vision/sources/TFLImageClassifier.h | 37 +- + .../task/vision/sources/TFLImageSegmenter.h | 49 +- .../task/vision/sources/TFLObjectDetector.h | 36 +- .../task/vision/utils/sources/GMLImageUtils.h | 5 +- .../vision/utils/sources/GMLImage+Helpers.h | 6 +- @@ -280,7 +300,7 @@ .../metadata/cc/metadata_extractor.cc | 21 +- .../metadata/cc/metadata_extractor.h | 4 +- .../metadata/cc/metadata_populator.h | 7 +- - .../metadata/cc/metadata_version.cc | 37 +- + .../metadata/cc/metadata_version.cc | 35 +- .../flatbuffers_lib/flatbuffers_lib.cc | 2 +- .../support/metadata/BoundedInputStream.java | 138 +- .../support/metadata/ByteBufferChannel.java | 188 +- @@ -316,15 +336,9 @@ .../odml/image/MediaImageExtractorTest.java | 48 +- .../odml/image/MediaMlImageBuilderTest.java | 109 +- .../android/odml/image/TestImageCreator.java | 211 +- - .../tools/ci_build/common.sh | 143 +- - .../pip_package/rpi/build_arm_pip_package.sh | 49 +- - .../tools/pip_package/rpi/install_bazel.sh | 75 +- .../src/third_party/fft2d/fft.h | 12 +- .../src/third_party/fft2d/fft2d.h | 12 +- - .../com_google_protobuf_build.patch | 12 +- - 318 files changed, 17318 insertions(+), 16946 deletions(-) - mode change 100755 => 100644 third_party/tflite_support/src/tensorflow_lite_support/tools/pip_package/rpi/build_arm_pip_package.sh - mode change 100755 => 100644 third_party/tflite_support/src/tensorflow_lite_support/tools/pip_package/rpi/install_bazel.sh + 334 files changed, 17385 insertions(+), 16965 deletions(-) diff --git a/third_party/tflite_support/src/tensorflow_lite_support/acceleration/configuration/edgetpu_coral_plugin.cc b/third_party/tflite_support/src/tensorflow_lite_support/acceleration/configuration/edgetpu_coral_plugin.cc index 9f27f3baae82f..6a16d12856258 100644 @@ -633,11 +647,35 @@ TfLiteSupportError** error); // Disposes off the image classifier. +diff --git a/third_party/tflite_support/src/tensorflow_lite_support/c/task/vision/image_segmenter.cc b/third_party/tflite_support/src/tensorflow_lite_support/c/task/vision/image_segmenter.cc +index 650cb8cd2383e..854985621f6a6 100644 +--- a/third_party/tflite_support/src/tensorflow_lite_support/c/task/vision/image_segmenter.cc ++++ b/third_party/tflite_support/src/tensorflow_lite_support/c/task/vision/image_segmenter.cc +@@ -92,7 +92,8 @@ TfLiteImageSegmenterOptions TfLiteImageSegmenterOptionsCreate() { + } + + TfLiteImageSegmenter* TfLiteImageSegmenterFromOptions( +- const TfLiteImageSegmenterOptions* options, TfLiteSupportError** error) { ++ const TfLiteImageSegmenterOptions* options, ++ TfLiteSupportError** error) { + StatusOr<ImageSegmenterOptionsCpp> cpp_option_status = + CreateImageSegmenterCppOptionsFromCOptions(options); + +@@ -182,7 +183,8 @@ TfLiteSegmentationResult* GetSegmentationResultCStruct( + + TfLiteSegmentationResult* TfLiteImageSegmenterSegment( + const TfLiteImageSegmenter* segmenter, +- const TfLiteFrameBuffer* frame_buffer, TfLiteSupportError** error) { ++ const TfLiteFrameBuffer* frame_buffer, ++ TfLiteSupportError** error) { + if (segmenter == nullptr) { + tflite::support::CreateTfLiteSupportError( + kInvalidArgumentError, "Expected non null image segmenter.", error); diff --git a/third_party/tflite_support/src/tensorflow_lite_support/c/task/vision/image_segmenter.h b/third_party/tflite_support/src/tensorflow_lite_support/c/task/vision/image_segmenter.h -index 5c2becc010e28..23b6b6eeb994c 100644 +index dd87e61e56b5d..a330acc43c282 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/c/task/vision/image_segmenter.h +++ b/third_party/tflite_support/src/tensorflow_lite_support/c/task/vision/image_segmenter.h -@@ -171,7 +171,8 @@ TfLiteImageSegmenterOptions TfLiteImageSegmenterOptionsCreate(); +@@ -172,7 +172,8 @@ TfLiteImageSegmenterOptions TfLiteImageSegmenterOptionsCreate(); // TfLiteSupportErrorDelete(error) // TfLiteImageSegmenter* TfLiteImageSegmenterFromOptions( @@ -647,7 +685,7 @@ // Invokes the encapsulated TFLite model and performs image segmentation on // the frame_buffer. -@@ -200,7 +201,8 @@ TfLiteImageSegmenter* TfLiteImageSegmenterFromOptions( +@@ -201,7 +202,8 @@ TfLiteImageSegmenter* TfLiteImageSegmenterFromOptions( // TfLiteSegmentationResult* TfLiteImageSegmenterSegment( const TfLiteImageSegmenter* segmenter, @@ -944,6 +982,171 @@ ASSERT_NE(classification_result, nullptr); EXPECT_GE(classification_result->size, 1); +diff --git a/third_party/tflite_support/src/tensorflow_lite_support/c/test/task/vision/image_segmenter_test.cc b/third_party/tflite_support/src/tensorflow_lite_support/c/test/task/vision/image_segmenter_test.cc +index f5e37f94e749a..81ade94585caf 100644 +--- a/third_party/tflite_support/src/tensorflow_lite_support/c/test/task/vision/image_segmenter_test.cc ++++ b/third_party/tflite_support/src/tensorflow_lite_support/c/test/task/vision/image_segmenter_test.cc +@@ -46,8 +46,8 @@ constexpr char kTestDataDirectory[] = + constexpr char kDeepLabV3[] = "deeplabv3.tflite"; + + StatusOr<ImageData> LoadImage(const char* image_name) { +- return DecodeImageFromFile(JoinPath("./" /*test src dir*/, +- kTestDataDirectory, image_name)); ++ return DecodeImageFromFile( ++ JoinPath("./" /*test src dir*/, kTestDataDirectory, image_name)); + } + + // The maximum fraction of pixels in the candidate mask that can have a +@@ -59,8 +59,11 @@ constexpr float kGoldenMaskTolerance = 1e-2; + // 20 means class index 2, etc. + constexpr int kGoldenMaskMagnificationFactor = 10; + +-void InitializeColoredLabel(TfLiteColoredLabel& colored_label, uint32_t r, +- uint32_t g, uint32_t b, const char* label) { ++void InitializeColoredLabel(TfLiteColoredLabel& colored_label, ++ uint32_t r, ++ uint32_t g, ++ uint32_t b, ++ const char* label) { + colored_label.r = r; + colored_label.g = g; + colored_label.b = b; +@@ -129,7 +132,8 @@ TEST_F(ImageSegmenterFromOptionsTest, FailsWithNullOptionsAndError) { + + EXPECT_EQ(image_segmenter, nullptr); + +- if (image_segmenter) TfLiteImageSegmenterDelete(image_segmenter); ++ if (image_segmenter) ++ TfLiteImageSegmenterDelete(image_segmenter); + + ASSERT_NE(error, nullptr); + EXPECT_EQ(error->code, kInvalidArgumentError); +@@ -147,7 +151,8 @@ TEST_F(ImageSegmenterFromOptionsTest, FailsWithMissingModelPath) { + + EXPECT_EQ(image_segmenter, nullptr); + +- if (image_segmenter) TfLiteImageSegmenterDelete(image_segmenter); ++ if (image_segmenter) ++ TfLiteImageSegmenterDelete(image_segmenter); + } + + TEST_F(ImageSegmenterFromOptionsTest, FailsWithMissingModelPathAndError) { +@@ -160,7 +165,8 @@ TEST_F(ImageSegmenterFromOptionsTest, FailsWithMissingModelPathAndError) { + + EXPECT_EQ(image_segmenter, nullptr); + +- if (image_segmenter) TfLiteImageSegmenterDelete(image_segmenter); ++ if (image_segmenter) ++ TfLiteImageSegmenterDelete(image_segmenter); + + ASSERT_NE(error, nullptr); + EXPECT_EQ(error->code, kInvalidArgumentError); +@@ -171,8 +177,8 @@ TEST_F(ImageSegmenterFromOptionsTest, FailsWithMissingModelPathAndError) { + } + + TEST_F(ImageSegmenterFromOptionsTest, SucceedsWithModelPath) { +- std::string model_path = JoinPath("./" /*test src dir*/, +- kTestDataDirectory, kDeepLabV3); ++ std::string model_path = ++ JoinPath("./" /*test src dir*/, kTestDataDirectory, kDeepLabV3); + + TfLiteImageSegmenterOptions options = TfLiteImageSegmenterOptionsCreate(); + options.base_options.model_file.file_path = model_path.data(); +@@ -186,8 +192,8 @@ TEST_F(ImageSegmenterFromOptionsTest, SucceedsWithModelPath) { + } + + TEST_F(ImageSegmenterFromOptionsTest, SucceedsWithNumberOfThreadsAndError) { +- std::string model_path = JoinPath("./" /*test src dir*/, +- kTestDataDirectory, kDeepLabV3); ++ std::string model_path = ++ JoinPath("./" /*test src dir*/, kTestDataDirectory, kDeepLabV3); + + TfLiteImageSegmenterOptions options = TfLiteImageSegmenterOptionsCreate(); + options.base_options.model_file.file_path = model_path.data(); +@@ -200,13 +206,15 @@ TEST_F(ImageSegmenterFromOptionsTest, SucceedsWithNumberOfThreadsAndError) { + EXPECT_NE(image_segmenter, nullptr); + EXPECT_EQ(error, nullptr); + +- if (image_segmenter) TfLiteImageSegmenterDelete(image_segmenter); +- if (error) TfLiteSupportErrorDelete(error); ++ if (image_segmenter) ++ TfLiteImageSegmenterDelete(image_segmenter); ++ if (error) ++ TfLiteSupportErrorDelete(error); + } + + TEST_F(ImageSegmenterFromOptionsTest, FailsWithUnspecifiedOutputTypeAndError) { +- std::string model_path = JoinPath("./" /*test src dir*/, +- kTestDataDirectory, kDeepLabV3); ++ std::string model_path = ++ JoinPath("./" /*test src dir*/, kTestDataDirectory, kDeepLabV3); + + TfLiteImageSegmenterOptions options = TfLiteImageSegmenterOptionsCreate(); + options.base_options.model_file.file_path = model_path.data(); +@@ -219,15 +227,17 @@ TEST_F(ImageSegmenterFromOptionsTest, FailsWithUnspecifiedOutputTypeAndError) { + EXPECT_EQ(image_segmenter, nullptr); + EXPECT_NE(error, nullptr); + +- if (image_segmenter) TfLiteImageSegmenterDelete(image_segmenter); +- if (error) TfLiteSupportErrorDelete(error); ++ if (image_segmenter) ++ TfLiteImageSegmenterDelete(image_segmenter); ++ if (error) ++ TfLiteSupportErrorDelete(error); + } + + class ImageSegmenterSegmentTest : public tflite_shims::testing::Test { + protected: + void SetUp() override { +- std::string model_path = JoinPath("./" /*test src dir*/, +- kTestDataDirectory, kDeepLabV3); ++ std::string model_path = ++ JoinPath("./" /*test src dir*/, kTestDataDirectory, kDeepLabV3); + + TfLiteImageSegmenterOptions options = TfLiteImageSegmenterOptionsCreate(); + options.base_options.model_file.file_path = model_path.data(); +@@ -241,7 +251,7 @@ class ImageSegmenterSegmentTest : public tflite_shims::testing::Test { + + TEST_F(ImageSegmenterSegmentTest, SucceedsWithCategoryMask) { + SUPPORT_ASSERT_OK_AND_ASSIGN(ImageData image_data, +- LoadImage("segmentation_input_rotation0.jpg")); ++ LoadImage("segmentation_input_rotation0.jpg")); + + TfLiteFrameBuffer frame_buffer = { + .format = kRGB, +@@ -264,7 +274,7 @@ TEST_F(ImageSegmenterSegmentTest, SucceedsWithCategoryMask) { + + // Load golden mask output. + SUPPORT_ASSERT_OK_AND_ASSIGN(ImageData golden_mask, +- LoadImage("segmentation_golden_rotation0.png")); ++ LoadImage("segmentation_golden_rotation0.png")); + + int inconsistent_pixels = 0; + int num_pixels = golden_mask.height * golden_mask.width; +@@ -285,8 +295,9 @@ TEST_F(ImageSegmenterSegmentTest, SucceedsWithCategoryMask) { + } + + TEST_F(ImageSegmenterSegmentTest, SucceedsWithCategoryMaskAndOrientation) { +- SUPPORT_ASSERT_OK_AND_ASSIGN(ImageData image_data, +- LoadImage("segmentation_input_rotation90_flop.jpg")); ++ SUPPORT_ASSERT_OK_AND_ASSIGN( ++ ImageData image_data, ++ LoadImage("segmentation_input_rotation90_flop.jpg")); + + TfLiteFrameBuffer frame_buffer = { + .format = kRGB, +@@ -308,8 +319,9 @@ TEST_F(ImageSegmenterSegmentTest, SucceedsWithCategoryMaskAndOrientation) { + segmentation_result->segmentations[0]); + + // Load golden mask output. +- SUPPORT_ASSERT_OK_AND_ASSIGN(ImageData golden_mask, +- LoadImage("segmentation_golden_rotation90_flop.png")); ++ SUPPORT_ASSERT_OK_AND_ASSIGN( ++ ImageData golden_mask, ++ LoadImage("segmentation_golden_rotation90_flop.png")); + + int inconsistent_pixels = 0; + int num_pixels = golden_mask.height * golden_mask.width; diff --git a/third_party/tflite_support/src/tensorflow_lite_support/c/test/task/vision/object_detector_test.cc b/third_party/tflite_support/src/tensorflow_lite_support/c/test/task/vision/object_detector_test.cc index f52623ada454c..99cd0034287ad 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/c/test/task/vision/object_detector_test.cc @@ -1756,7 +1959,7 @@ tflite::proto::ComputeSettings()) { tflite::proto::ComputeSettings settings_copy = diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/core/task_utils.h b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/core/task_utils.h -index b9438a576ee5b..43a508ae4d410 100644 +index 9c26d154634e1..2c21a95a1b075 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/core/task_utils.h +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/core/task_utils.h @@ -21,12 +21,12 @@ limitations under the License. @@ -1809,10 +2012,10 @@ - const TfLiteTensor* tensor, std::vector<std::string>* data) { + const TfLiteTensor* tensor, + std::vector<std::string>* data) { - if (tensor->type != typeToTfLiteType<std::string>()) { - return absl::InvalidArgumentError("not of type string"); - } -@@ -162,7 +166,8 @@ inline absl::Status PopulateVector<std::string>( + std::string* v __attribute__((unused)); + ASSIGN_OR_RETURN(v, AssertAndReturnTypedTensor<std::string>(tensor)); + int num = GetStringCount(tensor); +@@ -160,7 +164,8 @@ inline absl::Status PopulateVector<std::string>( // Note: std::negation is not used because it is from C++17, where the code will // be compiled using C++14 in OSS. template < @@ -1822,7 +2025,7 @@ typename = std::enable_if_t<std::is_same<T, std::string>::value == false>> inline absl::Status PopulateVectorToRepeated(const TfLiteTensor* tensor, TRepeatedField* data) { -@@ -238,7 +243,8 @@ int FindTensorIndexByName( +@@ -236,7 +241,8 @@ int FindTensorIndexByName( if (tensor_metadata != nullptr && tensor_metadata->size() == tensors.size()) { int index = FindTensorIndexByMetadataName(tensor_metadata, metadata_tensor_name); @@ -1833,7 +2036,7 @@ return FindTensorIndexByModelName(tensors, model_tensor_name); diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/core/tflite_engine.cc b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/core/tflite_engine.cc -index 484b9a099ecdc..0b34bad4f18f7 100644 +index 5999090cab973..41e06389af80b 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/core/tflite_engine.cc +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/core/tflite_engine.cc @@ -17,7 +17,7 @@ limitations under the License. @@ -1845,7 +2048,7 @@ #include "absl/strings/str_cat.h" // from @com_google_absl #include "tensorflow/lite/builtin_ops.h" #include "tensorflow/lite/core/shims/cc/kernels/register.h" -@@ -53,7 +53,8 @@ using ::tflite::support::CreateStatusWithPayload; +@@ -38,7 +38,8 @@ using ::tflite::support::CreateStatusWithPayload; using ::tflite::support::InterpreterCreationResources; using ::tflite::support::TfLiteSupportStatus; @@ -1855,7 +2058,7 @@ tflite::ErrorReporter* reporter) { return tflite_shims::Verify(data, length, reporter); } -@@ -84,7 +85,8 @@ std::vector<const TfLiteTensor*> TfLiteEngine::GetOutputs() { +@@ -69,7 +70,8 @@ std::vector<const TfLiteTensor*> TfLiteEngine::GetOutputs() { } void TfLiteEngine::VerifyAndBuildModelFromBuffer( @@ -1865,7 +2068,7 @@ TfLiteVerifier* extra_verifier) { model_ = tflite_shims::FlatBufferModel::VerifyAndBuildFromBuffer( buffer_data, buffer_size, extra_verifier, &error_reporter_); -@@ -131,7 +133,8 @@ absl::Status TfLiteEngine::InitializeFromModelFileHandler( +@@ -116,7 +118,8 @@ absl::Status TfLiteEngine::InitializeFromModelFileHandler( } absl::Status TfLiteEngine::BuildModelFromFlatBuffer( @@ -1875,7 +2078,7 @@ const tflite::proto::ComputeSettings& compute_settings) { if (model_) { return CreateStatusWithPayload(StatusCode::kInternal, -@@ -220,7 +223,8 @@ absl::Status TfLiteEngine::InitInterpreter(int num_threads) { +@@ -205,7 +208,8 @@ absl::Status TfLiteEngine::InitInterpreter(int num_threads) { // absl::Status TfLiteEngine::InitInterpreter( // const tflite::proto::ComputeSettings& compute_settings) absl::Status TfLiteEngine::InitInterpreter( @@ -2086,6 +2289,22 @@ absl::Status Preprocess(const std::string& text); +diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/bert_clu_annotator.cc b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/bert_clu_annotator.cc +index f60a556dbbe1b..802facec374f3 100644 +--- a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/bert_clu_annotator.cc ++++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/bert_clu_annotator.cc +@@ -19,9 +19,9 @@ limitations under the License. + #include <string> + #include <utility> + +-#include "absl/status/status.h" // from @com_google_absl ++#include "absl/status/status.h" // from @com_google_absl + #include "absl/strings/str_format.h" // from @com_google_absl +-#include "absl/strings/str_split.h" // from @com_google_absl ++#include "absl/strings/str_split.h" // from @com_google_absl + #include "tensorflow_lite_support/cc/port/status_macros.h" + #include "tensorflow_lite_support/cc/task/core/task_api_factory.h" + #include "tensorflow_lite_support/cc/task/core/task_utils.h" diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/bert_nl_classifier.cc b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/bert_nl_classifier.cc index 386cb14c1a8c8..7de37f1082212 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/bert_nl_classifier.cc @@ -2114,20 +2333,18 @@ #include "tensorflow/lite/c/common.h" #include "tensorflow/lite/core/api/op_resolver.h" diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/bert_question_answerer.cc b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/bert_question_answerer.cc -index 6b37649d4fbfd..591b70e84eb22 100644 +index 6b37649d4fbfd..b886e3b362902 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/bert_question_answerer.cc +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/bert_question_answerer.cc -@@ -15,8 +15,8 @@ limitations under the License. +@@ -15,7 +15,7 @@ limitations under the License. #include "tensorflow_lite_support/cc/task/text/bert_question_answerer.h" -#include "absl/status/status.h" // from @com_google_absl --#include "absl/strings/str_join.h" // from @com_google_absl -+#include "absl/status/status.h" // from @com_google_absl -+#include "absl/strings/str_join.h" // from @com_google_absl ++#include "absl/status/status.h" // from @com_google_absl + #include "absl/strings/str_join.h" // from @com_google_absl #include "absl/strings/str_split.h" // from @com_google_absl #include "tensorflow/lite/core/shims/cc/kernels/register.h" - #include "tensorflow_lite_support/cc/port/status_macros.h" @@ -111,7 +111,8 @@ StatusOr<std::unique_ptr<QuestionAnswerer>> BertQuestionAnswerer::CreateFromFd( StatusOr<std::unique_ptr<QuestionAnswerer>> @@ -2239,8 +2456,564 @@ // Initialize the API with the tokenizer set in the metadata. absl::Status InitializeFromMetadata( +diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/bert_utils.cc b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/bert_utils.cc +index 0164bf48f156e..dc88aad9c2bdf 100644 +--- a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/bert_utils.cc ++++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/bert_utils.cc +@@ -17,8 +17,8 @@ limitations under the License. + + #include <string> + +-#include "absl/status/status.h" // from @com_google_absl +-#include "absl/strings/ascii.h" // from @com_google_absl ++#include "absl/status/status.h" // from @com_google_absl ++#include "absl/strings/ascii.h" // from @com_google_absl + #include "absl/strings/str_cat.h" // from @com_google_absl + #include "tensorflow_lite_support/cc/port/status_macros.h" + #include "tensorflow_lite_support/cc/task/text/clu_lib/constants.h" +@@ -46,10 +46,13 @@ constexpr int kTurnIdForCurrentUtterance = 0; + absl::Status BertPreprocessing( + const tflite::support::text::tokenizer::BertTokenizer* tokenizer, + const std::vector<absl::string_view>& utterances_in_reverse_order, +- int max_seq_length, int max_history_turns, std::vector<int>* out_token_ids, ++ int max_seq_length, ++ int max_history_turns, ++ std::vector<int>* out_token_ids, + std::vector<std::pair<int, int>>* out_token_alignments, + std::vector<int>* out_token_first_subword_indicators, +- std::vector<int>* out_segment_id_list, std::vector<int>* out_turn_id_list) { ++ std::vector<int>* out_segment_id_list, ++ std::vector<int>* out_turn_id_list) { + int cls_id; + if (!tokenizer->LookupId(kClsToken, &cls_id)) { + return absl::InternalError( +@@ -183,7 +186,8 @@ absl::Status BertPreprocessing( + out_turn_id_list->push_back(turn_id); + + // Break if reaching max_seq_length. +- if (out_token_ids->size() >= max_seq_length) break; ++ if (out_token_ids->size() >= max_seq_length) ++ break; + } + if (out_token_ids->size() != out_token_alignments->size()) { + return absl::InternalError(absl::StrCat( +diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/bert_utils.h b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/bert_utils.h +index 69d13be6ce114..c3b3f6c4caf78 100644 +--- a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/bert_utils.h ++++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/bert_utils.h +@@ -80,10 +80,13 @@ namespace tflite::task::text::clu { + absl::Status BertPreprocessing( + const tflite::support::text::tokenizer::BertTokenizer* tokenizer, + const std::vector<absl::string_view>& utterances_in_reverse_order, +- int max_seq_length, int max_history_turns, std::vector<int>* out_token_ids, ++ int max_seq_length, ++ int max_history_turns, ++ std::vector<int>* out_token_ids, + std::vector<std::pair<int, int>>* out_token_alignments, + std::vector<int>* out_token_first_subword_indicators, +- std::vector<int>* out_segment_id_list, std::vector<int>* out_turn_id_list); ++ std::vector<int>* out_segment_id_list, ++ std::vector<int>* out_turn_id_list); + + } // namespace tflite::task::text::clu + +diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/intent_repr.cc b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/intent_repr.cc +index b310a0782c69f..037566235cf7c 100644 +--- a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/intent_repr.cc ++++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/intent_repr.cc +@@ -17,9 +17,9 @@ limitations under the License. + + #include <vector> + +-#include "absl/status/status.h" // from @com_google_absl +-#include "absl/strings/str_cat.h" // from @com_google_absl +-#include "absl/strings/str_split.h" // from @com_google_absl ++#include "absl/status/status.h" // from @com_google_absl ++#include "absl/strings/str_cat.h" // from @com_google_absl ++#include "absl/strings/str_split.h" // from @com_google_absl + #include "absl/strings/string_view.h" // from @com_google_absl + #include "tensorflow_lite_support/cc/task/text/clu_lib/constants.h" + +@@ -28,7 +28,8 @@ namespace tflite::task::text::clu { + // IntentRepr + + std::string IntentRepr::FullName() const { +- if (domain_.empty()) return name_; ++ if (domain_.empty()) ++ return name_; + return absl::StrCat(domain_, kNamespaceDelim, name_); + } + +@@ -40,16 +41,19 @@ absl::StatusOr<IntentRepr> IntentRepr::CreateFromFullName( + if (splits.size() > 2) { + return absl::InternalError(absl::StrCat("invalid argument: ", full_name)); + } +- if (splits.size() == 2) ret.domain_ = splits[0]; ++ if (splits.size() == 2) ++ ret.domain_ = splits[0]; + ret.name_ = splits[splits.size() - 1]; + return ret; + } + +-IntentRepr IntentRepr::Create(absl::string_view name, absl::string_view domain, ++IntentRepr IntentRepr::Create(absl::string_view name, ++ absl::string_view domain, + const bool share_across_domains) { + IntentRepr ret; + ret.name_ = std::string(name); +- if (!share_across_domains) ret.domain_ = std::string(domain); ++ if (!share_across_domains) ++ ret.domain_ = std::string(domain); + return ret; + } + +diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/intent_repr.h b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/intent_repr.h +index 9084deb1203b4..e040b04d998ea 100644 +--- a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/intent_repr.h ++++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/intent_repr.h +@@ -18,7 +18,7 @@ limitations under the License. + + #include <string> + +-#include "absl/status/statusor.h" // from @com_google_absl ++#include "absl/status/statusor.h" // from @com_google_absl + #include "absl/strings/string_view.h" // from @com_google_absl + + namespace tflite::task::text::clu { +@@ -30,7 +30,8 @@ class IntentRepr { + const std::string& Name() const { return name_; } + std::string FullName() const; + static absl::StatusOr<IntentRepr> CreateFromFullName(const absl::string_view); +- static IntentRepr Create(absl::string_view name, absl::string_view domain, ++ static IntentRepr Create(absl::string_view name, ++ absl::string_view domain, + const bool share_across_domains); + + private: +diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/slot_repr.cc b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/slot_repr.cc +index 114a721ee40ef..dbb0dc2a14263 100644 +--- a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/slot_repr.cc ++++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/slot_repr.cc +@@ -20,15 +20,15 @@ limitations under the License. + #include <memory> + #include <vector> + +-#include "absl/status/status.h" // from @com_google_absl +-#include "absl/status/statusor.h" // from @com_google_absl +-#include "absl/strings/match.h" // from @com_google_absl +-#include "absl/strings/str_cat.h" // from @com_google_absl +-#include "absl/strings/str_split.h" // from @com_google_absl ++#include "absl/status/status.h" // from @com_google_absl ++#include "absl/status/statusor.h" // from @com_google_absl ++#include "absl/strings/match.h" // from @com_google_absl ++#include "absl/strings/str_cat.h" // from @com_google_absl ++#include "absl/strings/str_split.h" // from @com_google_absl + #include "absl/strings/string_view.h" // from @com_google_absl +-#include "absl/strings/strip.h" // from @com_google_absl +-#include "absl/strings/substitute.h" // from @com_google_absl +-#include "absl/types/span.h" // from @com_google_absl ++#include "absl/strings/strip.h" // from @com_google_absl ++#include "absl/strings/substitute.h" // from @com_google_absl ++#include "absl/types/span.h" // from @com_google_absl + #include "tensorflow_lite_support/cc/port/status_macros.h" + #include "tensorflow_lite_support/cc/task/text/clu_lib/constants.h" + +@@ -39,7 +39,8 @@ using ::absl::StatusOr; + // SlotRepr + + std::string SlotRepr::FullName() const { +- if (domain_.empty()) return name_; ++ if (domain_.empty()) ++ return name_; + return absl::StrCat(domain_, kNamespaceDelim, name_); + } + +@@ -52,14 +53,16 @@ SlotRepr::SplitDomainAndName(const absl::string_view full_name) { + } + absl::string_view domain = ""; + absl::string_view name; +- if (splits.size() == 2) domain = splits[0]; ++ if (splits.size() == 2) ++ domain = splits[0]; + name = splits[splits.size() - 1]; + return std::tuple<absl::string_view, absl::string_view>{domain, name}; + } + + StatusOr<SlotRepr> SlotRepr::CreateFromIob(const absl::string_view repr) { + SlotRepr ret; +- if (IsO(repr)) return ret; ++ if (IsO(repr)) ++ return ret; + absl::string_view full_name; + if (absl::StartsWith(repr, kSlotBTagPrefix)) { + full_name = absl::StripPrefix(repr, kSlotBTagPrefix); +@@ -76,7 +79,8 @@ StatusOr<SlotRepr> SlotRepr::CreateFromIob(const absl::string_view repr) { + return ret; + } + +-SlotRepr SlotRepr::Create(absl::string_view name, absl::string_view domain, ++SlotRepr SlotRepr::Create(absl::string_view name, ++ absl::string_view domain, + const bool share_across_domains) { + SlotRepr ret; + ret.name_ = std::string(name); +@@ -94,7 +98,9 @@ bool SlotRepr::IsB(const absl::string_view repr) { + return absl::StartsWith(repr, kSlotBTagPrefix); + } + +-bool SlotRepr::IsO(const absl::string_view repr) { return repr == kSlotOTag; } ++bool SlotRepr::IsO(const absl::string_view repr) { ++ return repr == kSlotOTag; ++} + + bool SlotRepr::operator==(const SlotRepr& other) const { + return domain_ == other.domain_ && name_ == other.name_; +diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/slot_repr.h b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/slot_repr.h +index 04ca49b268917..9a5f68a00bdcd 100644 +--- a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/slot_repr.h ++++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/slot_repr.h +@@ -20,9 +20,9 @@ limitations under the License. + #include <utility> + #include <vector> + +-#include "absl/status/status.h" // from @com_google_absl +-#include "absl/status/statusor.h" // from @com_google_absl +-#include "absl/strings/str_cat.h" // from @com_google_absl ++#include "absl/status/status.h" // from @com_google_absl ++#include "absl/status/statusor.h" // from @com_google_absl ++#include "absl/strings/str_cat.h" // from @com_google_absl + #include "absl/strings/string_view.h" // from @com_google_absl + #include "tensorflow_lite_support/cc/task/text/clu_lib/constants.h" + +@@ -68,7 +68,8 @@ class SlotRepr { + static absl::StatusOr<SlotRepr> CreateFromIob(const absl::string_view); + + // Factory +- static SlotRepr Create(absl::string_view name, absl::string_view domain = "", ++ static SlotRepr Create(absl::string_view name, ++ absl::string_view domain = "", + const bool share_across_domains = true); + + // Splits the full_name into domain and slot name. +diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/slot_tagging_output.cc b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/slot_tagging_output.cc +index 716d29b76a98f..0d5abb443fcc3 100644 +--- a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/slot_tagging_output.cc ++++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/slot_tagging_output.cc +@@ -17,10 +17,10 @@ limitations under the License. + + #include <vector> + +-#include "absl/status/status.h" // from @com_google_absl +-#include "absl/status/statusor.h" // from @com_google_absl ++#include "absl/status/status.h" // from @com_google_absl ++#include "absl/status/statusor.h" // from @com_google_absl + #include "absl/strings/string_view.h" // from @com_google_absl +-#include "absl/types/span.h" // from @com_google_absl ++#include "absl/types/span.h" // from @com_google_absl + #include "tensorflow_lite_support/cc/port/status_macros.h" + #include "tensorflow_lite_support/cc/task/text/clu_lib/slot_repr.h" + +@@ -29,7 +29,9 @@ namespace { + + absl::StatusOr<std::vector<SlotMentionStruct>> + DecodeSlotChunksPredictOnFirstSubword( +- int cur_turn_start, int cur_turn_end, int seq_len, ++ int cur_turn_start, ++ int cur_turn_end, ++ int seq_len, + const absl::Span<const absl::string_view> tags_as_span, + const absl::Span<const float> confidences_as_span, + const absl::Span<const std::pair<int, int>> token_alignments_as_span, +@@ -74,10 +76,12 @@ DecodeSlotChunksPredictOnFirstSubword( + } // namespace + + absl::Status SlotModulePopulateResponse( +- const std::vector<absl::string_view>& tags, const float* confidences, ++ const std::vector<absl::string_view>& tags, ++ const float* confidences, + const std::vector<std::pair<int, int>>& token_alignments, + const std::vector<int>& token_turn_ids, +- const std::vector<int>& first_subword_indicators, float threshold, ++ const std::vector<int>& first_subword_indicators, ++ float threshold, + const std::vector<absl::string_view>& reverse_utterance_list_to_encode, + CluResponse* response) { + if (token_alignments.size() != token_turn_ids.size()) { +@@ -104,7 +108,7 @@ absl::Status SlotModulePopulateResponse( + + // Prepare the data and decode slot chunks. + std::vector<SlotMentionStruct> cur_turn_slot_mentions; +- // Decode slot chunks based on first subword tokens in the turn. ++ // Decode slot chunks based on first subword tokens in the turn. + ASSIGN_OR_RETURN(cur_turn_slot_mentions, + DecodeSlotChunksPredictOnFirstSubword( + cur_turn_start, cur_turn_end, seq_len, tags_as_span, +@@ -113,8 +117,10 @@ absl::Status SlotModulePopulateResponse( + + // Populate the response. + for (const auto& chunk : cur_turn_slot_mentions) { +- if (chunk.start == -1 || cur_turn_idx != 0) continue; +- if (chunk.confidence < threshold) continue; ++ if (chunk.start == -1 || cur_turn_idx != 0) ++ continue; ++ if (chunk.confidence < threshold) ++ continue; + auto slot = response->mutable_noncategorical_slots()->Add(); + slot->set_slot(chunk.repr.Name()); + auto extraction = slot->mutable_extraction(); +diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/slot_tagging_output.h b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/slot_tagging_output.h +index b8fc64425634e..7d2b9a1a1fd27 100644 +--- a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/slot_tagging_output.h ++++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/slot_tagging_output.h +@@ -41,10 +41,12 @@ namespace tflite::task::text::clu { + // Outputs: + // response + absl::Status SlotModulePopulateResponse( +- const std::vector<absl::string_view>& tags, const float* confidences, ++ const std::vector<absl::string_view>& tags, ++ const float* confidences, + const std::vector<std::pair<int, int>>& token_alignments, + const std::vector<int>& token_turn_ids, +- const std::vector<int>& first_subword_indicators, float threshold, ++ const std::vector<int>& first_subword_indicators, ++ float threshold, + const std::vector<absl::string_view>& reverse_utterance_list_to_encode, + CluResponse* response); + +diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/tflite_modules.cc b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/tflite_modules.cc +index c16f5bc02b861..f893f0341c903 100644 +--- a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/tflite_modules.cc ++++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/tflite_modules.cc +@@ -18,11 +18,11 @@ limitations under the License. + #include <memory> + #include <utility> + +-#include "absl/status/status.h" // from @com_google_absl +-#include "absl/status/statusor.h" // from @com_google_absl +-#include "absl/strings/str_cat.h" // from @com_google_absl +-#include "absl/strings/str_join.h" // from @com_google_absl +-#include "absl/strings/str_split.h" // from @com_google_absl ++#include "absl/status/status.h" // from @com_google_absl ++#include "absl/status/statusor.h" // from @com_google_absl ++#include "absl/strings/str_cat.h" // from @com_google_absl ++#include "absl/strings/str_join.h" // from @com_google_absl ++#include "absl/strings/str_split.h" // from @com_google_absl + #include "absl/strings/string_view.h" // from @com_google_absl + #include "tensorflow/lite/kernels/kernel_util.h" + #include "tensorflow/lite/string_util.h" +@@ -39,10 +39,14 @@ namespace tflite::task::text::clu { + // tensors by concatenating the current utterance with history turns. It also + // sets utterance_turn_id_seq for post-processing. + absl::Status PopulateInputTextTensorForBERT( +- const CluRequest& request, int token_id_tensor_idx, +- int token_mask_tensor_idx, int token_type_id_tensor_idx, ++ const CluRequest& request, ++ int token_id_tensor_idx, ++ int token_mask_tensor_idx, ++ int token_type_id_tensor_idx, + const tflite::support::text::tokenizer::BertTokenizer* tokenizer, +- size_t max_seq_len, int max_history_turns, tflite::Interpreter* interpreter, ++ size_t max_seq_len, ++ int max_history_turns, ++ tflite::Interpreter* interpreter, + Artifacts* artifacts) { + size_t seq_len; + int64_t* tokens_tensor = +@@ -139,7 +143,8 @@ absl::Status AbstractModule::Init(tflite::Interpreter* interpreter, + } + + absl::StatusOr<std::unique_ptr<AbstractModule>> UtteranceSeqModule::Create( +- tflite::Interpreter* interpreter, const TensorIndexMap* tensor_index_map, ++ tflite::Interpreter* interpreter, ++ const TensorIndexMap* tensor_index_map, + const BertCluAnnotatorOptions* options, + const tflite::support::text::tokenizer::BertTokenizer* tokenizer) { + auto out = std::make_unique<UtteranceSeqModule>(); +@@ -187,7 +192,8 @@ AbstractModule::NamesAndConfidencesFromOutput(int names_tensor_idx, + } + + absl::StatusOr<std::unique_ptr<AbstractModule>> DomainModule::Create( +- tflite::Interpreter* interpreter, const TensorIndexMap* tensor_index_map, ++ tflite::Interpreter* interpreter, ++ const TensorIndexMap* tensor_index_map, + const BertCluAnnotatorOptions* options) { + auto out = std::make_unique<DomainModule>(); + out->tensor_index_map_ = tensor_index_map; +@@ -204,7 +210,8 @@ absl::Status DomainModule::Postprocess(Artifacts* artifacts, + tensor_index_map_->domain_scores_idx)); + const auto& [names, confidences] = t_output; + for (int i = 0; i < names.size(); ++i) { +- if (confidences[i] < domain_threshold_) continue; ++ if (confidences[i] < domain_threshold_) ++ continue; + auto domain = response->add_domains(); + // Conversion to string is needed due to portable_proto generated code + const std::string names_i(names[i]); +@@ -215,7 +222,8 @@ absl::Status DomainModule::Postprocess(Artifacts* artifacts, + } + + absl::StatusOr<std::unique_ptr<AbstractModule>> IntentModule::Create( +- tflite::Interpreter* interpreter, const TensorIndexMap* tensor_index_map, ++ tflite::Interpreter* interpreter, ++ const TensorIndexMap* tensor_index_map, + const BertCluAnnotatorOptions* options) { + auto out = std::make_unique<IntentModule>(); + out->tensor_index_map_ = tensor_index_map; +@@ -239,7 +247,8 @@ absl::Status IntentModule::Postprocess(Artifacts* artifacts, + std::vector<absl::string_view> parts = absl::StrSplit(name.Name(), '='); + if (parts.size() == 2) { + // The name is like 'xxx=yyy'. It's a categorical slot. +- if (confidences[i] < categorical_slot_threshold_) continue; ++ if (confidences[i] < categorical_slot_threshold_) ++ continue; + auto new_categorical_slot = response->mutable_categorical_slots()->Add(); + + const auto slot = std::string(parts[0]); +@@ -251,7 +260,8 @@ absl::Status IntentModule::Postprocess(Artifacts* artifacts, + new_categorical_slot_prediction->set_score(confidences[i]); + } else { + // It's an intent. +- if (confidences[i] < intent_threshold_) continue; ++ if (confidences[i] < intent_threshold_) ++ continue; + auto new_intent = response->mutable_intents()->Add(); + new_intent->set_display_name(name.Name()); + new_intent->set_score(confidences[i]); +@@ -261,7 +271,8 @@ absl::Status IntentModule::Postprocess(Artifacts* artifacts, + } + + absl::StatusOr<std::unique_ptr<AbstractModule>> SlotModule::Create( +- tflite::Interpreter* interpreter, const TensorIndexMap* tensor_index_map, ++ tflite::Interpreter* interpreter, ++ const TensorIndexMap* tensor_index_map, + const BertCluAnnotatorOptions* options) { + auto out = std::make_unique<SlotModule>(); + out->tensor_index_map_ = tensor_index_map; +diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/tflite_modules.h b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/tflite_modules.h +index 5a9f183b8ca4e..eecd65fc495bf 100644 +--- a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/tflite_modules.h ++++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/tflite_modules.h +@@ -16,7 +16,7 @@ limitations under the License. + #ifndef TENSORFLOW_LITE_SUPPORT_CC_TASK_TEXT_CLU_LIB_TFLITE_MODULES_H_ + #define TENSORFLOW_LITE_SUPPORT_CC_TASK_TEXT_CLU_LIB_TFLITE_MODULES_H_ + +-#include "absl/status/statusor.h" // from @com_google_absl ++#include "absl/status/statusor.h" // from @com_google_absl + #include "absl/strings/string_view.h" // from @com_google_absl + #include "tensorflow/lite/interpreter.h" + #include "tensorflow_lite_support/cc/task/text/proto/bert_clu_annotator_options_proto_inc.h" +@@ -85,7 +85,8 @@ class AbstractModule { + // output tensors. + // The tensors are assumed to be of shape [1, max_seq_len] + absl::StatusOr<NamesAndConfidences> NamesAndConfidencesFromOutput( +- int names_tensor_idx, int scores_tensor_idx) const; ++ int names_tensor_idx, ++ int scores_tensor_idx) const; + + // TFLite interpreter + Interpreter* interpreter_ = nullptr; +@@ -98,7 +99,8 @@ class AbstractModule { + class UtteranceSeqModule : public AbstractModule { + public: + static absl::StatusOr<std::unique_ptr<AbstractModule>> Create( +- Interpreter* interpreter, const TensorIndexMap* tensor_index_map, ++ Interpreter* interpreter, ++ const TensorIndexMap* tensor_index_map, + const BertCluAnnotatorOptions* options, + const tflite::support::text::tokenizer::BertTokenizer* tokenizer); + +@@ -116,7 +118,8 @@ class UtteranceSeqModule : public AbstractModule { + class DomainModule : public AbstractModule { + public: + static absl::StatusOr<std::unique_ptr<AbstractModule>> Create( +- Interpreter* interpreter, const TensorIndexMap* tensor_index_map, ++ Interpreter* interpreter, ++ const TensorIndexMap* tensor_index_map, + const BertCluAnnotatorOptions* options); + + absl::Status Postprocess(Artifacts* artifacts, +@@ -130,7 +133,8 @@ class DomainModule : public AbstractModule { + class IntentModule : public AbstractModule { + public: + static absl::StatusOr<std::unique_ptr<AbstractModule>> Create( +- Interpreter* interpreter, const TensorIndexMap* tensor_index_map, ++ Interpreter* interpreter, ++ const TensorIndexMap* tensor_index_map, + const BertCluAnnotatorOptions* options); + + absl::Status Postprocess(Artifacts* artifacts, +@@ -145,7 +149,8 @@ class IntentModule : public AbstractModule { + class SlotModule : public AbstractModule { + public: + static absl::StatusOr<std::unique_ptr<AbstractModule>> Create( +- Interpreter* interpreter, const TensorIndexMap* tensor_index_map, ++ Interpreter* interpreter, ++ const TensorIndexMap* tensor_index_map, + const BertCluAnnotatorOptions* options); + + absl::Status Postprocess(Artifacts* artifacts, +diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/tflite_test_utils.cc b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/tflite_test_utils.cc +index 543958ce93994..30d2bd7513909 100644 +--- a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/tflite_test_utils.cc ++++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/tflite_test_utils.cc +@@ -24,7 +24,8 @@ namespace tflite::task::text::clu { + + template <> + void PopulateTfLiteTensorValue<std::string>( +- const std::initializer_list<std::string> values, TfLiteTensor* tensor) { ++ const std::initializer_list<std::string> values, ++ TfLiteTensor* tensor) { + tflite::DynamicBuffer buf; + for (const std::string& s : values) { + buf.AddString(s.data(), s.length()); +@@ -38,13 +39,18 @@ size_t NumTotalFromShape(const std::initializer_list<int>& shape) { + num_total = 1; + else + num_total = 0; +- for (const int dim : shape) num_total *= dim; ++ for (const int dim : shape) ++ num_total *= dim; + return num_total; + } + +-TfLiteTensor* UniqueTfLiteTensor::get() { return tensor_; } ++TfLiteTensor* UniqueTfLiteTensor::get() { ++ return tensor_; ++} + +-UniqueTfLiteTensor::~UniqueTfLiteTensor() { TfLiteTensorFree(tensor_); } ++UniqueTfLiteTensor::~UniqueTfLiteTensor() { ++ TfLiteTensorFree(tensor_); ++} + + template <> + TfLiteType TypeToTfLiteType<std::string>() { +diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/tflite_test_utils.h b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/tflite_test_utils.h +index 3a393c5223369..f19d2366fc092 100644 +--- a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/tflite_test_utils.h ++++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/tflite_test_utils.h +@@ -64,7 +64,8 @@ size_t NumTotalFromShape(const std::initializer_list<int>& shape); + + template <> + void PopulateTfLiteTensorValue<std::string>( +- const std::initializer_list<std::string> values, TfLiteTensor* tensor); ++ const std::initializer_list<std::string> values, ++ TfLiteTensor* tensor); + + template <typename T> + TfLiteType TypeToTfLiteType() { +@@ -84,7 +85,8 @@ void ReallocDynamicTensor(const std::initializer_list<int> shape, + TfLiteIntArray* shape_arr = TfLiteIntArrayCreate(shape.size()); + int i = 0; + const size_t num_total = NumTotalFromShape(shape); +- for (const int dim : shape) shape_arr->data[i++] = dim; ++ for (const int dim : shape) ++ shape_arr->data[i++] = dim; + tensor->dims = shape_arr; + if (tensor->type != kTfLiteString) { + TfLiteTensorRealloc(num_total * sizeof(T), tensor); diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/nlclassifier/nl_classifier.cc b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/nlclassifier/nl_classifier.cc -index d03296d2d09b5..542d153cb1262 100644 +index 6d80966ce89ec..2409dfd4c7c8e 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/nlclassifier/nl_classifier.cc +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/nlclassifier/nl_classifier.cc @@ -22,10 +22,10 @@ limitations under the License. @@ -2257,7 +3030,7 @@ #include "tensorflow/lite/c/common.h" #include "tensorflow/lite/core/api/op_resolver.h" #include "tensorflow/lite/kernels/internal/tensor_ctypes.h" -@@ -120,7 +120,8 @@ std::vector<Category> NLClassifier::Classify(const std::string& text) { +@@ -119,7 +119,8 @@ StatusOr<std::vector<Category>> NLClassifier::Classify( } absl::Status NLClassifier::Preprocess( @@ -2267,7 +3040,7 @@ return preprocessor_->Preprocess(input); } -@@ -300,7 +301,8 @@ StatusOr<std::unique_ptr<NLClassifier>> NLClassifier::CreateFromOptions( +@@ -299,7 +300,8 @@ StatusOr<std::unique_ptr<NLClassifier>> NLClassifier::CreateFromOptions( StatusOr<std::unique_ptr<NLClassifier>> NLClassifier::CreateFromBufferAndOptions( @@ -2277,7 +3050,7 @@ const NLClassifierOptions& options, std::unique_ptr<tflite::OpResolver> resolver) { std::unique_ptr<NLClassifier> nl_classifier; -@@ -313,7 +315,8 @@ NLClassifier::CreateFromBufferAndOptions( +@@ -312,7 +314,8 @@ NLClassifier::CreateFromBufferAndOptions( } StatusOr<std::unique_ptr<NLClassifier>> NLClassifier::CreateFromFileAndOptions( @@ -2287,7 +3060,7 @@ std::unique_ptr<tflite::OpResolver> resolver) { std::unique_ptr<NLClassifier> nl_classifier; ASSIGN_OR_RETURN(nl_classifier, -@@ -324,7 +327,8 @@ StatusOr<std::unique_ptr<NLClassifier>> NLClassifier::CreateFromFileAndOptions( +@@ -323,7 +326,8 @@ StatusOr<std::unique_ptr<NLClassifier>> NLClassifier::CreateFromFileAndOptions( } StatusOr<std::unique_ptr<NLClassifier>> NLClassifier::CreateFromFdAndOptions( @@ -2298,7 +3071,7 @@ std::unique_ptr<NLClassifier> nl_classifier; ASSIGN_OR_RETURN(nl_classifier, diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/nlclassifier/nl_classifier.h b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/nlclassifier/nl_classifier.h -index ab5126348f380..30fa25044e1cf 100644 +index 815bbf92840e2..be1547cf536d3 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/nlclassifier/nl_classifier.h +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/nlclassifier/nl_classifier.h @@ -23,8 +23,8 @@ limitations under the License. @@ -2342,7 +3115,7 @@ std::unique_ptr<tflite::OpResolver> resolver = absl::make_unique<tflite_shims::ops::builtin::BuiltinOpResolver>()); -@@ -177,7 +180,8 @@ class NLClassifier : public core::BaseTaskApi<std::vector<core::Category>, +@@ -178,7 +181,8 @@ class NLClassifier : public core::BaseTaskApi<std::vector<core::Category>, const std::vector<TensorType*>& tensors, const flatbuffers::Vector<flatbuffers::Offset<TensorMetadata>>* metadata_array, @@ -2352,7 +3125,7 @@ int tensor_index = FindTensorIndex(tensors, metadata_array, name, index); return tensor_index >= 0 && tensor_index < tensors.size() ? tensors[tensor_index] -@@ -192,7 +196,8 @@ class NLClassifier : public core::BaseTaskApi<std::vector<core::Category>, +@@ -193,7 +197,8 @@ class NLClassifier : public core::BaseTaskApi<std::vector<core::Category>, const std::vector<TensorType*>& tensors, const flatbuffers::Vector<flatbuffers::Offset<TensorMetadata>>* metadata_array, @@ -2929,22 +3702,20 @@ // Prebuilt list of ColoredLabel attached to each Segmentation result. The // i-th item in this list corresponds to the i-th label map item. diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/vision/object_detector.cc b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/vision/object_detector.cc -index 0a4d5f7553ee9..ade2de74cf728 100644 +index 0a4d5f7553ee9..00775015515ac 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/vision/object_detector.cc +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/vision/object_detector.cc -@@ -20,9 +20,9 @@ limitations under the License. +@@ -20,8 +20,8 @@ limitations under the License. #include <vector> #include <glog/logging.h> -#include "absl/memory/memory.h" // from @com_google_absl -#include "absl/status/status.h" // from @com_google_absl --#include "absl/strings/str_format.h" // from @com_google_absl -+#include "absl/memory/memory.h" // from @com_google_absl -+#include "absl/status/status.h" // from @com_google_absl -+#include "absl/strings/str_format.h" // from @com_google_absl ++#include "absl/memory/memory.h" // from @com_google_absl ++#include "absl/status/status.h" // from @com_google_absl + #include "absl/strings/str_format.h" // from @com_google_absl #include "absl/strings/string_view.h" // from @com_google_absl #include "tensorflow/lite/c/common.h" - #include "tensorflow_lite_support/cc/common.h" @@ -141,7 +141,8 @@ StatusOr<const BoundingBoxProperties*> GetBoundingBoxProperties( StatusOr<std::vector<LabelMapItem>> GetLabelMapIfAny( @@ -3498,7 +4269,7 @@ // Flips `buffer` horizontally. diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/vision/utils/libyuv_frame_buffer_utils.cc b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/vision/utils/libyuv_frame_buffer_utils.cc -index 6fd3ca81c984c..a00c8223fac99 100644 +index 53671cb88de51..a00c8223fac99 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/vision/utils/libyuv_frame_buffer_utils.cc +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/vision/utils/libyuv_frame_buffer_utils.cc @@ -20,10 +20,10 @@ limitations under the License. @@ -3666,12 +4437,9 @@ FrameBuffer::Dimension crop_dimension = GetCropDimension(x0, x1, y0, y1); if (crop_dimension == output_buffer->dimension()) { return CropPlane(buffer, x0, y0, x1, y1, output_buffer); -@@ -1326,10 +1354,13 @@ absl::Status CropResize(const FrameBuffer& buffer, int x0, int y0, int x1, - } - } +@@ -1328,8 +1356,11 @@ absl::Status CropResize(const FrameBuffer& buffer, int x0, int y0, int x1, --} // namespace -+} // namespace + } // namespace -absl::Status LibyuvFrameBufferUtils::Crop(const FrameBuffer& buffer, int x0, - int y0, int x1, int y1, @@ -3953,6 +4721,83 @@ } std::vector<QaAnswer> answer = question_answerer->Answer(kContext, kQuestion); +diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/test/task/text/clu_lib/bert_utils_test.cc b/third_party/tflite_support/src/tensorflow_lite_support/cc/test/task/text/clu_lib/bert_utils_test.cc +index 3d98fe16b07e9..6fd9508fd1ba0 100644 +--- a/third_party/tflite_support/src/tensorflow_lite_support/cc/test/task/text/clu_lib/bert_utils_test.cc ++++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/test/task/text/clu_lib/bert_utils_test.cc +@@ -128,10 +128,10 @@ TEST_F(BertUtilsTestClass, ZeroHistoryNotTrucated) { + std::vector<int> subword_indicators; + std::vector<int> segment_id_list; + std::vector<int> turn_id_list; +- SUPPORT_ASSERT_OK(BertPreprocessing(tokenizer_.get(), conversations_in_reverse_order, +- max_seq_length, max_history_turns, &token_ids, +- &token_alignments, &subword_indicators, +- &segment_id_list, &turn_id_list)); ++ SUPPORT_ASSERT_OK(BertPreprocessing( ++ tokenizer_.get(), conversations_in_reverse_order, max_seq_length, ++ max_history_turns, &token_ids, &token_alignments, &subword_indicators, ++ &segment_id_list, &turn_id_list)); + EXPECT_THAT(token_ids, expected_token_ids); + EXPECT_THAT(token_alignments, expected_token_alignments); + EXPECT_THAT(subword_indicators, expected_first_subword_indicators); +@@ -193,10 +193,10 @@ TEST_F(BertUtilsTestClass, ZeroHistoryTrucated) { + std::vector<int> subword_indicators; + std::vector<int> segment_id_list; + std::vector<int> turn_id_list; +- SUPPORT_ASSERT_OK(BertPreprocessing(tokenizer_.get(), conversations_in_reverse_order, +- max_seq_length, max_history_turns, &token_ids, +- &token_alignments, &subword_indicators, +- &segment_id_list, &turn_id_list)); ++ SUPPORT_ASSERT_OK(BertPreprocessing( ++ tokenizer_.get(), conversations_in_reverse_order, max_seq_length, ++ max_history_turns, &token_ids, &token_alignments, &subword_indicators, ++ &segment_id_list, &turn_id_list)); + EXPECT_THAT(token_ids, expected_token_ids); + EXPECT_THAT(token_alignments, expected_token_alignments); + EXPECT_THAT(subword_indicators, expected_first_subword_indicators); +@@ -342,10 +342,10 @@ TEST_F(BertUtilsTestClass, WithHistoryNotTrucated) { + std::vector<int> subword_indicators; + std::vector<int> segment_id_list; + std::vector<int> turn_id_list; +- SUPPORT_ASSERT_OK(BertPreprocessing(tokenizer_.get(), conversations_in_reverse_order, +- max_seq_length, max_history_turns, &token_ids, +- &token_alignments, &subword_indicators, +- &segment_id_list, &turn_id_list)); ++ SUPPORT_ASSERT_OK(BertPreprocessing( ++ tokenizer_.get(), conversations_in_reverse_order, max_seq_length, ++ max_history_turns, &token_ids, &token_alignments, &subword_indicators, ++ &segment_id_list, &turn_id_list)); + EXPECT_THAT(token_ids, expected_token_ids); + EXPECT_THAT(token_alignments, expected_token_alignments); + EXPECT_THAT(subword_indicators, expected_first_subword_indicators); +@@ -458,10 +458,10 @@ TEST_F(BertUtilsTestClass, WithHistoryTrucated) { + std::vector<int> subword_indicators; + std::vector<int> segment_id_list; + std::vector<int> turn_id_list; +- SUPPORT_ASSERT_OK(BertPreprocessing(tokenizer_.get(), conversations_in_reverse_order, +- max_seq_length, max_history_turns, &token_ids, +- &token_alignments, &subword_indicators, +- &segment_id_list, &turn_id_list)); ++ SUPPORT_ASSERT_OK(BertPreprocessing( ++ tokenizer_.get(), conversations_in_reverse_order, max_seq_length, ++ max_history_turns, &token_ids, &token_alignments, &subword_indicators, ++ &segment_id_list, &turn_id_list)); + EXPECT_THAT(token_ids, expected_token_ids); + EXPECT_THAT(token_alignments, expected_token_alignments); + EXPECT_THAT(subword_indicators, expected_first_subword_indicators); +diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/test/task/text/clu_lib/intent_repr_test.cc b/third_party/tflite_support/src/tensorflow_lite_support/cc/test/task/text/clu_lib/intent_repr_test.cc +index 8341751bbbac2..0501ec4a669b5 100644 +--- a/third_party/tflite_support/src/tensorflow_lite_support/cc/test/task/text/clu_lib/intent_repr_test.cc ++++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/test/task/text/clu_lib/intent_repr_test.cc +@@ -29,7 +29,7 @@ TEST(IntentClassification, IntentRepr) { + + TEST(IntentClassification, IntentRepr2) { + SUPPORT_ASSERT_OK_AND_ASSIGN(const auto intent_repr, +- IntentRepr::CreateFromFullName("REQUEST")); ++ IntentRepr::CreateFromFullName("REQUEST")); + EXPECT_EQ(intent_repr.Name(), "REQUEST"); + EXPECT_EQ(intent_repr.Domain(), ""); + } diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/test/task/text/nlclassifier/nl_classifier_test.cc b/third_party/tflite_support/src/tensorflow_lite_support/cc/test/task/text/nlclassifier/nl_classifier_test.cc index 67b03c3a45323..81198cfca30fc 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/cc/test/task/text/nlclassifier/nl_classifier_test.cc @@ -6675,15 +7520,10 @@ namespace tflite { namespace ops { diff --git a/third_party/tflite_support/src/tensorflow_lite_support/examples/task/audio/desktop/audio_classifier_demo.cc b/third_party/tflite_support/src/tensorflow_lite_support/examples/task/audio/desktop/audio_classifier_demo.cc -index 7447870046f48..6339ed705bcb9 100644 +index 7447870046f48..904673a95b799 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/examples/task/audio/desktop/audio_classifier_demo.cc +++ b/third_party/tflite_support/src/tensorflow_lite_support/examples/task/audio/desktop/audio_classifier_demo.cc -@@ -24,22 +24,30 @@ limitations under the License. - #include <iostream> - #include <limits> - --#include "absl/flags/flag.h" // from @com_google_absl -+#include "absl/flags/flag.h" // from @com_google_absl +@@ -28,18 +28,26 @@ limitations under the License. #include "absl/flags/parse.h" // from @com_google_absl #include "tensorflow_lite_support/examples/task/audio/desktop/audio_classifier_lib.h" @@ -7599,6 +8439,110 @@ @end +diff --git a/third_party/tflite_support/src/tensorflow_lite_support/ios/task/processor/sources/TFLSegmentationResult+Helpers.h b/third_party/tflite_support/src/tensorflow_lite_support/ios/task/processor/sources/TFLSegmentationResult+Helpers.h +index c979fda53c70b..0a85efe2877bb 100644 +--- a/third_party/tflite_support/src/tensorflow_lite_support/ios/task/processor/sources/TFLSegmentationResult+Helpers.h ++++ b/third_party/tflite_support/src/tensorflow_lite_support/ios/task/processor/sources/TFLSegmentationResult+Helpers.h +@@ -28,8 +28,8 @@ NS_ASSUME_NONNULL_BEGIN + * @return Segmentation Result of type TFLSegmentationResult to be returned by + * inference methods of the iOS TF Lite Task Image Segmentation task. + */ +-+ (TFLSegmentationResult *)segmentationResultWithCResult: +- (TfLiteSegmentationResult *)cSegmentationResult; +++ (TFLSegmentationResult*)segmentationResultWithCResult: ++ (TfLiteSegmentationResult*)cSegmentationResult; + @end + + NS_ASSUME_NONNULL_END +diff --git a/third_party/tflite_support/src/tensorflow_lite_support/ios/task/processor/sources/TFLSegmentationResult.h b/third_party/tflite_support/src/tensorflow_lite_support/ios/task/processor/sources/TFLSegmentationResult.h +index fddc44d0f1dd1..f75aed592b351 100644 +--- a/third_party/tflite_support/src/tensorflow_lite_support/ios/task/processor/sources/TFLSegmentationResult.h ++++ b/third_party/tflite_support/src/tensorflow_lite_support/ios/task/processor/sources/TFLSegmentationResult.h +@@ -1,11 +1,11 @@ + /* Copyright 2022 The TensorFlow Authors. All Rights Reserved. +- ++ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at +- ++ + http://www.apache.org/licenses/LICENSE-2.0 +- ++ + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@@ -22,7 +22,7 @@ NS_ASSUME_NONNULL_BEGIN + /** + * Confidence masks of size `width` x `height` for any one class. + */ +-@property(nonatomic, assign) float *mask; ++@property(nonatomic, assign) float* mask; + + /** + * The width of the mask. This is an intrinsic parameter of the model being +@@ -46,7 +46,7 @@ NS_ASSUME_NONNULL_BEGIN + * The value of each pixel in this mask represents the class to which the + * pixel belongs. + */ +-@property(nonatomic, assign) UInt8 *mask; ++@property(nonatomic, assign) UInt8* mask; + + /** + * The width of the mask. This is an intrinsic parameter of the model being +@@ -73,13 +73,13 @@ NS_ASSUME_NONNULL_BEGIN + /** The class name, as provided in the label map packed in the TFLite Model + * Metadata. + */ +-@property(nonatomic, copy) NSString *label; ++@property(nonatomic, copy) NSString* label; + + /** The display name, as provided in the label map (if available) packed in + * the TFLite Model Metadata. See `display_names_locale` field in + * ImageSegmenterOptions. + */ +-@property(nonatomic, copy) NSString *displayName; ++@property(nonatomic, copy) NSString* displayName; + + @end + +@@ -93,14 +93,15 @@ NS_ASSUME_NONNULL_BEGIN + * this particular class. + * This property is mutually exclusive with `categoryMask`. + */ +-@property(nonatomic, copy, nullable) NSArray<TFLConfidenceMask *> *confidenceMasks; ++@property(nonatomic, copy, nullable) ++ NSArray<TFLConfidenceMask*>* confidenceMasks; + + /** Holds the category mask . + * The value of each pixel in this mask represents the class to which the + * pixel belongs. + * This property is mutually exclusive with `confidenceMasks`. + */ +-@property(nonatomic, copy, nullable) TFLCategoryMask *categoryMask; ++@property(nonatomic, copy, nullable) TFLCategoryMask* categoryMask; + + /** + * The list of colored labels for all the supported categories (classes). +@@ -109,7 +110,7 @@ NS_ASSUME_NONNULL_BEGIN + * `colored_labels[i]`, `confidence_masks` indices, i.e. `confidence_masks[i]` + * is associated with `colored_labels[i]`. + */ +-@property(nonatomic, copy) NSArray<TFLColoredLabel *> *coloredLabels; ++@property(nonatomic, copy) NSArray<TFLColoredLabel*>* coloredLabels; + + @end + +@@ -122,7 +123,7 @@ NS_ASSUME_NONNULL_BEGIN + * e.g. instance segmentation models, which may return one segmentation per + * object. + */ +-@property(nonatomic, copy) NSArray<TFLSegmentation *> *segmentations; ++@property(nonatomic, copy) NSArray<TFLSegmentation*>* segmentations; + + @end + diff --git a/third_party/tflite_support/src/tensorflow_lite_support/ios/task/text/nlclassifier/Sources/TFLBertNLClassifier.h b/third_party/tflite_support/src/tensorflow_lite_support/ios/task/text/nlclassifier/Sources/TFLBertNLClassifier.h index 99de5ad04febf..ac81a15ac11c6 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/ios/task/text/nlclassifier/Sources/TFLBertNLClassifier.h @@ -7844,6 +8788,117 @@ NS_SWIFT_NAME(classify(gmlImage:regionOfInterest:)); - (instancetype)init NS_UNAVAILABLE; +diff --git a/third_party/tflite_support/src/tensorflow_lite_support/ios/task/vision/sources/TFLImageSegmenter.h b/third_party/tflite_support/src/tensorflow_lite_support/ios/task/vision/sources/TFLImageSegmenter.h +index 48bf54e285930..eb0d565884a22 100644 +--- a/third_party/tflite_support/src/tensorflow_lite_support/ios/task/vision/sources/TFLImageSegmenter.h ++++ b/third_party/tflite_support/src/tensorflow_lite_support/ios/task/vision/sources/TFLImageSegmenter.h +@@ -20,10 +20,10 @@ + NS_ASSUME_NONNULL_BEGIN + + /** +- * Specifies the type of output segmentation mask to be returned as a result +- * of the image segmentation operation. This allows specifying the type of +- * post-processing to perform on the raw model results +- * ++ * Specifies the type of output segmentation mask to be returned as a result ++ * of the image segmentation operation. This allows specifying the type of ++ * post-processing to perform on the raw model results ++ * + * @seealso TfLiteSegmentationResult for more. + */ + typedef NS_ENUM(NSUInteger, TFLOutputType) { +@@ -31,13 +31,13 @@ typedef NS_ENUM(NSUInteger, TFLOutputType) { + TFLUnspecifiedOutputType, + + /** +- * Gives a single output mask where each pixel represents the class which ++ * Gives a single output mask where each pixel represents the class which + * the pixel in the original image was predicted to belong to. + */ + TFLCategoryMaskOutputType, + + /** +- * Gives a list of output masks where, for each mask, each pixel represents ++ * Gives a list of output masks where, for each mask, each pixel represents + * the prediction confidence, usually in the [0, 1] range. + */ + TFLConfidenceMasksOutputType, +@@ -53,33 +53,34 @@ typedef NS_ENUM(NSUInteger, TFLOutputType) { + * Base options that is used for creation of any type of task. + * @seealso TFLBaseOptions + */ +-@property(nonatomic, copy) TFLBaseOptions *baseOptions; ++@property(nonatomic, copy) TFLBaseOptions* baseOptions; + + /** +- * Specifies the type of output segmentation mask to be returned as a result ++ * Specifies the type of output segmentation mask to be returned as a result + * of the image segmentation operation. + * @seealso TFLOutputType + */ + @property(nonatomic, assign) TFLOutputType outputType; + + /** Display names local for display names*/ +-@property(nonatomic, copy) NSString *displayNamesLocale; ++@property(nonatomic, copy) NSString* displayNamesLocale; + + /** + * Initializes TFLImageSegmenterOptions with the model path set to the specified + * path to a model file. +- * @description The external model file, must be a single standalone TFLite +- * file. It could be packed with TFLite Model Metadata[1] and associated files +- * if exist. Fail to provide the necessary metadata and associated files might +- * result in errors. Check the [documentation](https://www.tensorflow.org/lite/convert/metadata) +- * for each task about the specific requirement. +- * ++ * @description The external model file, must be a single standalone TFLite ++ * file. It could be packed with TFLite Model Metadata[1] and associated files ++ * if exist. Fail to provide the necessary metadata and associated files might ++ * result in errors. Check the ++ * [documentation](https://www.tensorflow.org/lite/convert/metadata) for each ++ * task about the specific requirement. ++ * + * @param modelPath Path to a TFLite model file. +- * ++ * + * @return An instance of TFLImageSegmenterOptions set to the specified + * modelPath. + */ +-- (nullable instancetype)initWithModelPath:(nonnull NSString *)modelPath; ++- (nullable instancetype)initWithModelPath:(nonnull NSString*)modelPath; + + @end + +@@ -93,21 +94,23 @@ typedef NS_ENUM(NSUInteger, TFLOutputType) { + * + * @return A TFLImageSegmenter instance. + */ +-+ (nullable instancetype)imageSegmenterWithOptions:(nonnull TFLImageSegmenterOptions *)options +- error:(NSError **)error +++ (nullable instancetype)imageSegmenterWithOptions: ++ (nonnull TFLImageSegmenterOptions*)options ++ error:(NSError**)error + NS_SWIFT_NAME(imageSegmenter(options:)); + + /** +- * Performs image segmentation on a GMLImage input, returns the segmentation ++ * Performs image segmentation on a GMLImage input, returns the segmentation + * results. + * + * @param image input to the model. +- * ++ * + * @return Segmentation Result of type TFLSegmentationResult holds the + * segmentation masks returned by the image segmentation task. + */ +-- (nullable TFLSegmentationResult *)segmentWithGMLImage:(GMLImage *)image +- error:(NSError *_Nullable *)error ++- (nullable TFLSegmentationResult*)segmentWithGMLImage:(GMLImage*)image ++ error: ++ (NSError* _Nullable*)error + NS_SWIFT_NAME(segment(gmlImage:)); + + - (instancetype)init NS_UNAVAILABLE; diff --git a/third_party/tflite_support/src/tensorflow_lite_support/ios/task/vision/sources/TFLObjectDetector.h b/third_party/tflite_support/src/tensorflow_lite_support/ios/task/vision/sources/TFLObjectDetector.h index 64271f31b6882..38b3b0ab18ebe 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/ios/task/vision/sources/TFLObjectDetector.h @@ -33472,21 +34527,19 @@ // The unpacked model FlatBuffer. tflite::ModelT model_t_; diff --git a/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_version.cc b/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_version.cc -index fb3e01e00b76d..2e2f2fa070362 100644 +index 17ffbbc67fbec..52f9335776035 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_version.cc +++ b/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_version.cc -@@ -22,8 +22,8 @@ limitations under the License. +@@ -22,7 +22,7 @@ limitations under the License. #include <string> #include <vector> -#include "absl/strings/str_join.h" // from @com_google_absl --#include "absl/strings/str_split.h" // from @com_google_absl -+#include "absl/strings/str_join.h" // from @com_google_absl -+#include "absl/strings/str_split.h" // from @com_google_absl ++#include "absl/strings/str_join.h" // from @com_google_absl + #include "absl/strings/str_split.h" // from @com_google_absl #include "flatbuffers/flatbuffers.h" // from @flatbuffers #include "tensorflow/lite/c/common.h" - #include "tensorflow/lite/kernels/internal/compatibility.h" -@@ -134,7 +134,8 @@ template <typename T> +@@ -137,7 +137,8 @@ template <typename T> void UpdateMinimumVersionForArray( const flatbuffers::Vector<flatbuffers::Offset<T>>* array, Version* min_version) { @@ -33496,7 +34549,7 @@ for (int i = 0; i < array->size(); ++i) { UpdateMinimumVersionForTable<T>(array->Get(i), min_version); -@@ -143,8 +144,10 @@ void UpdateMinimumVersionForArray( +@@ -146,8 +147,10 @@ void UpdateMinimumVersionForArray( template <> void UpdateMinimumVersionForTable<tflite::AssociatedFile>( @@ -33509,7 +34562,7 @@ if (table->type() == AssociatedFileType_VOCABULARY) { UpdateMinimumVersion( -@@ -155,8 +158,10 @@ void UpdateMinimumVersionForTable<tflite::AssociatedFile>( +@@ -164,8 +167,10 @@ void UpdateMinimumVersionForTable<tflite::AssociatedFile>( template <> void UpdateMinimumVersionForTable<tflite::ProcessUnit>( @@ -33522,7 +34575,7 @@ tflite::ProcessUnitOptions process_unit_type = table->options_type(); if (process_unit_type == ProcessUnitOptions_BertTokenizerOptions) { -@@ -182,7 +187,8 @@ void UpdateMinimumVersionForTable<tflite::ProcessUnit>( +@@ -191,7 +196,8 @@ void UpdateMinimumVersionForTable<tflite::ProcessUnit>( template <> void UpdateMinimumVersionForTable<tflite::Content>(const tflite::Content* table, Version* min_version) { @@ -33532,7 +34585,7 @@ // Checks the ContenProperties field. if (table->content_properties_type() == ContentProperties_AudioProperties) { -@@ -194,8 +200,10 @@ void UpdateMinimumVersionForTable<tflite::Content>(const tflite::Content* table, +@@ -203,8 +209,10 @@ void UpdateMinimumVersionForTable<tflite::Content>(const tflite::Content* table, template <> void UpdateMinimumVersionForTable<tflite::TensorMetadata>( @@ -33545,7 +34598,7 @@ // Checks the associated_files field. UpdateMinimumVersionForArray<tflite::AssociatedFile>( -@@ -211,8 +219,10 @@ void UpdateMinimumVersionForTable<tflite::TensorMetadata>( +@@ -220,8 +228,10 @@ void UpdateMinimumVersionForTable<tflite::TensorMetadata>( template <> void UpdateMinimumVersionForTable<tflite::SubGraphMetadata>( @@ -33558,7 +34611,7 @@ // Checks in the input/output metadata arrays. UpdateMinimumVersionForArray<tflite::TensorMetadata>( -@@ -259,7 +269,8 @@ void UpdateMinimumVersionForTable<tflite::SubGraphMetadata>( +@@ -268,7 +278,8 @@ void UpdateMinimumVersionForTable<tflite::SubGraphMetadata>( template <> void UpdateMinimumVersionForTable<tflite::ModelMetadata>( @@ -34615,7 +35668,7 @@ + } } diff --git a/third_party/tflite_support/src/tensorflow_lite_support/metadata/java/src/java/org/tensorflow/lite/support/metadata/MetadataParser.java b/third_party/tflite_support/src/tensorflow_lite_support/metadata/java/src/java/org/tensorflow/lite/support/metadata/MetadataParser.java -index b6dd4a6216f11..20f556692f8f0 100644 +index 8a262a02eab14..1dbf9ebb46386 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/metadata/java/src/java/org/tensorflow/lite/support/metadata/MetadataParser.java +++ b/third_party/tflite_support/src/tensorflow_lite_support/metadata/java/src/java/org/tensorflow/lite/support/metadata/MetadataParser.java @@ -17,11 +17,11 @@ package org.tensorflow.lite.support.metadata; @@ -34626,12 +35679,12 @@ - * The version of the metadata parser that this metadata extractor library is depending on. The - * value should match the value of "Schema Semantic version" in metadata_schema.fbs. - */ -- public static final String VERSION = "1.3.0"; +- public static final String VERSION = "1.4.0"; + /** + * The version of the metadata parser that this metadata extractor library is depending on. The + * value should match the value of "Schema Semantic version" in metadata_schema.fbs. + */ -+ public static final String VERSION = "1.3.0"; ++ public static final String VERSION = "1.4.0"; - private MetadataParser() {} + private MetadataParser() {} @@ -39667,7 +40720,7 @@ + } } diff --git a/third_party/tflite_support/src/tensorflow_lite_support/odml/ios/image/apis/GMLImage.h b/third_party/tflite_support/src/tensorflow_lite_support/odml/ios/image/apis/GMLImage.h -index 110186bb63a1b..18797d8135eb8 100644 +index 110186bb63a1b..0c494915e7357 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/odml/ios/image/apis/GMLImage.h +++ b/third_party/tflite_support/src/tensorflow_lite_support/odml/ios/image/apis/GMLImage.h @@ -19,7 +19,8 @@ @@ -39675,8 +40728,8 @@ /** Types of image sources. */ -typedef NSInteger GMLImageSourceType NS_TYPED_ENUM NS_SWIFT_NAME(MLImageSourceType); -+typedef NSInteger GMLImageSourceType -+ NS_TYPED_ENUM NS_SWIFT_NAME(MLImageSourceType); ++typedef NSInteger GMLImageSourceType NS_TYPED_ENUM ++ NS_SWIFT_NAME(MLImageSourceType); /** Image source is a `UIImage`. */ static const GMLImageSourceType GMLImageSourceTypeImage = 0; /** Image source is a `CVPixelBuffer`. */ @@ -42674,328 +43727,6 @@ + // Should not be instantiated. + private TestImageCreator() {} } -diff --git a/third_party/tflite_support/src/tensorflow_lite_support/tools/ci_build/common.sh b/third_party/tflite_support/src/tensorflow_lite_support/tools/ci_build/common.sh -index 135e4286275f1..17c38d288a25a 100644 ---- a/third_party/tflite_support/src/tensorflow_lite_support/tools/ci_build/common.sh -+++ b/third_party/tflite_support/src/tensorflow_lite_support/tools/ci_build/common.sh -@@ -1,95 +1,90 @@ --#!/usr/bin/env bash --# Copyright 2020 The TensorFlow Authors. All Rights Reserved. -+#!/ usr / bin / env bash -+#Copyright 2020 The TensorFlow Authors.All Rights Reserved. - # --# Licensed under the Apache License, Version 2.0 (the "License"); --# you may not use this file except in compliance with the License. --# You may obtain a copy of the License at -+#Licensed under the Apache License, Version 2.0(the "License"); -+#you may not use this file except in compliance with the License. -+#You may obtain a copy of the License at - # --# http://www.apache.org/licenses/LICENSE-2.0 -+#http: // www.apache.org/licenses/LICENSE-2.0 - # --# Unless required by applicable law or agreed to in writing, software --# distributed under the License is distributed on an "AS IS" BASIS, --# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --# See the License for the specific language governing permissions and --# limitations under the License. --# ============================================================================== --# External `common.sh` -+#Unless required by applicable law or agreed to in writing, software -+#distributed under the License is distributed on an "AS IS" BASIS, -+#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+#See the License for the specific language governing permissions and -+#limitations under the License. -+#== == == == == == == == == == == == == == == == == == == == == == == == == == \ -+ == == == == == == == == == == == == == -+#External `common.sh` - --# Keep in sync with tensorflow core and configure.py. --LATEST_BAZEL_VERSION=4.2.2 -- --# Run flaky functions with retries. --# run_with_retry cmd --function run_with_retry { -+#Keep in sync with tensorflow core and configure.py. -+LATEST_BAZEL_VERSION = 4.2.2 -+#Run flaky functions with retries. -+#run_with_retry cmd -+ function run_with_retry { - eval "$1" -- # If the command fails retry again in 60 seconds. -- if [[ $? -ne 0 ]]; then -- sleep 60 -- eval "$1" -- fi -+#If the command fails retry again in 60 seconds. -+ if [[ $? -ne 0 ]]; -+ then sleep 60 eval "$1" fi - } - - function die() { -- echo "$@" 1>&2 ; exit 1; -+ echo "$@" 1 > &2; -+ exit 1; - } - --# A small utility to run the command and only print logs if the command fails. --# On success, all logs are hidden. --function readable_run { -- # Disable debug mode to avoid printing of variables here. -- set +x -- result=$("$@" 2>&1) || die "$result" -- echo "$@" -- echo "Command completed successfully at $(date)" -- set -x --} -+#A small utility to run the command and only print logs if the command fails. -+#On success, all logs are hidden. -+function readable_run{ -+#Disable debug mode to avoid printing of variables here. -+ set + x result = -+ $("$@" 2 > &1) || die "$result" echo "$@" echo -+ "Command completed successfully at $(date)" set - -+ x} - --# TODO(b/158448780): Guard bazel installation with IfChangeThenChange. --function set_bazel_outdir { -- mkdir -p /tmpfs/bazel_output -- export TEST_TMPDIR=/tmpfs/bazel_output --} -+#TODO(b / 158448780) : Guard bazel installation with IfChangeThenChange. -+function set_bazel_outdir{mkdir - p / tmpfs / bazel_output export TEST_TMPDIR = -+ / tmpfs / bazel_output} - --# Downloads bazelisk to ~/bin as `bazel`. -+#Downloads bazelisk to ~ / bin as `bazel`. - function install_bazelisk { - date - case "$(uname -s)" in -- Darwin) local name=bazelisk-darwin-amd64 ;; -- Linux) local name=bazelisk-linux-amd64 ;; -- *) die "Unknown OS: $(uname -s)" ;; -- esac -- mkdir -p "$HOME/bin" -- wget --no-verbose -O "$HOME/bin/bazel" \ -- "https://github.com/bazelbuild/bazelisk/releases/download/v1.3.0/$name" -- chmod u+x "$HOME/bin/bazel" -- if [[ ! ":$PATH:" =~ :"$HOME"/bin/?: ]]; then -- PATH="$HOME/bin:$PATH" -- fi -- set_bazel_outdir -- which bazel -- bazel version -- date -+ Darwin) local name=bazelisk-darwin-amd64 ; -+ ; -+ Linux) local name=bazelisk-linux-amd64 ; -+ ; -+ *) die "Unknown OS: $(uname -s)" ; -+ ; -+ esac mkdir - p "$HOME/bin" wget-- no - verbose - -+ O -+ "$HOME/bin/bazel" -+ "https://github.com/bazelbuild/bazelisk/releases/download/v1.3.0/" -+ "$name" chmod u + -+ x "$HOME/bin/bazel" if[[!":$PATH:" = ~:"$HOME" / bin / ?: ]]; -+ then PATH = -+ "$HOME/bin:$PATH" fi set_bazel_outdir which bazel bazel version date - } - --# Install the given bazel version on linux -+#Install the given bazel version on linux - function update_bazel_linux { -- if [[ -z "$1" ]]; then -- BAZEL_VERSION=${LATEST_BAZEL_VERSION} -- else -- BAZEL_VERSION=$1 -- fi -- rm -rf ~/bazel -- mkdir ~/bazel -+ if -+ [[-z "$1"]]; -+ then BAZEL_VERSION = $ { -+ LATEST_BAZEL_VERSION -+ } -+ else BAZEL_VERSION = -+ $1 fi rm - -+ rf ~ / bazel mkdir ~ / -+ bazel - -- pushd ~/bazel -- readable_run wget https://github.com/bazelbuild/bazel/releases/download/"${BAZEL_VERSION}"/bazel-"${BAZEL_VERSION}"-installer-linux-x86_64.sh -- chmod +x bazel-*.sh -- ./bazel-"${BAZEL_VERSION}"-installer-linux-x86_64.sh --user -- rm bazel-"${BAZEL_VERSION}"-installer-linux-x86_64.sh -- popd -+ pushd ~ / -+ bazel readable_run wget https -+ : // github.com/bazelbuild/bazel/releases/download/"${BAZEL_VERSION}"/bazel-"${BAZEL_VERSION}"-installer-linux-x86_64.sh -+ chmod + -+ x bazel - *.sh./ bazel - "${BAZEL_VERSION}" - installer - linux - -+ x86_64.sh-- user rm bazel - "${BAZEL_VERSION}" - installer - linux - -+ x86_64.sh popd - -- PATH="/home/kbuilder/bin:$PATH" -- set_bazel_outdir -- which bazel -- bazel version -+ PATH = -+ "/home/kbuilder/bin:$PATH" set_bazel_outdir which bazel bazel version - } -diff --git a/third_party/tflite_support/src/tensorflow_lite_support/tools/pip_package/rpi/build_arm_pip_package.sh b/third_party/tflite_support/src/tensorflow_lite_support/tools/pip_package/rpi/build_arm_pip_package.sh -old mode 100755 -new mode 100644 -index 5580f4a7c7045..e2ad7acc54606 ---- a/third_party/tflite_support/src/tensorflow_lite_support/tools/pip_package/rpi/build_arm_pip_package.sh -+++ b/third_party/tflite_support/src/tensorflow_lite_support/tools/pip_package/rpi/build_arm_pip_package.sh -@@ -1,24 +1,37 @@ --#!/usr/bin/env bash --# Copyright 2021 The TensorFlow Authors. All Rights Reserved. -+#!/ usr / bin / env bash -+#Copyright 2021 The TensorFlow Authors.All Rights Reserved. - # --# Licensed under the Apache License, Version 2.0 (the "License"); --# you may not use this file except in compliance with the License. --# You may obtain a copy of the License at -+#Licensed under the Apache License, Version 2.0(the "License"); -+#you may not use this file except in compliance with the License. -+#You may obtain a copy of the License at - # --# http://www.apache.org/licenses/LICENSE-2.0 -+#http: // www.apache.org/licenses/LICENSE-2.0 - # --# Unless required by applicable law or agreed to in writing, software --# distributed under the License is distributed on an "AS IS" BASIS, --# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --# See the License for the specific language governing permissions and --# limitations under the License. --# ============================================================================== -+#Unless required by applicable law or agreed to in writing, software -+#distributed under the License is distributed on an "AS IS" BASIS, -+#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+#See the License for the specific language governing permissions and -+#limitations under the License. -+#== == == == == == == == == == == == == == == == == == == == == == == == == == \ -+ == == == == == == == == == == == == == - --set -ex -+set - ex - --NIGHTLY_FLAG=$1 -+ NIGHTLY_FLAG = -+ $1 - --bazel build -c opt --config=elinux_armhf tensorflow_lite_support/tools/pip_package:build_pip_package --EXTRA_PKG_NAME_FLAG="--plat-name=manylinux2014-armv7l" ./bazel-bin/tensorflow_lite_support/tools/pip_package/build_pip_package --dst wheels ${NIGHTLY_FLAG} --bazel build -c opt --config=elinux_aarch64 tensorflow_lite_support/tools/pip_package:build_pip_package --EXTRA_PKG_NAME_FLAG="--plat-name=manylinux2014-aarch64" ./bazel-bin/tensorflow_lite_support/tools/pip_package/build_pip_package --dst wheels ${NIGHTLY_FLAG} -+ bazel build - -+ c opt-- config = -+ elinux_armhf tensorflow_lite_support / tools / -+ pip_package : build_pip_package EXTRA_PKG_NAME_FLAG = -+ "--plat-name=manylinux2014-armv7l"./ bazel - -+ bin / tensorflow_lite_support / tools / pip_package / -+ build_pip_package-- dst wheels ${NIGHTLY_FLAG} bazel build - -+ c opt-- config = -+ elinux_aarch64 tensorflow_lite_support / tools / -+ pip_package : build_pip_package EXTRA_PKG_NAME_FLAG = -+ "--plat-name=manylinux2014-aarch64"./ bazel - -+ bin / tensorflow_lite_support / tools / pip_package / -+ build_pip_package-- dst wheels $ { -+ NIGHTLY_FLAG -+} -diff --git a/third_party/tflite_support/src/tensorflow_lite_support/tools/pip_package/rpi/install_bazel.sh b/third_party/tflite_support/src/tensorflow_lite_support/tools/pip_package/rpi/install_bazel.sh -old mode 100755 -new mode 100644 -index 9e3c0768dad04..fd376bf84ecb6 ---- a/third_party/tflite_support/src/tensorflow_lite_support/tools/pip_package/rpi/install_bazel.sh -+++ b/third_party/tflite_support/src/tensorflow_lite_support/tools/pip_package/rpi/install_bazel.sh -@@ -1,40 +1,53 @@ --#!/usr/bin/env bash --# Copyright 2015 The TensorFlow Authors. All Rights Reserved. -+#!/ usr / bin / env bash -+#Copyright 2015 The TensorFlow Authors.All Rights Reserved. - # --# Licensed under the Apache License, Version 2.0 (the "License"); --# you may not use this file except in compliance with the License. --# You may obtain a copy of the License at -+#Licensed under the Apache License, Version 2.0(the "License"); -+#you may not use this file except in compliance with the License. -+#You may obtain a copy of the License at - # --# http://www.apache.org/licenses/LICENSE-2.0 -+#http: // www.apache.org/licenses/LICENSE-2.0 - # --# Unless required by applicable law or agreed to in writing, software --# distributed under the License is distributed on an "AS IS" BASIS, --# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --# See the License for the specific language governing permissions and --# limitations under the License. --# ============================================================================== -+#Unless required by applicable law or agreed to in writing, software -+#distributed under the License is distributed on an "AS IS" BASIS, -+#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+#See the License for the specific language governing permissions and -+#limitations under the License. -+#== == == == == == == == == == == == == == == == == == == == == == == == == == \ -+ == == == == == == == == == == == == == - --# Select bazel version. --BAZEL_VERSION="4.2.2" -+#Select bazel version. -+BAZEL_VERSION = "4.2.2" - --set +e --local_bazel_ver=$(bazel version 2>&1 | grep -i label | awk '{print $3}') -+ set + -+ e local_bazel_ver = -+ $(bazel version 2 > &1 | grep - i label | awk '{print $3}') - --if [[ "$local_bazel_ver" == "$BAZEL_VERSION" ]]; then -- exit 0 --fi -+ if[["$local_bazel_ver" == "$BAZEL_VERSION"]]; -+then exit 0 fi - --set -e -+ set - -+ e - --# Install bazel. --mkdir -p /bazel --cd /bazel --if [[ ! -f "bazel-$BAZEL_VERSION-installer-linux-x86_64.sh" ]]; then -- curl -fSsL -O https://github.com/bazelbuild/bazel/releases/download/$BAZEL_VERSION/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh --fi --chmod +x /bazel/bazel-*.sh --/bazel/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh --rm -f /bazel/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh -+#Install bazel. -+ mkdir - -+ p / bazel cd / -+ bazel if[[!-f "bazel-$BAZEL_VERSION-installer-linux-x86_64.sh"]]; -+then curl - fSsL - -+ O https -+ : // github.com/bazelbuild/bazel/releases/download/$BAZEL_VERSION/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh -+ fi chmod + -+ x / bazel / bazel - -+ *.sh / bazel / bazel - -+ $BAZEL_VERSION - -+ installer - -+ linux - -+ x86_64.sh rm - -+ f / bazel / bazel - -+ $BAZEL_VERSION - -+ installer - -+ linux - -+ x86_64.sh - --# Enable bazel auto completion. --echo "source /usr/local/lib/bazel/bin/bazel-complete.bash" >> ~/.bashrc -+#Enable bazel auto completion. -+ echo "source /usr/local/lib/bazel/bin/bazel-complete.bash" >> -+ ~ /.bashrc diff --git a/third_party/tflite_support/src/third_party/fft2d/fft.h b/third_party/tflite_support/src/third_party/fft2d/fft.h index 36d838b7f6280..35dbcc766c169 100644 --- a/third_party/tflite_support/src/third_party/fft2d/fft.h @@ -43042,26 +43773,6 @@ #ifdef __cplusplus } -diff --git a/third_party/tflite_support/src/third_party/pybind11_protobuf/com_google_protobuf_build.patch b/third_party/tflite_support/src/third_party/pybind11_protobuf/com_google_protobuf_build.patch -index 01ecf027b5ac1..605337839c0fe 100644 ---- a/third_party/tflite_support/src/third_party/pybind11_protobuf/com_google_protobuf_build.patch -+++ b/third_party/tflite_support/src/third_party/pybind11_protobuf/com_google_protobuf_build.patch -@@ -1,9 +1,9 @@ ----- BUILD --+++ BUILD --@@ -889,6 +889,8 @@ -- "//conditions:default": [], -- ":use_fast_cpp_protos": ["//external:python_headers"], -- }), -+-- -BUILD++ + BUILD @ @-889, 6 + 889, -+ 8 @@ -+ "//conditions:default" : [], -+ ":use_fast_cpp_protos" -+ : ["//external:python_headers"], -+}), - + - + visibility = ["//visibility:public"], - ) -- -2.35.0.263.gb82422642f-goog +2.35.1.616.g0bdcbb4464-goog
diff --git a/third_party/tflite_support/src/.bazelrc b/third_party/tflite_support/src/.bazelrc index 02ba9da..07a32152 100644 --- a/third_party/tflite_support/src/.bazelrc +++ b/third_party/tflite_support/src/.bazelrc
@@ -54,7 +54,7 @@ build:ios_x86_64 --config=ios build:ios_x86_64 --cpu=ios_x86_64 build:ios_fat --config=ios -build:ios_fat --ios_multi_cpus=armv7,arm64,x86_64 +build:ios_fat --ios_multi_cpus=arm64,x86_64 # TFLite build configs for generic embedded Linux build:elinux --crosstool_top=@local_config_embedded_arm//:toolchain @@ -65,6 +65,7 @@ build:elinux_armhf --config=elinux build:elinux_armhf --cpu=armhf build:elinux_armhf --distinct_host_configuration=true +build:elinux_armhf --copt -mfp16-format=ieee # By default, build TF in C++ 14 mode. build:android --cxxopt=-std=c++14
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/c/task/processor/BUILD b/third_party/tflite_support/src/tensorflow_lite_support/c/task/processor/BUILD index e6e5e685..71f32c2 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/c/task/processor/BUILD +++ b/third_party/tflite_support/src/tensorflow_lite_support/c/task/processor/BUILD
@@ -44,5 +44,8 @@ cc_library( name = "segmentation_result", + srcs = [ + "segmentation_result.cc", + ], hdrs = ["segmentation_result.h"], )
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/c/task/processor/segmentation_result.cc b/third_party/tflite_support/src/tensorflow_lite_support/c/task/processor/segmentation_result.cc new file mode 100644 index 0000000..da0ecf7 --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/c/task/processor/segmentation_result.cc
@@ -0,0 +1,51 @@ +/* Copyright 2021 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==============================================================================*/ + +#include "tensorflow_lite_support/c/task/processor/segmentation_result.h" + +#include <memory> + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +void TfLiteSegmentationResultDelete( + TfLiteSegmentationResult* segmentation_result) { + for (int i = 0; i < segmentation_result->size; ++i) { + TfLiteSegmentation segmentation = segmentation_result->segmentations[i]; + for (int j = 0; j < segmentation.colored_labels_size; ++j) { + free(segmentation.colored_labels[j].display_name); + free(segmentation.colored_labels[j].label); + } + + if (segmentation.confidence_masks != nullptr) { + for (int j = 0; j < segmentation.colored_labels_size; ++j) { + delete[] segmentation.confidence_masks[j]; + } + delete[] segmentation.confidence_masks; + } + + delete[] segmentation.category_mask; + + delete[] segmentation.colored_labels; + } + + delete[] segmentation_result->segmentations; + delete segmentation_result; +} + +#ifdef __cplusplus +} // extern "C" +#endif // __cplusplus
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/c/task/processor/segmentation_result.h b/third_party/tflite_support/src/tensorflow_lite_support/c/task/processor/segmentation_result.h index 6cc211f6..b2d99569 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/c/task/processor/segmentation_result.h +++ b/third_party/tflite_support/src/tensorflow_lite_support/c/task/processor/segmentation_result.h
@@ -27,9 +27,11 @@ // Holds a label associated with an RGB color, for display purposes. typedef struct TfLiteColoredLabel { // The RGB color components for the label, in the [0, 255] range. - unsigned int r; - unsigned int g; - unsigned int b; + // Note uint32_t to keep it consistent with underlying C++ segmentations + // proto. + uint32_t r; + uint32_t g; + uint32_t b; // The class name, as provided in the label map packed in the TFLite Model // Metadata. @@ -39,18 +41,17 @@ // the TFLite Model Metadata. See `display_names_locale` field in // ImageSegmenterOptions. char* display_name; - } TfLiteColoredLabel; // Holds a resulting segmentation mask and associated metadata. typedef struct TfLiteSegmentation { // The width of the mask. This is an intrinsic parameter of the model being // used, and does not depend on the input image dimensions. - unsigned int width; + int width; // The height of the mask. This is an intrinsic parameter of the model being // used, and does not depend on the input image dimensions. - unsigned int height; + int height; // IMPORTANT: A TfLiteSegmentation can either have `confidence_masks` // or `category_mask` based on the output type selected in @@ -75,6 +76,10 @@ // class to which the pixel belongs. uint8_t* category_mask; + // Number of colored labels which is equivalent to number of classes + // supported by the model. + int colored_labels_size; + // The list of colored labels for all the supported categories (classes). // Depending on which is present, this list is in 1:1 correspondence with: // * `category_mask` pixel values, i.e. a pixel with value `i` is @@ -82,7 +87,6 @@ // * `confidence_masks` indices, i.e. `confidence_masks[i]` is associated with // `colored_labels[i]`. TfLiteColoredLabel* colored_labels; - } TfLiteSegmentation; // Holds Image Segmentation Results. @@ -99,7 +103,7 @@ TfLiteSegmentation* segmentations; } TfLiteSegmentationResult; -// Frees up the TfLiteSegmentationResult Structure. +// Frees up the TfLiteSegmentationResult structure. void TfLiteSegmentationResultDelete( TfLiteSegmentationResult* segmentation_result);
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/c/task/vision/BUILD b/third_party/tflite_support/src/tensorflow_lite_support/c/task/vision/BUILD index 8e3538f..b4dafc7 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/c/task/vision/BUILD +++ b/third_party/tflite_support/src/tensorflow_lite_support/c/task/vision/BUILD
@@ -63,6 +63,9 @@ cc_library_with_tflite( name = "image_segmenter", + srcs = [ + "image_segmenter.cc", + ], hdrs = [ "image_segmenter.h", ], @@ -71,8 +74,13 @@ ], deps = [ "//tensorflow_lite_support/c:common", + "//tensorflow_lite_support/c:common_utils", "//tensorflow_lite_support/c/task/core:base_options", + "//tensorflow_lite_support/c/task/core/utils:base_options_utils", "//tensorflow_lite_support/c/task/processor:segmentation_result", "//tensorflow_lite_support/c/task/vision/core:frame_buffer", + "//tensorflow_lite_support/c/task/vision/utils:frame_buffer_cpp_c_utils", + "//tensorflow_lite_support/cc/task/vision/proto:image_segmenter_options_proto_inc", + "//tensorflow_lite_support/cc/task/vision/proto:segmentations_proto_inc", ], )
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/c/task/vision/core/frame_buffer.h b/third_party/tflite_support/src/tensorflow_lite_support/c/task/vision/core/frame_buffer.h index 8cab2676..0386eb7 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/c/task/vision/core/frame_buffer.h +++ b/third_party/tflite_support/src/tensorflow_lite_support/c/task/vision/core/frame_buffer.h
@@ -66,6 +66,8 @@ // Colorspace format of the frame buffer. enum TfLiteFrameBufferFormat format; // Orientation of the frame buffer. + // If uninitialized or provided with a value outside the range of + // TfLiteFrameBufferOrientation, it takes the value `kTopLeft`. enum TfLiteFrameBufferOrientation orientation; // Dimension information for the whole frame. struct TfLiteFrameBufferDimension dimension;
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/c/task/vision/image_segmenter.cc b/third_party/tflite_support/src/tensorflow_lite_support/c/task/vision/image_segmenter.cc new file mode 100644 index 0000000..8549856 --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/c/task/vision/image_segmenter.cc
@@ -0,0 +1,220 @@ +/* Copyright 2021 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==============================================================================*/ + +#include "tensorflow_lite_support/c/task/vision/image_segmenter.h" + +#include <memory> + +#include "tensorflow_lite_support/c/common_utils.h" +#include "tensorflow_lite_support/c/task/core/utils/base_options_utils.h" +#include "tensorflow_lite_support/c/task/vision/utils/frame_buffer_cpp_c_utils.h" +#include "tensorflow_lite_support/cc/task/vision/image_segmenter.h" +#include "tensorflow_lite_support/cc/task/vision/proto/image_segmenter_options_proto_inc.h" +#include "tensorflow_lite_support/cc/task/vision/proto/segmentations_proto_inc.h" + +namespace { +using ::tflite::support::StatusOr; +using SegmentationResultCpp = ::tflite::task::vision::SegmentationResult; +using SegmentationCpp = ::tflite::task::vision::Segmentation; +using ColoredLabelCpp = ::tflite::task::vision::Segmentation_ColoredLabel; +using ImageSegmenterCpp = ::tflite::task::vision::ImageSegmenter; +using ImageSegmenterOptionsCpp = ::tflite::task::vision::ImageSegmenterOptions; +using FrameBufferCpp = ::tflite::task::vision::FrameBuffer; +using OutputTypeCpp = ::tflite::task::vision::ImageSegmenterOptions_OutputType; +using ::tflite::support::TfLiteSupportStatus; + +StatusOr<ImageSegmenterOptionsCpp> CreateImageSegmenterCppOptionsFromCOptions( + const TfLiteImageSegmenterOptions* c_options) { + if (c_options == nullptr) { + return CreateStatusWithPayload( + absl::StatusCode::kInvalidArgument, + absl::StrFormat("Expected non null options."), + TfLiteSupportStatus::kInvalidArgumentError); + } + + ImageSegmenterOptionsCpp cpp_options = {}; + + // More file sources can be added in else ifs + if (c_options->base_options.model_file.file_path) + cpp_options.mutable_base_options()->mutable_model_file()->set_file_name( + c_options->base_options.model_file.file_path); + + // c_options->base_options.compute_settings.num_threads is expected to be + // set to value > 0 or -1. Otherwise invoking + // ImageSegmenterCpp::CreateFromOptions() results in a not ok status. + cpp_options.mutable_base_options() + ->mutable_compute_settings() + ->mutable_tflite_settings() + ->mutable_cpu_settings() + ->set_num_threads( + c_options->base_options.compute_settings.cpu_settings.num_threads); + + cpp_options.set_output_type((OutputTypeCpp)c_options->output_type); + + // Check needed since setting a nullptr for this field results in a segfault + // on invocation of ImageSegmenterCpp::CreateFromOptions(). + if (c_options->display_names_locale) { + cpp_options.set_display_names_locale(c_options->display_names_locale); + } + + return cpp_options; +} +} // namespace + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +struct TfLiteImageSegmenter { + std::unique_ptr<ImageSegmenterCpp> impl; +}; + +TfLiteImageSegmenterOptions TfLiteImageSegmenterOptionsCreate() { + // Use brace-enclosed initializer list will break the Kokoro test. + TfLiteImageSegmenterOptions options; + options.base_options = tflite::task::core::CreateDefaultBaseOptions(); + options.display_names_locale = nullptr; + options.output_type = kCategoryMask; + + return options; +} + +TfLiteImageSegmenter* TfLiteImageSegmenterFromOptions( + const TfLiteImageSegmenterOptions* options, + TfLiteSupportError** error) { + StatusOr<ImageSegmenterOptionsCpp> cpp_option_status = + CreateImageSegmenterCppOptionsFromCOptions(options); + + if (!cpp_option_status.ok()) { + ::tflite::support::CreateTfLiteSupportErrorWithStatus( + cpp_option_status.status(), error); + return nullptr; + } + StatusOr<std::unique_ptr<ImageSegmenterCpp>> segmenter_status = + ImageSegmenterCpp::CreateFromOptions(cpp_option_status.value()); + + if (segmenter_status.ok()) { + return new TfLiteImageSegmenter{.impl = + std::move(segmenter_status.value())}; + } else { + ::tflite::support::CreateTfLiteSupportErrorWithStatus( + segmenter_status.status(), error); + return nullptr; + } +} + +TfLiteSegmentationResult* GetSegmentationResultCStruct( + const SegmentationResultCpp& segmentation_result_cpp) { + auto c_segmentations = + new TfLiteSegmentation[segmentation_result_cpp.segmentation_size()](); + + for (int i = 0; i < segmentation_result_cpp.segmentation_size(); ++i) { + const SegmentationCpp& segmentation = + segmentation_result_cpp.segmentation(i); + + c_segmentations[i].width = (int)segmentation.width(); + c_segmentations[i].height = (int)segmentation.height(); + c_segmentations[i].colored_labels_size = segmentation.colored_labels_size(); + + auto c_colored_labels = + new TfLiteColoredLabel[segmentation.colored_labels_size()](); + + if (segmentation.has_category_mask()) { + c_segmentations[i].category_mask = + new uint8_t[segmentation.width() * segmentation.height()]; + std::memcpy( + c_segmentations[i].category_mask, + reinterpret_cast<const uint8_t*>(segmentation.category_mask().data()), + segmentation.width() * segmentation.height() * sizeof(uint8_t)); + + } else if (segmentation.has_confidence_masks()) { + c_segmentations[i].confidence_masks = + new float*[segmentation.colored_labels_size()]; + for (int k = 0; k < segmentation.colored_labels_size(); ++k) { + c_segmentations[i].confidence_masks[k] = + new float[segmentation.width() * segmentation.height()]; + + std::memcpy( + c_segmentations[i].confidence_masks[k], + reinterpret_cast<const float*>(segmentation.confidence_masks() + .confidence_mask(k) + .value() + .data()), + segmentation.width() * segmentation.height() * sizeof(float)); + } + } + + for (int j = 0; j < segmentation.colored_labels_size(); ++j) { + const ColoredLabelCpp& colored_label = segmentation.colored_labels(j); + c_colored_labels[j].r = colored_label.r(); + c_colored_labels[j].g = colored_label.g(); + c_colored_labels[j].b = colored_label.b(); + + if (colored_label.has_class_name()) { + c_colored_labels[j].label = strdup(colored_label.class_name().c_str()); + } + + if (colored_label.has_display_name()) { + c_colored_labels[j].display_name = + strdup(colored_label.display_name().c_str()); + } + } + c_segmentations[i].colored_labels = c_colored_labels; + } + + auto c_segmentation_result = new TfLiteSegmentationResult; + c_segmentation_result->segmentations = c_segmentations; + c_segmentation_result->size = segmentation_result_cpp.segmentation_size(); + + return c_segmentation_result; +} + +TfLiteSegmentationResult* TfLiteImageSegmenterSegment( + const TfLiteImageSegmenter* segmenter, + const TfLiteFrameBuffer* frame_buffer, + TfLiteSupportError** error) { + if (segmenter == nullptr) { + tflite::support::CreateTfLiteSupportError( + kInvalidArgumentError, "Expected non null image segmenter.", error); + return nullptr; + } + + StatusOr<std::unique_ptr<FrameBufferCpp>> cpp_frame_buffer_status = + ::tflite::task::vision::CreateCppFrameBuffer(frame_buffer); + if (!cpp_frame_buffer_status.ok()) { + tflite::support::CreateTfLiteSupportErrorWithStatus( + cpp_frame_buffer_status.status(), error); + return nullptr; + } + + StatusOr<SegmentationResultCpp> cpp_segmentation_result_status = + segmenter->impl->Segment(*(cpp_frame_buffer_status.value())); + + if (!cpp_segmentation_result_status.ok()) { + tflite::support::CreateTfLiteSupportErrorWithStatus( + cpp_segmentation_result_status.status(), error); + return nullptr; + } + + return GetSegmentationResultCStruct(cpp_segmentation_result_status.value()); +} + +void TfLiteImageSegmenterDelete(TfLiteImageSegmenter* segmenter) { + delete segmenter; +} + +#ifdef __cplusplus +} // extern "C" +#endif // __cplusplus
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/c/task/vision/image_segmenter.h b/third_party/tflite_support/src/tensorflow_lite_support/c/task/vision/image_segmenter.h index 23b6b6e..a330acc4 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/c/task/vision/image_segmenter.h +++ b/third_party/tflite_support/src/tensorflow_lite_support/c/task/vision/image_segmenter.h
@@ -97,8 +97,9 @@ // as a result of the image segmentation operation. // This allows specifying the type of post-processing to // perform on the raw model results (see TfLiteSegmentationResult for more). -enum TfLiteImageSegmenterOutputType { +typedef enum TfLiteImageSegmenterOutputType { kUnspecified, + // Gives a single output mask where each pixel represents the class which // the pixel in the original image was predicted to belong to. kCategoryMask, @@ -106,7 +107,7 @@ // Gives a list of output masks where, for each mask, each pixel represents // the prediction confidence, usually in the [0, 1] range. kConfidenceMask -}; +} TfLiteImageSegmenterOutputType; // Holds options for configuring the creation of TfLiteImageSegmenter. typedef struct TfLiteImageSegmenterOptions {
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/c/task/vision/utils/frame_buffer_cpp_c_utils.cc b/third_party/tflite_support/src/tensorflow_lite_support/c/task/vision/utils/frame_buffer_cpp_c_utils.cc index a084789d..5152fe6 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/c/task/vision/utils/frame_buffer_cpp_c_utils.cc +++ b/third_party/tflite_support/src/tensorflow_lite_support/c/task/vision/utils/frame_buffer_cpp_c_utils.cc
@@ -39,10 +39,19 @@ FrameBufferCpp::Format frame_buffer_format = FrameBufferCpp::Format(frame_buffer->format); + // If an invalid value is provided for Frame Buffer orientation by the C API + // call, the underlying C++ FrameBuffer orientation is initialized with a + // value of kTopLeft. This is to avoid invalid model inference results as the + // underlying C++ implementation does not perform error handling for enum + // values. + FrameBufferCpp::Orientation orientation = + (int)frame_buffer->orientation >= 1 && (int)frame_buffer->orientation <= 8 + ? (FrameBufferCpp::Orientation)frame_buffer->orientation + : FrameBufferCpp::Orientation::kTopLeft; return CreateFromRawBuffer( frame_buffer->buffer, {frame_buffer->dimension.width, frame_buffer->dimension.height}, - frame_buffer_format); + frame_buffer_format, orientation); } } // namespace vision
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/c/test/task/vision/BUILD b/third_party/tflite_support/src/tensorflow_lite_support/c/test/task/vision/BUILD index 09f7e08..fc723360 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/c/test/task/vision/BUILD +++ b/third_party/tflite_support/src/tensorflow_lite_support/c/test/task/vision/BUILD
@@ -54,3 +54,24 @@ "//tensorflow_lite_support/examples/task/vision/desktop/utils:image_utils", ], ) + +cc_test_with_tflite( + name = "image_segmenter_test", + srcs = ["image_segmenter_test.cc"], + data = [ + "//tensorflow_lite_support/cc/test/testdata/task/vision:test_images", + "//tensorflow_lite_support/cc/test/testdata/task/vision:test_models", + ], + tflite_deps = [ + "//tensorflow_lite_support/c/task/vision:image_segmenter", + "@org_tensorflow//tensorflow/lite/core/shims:cc_shims_test_util", + ], + deps = [ + "//tensorflow_lite_support/c:common", + "//tensorflow_lite_support/c/task/processor:segmentation_result", + "//tensorflow_lite_support/c/task/vision/core:frame_buffer", + "//tensorflow_lite_support/cc/port:gtest_main", + "//tensorflow_lite_support/cc/test:test_utils", + "//tensorflow_lite_support/examples/task/vision/desktop/utils:image_utils", + ], +)
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/c/test/task/vision/image_segmenter_test.cc b/third_party/tflite_support/src/tensorflow_lite_support/c/test/task/vision/image_segmenter_test.cc new file mode 100644 index 0000000..81ade945 --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/c/test/task/vision/image_segmenter_test.cc
@@ -0,0 +1,347 @@ +/* Copyright 2021 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==============================================================================*/ + +#include "tensorflow_lite_support/c/task/vision/image_segmenter.h" + +#include <string.h> + +#include <cstdio> + +#include "tensorflow/lite/core/shims/cc/shims_test_util.h" +#include "tensorflow_lite_support/c/common.h" +#include "tensorflow_lite_support/c/task/processor/segmentation_result.h" +#include "tensorflow_lite_support/c/task/vision/core/frame_buffer.h" +#include "tensorflow_lite_support/cc/port/gmock.h" +#include "tensorflow_lite_support/cc/port/gtest.h" +#include "tensorflow_lite_support/cc/port/status_matchers.h" +#include "tensorflow_lite_support/cc/test/test_utils.h" +#include "tensorflow_lite_support/examples/task/vision/desktop/utils/image_utils.h" + +namespace tflite { +namespace task { +namespace vision { +namespace { + +using ::testing::HasSubstr; +using ::testing::StrEq; +using ::tflite::support::StatusOr; +using ::tflite::task::JoinPath; + +constexpr char kTestDataDirectory[] = + "/tensorflow_lite_support/cc/test/testdata/task/" + "vision/"; +// Quantized model. +constexpr char kDeepLabV3[] = "deeplabv3.tflite"; + +StatusOr<ImageData> LoadImage(const char* image_name) { + return DecodeImageFromFile( + JoinPath("./" /*test src dir*/, kTestDataDirectory, image_name)); +} + +// The maximum fraction of pixels in the candidate mask that can have a +// different class than the golden mask for the test to pass. +constexpr float kGoldenMaskTolerance = 1e-2; +// Magnification factor used when creating the golden category masks to make +// them more human-friendly. Each pixel in the golden masks has its value +// multiplied by this factor, i.e. a value of 10 means class index 1, a value of +// 20 means class index 2, etc. +constexpr int kGoldenMaskMagnificationFactor = 10; + +void InitializeColoredLabel(TfLiteColoredLabel& colored_label, + uint32_t r, + uint32_t g, + uint32_t b, + const char* label) { + colored_label.r = r; + colored_label.g = g; + colored_label.b = b; + colored_label.label = strdup(label); + colored_label.display_name = nullptr; +} + +TfLiteSegmentation CreatePartialDeepLabV3Segmentation() { + TfLiteSegmentation segmentation = {.width = 257, .height = 257}; + segmentation.colored_labels = new TfLiteColoredLabel[21]; + segmentation.colored_labels_size = 21; + InitializeColoredLabel(segmentation.colored_labels[0], 0, 0, 0, "background"); + InitializeColoredLabel(segmentation.colored_labels[1], 128, 0, 0, + "aeroplane"); + InitializeColoredLabel(segmentation.colored_labels[2], 0, 128, 0, "bicycle"); + InitializeColoredLabel(segmentation.colored_labels[3], 128, 128, 0, "bird"); + InitializeColoredLabel(segmentation.colored_labels[4], 0, 0, 128, "boat"); + InitializeColoredLabel(segmentation.colored_labels[5], 128, 0, 128, "bottle"); + InitializeColoredLabel(segmentation.colored_labels[6], 0, 128, 128, "bus"); + InitializeColoredLabel(segmentation.colored_labels[7], 128, 128, 128, "car"); + InitializeColoredLabel(segmentation.colored_labels[8], 64, 0, 0, "cat"); + InitializeColoredLabel(segmentation.colored_labels[9], 192, 0, 0, "chair"); + InitializeColoredLabel(segmentation.colored_labels[10], 64, 128, 0, "cow"); + InitializeColoredLabel(segmentation.colored_labels[11], 192, 128, 0, + "dining table"); + InitializeColoredLabel(segmentation.colored_labels[12], 64, 0, 128, "dog"); + InitializeColoredLabel(segmentation.colored_labels[13], 192, 0, 128, "horse"); + InitializeColoredLabel(segmentation.colored_labels[14], 64, 128, 128, + "motorbike"); + InitializeColoredLabel(segmentation.colored_labels[15], 192, 128, 128, + "person"); + InitializeColoredLabel(segmentation.colored_labels[16], 0, 64, 0, + "potted plant"); + InitializeColoredLabel(segmentation.colored_labels[17], 128, 64, 0, "sheep"); + InitializeColoredLabel(segmentation.colored_labels[18], 0, 192, 0, "sofa"); + InitializeColoredLabel(segmentation.colored_labels[19], 128, 192, 0, "train"); + InitializeColoredLabel(segmentation.colored_labels[20], 0, 64, 128, "tv"); + + return segmentation; +} + +TfLiteSegmentation partial_deep_lab_v3_segmentation = + CreatePartialDeepLabV3Segmentation(); + +// Checks that the two provided `TfLiteSegmentation`s are equal. +void ExpectPartiallyEqual(const TfLiteSegmentation& actual, + const TfLiteSegmentation& expected) { + EXPECT_EQ(actual.height, expected.height); + EXPECT_EQ(actual.width, expected.width); + for (int i = 0; i < actual.colored_labels_size; i++) { + EXPECT_EQ(actual.colored_labels[i].r, expected.colored_labels[i].r); + EXPECT_EQ(actual.colored_labels[i].g, expected.colored_labels[i].g); + EXPECT_EQ(actual.colored_labels[i].b, expected.colored_labels[i].b); + EXPECT_THAT(actual.colored_labels[i].label, + StrEq(expected.colored_labels[i].label)); + } +} + +class ImageSegmenterFromOptionsTest : public tflite_shims::testing::Test {}; + +TEST_F(ImageSegmenterFromOptionsTest, FailsWithNullOptionsAndError) { + TfLiteSupportError* error = nullptr; + + TfLiteImageSegmenter* image_segmenter = + TfLiteImageSegmenterFromOptions(nullptr, &error); + + EXPECT_EQ(image_segmenter, nullptr); + + if (image_segmenter) + TfLiteImageSegmenterDelete(image_segmenter); + + ASSERT_NE(error, nullptr); + EXPECT_EQ(error->code, kInvalidArgumentError); + EXPECT_NE(error->message, nullptr); + EXPECT_THAT(error->message, HasSubstr("Expected non null options")); + + TfLiteSupportErrorDelete(error); +} + +TEST_F(ImageSegmenterFromOptionsTest, FailsWithMissingModelPath) { + TfLiteImageSegmenterOptions options = TfLiteImageSegmenterOptionsCreate(); + + TfLiteImageSegmenter* image_segmenter = + TfLiteImageSegmenterFromOptions(&options, nullptr); + + EXPECT_EQ(image_segmenter, nullptr); + + if (image_segmenter) + TfLiteImageSegmenterDelete(image_segmenter); +} + +TEST_F(ImageSegmenterFromOptionsTest, FailsWithMissingModelPathAndError) { + TfLiteImageSegmenterOptions options = TfLiteImageSegmenterOptionsCreate(); + + TfLiteSupportError* error = nullptr; + + TfLiteImageSegmenter* image_segmenter = + TfLiteImageSegmenterFromOptions(&options, &error); + + EXPECT_EQ(image_segmenter, nullptr); + + if (image_segmenter) + TfLiteImageSegmenterDelete(image_segmenter); + + ASSERT_NE(error, nullptr); + EXPECT_EQ(error->code, kInvalidArgumentError); + EXPECT_NE(error->message, nullptr); + EXPECT_THAT(error->message, HasSubstr("`base_options.model_file`")); + + TfLiteSupportErrorDelete(error); +} + +TEST_F(ImageSegmenterFromOptionsTest, SucceedsWithModelPath) { + std::string model_path = + JoinPath("./" /*test src dir*/, kTestDataDirectory, kDeepLabV3); + + TfLiteImageSegmenterOptions options = TfLiteImageSegmenterOptionsCreate(); + options.base_options.model_file.file_path = model_path.data(); + + TfLiteImageSegmenter* image_segmenter = + TfLiteImageSegmenterFromOptions(&options, nullptr); + + EXPECT_NE(image_segmenter, nullptr); + + TfLiteImageSegmenterDelete(image_segmenter); +} + +TEST_F(ImageSegmenterFromOptionsTest, SucceedsWithNumberOfThreadsAndError) { + std::string model_path = + JoinPath("./" /*test src dir*/, kTestDataDirectory, kDeepLabV3); + + TfLiteImageSegmenterOptions options = TfLiteImageSegmenterOptionsCreate(); + options.base_options.model_file.file_path = model_path.data(); + options.base_options.compute_settings.cpu_settings.num_threads = 3; + + TfLiteSupportError* error = nullptr; + TfLiteImageSegmenter* image_segmenter = + TfLiteImageSegmenterFromOptions(&options, &error); + + EXPECT_NE(image_segmenter, nullptr); + EXPECT_EQ(error, nullptr); + + if (image_segmenter) + TfLiteImageSegmenterDelete(image_segmenter); + if (error) + TfLiteSupportErrorDelete(error); +} + +TEST_F(ImageSegmenterFromOptionsTest, FailsWithUnspecifiedOutputTypeAndError) { + std::string model_path = + JoinPath("./" /*test src dir*/, kTestDataDirectory, kDeepLabV3); + + TfLiteImageSegmenterOptions options = TfLiteImageSegmenterOptionsCreate(); + options.base_options.model_file.file_path = model_path.data(); + options.output_type = kUnspecified; + + TfLiteSupportError* error = nullptr; + TfLiteImageSegmenter* image_segmenter = + TfLiteImageSegmenterFromOptions(&options, &error); + + EXPECT_EQ(image_segmenter, nullptr); + EXPECT_NE(error, nullptr); + + if (image_segmenter) + TfLiteImageSegmenterDelete(image_segmenter); + if (error) + TfLiteSupportErrorDelete(error); +} + +class ImageSegmenterSegmentTest : public tflite_shims::testing::Test { + protected: + void SetUp() override { + std::string model_path = + JoinPath("./" /*test src dir*/, kTestDataDirectory, kDeepLabV3); + + TfLiteImageSegmenterOptions options = TfLiteImageSegmenterOptionsCreate(); + options.base_options.model_file.file_path = model_path.data(); + image_segmenter = TfLiteImageSegmenterFromOptions(&options, nullptr); + ASSERT_NE(image_segmenter, nullptr); + } + + void TearDown() override { TfLiteImageSegmenterDelete(image_segmenter); } + TfLiteImageSegmenter* image_segmenter; +}; + +TEST_F(ImageSegmenterSegmentTest, SucceedsWithCategoryMask) { + SUPPORT_ASSERT_OK_AND_ASSIGN(ImageData image_data, + LoadImage("segmentation_input_rotation0.jpg")); + + TfLiteFrameBuffer frame_buffer = { + .format = kRGB, + .orientation = kTopLeft, + .dimension = {.width = image_data.width, .height = image_data.height}, + .buffer = image_data.pixel_data}; + + TfLiteSegmentationResult* segmentation_result = + TfLiteImageSegmenterSegment(image_segmenter, &frame_buffer, nullptr); + + ImageDataFree(&image_data); + + ASSERT_NE(segmentation_result, nullptr); + EXPECT_EQ(segmentation_result->size, 1); + EXPECT_NE(segmentation_result->segmentations, nullptr); + EXPECT_NE(segmentation_result->segmentations[0].category_mask, nullptr); + + ExpectPartiallyEqual(partial_deep_lab_v3_segmentation, + segmentation_result->segmentations[0]); + + // Load golden mask output. + SUPPORT_ASSERT_OK_AND_ASSIGN(ImageData golden_mask, + LoadImage("segmentation_golden_rotation0.png")); + + int inconsistent_pixels = 0; + int num_pixels = golden_mask.height * golden_mask.width; + + for (int i = 0; i < num_pixels; ++i) { + inconsistent_pixels += + (segmentation_result->segmentations[0].category_mask[i] * + kGoldenMaskMagnificationFactor != + golden_mask.pixel_data[i]); + } + + EXPECT_LT(static_cast<float>(inconsistent_pixels) / num_pixels, + kGoldenMaskTolerance); + + ImageDataFree(&golden_mask); + + TfLiteSegmentationResultDelete(segmentation_result); +} + +TEST_F(ImageSegmenterSegmentTest, SucceedsWithCategoryMaskAndOrientation) { + SUPPORT_ASSERT_OK_AND_ASSIGN( + ImageData image_data, + LoadImage("segmentation_input_rotation90_flop.jpg")); + + TfLiteFrameBuffer frame_buffer = { + .format = kRGB, + .orientation = kRightBottom, + .dimension = {.width = image_data.width, .height = image_data.height}, + .buffer = image_data.pixel_data}; + + TfLiteSegmentationResult* segmentation_result = + TfLiteImageSegmenterSegment(image_segmenter, &frame_buffer, nullptr); + + ImageDataFree(&image_data); + + ASSERT_NE(segmentation_result, nullptr); + EXPECT_EQ(segmentation_result->size, 1); + EXPECT_NE(segmentation_result->segmentations, nullptr); + EXPECT_NE(segmentation_result->segmentations[0].category_mask, nullptr); + + ExpectPartiallyEqual(partial_deep_lab_v3_segmentation, + segmentation_result->segmentations[0]); + + // Load golden mask output. + SUPPORT_ASSERT_OK_AND_ASSIGN( + ImageData golden_mask, + LoadImage("segmentation_golden_rotation90_flop.png")); + + int inconsistent_pixels = 0; + int num_pixels = golden_mask.height * golden_mask.width; + + for (int i = 0; i < num_pixels; ++i) { + inconsistent_pixels += + (segmentation_result->segmentations[0].category_mask[i] * + kGoldenMaskMagnificationFactor != + golden_mask.pixel_data[i]); + } + + EXPECT_LT(static_cast<float>(inconsistent_pixels) / num_pixels, + kGoldenMaskTolerance); + + ImageDataFree(&golden_mask); + + TfLiteSegmentationResultDelete(segmentation_result); +} + +} // namespace +} // namespace vision +} // namespace task +} // namespace tflite
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/core/task_utils.h b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/core/task_utils.h index 43a508ae..2c21a95 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/core/task_utils.h +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/core/task_utils.h
@@ -149,10 +149,8 @@ inline absl::Status PopulateVector<std::string>( const TfLiteTensor* tensor, std::vector<std::string>* data) { - if (tensor->type != typeToTfLiteType<std::string>()) { - return absl::InvalidArgumentError("not of type string"); - } - + std::string* v __attribute__((unused)); + ASSIGN_OR_RETURN(v, AssertAndReturnTypedTensor<std::string>(tensor)); int num = GetStringCount(tensor); data->reserve(num); for (int i = 0; i < num; i++) {
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/processor/proto/BUILD b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/processor/proto/BUILD index 996467c..31e66d57 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/processor/proto/BUILD +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/processor/proto/BUILD
@@ -75,6 +75,13 @@ ], ) +support_py_proto_library( + name = "classification_options_py_pb2", + srcs = ["classification_options.proto"], + api_version = 2, + proto_deps = [":classification_options_proto"], +) + java_lite_proto_library( name = "classification_options_java_proto_lite", deps = [":classification_options_proto"], @@ -84,3 +91,25 @@ name = "embedding_options_java_proto_lite", deps = [":embedding_options_proto"], ) + +proto_library( + name = "detection_options_proto", + srcs = ["detection_options.proto"], +) + +cc_proto_library( + name = "detection_options_cc_proto", + deps = [":detection_options_proto"], +) + +support_py_proto_library( + name = "detection_options_py_pb2", + srcs = ["detection_options.proto"], + api_version = 2, + proto_deps = [":detection_options_proto"], +) + +java_lite_proto_library( + name = "detection_options_java_proto_lite", + deps = [":detection_options_proto"], +)
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/processor/proto/detection_options.proto b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/processor/proto/detection_options.proto new file mode 100644 index 0000000..8cb90f50 --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/processor/proto/detection_options.proto
@@ -0,0 +1,48 @@ +/* Copyright 2022 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==============================================================================*/ + +syntax = "proto2"; + +package tflite.task.processor; + +option java_multiple_files = true; +option java_package = "org.tensorflow.lite.task.processor.proto"; + +// Options for object detection processor. +// Next Id: 6 +message DetectionOptions { + // The locale to use for display names specified through the TFLite Model + // Metadata, if any. Defaults to English. + optional string display_names_locale = 1 [default = "en"]; + + // The maximum number of top-scored classification results to return. If < 0, + // all available results will be returned. If 0, an invalid argument error is + // returned. + optional int32 max_results = 2 [default = -1]; + + // Score threshold, overrides the ones provided in the model metadata + // (if any). Results below this value are rejected. + optional float score_threshold = 3; + + // Optional allowlist of class names. If non-empty, classifications whose + // class name is not in this set will be filtered out. Duplicate or unknown + // class names are ignored. Mutually exclusive with class_name_denylist. + repeated string class_name_allowlist = 4; + + // Optional denylist of class names. If non-empty, classifications whose + // class name is in this set will be filtered out. Duplicate or unknown + // class names are ignored. Mutually exclusive with class_name_allowlist. + repeated string class_name_denylist = 5; +}
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/BUILD b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/BUILD index 67581ac2..8baab25 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/BUILD +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/BUILD
@@ -132,3 +132,38 @@ "@org_tensorflow//tensorflow/lite/core/api:op_resolver", ], ) + +cc_library( + name = "clu_annotator", + hdrs = [ + "clu_annotator.h", + ], + deps = [ + "//tensorflow_lite_support/cc/task/core:base_task_api", + "//tensorflow_lite_support/cc/task/core:tflite_engine", + "//tensorflow_lite_support/cc/task/text/proto:clu_proto_inc", + ], +) + +cc_library( + name = "bert_clu_annotator", + srcs = [ + "bert_clu_annotator.cc", + ], + hdrs = [ + "bert_clu_annotator.h", + ], + deps = [ + ":clu_annotator", + "//tensorflow_lite_support/cc/port:status_macros", + "//tensorflow_lite_support/cc/task/core:task_api_factory", + "//tensorflow_lite_support/cc/task/core:task_utils", + "//tensorflow_lite_support/cc/task/text/clu_lib:tflite_modules", + "//tensorflow_lite_support/cc/task/text/proto:bert_clu_annotator_options_proto_inc", + "//tensorflow_lite_support/cc/text/tokenizers:bert_tokenizer", + "//tensorflow_lite_support/cc/text/tokenizers:tokenizer_utils", + "@com_google_absl//absl/status", + "@com_google_absl//absl/strings", + "@com_google_absl//absl/strings:str_format", + ], +)
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/bert_clu_annotator.cc b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/bert_clu_annotator.cc new file mode 100644 index 0000000..802face --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/bert_clu_annotator.cc
@@ -0,0 +1,202 @@ +/* Copyright 2022 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==============================================================================*/ + +#include "tensorflow_lite_support/cc/task/text/bert_clu_annotator.h" + +#include <memory> +#include <string> +#include <utility> + +#include "absl/status/status.h" // from @com_google_absl +#include "absl/strings/str_format.h" // from @com_google_absl +#include "absl/strings/str_split.h" // from @com_google_absl +#include "tensorflow_lite_support/cc/port/status_macros.h" +#include "tensorflow_lite_support/cc/task/core/task_api_factory.h" +#include "tensorflow_lite_support/cc/task/core/task_utils.h" +#include "tensorflow_lite_support/cc/task/text/clu_lib/tflite_modules.h" +#include "tensorflow_lite_support/cc/text/tokenizers/bert_tokenizer.h" +#include "tensorflow_lite_support/cc/text/tokenizers/tokenizer_utils.h" + +namespace tflite { +namespace task { +namespace text { +namespace clu { + +namespace { +constexpr int kTokenizerProcessUnitIndex = 0; + +constexpr char kTokenIdTensorName[] = "ids"; +constexpr char kMaskTensorName[] = "mask"; +constexpr char kTokenTypeIdTensorName[] = "segment_ids"; + +constexpr char kDomainTaskNamesTensorName[] = "domain_task/names"; +constexpr char kDomainTaskScoresTensorName[] = "domain_task/scores"; +constexpr char kIntentTaskNamesTensorName[] = "intent_task/names"; +constexpr char kIntentTaskScoresTensorName[] = "intent_task/scores"; +constexpr char kSlotTaskNamesTensorName[] = "slot_task/names"; +constexpr char kSlotTaskScoresTensorName[] = "slot_task/scores"; + +absl::Status SanityCheckOptions(const BertCluAnnotatorOptions& options) { + if (!options.has_base_options()) { + return CreateStatusWithPayload( + absl::StatusCode::kInvalidArgument, + "Missing mandatory `base_options` field", + support::TfLiteSupportStatus::kInvalidArgumentError); + } + return absl::OkStatus(); +} + +absl::StatusOr<int> FindTensorIdxByName( + const flatbuffers::Vector<flatbuffers::Offset<TensorMetadata>>* + tensor_metadatas, + const std::string& name) { + int tensor_idx = core::FindTensorIndexByMetadataName(tensor_metadatas, name); + if (tensor_idx == -1) { + return absl::InternalError(absl::StrFormat( + "The expected tensor name \"%s\" is not found in metadata list.", + name)); + } + return tensor_idx; +} +} // namespace + +/*static*/ tflite::support::StatusOr<std::unique_ptr<CluAnnotator>> +BertCluAnnotator::CreateFromOptions( + const BertCluAnnotatorOptions& options, + std::unique_ptr<tflite::OpResolver> resolver) { + RETURN_IF_ERROR(SanityCheckOptions(options)); + + // Copy options to ensure the ExternalFile outlives the duration of this + // created BertCluAnnotator object. + auto options_copy = std::make_unique<BertCluAnnotatorOptions>(options); + + ASSIGN_OR_RETURN( + auto bert_clu_annotator, + core::TaskAPIFactory::CreateFromBaseOptions<BertCluAnnotator>( + &options_copy->base_options(), std::move(resolver))); + RETURN_IF_ERROR(bert_clu_annotator->Init(std::move(options_copy))); + return std::move(bert_clu_annotator); +} + +absl::Status BertCluAnnotator::Init( + std::unique_ptr<BertCluAnnotatorOptions> options) { + options_ = std::move(options); + + const ProcessUnit* tokenizer_process_unit = + GetMetadataExtractor()->GetInputProcessUnit(kTokenizerProcessUnitIndex); + if (tokenizer_process_unit == nullptr) { + return CreateStatusWithPayload( + absl::StatusCode::kInvalidArgument, + "No input process unit found from metadata.", + support::TfLiteSupportStatus::kMetadataInvalidTokenizerError); + } + ASSIGN_OR_RETURN(tokenizer_, + support::text::tokenizer::CreateTokenizerFromProcessUnit( + tokenizer_process_unit, GetMetadataExtractor())); + + // Initialize the modules. + auto* interpreter = GetTfLiteEngine()->interpreter(); + + const metadata::ModelMetadataExtractor* metadata_extractor = + GetTfLiteEngine()->metadata_extractor(); + auto input_tensors_metadata = metadata_extractor->GetInputTensorMetadata(); + auto output_tensors_metadata = metadata_extractor->GetOutputTensorMetadata(); + + tensor_index_map_ = std::make_unique<TensorIndexMap>(); + + ASSIGN_OR_RETURN( + tensor_index_map_->token_id_idx, + FindTensorIdxByName(input_tensors_metadata, kTokenIdTensorName)); + ASSIGN_OR_RETURN( + tensor_index_map_->token_mask_idx, + FindTensorIdxByName(input_tensors_metadata, kMaskTensorName)); + ASSIGN_OR_RETURN( + tensor_index_map_->token_type_id_idx, + FindTensorIdxByName(input_tensors_metadata, kTokenTypeIdTensorName)); + ASSIGN_OR_RETURN( + tensor_index_map_->domain_names_idx, + FindTensorIdxByName(output_tensors_metadata, kDomainTaskNamesTensorName)); + ASSIGN_OR_RETURN(tensor_index_map_->domain_scores_idx, + FindTensorIdxByName(output_tensors_metadata, + kDomainTaskScoresTensorName)); + ASSIGN_OR_RETURN( + tensor_index_map_->intent_names_idx, + FindTensorIdxByName(output_tensors_metadata, kIntentTaskNamesTensorName)); + ASSIGN_OR_RETURN(tensor_index_map_->intent_scores_idx, + FindTensorIdxByName(output_tensors_metadata, + kIntentTaskScoresTensorName)); + ASSIGN_OR_RETURN( + tensor_index_map_->slot_names_idx, + FindTensorIdxByName(output_tensors_metadata, kSlotTaskNamesTensorName)); + ASSIGN_OR_RETURN( + tensor_index_map_->slot_scores_idx, + FindTensorIdxByName(output_tensors_metadata, kSlotTaskScoresTensorName)); + + absl::StatusOr<std::unique_ptr<AbstractModule>> m; + // UtteranceSeqModule + m = UtteranceSeqModule::Create( + interpreter, tensor_index_map_.get(), options_.get(), + static_cast<tflite::support::text::tokenizer::BertTokenizer*>( + tokenizer_.get())); + RETURN_IF_ERROR(m.status()); + modules_.emplace_back(*std::move(m)); + // DomainModule. + m = DomainModule::Create(interpreter, tensor_index_map_.get(), + options_.get()); + RETURN_IF_ERROR(m.status()); + modules_.emplace_back(*std::move(m)); + // IntentModule. + m = IntentModule::Create(interpreter, tensor_index_map_.get(), + options_.get()); + RETURN_IF_ERROR(m.status()); + modules_.emplace_back(*std::move(m)); + // SlotModule. + m = SlotModule::Create(interpreter, tensor_index_map_.get(), options_.get()); + RETURN_IF_ERROR(m.status()); + modules_.emplace_back(*std::move(m)); + + return absl::OkStatus(); +} + +absl::StatusOr<CluResponse> BertCluAnnotator::Annotate( + const CluRequest& request) { + return Infer(request); +} + +absl::Status BertCluAnnotator::Preprocess( + const std::vector<TfLiteTensor*>& input_tensors, + const CluRequest& request) { + artifacts_.Clear(); + // Preprocess + for (const auto& module : modules_) { + RETURN_IF_ERROR(module->Preprocess(request, &artifacts_)); + } + return absl::OkStatus(); +} + +tflite::support::StatusOr<CluResponse> BertCluAnnotator::Postprocess( + const std::vector<const TfLiteTensor*>& output_tensors, + const CluRequest& request) { + CluResponse response; + for (const auto& module : modules_) { + RETURN_IF_ERROR(module->Postprocess(&artifacts_, &response)); + } + return response; +} + +} // namespace clu +} // namespace text +} // namespace task +} // namespace tflite
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/bert_clu_annotator.h b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/bert_clu_annotator.h new file mode 100644 index 0000000..6cce06fa --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/bert_clu_annotator.h
@@ -0,0 +1,86 @@ +/* Copyright 2022 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==============================================================================*/ + +#ifndef TENSORFLOW_LITE_SUPPORT_CC_TASK_TEXT_CLU_BERT_CLU_ANNOTATOR_H_ +#define TENSORFLOW_LITE_SUPPORT_CC_TASK_TEXT_CLU_BERT_CLU_ANNOTATOR_H_ + +#include <memory> + +#include "tensorflow_lite_support/cc/task/text/clu_annotator.h" +#include "tensorflow_lite_support/cc/task/text/clu_lib/tflite_modules.h" +#include "tensorflow_lite_support/cc/task/text/proto/bert_clu_annotator_options_proto_inc.h" +#include "tensorflow_lite_support/cc/text/tokenizers/bert_tokenizer.h" + +namespace tflite { +namespace task { +namespace text { +namespace clu { + +// BertCluAnnotator task API, performs tokenization for models (BERT) in +// preprocess and returns CLU annotations. +// +// The API expects a Bert based TFLite model with metadata populated. +// The metadata should contain the following information: +// - input_process_units for Wordpiece Tokenizer. +// - 3 input tensors with names "ids", "mask" and "segment_ids". +// - 6 output tensors with names "domain_task/names", "domain_task/scores", +// "intent_task/names", "intent_task/scores", "slot_task/names", and +// "slot_task/scores". +class BertCluAnnotator : public CluAnnotator { + public: + static constexpr int kNumLiteThreads = 4; + + // Factory function to create a `BertCluAnnotator` from + // `BertCluAnnotatorOptions`. + static tflite::support::StatusOr<std::unique_ptr<CluAnnotator>> + CreateFromOptions( + const BertCluAnnotatorOptions& options, + std::unique_ptr<tflite::OpResolver> resolver = + std::make_unique<tflite_shims::ops::builtin::BuiltinOpResolver>()); + + explicit BertCluAnnotator(std::unique_ptr<core::TfLiteEngine> engine) + : CluAnnotator(std::move(engine)) {} + + absl::StatusOr<CluResponse> Annotate(const CluRequest& request) override; + + private: + absl::Status Init(std::unique_ptr<BertCluAnnotatorOptions> options); + + absl::Status Preprocess(const std::vector<TfLiteTensor*>& input_tensors, + const CluRequest& request) override; + + tflite::support::StatusOr<CluResponse> Postprocess( + const std::vector<const TfLiteTensor*>& output_tensors, + const CluRequest& request) override; + + std::unique_ptr<tflite::support::text::tokenizer::Tokenizer> tokenizer_; + + // A list of modules in topological ordering. + std::vector<std::unique_ptr<const AbstractModule>> modules_; + + // The artifacts for the current CLU request. + Artifacts artifacts_; + + std::unique_ptr<BertCluAnnotatorOptions> options_; + + std::unique_ptr<TensorIndexMap> tensor_index_map_; +}; + +} // namespace clu +} // namespace text +} // namespace task +} // namespace tflite + +#endif // TENSORFLOW_LITE_SUPPORT_CC_TASK_TEXT_CLU_BERT_CLU_ANNOTATOR_H_
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/bert_question_answerer.cc b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/bert_question_answerer.cc index 591b70e..b886e3b 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/bert_question_answerer.cc +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/bert_question_answerer.cc
@@ -15,8 +15,8 @@ #include "tensorflow_lite_support/cc/task/text/bert_question_answerer.h" -#include "absl/status/status.h" // from @com_google_absl -#include "absl/strings/str_join.h" // from @com_google_absl +#include "absl/status/status.h" // from @com_google_absl +#include "absl/strings/str_join.h" // from @com_google_absl #include "absl/strings/str_split.h" // from @com_google_absl #include "tensorflow/lite/core/shims/cc/kernels/register.h" #include "tensorflow_lite_support/cc/port/status_macros.h"
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_annotator.h b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_annotator.h new file mode 100644 index 0000000..e99dbb60 --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_annotator.h
@@ -0,0 +1,42 @@ +/* Copyright 2022 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==============================================================================*/ + +#ifndef TENSORFLOW_LITE_SUPPORT_CC_TASK_TEXT_CLU_CLU_ANNOTATOR_H_ +#define TENSORFLOW_LITE_SUPPORT_CC_TASK_TEXT_CLU_CLU_ANNOTATOR_H_ + +#include "tensorflow_lite_support/cc/task/core/base_task_api.h" +#include "tensorflow_lite_support/cc/task/core/tflite_engine.h" +#include "tensorflow_lite_support/cc/task/text/proto/clu_proto_inc.h" + +namespace tflite { +namespace task { +namespace text { +namespace clu { + +// Interface for a CLU-Annotator API. +class CluAnnotator : public core::BaseTaskApi<CluResponse, const CluRequest&> { + public: + explicit CluAnnotator(std::unique_ptr<core::TfLiteEngine> engine) + : BaseTaskApi(std::move(engine)) {} + + virtual absl::StatusOr<CluResponse> Annotate(const CluRequest& request) = 0; +}; + +} // namespace clu +} // namespace text +} // namespace task +} // namespace tflite + +#endif // TENSORFLOW_LITE_SUPPORT_CC_TASK_TEXT_CLU_CLU_ANNOTATOR_H_
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/BUILD b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/BUILD new file mode 100644 index 0000000..13e63db --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/BUILD
@@ -0,0 +1,103 @@ +package( + default_visibility = ["//visibility:public"], + licenses = ["notice"], # Apache 2.0 +) + +cc_library( + name = "tflite_modules", + srcs = ["tflite_modules.cc"], + hdrs = ["tflite_modules.h"], + deps = [ + ":bert_utils", + ":constants", + ":intent_repr", + ":slot_tagging_output", + "//tensorflow_lite_support/cc/port:status_macros", + "//tensorflow_lite_support/cc/task/core/proto:class_cc_proto", + "//tensorflow_lite_support/cc/task/text/proto:bert_clu_annotator_options_proto_inc", + "//tensorflow_lite_support/cc/task/text/proto:clu_proto_inc", + "//tensorflow_lite_support/cc/text/tokenizers:bert_tokenizer", + "@com_google_absl//absl/status", + "@com_google_absl//absl/status:statusor", + "@com_google_absl//absl/strings", + "@org_tensorflow//tensorflow/lite:framework", + "@org_tensorflow//tensorflow/lite:string_util", + "@org_tensorflow//tensorflow/lite/kernels:kernel_util", + ], +) + +cc_library( + name = "tflite_test_utils", + testonly = True, + srcs = ["tflite_test_utils.cc"], + hdrs = ["tflite_test_utils.h"], + deps = [ + "@org_tensorflow//tensorflow/lite:string_util", + "@org_tensorflow//tensorflow/lite:type_to_tflitetype", + "@org_tensorflow//tensorflow/lite/c:common", + ], +) + +cc_library( + name = "bert_utils", + srcs = ["bert_utils.cc"], + hdrs = ["bert_utils.h"], + deps = [ + ":constants", + "//tensorflow_lite_support/cc/port:status_macros", + "//tensorflow_lite_support/cc/text/tokenizers:bert_tokenizer", + "@com_google_absl//absl/status", + "@com_google_absl//absl/strings", + ], +) + +cc_library( + name = "constants", + srcs = ["constants.cc"], + hdrs = ["constants.h"], +) + +cc_library( + name = "intent_repr", + srcs = ["intent_repr.cc"], + hdrs = ["intent_repr.h"], + deps = [ + ":constants", + "@com_google_absl//absl/status", + "@com_google_absl//absl/status:statusor", + "@com_google_absl//absl/strings", + ], +) + +cc_library( + name = "slot_repr", + srcs = [ + "slot_repr.cc", + ], + hdrs = [ + "slot_repr.h", + ], + deps = [ + ":constants", + "//tensorflow_lite_support/cc/port:status_macros", + "@com_google_absl//absl/status", + "@com_google_absl//absl/status:statusor", + "@com_google_absl//absl/strings", + "@com_google_absl//absl/types:span", + ], +) + +cc_library( + name = "slot_tagging_output", + srcs = ["slot_tagging_output.cc"], + hdrs = ["slot_tagging_output.h"], + deps = [ + ":slot_repr", + "//tensorflow_lite_support/cc/port:status_macros", + "//tensorflow_lite_support/cc/task/text/proto:clu_proto_inc", + "@com_google_absl//absl/status", + "@com_google_absl//absl/status:statusor", + "@com_google_absl//absl/strings", + "@com_google_absl//absl/types:span", + ], +)
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/bert_utils.cc b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/bert_utils.cc new file mode 100644 index 0000000..dc88aad --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/bert_utils.cc
@@ -0,0 +1,220 @@ +/* Copyright 2022 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==============================================================================*/ + +#include "tensorflow_lite_support/cc/task/text/clu_lib/bert_utils.h" + +#include <string> + +#include "absl/status/status.h" // from @com_google_absl +#include "absl/strings/ascii.h" // from @com_google_absl +#include "absl/strings/str_cat.h" // from @com_google_absl +#include "tensorflow_lite_support/cc/port/status_macros.h" +#include "tensorflow_lite_support/cc/task/text/clu_lib/constants.h" + +namespace tflite::task::text::clu { + +namespace { +// Segment id is an alias of `token_type_id` in BERT encoder. `0` corresponds to +// the first sentence in BERT input (i.e., `token_type_id = 0`). +constexpr int kSegmentIdForCurrentUtterance = 0; +// Segment id is an alias of `token_type_id` in BERT encoder. `1` corresponds to +// the first sentence in BERT input (i.e., `token_type_id = 1`). +constexpr int kSegmentIdForPreviousUtterances = 1; + +// `1` indicates that the subword token is the first token of a word. +constexpr int kIsFirstTokenInAWord = 1; +// `0` indicates that the subword token is *not* the first token of a word. +constexpr int kNotFirstTokenInAWord = 0; + +// The turn id of the current utterance. Because the input turns are in the +// reverse choronological order, the turn id of the current utterance is 0. +constexpr int kTurnIdForCurrentUtterance = 0; +} // namespace + +absl::Status BertPreprocessing( + const tflite::support::text::tokenizer::BertTokenizer* tokenizer, + const std::vector<absl::string_view>& utterances_in_reverse_order, + int max_seq_length, + int max_history_turns, + std::vector<int>* out_token_ids, + std::vector<std::pair<int, int>>* out_token_alignments, + std::vector<int>* out_token_first_subword_indicators, + std::vector<int>* out_segment_id_list, + std::vector<int>* out_turn_id_list) { + int cls_id; + if (!tokenizer->LookupId(kClsToken, &cls_id)) { + return absl::InternalError( + absl::StrCat("Cannot locate id for ", kClsToken)); + } + int sep_id; + if (!tokenizer->LookupId(kSepToken, &sep_id)) { + return absl::InternalError( + absl::StrCat("Cannot locate id for ", kSepToken)); + } + // Add the [CLS] sentinel token. + out_token_ids->emplace_back(cls_id); + out_token_alignments->emplace_back( + -1, -1); // No input tokens are aligned to [CLS]. + out_token_first_subword_indicators->push_back(kNotFirstTokenInAWord); + out_segment_id_list->push_back(kSegmentIdForCurrentUtterance); + out_turn_id_list->push_back(kTurnIdForCurrentUtterance); + // For each turn, preprocess and truncate. + const int max_turn_id = + std::min(static_cast<int>(utterances_in_reverse_order.size()), + max_history_turns + 1); + for (int turn_id = 0; turn_id < max_turn_id; ++turn_id) { + // Tokenize each turn. + const auto& utterance = utterances_in_reverse_order[turn_id]; + std::string utterance_text = std::string(utterance); + if (kUseLowerCase) { + absl::AsciiStrToLower(&utterance_text); + } + support::text::tokenizer::WordpieceTokenizerResult tokenize_result = + tokenizer->TokenizeWordpiece(utterance_text); + if (tokenize_result.subwords.size() != + tokenize_result.wp_begin_offset.size()) { + // Should never happen. + return absl::InternalError( + absl::StrCat("In BertTokenize result, subwords and begin_offset " + "should have the same size, found ", + tokenize_result.subwords.size(), " v.s. ", + tokenize_result.wp_begin_offset.size())); + } + if (tokenize_result.wp_begin_offset.size() != + tokenize_result.wp_end_offset.size()) { + // Should never happen. + return absl::InternalError( + absl::StrCat("In BertTokenize result, begin_offset and end_offset" + "should have the same size, found ", + tokenize_result.wp_begin_offset.size(), " v.s. ", + tokenize_result.wp_end_offset.size())); + } + std::vector<int> turn_token_ids; + turn_token_ids.reserve(tokenize_result.subwords.size()); + for (const auto& subword : tokenize_result.subwords) { + int subword_id; + if (!tokenizer->LookupId(subword, &subword_id)) { + // Should never happen. + return absl::InternalError( + absl::StrCat("Cannot locate id for ", subword)); + } + turn_token_ids.push_back(subword_id); + } + std::vector<std::pair<int, int>> turn_token_alignments; + turn_token_alignments.reserve(tokenize_result.wp_begin_offset.size()); + for (int i = 0; i < tokenize_result.wp_begin_offset.size(); ++i) { + turn_token_alignments.emplace_back(tokenize_result.wp_begin_offset[i], + tokenize_result.wp_end_offset[i]); + } + std::vector<int> first_subword_indicators(tokenize_result.subwords.size(), + kNotFirstTokenInAWord); + int first_subword_pos = 0; + for (int i = 0; i < tokenize_result.row_lengths.size(); ++i) { + if (first_subword_pos < first_subword_indicators.size()) { + first_subword_indicators[first_subword_pos] = kIsFirstTokenInAWord; + } + first_subword_pos += tokenize_result.row_lengths[i]; + } + + // Truncates if necessary. + const int max_turn_len_before_sentinels = + max_seq_length - 1 - + out_token_ids->size(); // Reserve one position for the [SEP] sentinel. + if (max_turn_len_before_sentinels <= 0) { + // The entire turn needs to be truncated. And max_seq_length has been + // reached. + break; + } + if (turn_token_ids.size() > max_turn_len_before_sentinels) { + // Truncate the three sequences based on whole word units. We want to make + // sure that if a subword token is truncated, all the subword tokens of + // that whole word is truncated. + int truncating_position = max_turn_len_before_sentinels; + while (truncating_position >= 0 && + first_subword_indicators[truncating_position] == + kNotFirstTokenInAWord) { + --truncating_position; + } + if (truncating_position <= 0) { + // The entire turn needs to be truncated; it does not make sense to + // append [SEP] in this case. And max_seq_length has been reached. + break; + } + // 'truncating_position' now points to the position of the first natural + // word to be truncated. + turn_token_ids.resize(truncating_position); + turn_token_alignments.resize(truncating_position); + first_subword_indicators.resize(truncating_position); + } + + // Append the current turn to the concatenated output. + out_token_ids->insert(out_token_ids->end(), turn_token_ids.begin(), + turn_token_ids.end()); + out_token_alignments->insert(out_token_alignments->end(), + turn_token_alignments.begin(), + turn_token_alignments.end()); + out_token_first_subword_indicators->insert( + out_token_first_subword_indicators->end(), + first_subword_indicators.begin(), first_subword_indicators.end()); + const int segment_id = (turn_id == kTurnIdForCurrentUtterance + ? kSegmentIdForCurrentUtterance + : kSegmentIdForPreviousUtterances); + out_segment_id_list->resize( + out_segment_id_list->size() + turn_token_ids.size(), segment_id); + out_turn_id_list->resize(out_turn_id_list->size() + turn_token_ids.size(), + turn_id); + + // Add the [SEP] sentinel token. + const int last_token_end_pos = + turn_token_alignments.empty() ? 0 : turn_token_alignments.back().second; + out_token_ids->push_back(sep_id); + out_token_alignments->emplace_back(last_token_end_pos, last_token_end_pos); + out_token_first_subword_indicators->push_back(kNotFirstTokenInAWord); + out_segment_id_list->push_back(segment_id); + out_turn_id_list->push_back(turn_id); + + // Break if reaching max_seq_length. + if (out_token_ids->size() >= max_seq_length) + break; + } + if (out_token_ids->size() != out_token_alignments->size()) { + return absl::InternalError(absl::StrCat( + "The size of out_token_ids and out_token_alignments are not equal in " + "BERT preprocessing.", + out_token_ids->size(), " v.s. ", out_token_alignments->size())); + } + if (out_token_ids->size() != out_token_first_subword_indicators->size()) { + return absl::InternalError(absl::StrCat( + "The size of out_token_ids and out_token_first_subword_indicators are " + "not equal in BERT preprocessing.", + out_token_ids->size(), " v.s. ", + out_token_first_subword_indicators->size())); + } + if (out_token_ids->size() != out_segment_id_list->size()) { + return absl::InternalError(absl::StrCat( + "The size of out_token_ids and out_segment_id_list are not equal in " + "BERT preprocessing.", + out_token_ids->size(), " v.s. ", out_segment_id_list->size())); + } + if (out_token_ids->size() != out_turn_id_list->size()) { + return absl::InternalError(absl::StrCat( + "The size of out_token_ids and out_turn_id_list are not equal in " + "BERT preprocessing.", + out_token_ids->size(), " v.s. ", out_turn_id_list->size())); + } + + return absl::OkStatus(); +} +} // namespace tflite::task::text::clu
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/bert_utils.h b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/bert_utils.h new file mode 100644 index 0000000..c3b3f6c --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/bert_utils.h
@@ -0,0 +1,93 @@ +/* Copyright 2022 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==============================================================================*/ + +#ifndef TENSORFLOW_LITE_SUPPORT_CC_TASK_TEXT_CLU_LIB_BERT_UTILS_H_ +#define TENSORFLOW_LITE_SUPPORT_CC_TASK_TEXT_CLU_LIB_BERT_UTILS_H_ + +#include "absl/status/status.h" // from @com_google_absl +#include "tensorflow_lite_support/cc/text/tokenizers/bert_tokenizer.h" + +namespace tflite::task::text::clu { +// Processes input for BERT modeling. +// +// Given the current turn and the conversation history as list of utterances +// in the reverse chronological order, starting from the current turn, +// it does the following: +// * tokenizes the utterance of each turn, +// * concatenates all turns to form the input sequence for BERT, +// * truncates (if necessary) the input, and +// * adds CLS/SEP sentinels. +// +// If truncation is needed, it truncates the utterance based on natural word +// unit. That is, a natural word is either kept or truncated entirely. +// +// Inputs: +// - tokenizer: the tokenizer. TODO(xysong): Upgrade SentencePiece tokenizer to +// return subword_indicator in order to be used here. +// - utterances_in_reverse_order: the pairs of utterance in the dialogue in the +// reverse chronological order, starting from the +// current turn. +// - max_seq_length: the max sequence length of BERT model. +// - max_history_turns: the max number of history turns that are encoded, in +// addition to the current turn. So if 'max_history_turns=2', then there are 3 +// turns encoded in total. +// +// The result is stored in 'out_token_id_and_indicator_list', +// 'out_segment_id_list', 'out_turn_id_list', consisting of five vectors of the +// same length: +// - token_ids: [CLS] token ids of the current turn [SEP] token ids of the +// previous turn [SEP] token ids of the turn before previous [SEP] ... +// - token_alignments: the span of the corresponding token in their original +// utterance of the turn that it belongs to. +// - first_subword_indicators: 0 or 1s, the first subword indicator of the +// corresponding token. 1 means the corresponding token is the first subword +// of a natural word. 0 means the corresponding token is not the first subword +// of a natural word. Note that for [CLS], [SEP], the first subword indicator +// is always 0. +// - segment_ids: 0 or 1s. 0 means the corresponding token belongs to the first +// sentence segment for BERT. 1 means that the corresponding token belongs to +// the second sentence segment for BERT. This vector feeds to BERT as the +// segment_ids (a.k.a. type_ids). +// - turn_ids: the turn index of the corresponding token, like 0 0 0 1 1 1 2 +// 2 2. This can be used to determine which turn a token belongs to. [CLS] +// belongs to turn 0. [SEP] belongs to the turn that it follows. +// +// An important case is that when truncation is necessary (i.e., if the combined +// length of all turns plus satinels exceeds 'max_seq_len'), the earliest turns +// get truncated first, then later turns, then finally the current turn. This is +// different from normal BERT practice where the longer sequence is always get +// truncated. The reason is that the more recent turns are often more important +// in dialogue. +// +// In addition, the utterances are truncated first before satinels (CLS/SEP) are +// added. There is always an [SEP] after each turn. +// +// This function does *not* do padding. The result contains the real tokens of +// the input. Padding is done later in TF graph and TFLite preprocessing. After +// modeling, we will do post-processing to extract slots from those real tokens. +absl::Status BertPreprocessing( + const tflite::support::text::tokenizer::BertTokenizer* tokenizer, + const std::vector<absl::string_view>& utterances_in_reverse_order, + int max_seq_length, + int max_history_turns, + std::vector<int>* out_token_ids, + std::vector<std::pair<int, int>>* out_token_alignments, + std::vector<int>* out_token_first_subword_indicators, + std::vector<int>* out_segment_id_list, + std::vector<int>* out_turn_id_list); + +} // namespace tflite::task::text::clu + +#endif // TENSORFLOW_LITE_SUPPORT_CC_TASK_TEXT_CLU_LIB_BERT_UTILS_H_
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/constants.cc b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/constants.cc new file mode 100644 index 0000000..3e2c1ad7 --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/constants.cc
@@ -0,0 +1,45 @@ +/* Copyright 2022 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==============================================================================*/ + +#include "tensorflow_lite_support/cc/task/text/clu_lib/constants.h" + +namespace tflite::task::text::clu { + +// Static member defs +constexpr char CLUFeature::kDialogId[]; +constexpr char CLUFeature::kTurnIndex[]; +constexpr char CLUFeature::kUtteranceSeq[]; +constexpr char CLUFeature::kUtteranceTokenIdSeq[]; +constexpr char CLUFeature::kUtteranceCharSeq[]; +constexpr char CLUFeature::kUtteranceEngineeredSeq[]; +constexpr char CLUFeature::kSeqLength[]; +constexpr char CLUFeature::kWord[]; +constexpr char CLUFeature::kRawUtterance[]; +constexpr char CLUFeature::kTokenAlignmentSeq[]; +constexpr char CLUFeature::kSlotTagSeq[]; +constexpr char CLUFeature::kIntents[]; +constexpr char CLUFeature::kDomain[]; +constexpr char CLUFeature::kAnnotatedSpanSeq[]; +constexpr char CLUFeature::kAnnotatedSpanScoreSeq[]; +constexpr char CLUFeature::kNumHistoryTurns[]; +constexpr char CLUFeature::kHistorySeq[]; +constexpr char CLUFeature::kHistorySeqLength[]; +constexpr char CLUFeature::kSurfaceType[]; +constexpr char CLUFeature::kPosTagSeq[]; +constexpr char CLUFeature::kHasDomain[]; +constexpr char CLUFeature::kHasIntents[]; +constexpr char CLUFeature::kHasSlots[]; + +} // namespace tflite::task::text::clu
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/constants.h b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/constants.h new file mode 100644 index 0000000..cb7997b3 --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/constants.h
@@ -0,0 +1,86 @@ +/* Copyright 2022 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==============================================================================*/ + +#ifndef TENSORFLOW_LITE_SUPPORT_CC_TASK_TEXT_CLU_LIB_CONSTANTS_H_ +#define TENSORFLOW_LITE_SUPPORT_CC_TASK_TEXT_CLU_LIB_CONSTANTS_H_ + +namespace tflite::task::text::clu { + +// Whether to do lower case before Bert Tokenization. +inline constexpr bool kUseLowerCase = true; + +// Tokens used in BERT model. +inline constexpr char kClsToken[] = "[CLS]"; +inline constexpr char kSepToken[] = "[SEP]"; +inline constexpr char kUnkToken[] = "[UNK]"; +// The padding symbol for BERT WordpieceTokenizer. +inline constexpr char kWordpiecePadToken[] = "[PAD]"; +// IOB tags +inline constexpr char kSlotOTag[] = "O"; +inline constexpr char kSlotBTagPrefix[] = "B-"; +inline constexpr char kSlotITagPrefix[] = "I-"; + +inline constexpr char kNamespaceDelim[] = "~~"; + +// CLU features +struct CLUFeature { + static constexpr char kDialogId[] = "dialog_id"; + static constexpr char kTurnIndex[] = "turn_index"; + static constexpr char kUtteranceSeq[] = "utterance_seq"; + static constexpr char kUtteranceTokenIdSeq[] = "utterance_token_id_seq"; + static constexpr char kUtteranceFirstSubwordSeq[] = + "utterance_first_subword_seq"; + static constexpr char kUtteranceSegmentIdSeq[] = "utterance_segment_id_seq"; + static constexpr char kUtteranceTurnIdSeq[] = "utterance_turn_id_seq"; + static constexpr char kUtteranceCharSeq[] = "utterance_char_seq"; + static constexpr char kUtteranceEngineeredSeq[] = "utterance_engineered_seq"; + static constexpr char kSeqLength[] = "seq_length"; + static constexpr char kWord[] = "word"; + static constexpr char kRawUtterance[] = "raw_utterance"; + static constexpr char kTokenAlignmentSeq[] = "token_alignment_seq"; + static constexpr char kSlotTagSeq[] = "slot_tag_seq"; + static constexpr char kIntents[] = "intents"; + static constexpr char kDomain[] = "domain"; + static constexpr char kPosTagSeq[] = "pos_tag_seq"; + // Indicator features denoting whether the domain/intent/slot annotations are + // present in the example. + static constexpr char kHasDomain[] = "has_domain"; + static constexpr char kHasIntents[] = "has_intents"; + static constexpr char kHasSlots[] = "has_slots"; + // Annotated Span features + static constexpr char kAnnotatedSpanSeq[] = "annotated_span_seq"; + static constexpr char kAnnotatedSpanScoreSeq[] = "annotated_span_score_seq"; + static constexpr char kAnnotatedSpanTimeDurationSeq[] = + "annotated_span_time_duration_seq"; + static constexpr char kAnnotatedSpanTimeOfDaySeq[] = + "annotated_span_time_of_day_seq"; + static constexpr char kAnnotatedSpanDayOfWeekSeq[] = + "annotated_span_day_of_week_seq"; + static constexpr char kAnnotatedSpanAppTypeSeq[] = + "annotated_span_app_type_seq"; + static constexpr char kAnnotatedSpanAppLocaleSeq[] = + "annotated_span_app_locale_seq"; + static constexpr char kAnnotatedSpanAppCategorySeq[] = + "annotated_span_app_category_seq"; + // End of Annotated Span features + static constexpr char kNumHistoryTurns[] = "num_history_turns"; + static constexpr char kHistorySeq[] = "history_seq_"; + static constexpr char kHistorySeqLength[] = "history_seq_length_"; + static constexpr char kSurfaceType[] = "surface_type"; +}; + +} // namespace tflite::task::text::clu + +#endif // TENSORFLOW_LITE_SUPPORT_CC_TASK_TEXT_CLU_LIB_CONSTANTS_H_
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/intent_repr.cc b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/intent_repr.cc new file mode 100644 index 0000000..03756623 --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/intent_repr.cc
@@ -0,0 +1,60 @@ +/* Copyright 2022 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==============================================================================*/ + +#include "tensorflow_lite_support/cc/task/text/clu_lib/intent_repr.h" + +#include <vector> + +#include "absl/status/status.h" // from @com_google_absl +#include "absl/strings/str_cat.h" // from @com_google_absl +#include "absl/strings/str_split.h" // from @com_google_absl +#include "absl/strings/string_view.h" // from @com_google_absl +#include "tensorflow_lite_support/cc/task/text/clu_lib/constants.h" + +namespace tflite::task::text::clu { + +// IntentRepr + +std::string IntentRepr::FullName() const { + if (domain_.empty()) + return name_; + return absl::StrCat(domain_, kNamespaceDelim, name_); +} + +absl::StatusOr<IntentRepr> IntentRepr::CreateFromFullName( + const absl::string_view full_name) { + IntentRepr ret; + std::vector<std::string> splits = absl::StrSplit(full_name, kNamespaceDelim); + // Ensure we only end up with at most two parts after splitting. + if (splits.size() > 2) { + return absl::InternalError(absl::StrCat("invalid argument: ", full_name)); + } + if (splits.size() == 2) + ret.domain_ = splits[0]; + ret.name_ = splits[splits.size() - 1]; + return ret; +} + +IntentRepr IntentRepr::Create(absl::string_view name, + absl::string_view domain, + const bool share_across_domains) { + IntentRepr ret; + ret.name_ = std::string(name); + if (!share_across_domains) + ret.domain_ = std::string(domain); + return ret; +} + +} // namespace tflite::task::text::clu
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/intent_repr.h b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/intent_repr.h new file mode 100644 index 0000000..e040b04 --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/intent_repr.h
@@ -0,0 +1,44 @@ +/* Copyright 2022 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==============================================================================*/ + +#ifndef TENSORFLOW_LITE_SUPPORT_CC_TASK_TEXT_CLU_LIB_INTENT_REPR_H_ +#define TENSORFLOW_LITE_SUPPORT_CC_TASK_TEXT_CLU_LIB_INTENT_REPR_H_ + +#include <string> + +#include "absl/status/statusor.h" // from @com_google_absl +#include "absl/strings/string_view.h" // from @com_google_absl + +namespace tflite::task::text::clu { + +// Takes care of adding and parsing Domain prefixes +class IntentRepr { + public: + const std::string& Domain() const { return domain_; } + const std::string& Name() const { return name_; } + std::string FullName() const; + static absl::StatusOr<IntentRepr> CreateFromFullName(const absl::string_view); + static IntentRepr Create(absl::string_view name, + absl::string_view domain, + const bool share_across_domains); + + private: + std::string domain_; + std::string name_; +}; + +} // namespace tflite::task::text::clu + +#endif // TENSORFLOW_LITE_SUPPORT_CC_TASK_TEXT_CLU_LIB_INTENT_REPR_H_
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/slot_repr.cc b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/slot_repr.cc new file mode 100644 index 0000000..dbb0dc2a --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/slot_repr.cc
@@ -0,0 +1,233 @@ +/* Copyright 2022 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==============================================================================*/ + +#include "tensorflow_lite_support/cc/task/text/clu_lib/slot_repr.h" + +#include <algorithm> +#include <iterator> +#include <memory> +#include <vector> + +#include "absl/status/status.h" // from @com_google_absl +#include "absl/status/statusor.h" // from @com_google_absl +#include "absl/strings/match.h" // from @com_google_absl +#include "absl/strings/str_cat.h" // from @com_google_absl +#include "absl/strings/str_split.h" // from @com_google_absl +#include "absl/strings/string_view.h" // from @com_google_absl +#include "absl/strings/strip.h" // from @com_google_absl +#include "absl/strings/substitute.h" // from @com_google_absl +#include "absl/types/span.h" // from @com_google_absl +#include "tensorflow_lite_support/cc/port/status_macros.h" +#include "tensorflow_lite_support/cc/task/text/clu_lib/constants.h" + +namespace tflite::task::text::clu { + +using ::absl::StatusOr; + +// SlotRepr + +std::string SlotRepr::FullName() const { + if (domain_.empty()) + return name_; + return absl::StrCat(domain_, kNamespaceDelim, name_); +} + +StatusOr<std::tuple<absl::string_view, absl::string_view>> +SlotRepr::SplitDomainAndName(const absl::string_view full_name) { + std::vector<absl::string_view> splits = + absl::StrSplit(full_name, kNamespaceDelim); + if (splits.size() > 2) { + return absl::InternalError(absl::StrCat("invalid input: ", full_name)); + } + absl::string_view domain = ""; + absl::string_view name; + if (splits.size() == 2) + domain = splits[0]; + name = splits[splits.size() - 1]; + return std::tuple<absl::string_view, absl::string_view>{domain, name}; +} + +StatusOr<SlotRepr> SlotRepr::CreateFromIob(const absl::string_view repr) { + SlotRepr ret; + if (IsO(repr)) + return ret; + absl::string_view full_name; + if (absl::StartsWith(repr, kSlotBTagPrefix)) { + full_name = absl::StripPrefix(repr, kSlotBTagPrefix); + } else if (absl::StartsWith(repr, kSlotITagPrefix)) { + full_name = absl::StripPrefix(repr, kSlotITagPrefix); + } else { + return absl::InternalError(absl::StrCat("repr not started with ", + kSlotBTagPrefix, " or ", + kSlotITagPrefix, ": ", repr)); + } + ASSIGN_OR_RETURN(const auto domain_name_pair, SplitDomainAndName(full_name)); + ret.domain_ = std::string(std::get<0>(domain_name_pair)); + ret.name_ = std::string(std::get<1>(domain_name_pair)); + return ret; +} + +SlotRepr SlotRepr::Create(absl::string_view name, + absl::string_view domain, + const bool share_across_domains) { + SlotRepr ret; + ret.name_ = std::string(name); + if (!share_across_domains) { + ret.domain_ = std::string(domain); + } + return ret; +} + +bool SlotRepr::IsI(const absl::string_view repr) { + return absl::StartsWith(repr, kSlotITagPrefix); +} + +bool SlotRepr::IsB(const absl::string_view repr) { + return absl::StartsWith(repr, kSlotBTagPrefix); +} + +bool SlotRepr::IsO(const absl::string_view repr) { + return repr == kSlotOTag; +} + +bool SlotRepr::operator==(const SlotRepr& other) const { + return domain_ == other.domain_ && name_ == other.name_; +} + +std::ostream& operator<<(std::ostream& os, const SlotRepr& slot_repr) { + os << slot_repr.FullName(); + return os; +} + +absl::Status ResolveInconsistentIobTagSeq(std::vector<std::string>* tag_names) { + // Force the BOS and EOS elements to be O during prediction. Usually the + // training takes care of it but it doesn't hurt to force them. Disable for + // TFLite as tf.tensor_scatter_update() isn't supported well. + if (!tag_names->empty()) { + (*tag_names)[0] = kSlotOTag; + (*tag_names)[tag_names->size() - 1] = kSlotOTag; + } + absl::string_view prev_tag = kSlotOTag; + for (size_t i = 0; i < tag_names->size(); ++i) { + const auto& tag = tag_names->at(i); + if (SlotRepr::IsI(tag)) { + ASSIGN_OR_RETURN(const SlotRepr repr, SlotRepr::CreateFromIob(tag)); + if (SlotRepr::IsO(prev_tag)) { + // inconsistent case. eg. O I-time + (*tag_names)[i] = repr.BTag(); + } else { + ASSIGN_OR_RETURN(const SlotRepr prev_repr, + SlotRepr::CreateFromIob(prev_tag)); + if (prev_repr.FullName() != repr.FullName()) { + // inconsistent case. eg. B-time I-per I-time I-per + (*tag_names)[i] = repr.BTag(); + } + } + } + prev_tag = tag; + } + return absl::OkStatus(); +} + +absl::StatusOr<std::vector<SlotMentionStruct>> DecodeSlotChunks( + const absl::Span<const absl::string_view> tag_names, + const absl::Span<const float> tag_probs, + const absl::Span<const std::pair<int, int>> token_alignments) { + if (tag_names.size() != tag_probs.size()) { + return absl::InternalError(absl::StrCat( + "Lengths of tag sequence and probability sequence are not equal: " + "tag_seq size: ", + tag_names.size(), " tag_probs size: ", tag_probs.size())); + } + // The index for one past the final token (including BOS and EOS) + const size_t eos_exclusive_idx = + std::min(tag_probs.size(), token_alignments.size()); + // Make a copy since the input is constant while still modifications are + // needed. + std::vector<std::string> tag_names_fixed(tag_names.begin(), tag_names.end()); + RETURN_IF_ERROR(ResolveInconsistentIobTagSeq(&tag_names_fixed)); + + std::vector<SlotMentionStruct> result; + // Compute slot tag spans + // Current state + int cur_slot_start = -1; + int cur_slot_exclusive_end = -1; + float cur_slot_confidence = 1.0; + SlotRepr cur_slot; + for (int token_i = 0; token_i < eos_exclusive_idx; ++token_i) { + const auto& tag_str_i = tag_names_fixed.at(token_i); + // I tag + if (SlotRepr::IsI(tag_str_i)) { + SlotRepr slot_tag_i; + ASSIGN_OR_RETURN(slot_tag_i, SlotRepr::CreateFromIob(tag_str_i)); + if (cur_slot == slot_tag_i) { + cur_slot_exclusive_end = token_i + 1; + // Compute the phrase level confidence by taking min(tag confidences). + cur_slot_confidence = std::min(cur_slot_confidence, tag_probs[token_i]); + continue; + } else { + return ::absl::InvalidArgumentError(absl::StrCat( + "Bad sequence at: '", cur_slot.FullName(), "', '", token_i, "'")); + } + } + // Emit + if (!cur_slot.Name().empty()) { + if (cur_slot_start == -1) { + return absl::InternalError("cur_slot_start should not be -1"); + } + if (cur_slot_exclusive_end == -1) { + return absl::InternalError("cur_slot_exclusive_end should not be -1"); + } + result.emplace_back( + SlotMentionStruct{cur_slot, token_alignments[cur_slot_start].first, + token_alignments[cur_slot_exclusive_end - 1].second, + cur_slot_confidence}); + } + // B tag + if (SlotRepr::IsB(tag_str_i)) { + cur_slot_start = token_i; + cur_slot_exclusive_end = token_i + 1; + cur_slot_confidence = tag_probs[token_i]; + ASSIGN_OR_RETURN(cur_slot, SlotRepr::CreateFromIob(tag_str_i)); + } else { + // O tag + if (!SlotRepr::IsO(tag_str_i)) { + return absl::InternalError( + absl::StrCat("Bad sequence at: ", tag_str_i)); + } + // Clear state + cur_slot_start = -1; + cur_slot_exclusive_end = -1; + cur_slot_confidence = 1.0; + cur_slot = SlotRepr(); + } + } + // Emit + if (!cur_slot.Name().empty()) { + if (cur_slot_start == -1) { + return absl::InternalError("cur_slot_start should not be -1"); + } + if (cur_slot_exclusive_end == -1) { + return absl::InternalError("cur_slot_exclusive_end should not be -1"); + } + result.emplace_back( + SlotMentionStruct{cur_slot, token_alignments[cur_slot_start].first, + token_alignments[cur_slot_exclusive_end - 1].second, + cur_slot_confidence}); + } + return result; +} + +} // namespace tflite::task::text::clu
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/slot_repr.h b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/slot_repr.h new file mode 100644 index 0000000..9a5f68a0 --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/slot_repr.h
@@ -0,0 +1,123 @@ +/* Copyright 2022 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==============================================================================*/ + +#ifndef TENSORFLOW_LITE_SUPPORT_CC_TASK_TEXT_CLU_LIB_SLOT_REPR_H_ +#define TENSORFLOW_LITE_SUPPORT_CC_TASK_TEXT_CLU_LIB_SLOT_REPR_H_ + +#include <string> +#include <utility> +#include <vector> + +#include "absl/status/status.h" // from @com_google_absl +#include "absl/status/statusor.h" // from @com_google_absl +#include "absl/strings/str_cat.h" // from @com_google_absl +#include "absl/strings/string_view.h" // from @com_google_absl +#include "tensorflow_lite_support/cc/task/text/clu_lib/constants.h" + +namespace tflite::task::text::clu { + +// Takes care of adding IOB and Domain prefixes and parsing them later +class SlotRepr { + public: + // I-tag for the slot + std::string ITag() const { return absl::StrCat(kSlotITagPrefix, FullName()); } + + // B-tag for the slot + std::string BTag() const { return absl::StrCat(kSlotBTagPrefix, FullName()); } + + // The domain name + const std::string& Domain() const { return domain_; } + + // The slot name + const std::string& Name() const { return name_; } + + // The domain and slot name + std::string FullName() const; + + bool operator==(const SlotRepr& other) const; + + // I-tag for the given slot name + static std::string ITag(absl::string_view name) { + return absl::StrCat(kSlotITagPrefix, name); + } + + // B-tag for the given slot name + static std::string BTag(absl::string_view name) { + return absl::StrCat(kSlotBTagPrefix, name); + } + + static bool IsI(const absl::string_view repr); + + static bool IsB(const absl::string_view repr); + + static bool IsO(const absl::string_view repr); + + // Factory function given the BIO string representation + static absl::StatusOr<SlotRepr> CreateFromIob(const absl::string_view); + + // Factory + static SlotRepr Create(absl::string_view name, + absl::string_view domain = "", + const bool share_across_domains = true); + + // Splits the full_name into domain and slot name. + static absl::StatusOr<std::tuple<absl::string_view, absl::string_view>> + SplitDomainAndName(const absl::string_view full_name); + + private: + std::string domain_; + std::string name_; +}; + +std::ostream& operator<<(std::ostream& os, const SlotRepr& slot_repr); + +// A non-proto message version of SlotMention, with some additional fields. +// TODO(amiraf, pengwang): Consider using a proto instead. +struct SlotMentionStruct { + SlotRepr repr; + int start; + int exclusive_end; + float confidence; +}; + +// A span over character or tokens. +struct Span { + int start; + int exclusive_end; + + Span(const int start_arg, const int exclusive_end_arg) + : start(start_arg), exclusive_end(exclusive_end_arg) {} + + explicit Span(const std::pair<int, int>& start_end) + : start(start_end.first), exclusive_end(start_end.second) {} + + inline int Middle() const { return (start + exclusive_end) / 2; } +}; + +// Produces chunks/spans for the slots from the IOB tags with confidence. The +// result is ordered by `start` in ascending order. +absl::StatusOr<std::vector<SlotMentionStruct>> DecodeSlotChunks( + const absl::Span<const absl::string_view> tag_names, + const absl::Span<const float> tag_probs, + const absl::Span<const std::pair<int, int>> token_alignments); + +// Resolve inconsistent IOB tags. +// Three cases: (1) O I-y (2) B-x I-y (3) I-x I-y. In either case, change the +// second to 'B-y'. +absl::Status ResolveInconsistentIobTagSeq(std::vector<std::string>* tag_names); + +} // namespace tflite::task::text::clu + +#endif // TENSORFLOW_LITE_SUPPORT_CC_TASK_TEXT_CLU_LIB_SLOT_REPR_H_
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/slot_tagging_output.cc b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/slot_tagging_output.cc new file mode 100644 index 0000000..0d5abb4 --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/slot_tagging_output.cc
@@ -0,0 +1,145 @@ +/* Copyright 2022 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==============================================================================*/ + +#include "tensorflow_lite_support/cc/task/text/clu_lib/slot_tagging_output.h" + +#include <vector> + +#include "absl/status/status.h" // from @com_google_absl +#include "absl/status/statusor.h" // from @com_google_absl +#include "absl/strings/string_view.h" // from @com_google_absl +#include "absl/types/span.h" // from @com_google_absl +#include "tensorflow_lite_support/cc/port/status_macros.h" +#include "tensorflow_lite_support/cc/task/text/clu_lib/slot_repr.h" + +namespace tflite::task::text::clu { +namespace { + +absl::StatusOr<std::vector<SlotMentionStruct>> +DecodeSlotChunksPredictOnFirstSubword( + int cur_turn_start, + int cur_turn_end, + int seq_len, + const absl::Span<const absl::string_view> tags_as_span, + const absl::Span<const float> confidences_as_span, + const absl::Span<const std::pair<int, int>> token_alignments_as_span, + const std::vector<int>& first_subword_indicators) { + // Construct the vectors by select only first subword tokens and extend + // the token alignments to the whole word. + std::vector<absl::string_view> first_subword_tag_names; + first_subword_tag_names.reserve(seq_len); + std::vector<float> first_subword_tag_probs; + first_subword_tag_probs.reserve(seq_len); + std::vector<std::pair<int, int>> whole_word_token_alignments; + whole_word_token_alignments.reserve(seq_len); + for (int idx = cur_turn_start; idx < cur_turn_end; ++idx) { + if (first_subword_indicators[idx] == 1) { + // Encountering a new word. + first_subword_tag_names.emplace_back(tags_as_span[idx]); + first_subword_tag_probs.push_back(confidences_as_span[idx]); + whole_word_token_alignments.emplace_back(token_alignments_as_span[idx]); + } else if (!whole_word_token_alignments.empty()) { + // Update the token alignment of the current word. + whole_word_token_alignments.back().second = + token_alignments_as_span[idx].second; + } + } + // Add BOS and EOS sentinels. + first_subword_tag_names.insert(first_subword_tag_names.begin(), "O"); + first_subword_tag_probs.insert(first_subword_tag_probs.begin(), 1.0); + whole_word_token_alignments.insert(whole_word_token_alignments.begin(), + {-1, -1}); + first_subword_tag_names.emplace_back("O"); + first_subword_tag_probs.push_back(1.0); + const int last_exclusive_end = whole_word_token_alignments.back().second; + whole_word_token_alignments.emplace_back(last_exclusive_end, + last_exclusive_end); + ASSIGN_OR_RETURN( + auto slot_mentions, + DecodeSlotChunks(first_subword_tag_names, first_subword_tag_probs, + whole_word_token_alignments)); + return slot_mentions; +} + +} // namespace + +absl::Status SlotModulePopulateResponse( + const std::vector<absl::string_view>& tags, + const float* confidences, + const std::vector<std::pair<int, int>>& token_alignments, + const std::vector<int>& token_turn_ids, + const std::vector<int>& first_subword_indicators, + float threshold, + const std::vector<absl::string_view>& reverse_utterance_list_to_encode, + CluResponse* response) { + if (token_alignments.size() != token_turn_ids.size()) { + return absl::InternalError(absl::StrCat( + "Lengths of token alignments and token_ids are not equal: " + "tag_alignemtns size: ", + token_alignments.size(), " turn_ids size: ", token_turn_ids.size())); + } + // The effective seq_len is the minimal size of tags and token_alignments. + const size_t seq_len = std::min(tags.size(), token_alignments.size()); + const auto tags_as_span = absl::MakeConstSpan(tags).subspan(0, seq_len); + const auto confidences_as_span = absl::MakeConstSpan(confidences, seq_len); + const auto token_alignments_as_span = + absl::MakeConstSpan(token_alignments).subspan(0, seq_len); + int cur_turn_start = 0; + while (cur_turn_start < seq_len) { + // Determine the start and end of each turn. + const int cur_turn_idx = token_turn_ids[cur_turn_start]; + int cur_turn_end = cur_turn_start + 1; + while (cur_turn_end < seq_len && + token_turn_ids[cur_turn_end] == cur_turn_idx) { + ++cur_turn_end; + } + + // Prepare the data and decode slot chunks. + std::vector<SlotMentionStruct> cur_turn_slot_mentions; + // Decode slot chunks based on first subword tokens in the turn. + ASSIGN_OR_RETURN(cur_turn_slot_mentions, + DecodeSlotChunksPredictOnFirstSubword( + cur_turn_start, cur_turn_end, seq_len, tags_as_span, + confidences_as_span, token_alignments_as_span, + first_subword_indicators)); + + // Populate the response. + for (const auto& chunk : cur_turn_slot_mentions) { + if (chunk.start == -1 || cur_turn_idx != 0) + continue; + if (chunk.confidence < threshold) + continue; + auto slot = response->mutable_noncategorical_slots()->Add(); + slot->set_slot(chunk.repr.Name()); + auto extraction = slot->mutable_extraction(); + extraction->set_value( + std::string(reverse_utterance_list_to_encode[cur_turn_idx].substr( + chunk.start, chunk.exclusive_end - chunk.start))); + extraction->set_score(chunk.confidence); + extraction->set_start(chunk.start); + extraction->set_end(chunk.exclusive_end); + if (chunk.start >= chunk.exclusive_end) { + return absl::InternalError( + absl::StrCat("Empty span: ", slot->DebugString())); + } + } + + // Set start for the next turn. + cur_turn_start = cur_turn_end; + } + return absl::OkStatus(); +} + +} // namespace tflite::task::text::clu
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/slot_tagging_output.h b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/slot_tagging_output.h new file mode 100644 index 0000000..7d2b9a1 --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/slot_tagging_output.h
@@ -0,0 +1,55 @@ +/* Copyright 2022 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==============================================================================*/ + +#ifndef TENSORFLOW_LITE_SUPPORT_CC_TASK_TEXT_CLU_LIB_SLOT_TAGGING_OUTPUT_H_ +#define TENSORFLOW_LITE_SUPPORT_CC_TASK_TEXT_CLU_LIB_SLOT_TAGGING_OUTPUT_H_ + +#include <vector> + +#include "absl/status/status.h" // from @com_google_absl +#include "tensorflow_lite_support/cc/task/text/proto/clu_proto_inc.h" + +namespace tflite::task::text::clu { + +// Given the input IOB tags and corresponding confidences and token alignments +// this will populate the slots in CluResponse. For BERT models with history, +// 'token_alignments' is concatenation of all turns, and the turn id is given by +// 'token_turn_ids'. +// Inputs: +// tags: IOB tags +// confidences: array of confidence scores score for each tag. +// token_alignments: A list of (start, exclusive_end) offsets into the +// original text. +// token_turn_ids: A list of int. The turn id of each token. +// first_subword_indicators: A list of int. Whether the corresponding +// subword token is the first subword of a natural word or not. +// threshold: the threshold for slot extraction. +// reverse_utterance_list_to_encode: the utterance list in the reverse +// chronological order. +// Outputs: +// response +absl::Status SlotModulePopulateResponse( + const std::vector<absl::string_view>& tags, + const float* confidences, + const std::vector<std::pair<int, int>>& token_alignments, + const std::vector<int>& token_turn_ids, + const std::vector<int>& first_subword_indicators, + float threshold, + const std::vector<absl::string_view>& reverse_utterance_list_to_encode, + CluResponse* response); + +} // namespace tflite::task::text::clu + +#endif // TENSORFLOW_LITE_SUPPORT_CC_TASK_TEXT_CLU_LIB_SLOT_TAGGING_OUTPUT_H_
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/tflite_modules.cc b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/tflite_modules.cc new file mode 100644 index 0000000..f893f034 --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/tflite_modules.cc
@@ -0,0 +1,299 @@ +/* Copyright 2022 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==============================================================================*/ + +#include "tensorflow_lite_support/cc/task/text/clu_lib/tflite_modules.h" + +#include <memory> +#include <utility> + +#include "absl/status/status.h" // from @com_google_absl +#include "absl/status/statusor.h" // from @com_google_absl +#include "absl/strings/str_cat.h" // from @com_google_absl +#include "absl/strings/str_join.h" // from @com_google_absl +#include "absl/strings/str_split.h" // from @com_google_absl +#include "absl/strings/string_view.h" // from @com_google_absl +#include "tensorflow/lite/kernels/kernel_util.h" +#include "tensorflow/lite/string_util.h" +#include "tensorflow_lite_support/cc/port/status_macros.h" +#include "tensorflow_lite_support/cc/task/core/proto/class.pb.h" +#include "tensorflow_lite_support/cc/task/text/clu_lib/bert_utils.h" +#include "tensorflow_lite_support/cc/task/text/clu_lib/constants.h" +#include "tensorflow_lite_support/cc/task/text/clu_lib/intent_repr.h" +#include "tensorflow_lite_support/cc/task/text/clu_lib/slot_tagging_output.h" +#include "tensorflow_lite_support/cc/task/text/proto/bert_clu_annotator_options_proto_inc.h" + +namespace tflite::task::text::clu { +// This handles WordPiece tokenizer for BERT-DeepCLU. It populates the input +// tensors by concatenating the current utterance with history turns. It also +// sets utterance_turn_id_seq for post-processing. +absl::Status PopulateInputTextTensorForBERT( + const CluRequest& request, + int token_id_tensor_idx, + int token_mask_tensor_idx, + int token_type_id_tensor_idx, + const tflite::support::text::tokenizer::BertTokenizer* tokenizer, + size_t max_seq_len, + int max_history_turns, + tflite::Interpreter* interpreter, + Artifacts* artifacts) { + size_t seq_len; + int64_t* tokens_tensor = + interpreter->typed_input_tensor<int64_t>(token_id_tensor_idx); + if (tokens_tensor == nullptr) { + return absl::InternalError("tokens_tensor is nullptr"); + } + const int turns_to_encode = + std::min(max_history_turns + 1, request.utterances_size()); + // Prepare the utterance list of the current turn and the history. + std::vector<absl::string_view> utterance_list; + artifacts->reverse_utterance_list_to_encode.reserve(turns_to_encode); + for (int reverse_turn_id = 0; reverse_turn_id < turns_to_encode; + ++reverse_turn_id) { + artifacts->reverse_utterance_list_to_encode.emplace_back( + request.utterances(request.utterances_size() - 1 - reverse_turn_id)); + } + // Call BERT preprocessing. + std::vector<int> token_ids; + std::vector<std::pair<int, int>> alignments; + std::vector<int> first_subword_indicators; + std::vector<int> segment_id_list; + RETURN_IF_ERROR(BertPreprocessing( + tokenizer, artifacts->reverse_utterance_list_to_encode, max_seq_len, + max_history_turns, &token_ids, &alignments, &first_subword_indicators, + &segment_id_list, &(artifacts->token_turn_ids))); + // Populate tokens. + for (int i = 0; i < token_ids.size(); ++i) { + tokens_tensor[i] = token_ids[i]; + } + seq_len = token_ids.size(); + // Pad the remaining. + int pad_int; + if (!tokenizer->LookupId(kWordpiecePadToken, &pad_int)) { + return absl::InternalError( + absl::StrCat("Cannot locate id for ", kWordpiecePadToken)); + } + for (int i = seq_len; i < max_seq_len; ++i) { + tokens_tensor[i] = pad_int; + } + // Token alignments. + artifacts->token_alignments = std::move(alignments); + // Token first subword indicators. + artifacts->first_subword_indicators = std::move(first_subword_indicators); + // Populate segment_id. + int64_t* segment_ids_tensor = + interpreter->typed_input_tensor<int64_t>(token_type_id_tensor_idx); + if (segment_ids_tensor == nullptr) { + return absl::InternalError("segment_ids_tensor is nullptr"); + } + for (int i = 0; i < segment_id_list.size(); ++i) { + segment_ids_tensor[i] = segment_id_list[i]; + } + // Pad the remaining. + for (int i = seq_len; i < max_seq_len; ++i) { + segment_ids_tensor[i] = 0; // Always. + } + + // Token alignment does not need to be padded as it's not used in the TF + // graph. It's instead used in populating the response + + // Populate the input mask. + int32_t* masks_tensor = + interpreter->typed_input_tensor<int32_t>(token_mask_tensor_idx); + if (masks_tensor == nullptr) { + return absl::InternalError("masks_tensor is nullptr"); + } + for (int i = 0; i < max_seq_len; ++i) { + masks_tensor[i] = i < seq_len ? 1 : 0; + } + return absl::OkStatus(); +} + +absl::StatusOr<int> GetInputSeqDimSize(const size_t input_idx, + const tflite::Interpreter* interpreter) { + if (input_idx >= interpreter->inputs().size()) { + return absl::InternalError(absl::StrCat( + "input_idx should be less than interpreter input numbers. ", input_idx, + " v.s. ", interpreter->inputs().size())); + } + const auto tensor = interpreter->input_tensor(input_idx); + if (tflite::NumDimensions(tensor) < 2) { + return absl::InternalError(absl::StrCat( + "the dimension of the input tensor should be less than 2; found ", + tflite::NumDimensions(tensor))); + } + return tflite::SizeOfDimension(tensor, 1); +} + +absl::Status AbstractModule::Init(tflite::Interpreter* interpreter, + const BertCluAnnotatorOptions* options) { + interpreter_ = interpreter; + return absl::OkStatus(); +} + +absl::StatusOr<std::unique_ptr<AbstractModule>> UtteranceSeqModule::Create( + tflite::Interpreter* interpreter, + const TensorIndexMap* tensor_index_map, + const BertCluAnnotatorOptions* options, + const tflite::support::text::tokenizer::BertTokenizer* tokenizer) { + auto out = std::make_unique<UtteranceSeqModule>(); + out->tensor_index_map_ = tensor_index_map; + RETURN_IF_ERROR(out->Init(interpreter, options)); + out->tokenizer_ = tokenizer; + ASSIGN_OR_RETURN( + out->max_seq_len_, + GetInputSeqDimSize(tensor_index_map->token_id_idx, interpreter)); + out->max_history_turns_ = options->max_history_turns(); + return out; +} + +absl::Status UtteranceSeqModule::Preprocess(const CluRequest& request, + Artifacts* artifacts) const { + return PopulateInputTextTensorForBERT( + request, tensor_index_map_->token_id_idx, + tensor_index_map_->token_mask_idx, tensor_index_map_->token_type_id_idx, + tokenizer_, max_seq_len_, max_history_turns_, interpreter_, artifacts); +} + +/////////////////////////////// Output tasks + +absl::StatusOr<AbstractModule::NamesAndConfidences> +AbstractModule::NamesAndConfidencesFromOutput(int names_tensor_idx, + int scores_tensor_idx) const { + const TfLiteTensor* names_data = + interpreter_->output_tensor(names_tensor_idx); + const size_t size = tflite::GetStringCount(names_data); + const float* confidence_data = + interpreter_->typed_output_tensor<float>(scores_tensor_idx); + if (size > tflite::SizeOfDimension( + interpreter_->output_tensor(scores_tensor_idx), 1)) { + return absl::InternalError(""); + } + NamesAndConfidences ret; + auto& [names, confidences] = ret; + confidences = confidence_data; + names.reserve(size); + for (int i = 0; i < size; ++i) { + const auto ref = tflite::GetString(names_data, i); + names.emplace_back(absl::string_view(ref.str, ref.len)); + } + return ret; +} + +absl::StatusOr<std::unique_ptr<AbstractModule>> DomainModule::Create( + tflite::Interpreter* interpreter, + const TensorIndexMap* tensor_index_map, + const BertCluAnnotatorOptions* options) { + auto out = std::make_unique<DomainModule>(); + out->tensor_index_map_ = tensor_index_map; + out->domain_threshold_ = options->domain_threshold(); + RETURN_IF_ERROR(out->Init(interpreter, options)); + return out; +} + +absl::Status DomainModule::Postprocess(Artifacts* artifacts, + CluResponse* response) const { + ASSIGN_OR_RETURN( + const auto t_output, + NamesAndConfidencesFromOutput(tensor_index_map_->domain_names_idx, + tensor_index_map_->domain_scores_idx)); + const auto& [names, confidences] = t_output; + for (int i = 0; i < names.size(); ++i) { + if (confidences[i] < domain_threshold_) + continue; + auto domain = response->add_domains(); + // Conversion to string is needed due to portable_proto generated code + const std::string names_i(names[i]); + domain->set_display_name(names_i); + domain->set_score(confidences[i]); + } + return absl::OkStatus(); +} + +absl::StatusOr<std::unique_ptr<AbstractModule>> IntentModule::Create( + tflite::Interpreter* interpreter, + const TensorIndexMap* tensor_index_map, + const BertCluAnnotatorOptions* options) { + auto out = std::make_unique<IntentModule>(); + out->tensor_index_map_ = tensor_index_map; + out->intent_threshold_ = options->intent_threshold(); + out->categorical_slot_threshold_ = options->categorical_slot_threshold(); + RETURN_IF_ERROR(out->Init(interpreter, options)); + return out; +} + +absl::Status IntentModule::Postprocess(Artifacts* artifacts, + CluResponse* response) const { + ASSIGN_OR_RETURN( + const auto t_output, + NamesAndConfidencesFromOutput(tensor_index_map_->intent_names_idx, + tensor_index_map_->intent_scores_idx)); + const auto& [names, confidences] = t_output; + + for (int i = 0; i < names.size(); ++i) { + ASSIGN_OR_RETURN(const auto name, IntentRepr::CreateFromFullName(names[i])); + // TODO(xysong): Differentiate categorical slots from intents. + std::vector<absl::string_view> parts = absl::StrSplit(name.Name(), '='); + if (parts.size() == 2) { + // The name is like 'xxx=yyy'. It's a categorical slot. + if (confidences[i] < categorical_slot_threshold_) + continue; + auto new_categorical_slot = response->mutable_categorical_slots()->Add(); + + const auto slot = std::string(parts[0]); + new_categorical_slot->set_slot(slot); + auto new_categorical_slot_prediction = + new_categorical_slot->mutable_prediction(); + const auto display_name = std::string(parts[1]); + new_categorical_slot_prediction->set_display_name(display_name); + new_categorical_slot_prediction->set_score(confidences[i]); + } else { + // It's an intent. + if (confidences[i] < intent_threshold_) + continue; + auto new_intent = response->mutable_intents()->Add(); + new_intent->set_display_name(name.Name()); + new_intent->set_score(confidences[i]); + } + } + return absl::OkStatus(); +} + +absl::StatusOr<std::unique_ptr<AbstractModule>> SlotModule::Create( + tflite::Interpreter* interpreter, + const TensorIndexMap* tensor_index_map, + const BertCluAnnotatorOptions* options) { + auto out = std::make_unique<SlotModule>(); + out->tensor_index_map_ = tensor_index_map; + out->noncategorical_slot_threshold_ = + options->noncategorical_slot_threshold(); + RETURN_IF_ERROR(out->Init(interpreter, options)); + return out; +} + +absl::Status SlotModule::Postprocess(Artifacts* artifacts, + CluResponse* response) const { + ASSIGN_OR_RETURN( + const auto t_output, + NamesAndConfidencesFromOutput(tensor_index_map_->slot_names_idx, + tensor_index_map_->slot_scores_idx)); + const auto& [tags, confidences] = t_output; + RETURN_IF_ERROR(SlotModulePopulateResponse( + tags, confidences, artifacts->token_alignments, artifacts->token_turn_ids, + artifacts->first_subword_indicators, noncategorical_slot_threshold_, + artifacts->reverse_utterance_list_to_encode, response)); + return absl::OkStatus(); +} + +} // namespace tflite::task::text::clu
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/tflite_modules.h b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/tflite_modules.h new file mode 100644 index 0000000..eecd65f --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/tflite_modules.h
@@ -0,0 +1,165 @@ +/* Copyright 2022 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==============================================================================*/ + +#ifndef TENSORFLOW_LITE_SUPPORT_CC_TASK_TEXT_CLU_LIB_TFLITE_MODULES_H_ +#define TENSORFLOW_LITE_SUPPORT_CC_TASK_TEXT_CLU_LIB_TFLITE_MODULES_H_ + +#include "absl/status/statusor.h" // from @com_google_absl +#include "absl/strings/string_view.h" // from @com_google_absl +#include "tensorflow/lite/interpreter.h" +#include "tensorflow_lite_support/cc/task/text/proto/bert_clu_annotator_options_proto_inc.h" +#include "tensorflow_lite_support/cc/task/text/proto/clu_proto_inc.h" +#include "tensorflow_lite_support/cc/text/tokenizers/bert_tokenizer.h" + +namespace tflite::task::text::clu { + +// Artifacts used by modules. +struct Artifacts { + std::vector<std::pair<int, int>> token_alignments; + std::vector<absl::string_view> reverse_utterance_list_to_encode; + std::vector<int> token_turn_ids; + std::vector<int> first_subword_indicators; + + void Clear() { + token_alignments.clear(); + reverse_utterance_list_to_encode.clear(); + token_turn_ids.clear(); + first_subword_indicators.clear(); + } +}; + +// Tensor index used in different TFLite modules. +struct TensorIndexMap { + int token_id_idx; + int token_mask_idx; + int token_type_id_idx; + int domain_names_idx; + int domain_scores_idx; + int intent_names_idx; + int intent_scores_idx; + int slot_names_idx; + int slot_scores_idx; +}; + +// A super class for `modules` which do feature extraction on the input proto +// and convert the output tensors into the output response proto +class AbstractModule { + public: + AbstractModule(const AbstractModule& other) = delete; + AbstractModule& operator=(const AbstractModule& rhs) = delete; + virtual ~AbstractModule() = default; + + // Populates the Interpreter input tensors from the Request proto. + virtual absl::Status Preprocess(const CluRequest& request, + Artifacts* artifacts) const { + return absl::OkStatus(); + } + + // Reads the output tensors and populates the Response proto. + virtual absl::Status Postprocess(Artifacts* artifacts, + CluResponse* response) const { + return absl::OkStatus(); + } + + protected: + AbstractModule() = default; + + absl::Status Init(Interpreter* interpreter, + const BertCluAnnotatorOptions* options); + + using NamesAndConfidences = + std::tuple<std::vector<absl::string_view>, const float*>; + // Reads a sequence of strings, confidence scores and their size from the + // output tensors. + // The tensors are assumed to be of shape [1, max_seq_len] + absl::StatusOr<NamesAndConfidences> NamesAndConfidencesFromOutput( + int names_tensor_idx, + int scores_tensor_idx) const; + + // TFLite interpreter + Interpreter* interpreter_ = nullptr; + + const TensorIndexMap* tensor_index_map_ = nullptr; +}; + +// Below are modules used in the TFLite code path. + +class UtteranceSeqModule : public AbstractModule { + public: + static absl::StatusOr<std::unique_ptr<AbstractModule>> Create( + Interpreter* interpreter, + const TensorIndexMap* tensor_index_map, + const BertCluAnnotatorOptions* options, + const tflite::support::text::tokenizer::BertTokenizer* tokenizer); + + absl::Status Preprocess(const CluRequest& request, + Artifacts* artifacts) const override; + + private: + // The length of the input sequence as required by the model. + size_t max_seq_len_; + // The maximum number of previous turns to consider. Used in BERT-DeepCLU. + int max_history_turns_; + const tflite::support::text::tokenizer::BertTokenizer* tokenizer_ = nullptr; +}; + +class DomainModule : public AbstractModule { + public: + static absl::StatusOr<std::unique_ptr<AbstractModule>> Create( + Interpreter* interpreter, + const TensorIndexMap* tensor_index_map, + const BertCluAnnotatorOptions* options); + + absl::Status Postprocess(Artifacts* artifacts, + CluResponse* response) const override; + + private: + float domain_threshold_; +}; + +// Responsible for intents and categorical slots. +class IntentModule : public AbstractModule { + public: + static absl::StatusOr<std::unique_ptr<AbstractModule>> Create( + Interpreter* interpreter, + const TensorIndexMap* tensor_index_map, + const BertCluAnnotatorOptions* options); + + absl::Status Postprocess(Artifacts* artifacts, + CluResponse* response) const override; + + private: + float intent_threshold_; + float categorical_slot_threshold_; +}; + +// Responsible for noncategorical slots. +class SlotModule : public AbstractModule { + public: + static absl::StatusOr<std::unique_ptr<AbstractModule>> Create( + Interpreter* interpreter, + const TensorIndexMap* tensor_index_map, + const BertCluAnnotatorOptions* options); + + absl::Status Postprocess(Artifacts* artifacts, + CluResponse* response) const override; + + private: + float noncategorical_slot_threshold_; +}; + +} // namespace tflite::task::text::clu + +#endif // TENSORFLOW_LITE_SUPPORT_CC_TASK_TEXT_CLU_LIB_TFLITE_MODULES_H_
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/tflite_test_utils.cc b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/tflite_test_utils.cc new file mode 100644 index 0000000..30d2bd75 --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/tflite_test_utils.cc
@@ -0,0 +1,60 @@ +/* Copyright 2022 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==============================================================================*/ + +#include "tensorflow_lite_support/cc/task/text/clu_lib/tflite_test_utils.h" + +#include <initializer_list> + +#include "tensorflow/lite/c/common.h" +#include "tensorflow/lite/string_util.h" + +namespace tflite::task::text::clu { + +template <> +void PopulateTfLiteTensorValue<std::string>( + const std::initializer_list<std::string> values, + TfLiteTensor* tensor) { + tflite::DynamicBuffer buf; + for (const std::string& s : values) { + buf.AddString(s.data(), s.length()); + } + buf.WriteToTensor(tensor, /*new_shape=*/nullptr); +} + +size_t NumTotalFromShape(const std::initializer_list<int>& shape) { + size_t num_total; + if (shape.size() > 0) + num_total = 1; + else + num_total = 0; + for (const int dim : shape) + num_total *= dim; + return num_total; +} + +TfLiteTensor* UniqueTfLiteTensor::get() { + return tensor_; +} + +UniqueTfLiteTensor::~UniqueTfLiteTensor() { + TfLiteTensorFree(tensor_); +} + +template <> +TfLiteType TypeToTfLiteType<std::string>() { + return kTfLiteString; +} + +} // namespace tflite::task::text::clu
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/tflite_test_utils.h b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/tflite_test_utils.h new file mode 100644 index 0000000..f19d236 --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/clu_lib/tflite_test_utils.h
@@ -0,0 +1,110 @@ +/* Copyright 2022 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==============================================================================*/ + +#ifndef TENSORFLOW_LITE_SUPPORT_CC_TASK_TEXT_CLU_LIB_TFLITE_TEST_UTILS_H_ +#define TENSORFLOW_LITE_SUPPORT_CC_TASK_TEXT_CLU_LIB_TFLITE_TEST_UTILS_H_ + +#include <initializer_list> +#include <string> + +#include "tensorflow/lite/c/common.h" +#include "tensorflow/lite/type_to_tflitetype.h" + +namespace tflite::task::text::clu { + +// A wrapper around TfLiteTensor which frees it in its dtor. +class UniqueTfLiteTensor { + public: + explicit UniqueTfLiteTensor(TfLiteTensor* tensor) : tensor_(tensor) {} + + UniqueTfLiteTensor() = default; + + // Returns the underlying pointer + TfLiteTensor* get(); + + TfLiteTensor& operator*() { return *tensor_; } + + TfLiteTensor* operator->() { return tensor_; } + + const TfLiteTensor* operator->() const { return tensor_; } + + // Resets the underlying pointer + void reset(TfLiteTensor* tensor) { tensor_ = tensor; } + + // Deallocates the tensor as well + ~UniqueTfLiteTensor(); + + private: + TfLiteTensor* tensor_ = nullptr; +}; + +template <typename T> +void PopulateTfLiteTensorValue(const std::initializer_list<T> values, + TfLiteTensor* tensor) { + T* buffer = reinterpret_cast<T*>(tensor->data.raw); + int i = 0; + for (const auto v : values) { + buffer[i++] = v; + } +} + +size_t NumTotalFromShape(const std::initializer_list<int>& shape); + +template <> +void PopulateTfLiteTensorValue<std::string>( + const std::initializer_list<std::string> values, + TfLiteTensor* tensor); + +template <typename T> +TfLiteType TypeToTfLiteType() { + return tflite::typeToTfLiteType<T>(); +} + +template <> +TfLiteType TypeToTfLiteType<std::string>(); + +template <typename T> +void ReallocDynamicTensor(const std::initializer_list<int> shape, + TfLiteTensor* tensor) { + TfLiteTensorFree(tensor); + tensor->allocation_type = kTfLiteDynamic; + tensor->type = TypeToTfLiteType<T>(); + // Populate Shape + TfLiteIntArray* shape_arr = TfLiteIntArrayCreate(shape.size()); + int i = 0; + const size_t num_total = NumTotalFromShape(shape); + for (const int dim : shape) + shape_arr->data[i++] = dim; + tensor->dims = shape_arr; + if (tensor->type != kTfLiteString) { + TfLiteTensorRealloc(num_total * sizeof(T), tensor); + } +} + +template <typename T> +void PopulateTfLiteTensor(const std::initializer_list<T> values, + const std::initializer_list<int> shape, + TfLiteTensor* tensor) { + const size_t num_total = NumTotalFromShape(shape); + CHECK_EQ(num_total, values.size()); + // Populate Shape + ReallocDynamicTensor<T>(shape, tensor); + // Value allocation + PopulateTfLiteTensorValue<T>(values, tensor); +} + +} // namespace tflite::task::text::clu + +#endif // TENSORFLOW_LITE_SUPPORT_CC_TASK_TEXT_CLU_LIB_TFLITE_TEST_UTILS_H_
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/proto/BUILD b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/proto/BUILD index debdc10b..784ee95 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/proto/BUILD +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/proto/BUILD
@@ -1,4 +1,4 @@ -load("//tensorflow_lite_support/cc/port:build_defs.bzl", "support_cc_proto_library") +load("//tensorflow_lite_support/cc/port:build_defs.bzl", "support_cc_proto_library", "support_py_proto_library") package( default_visibility = ["//tensorflow_lite_support:users"], @@ -116,3 +116,55 @@ name = "text_embedder_options_cc_proto", deps = [":text_embedder_options_proto"], ) + +support_py_proto_library( + name = "text_embedder_options_py_pb2", + srcs = ["text_embedder_options.proto"], + api_version = 2, + proto_deps = [":text_embedder_options_proto"], + py_proto_deps = [ + "//tensorflow_lite_support/cc/task/core/proto:base_options_py_pb2", + "//tensorflow_lite_support/cc/task/processor/proto:embedding_options_py_pb2", + ], +) + +proto_library( + name = "clu_proto", + srcs = ["clu.proto"], + deps = [ + "//tensorflow_lite_support/cc/task/core/proto:class_proto", + ], +) + +cc_proto_library( + name = "clu_cc_proto", + deps = [":clu_proto"], +) + +cc_library( + name = "clu_proto_inc", + hdrs = ["clu_proto_inc.h"], + deps = [":clu_cc_proto"], +) + +proto_library( + name = "bert_clu_annotator_options_proto", + srcs = ["bert_clu_annotator_options.proto"], + deps = [ + "//tensorflow_lite_support/cc/task/core/proto:base_options_proto", + ], +) + +cc_proto_library( + name = "bert_clu_annotator_options_cc_proto", + deps = [":bert_clu_annotator_options_proto"], +) + +cc_library( + name = "bert_clu_annotator_options_proto_inc", + hdrs = ["bert_clu_annotator_options_proto_inc.h"], + deps = [ + ":bert_clu_annotator_options_cc_proto", + "//tensorflow_lite_support/cc/task/core/proto:base_options_proto_inc", + ], +)
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/proto/bert_clu_annotator_options.proto b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/proto/bert_clu_annotator_options.proto new file mode 100644 index 0000000..8c87d9f1 --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/proto/bert_clu_annotator_options.proto
@@ -0,0 +1,43 @@ +/* Copyright 2022 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==============================================================================*/ + +syntax = "proto2"; + +package tflite.task.text; + +import "tensorflow_lite_support/cc/task/core/proto/base_options.proto"; + +// Options for setting up an BertCluAnnotator. +// Next Id: 7 +message BertCluAnnotatorOptions { + // Base options for configuring BertCluAnnotator, such as specifying the + // TfLite model file with metadata, accelerator options, etc. + optional tflite.task.core.BaseOptions base_options = 1; + + // Max number of history turns to encode by the model. + optional int32 max_history_turns = 2 [default = 5]; + + // The threshold of domain prediction. + optional float domain_threshold = 3 [default = 0.5]; + + // The threshold of intent prediction. + optional float intent_threshold = 4 [default = 0.5]; + + // The threshold of categorical slot prediction. + optional float categorical_slot_threshold = 5 [default = 0.5]; + + // The threshold of noncategorical slot prediction. + optional float noncategorical_slot_threshold = 6 [default = 0.5]; +}
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/proto/bert_clu_annotator_options_proto_inc.h b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/proto/bert_clu_annotator_options_proto_inc.h new file mode 100644 index 0000000..15c31b2 --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/proto/bert_clu_annotator_options_proto_inc.h
@@ -0,0 +1,22 @@ +/* Copyright 2022 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==============================================================================*/ + +#ifndef TENSORFLOW_LITE_SUPPORT_CC_TASK_TEXT_PROTO_CLU_BERT_CLU_ANNOTATOR_OPTIONS_PROTO_INC_H_ +#define TENSORFLOW_LITE_SUPPORT_CC_TASK_TEXT_PROTO_CLU_BERT_CLU_ANNOTATOR_OPTIONS_PROTO_INC_H_ + +#include "tensorflow_lite_support/cc/task/core/proto/base_options_proto_inc.h" +#include "tensorflow_lite_support/cc/task/text/proto/bert_clu_annotator_options.pb.h" + +#endif // TENSORFLOW_LITE_SUPPORT_CC_TASK_TEXT_PROTO_CLU_BERT_CLU_ANNOTATOR_OPTIONS_PROTO_INC_H_
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/proto/clu.proto b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/proto/clu.proto new file mode 100644 index 0000000..a44dde4 --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/proto/clu.proto
@@ -0,0 +1,91 @@ +/* Copyright 2022 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==============================================================================*/ + +syntax = "proto2"; + +package tflite.task.text; + +import "tensorflow_lite_support/cc/task/core/proto/class.proto"; + +// The input to CLU (Conversational Language Understanding). +message CluRequest { + // The utterances of dialogue conversation turns in the chronological order. + // The last utterance is the current turn. + repeated string utterances = 1; +} + +// The output of CLU. +// +// Example input request: +// ``` +// utterances: "I would like to make a restaurant reservation at morning 11:15." +// utterances: "Which restaurant do you want to go to?" +// utterances: "Can I get a reservation for two people at Andes Cafe? Where is +// their address?" +// ``` +// +// Example output: +// ``` +// domains { display_name: "Restaurants" score: 0.91 } +// intents { display_name: "request(street_address)" score: 0.79 } +// categorical_slots { +// slot: "party_size" +// prediction: { display_name="2" score: 0.78 } +// } +// noncategorical_slots { +// slot: "restaurant_name" +// extraction: { value: "Andes Cafe" confidence: 0.91 start: 42 end: 52 } +// } +// ``` +message CluResponse { + // The list of predicted domains. + repeated tflite.task.core.Class domains = 1; + // The list of predicted intents. + repeated tflite.task.core.Class intents = 2; + // The list of predicted categorical slots. + repeated CategoricalSlot categorical_slots = 3; + // The list of predicted noncategorical slots. + repeated NonCategoricalSlot noncategorical_slots = 4; +} + +// Represents a categorical slot whose values are within a finite set. +message CategoricalSlot { + // The name of the slot. + optional string slot = 1; + // The predicted class. + optional tflite.task.core.Class prediction = 2; +} + +// A single extraction result. +message Extraction { + // The text value of the extraction. + optional string value = 2; + // The score for this extraction e.g. (but not necessarily) a probability in + // [0,1]. + optional float score = 3; + // Start of the bytes of this extraction. + optional uint32 start = 4; + // Exclusive end of the bytes of this extraction. + optional uint32 end = 5; +} + +// Represents a non-categorical slot whose values are open text extracted from +// the input text. +message NonCategoricalSlot { + // The name of the slot. + optional string slot = 1; + // The predicted extraction. + optional Extraction extraction = 2; +}
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/proto/clu_proto_inc.h b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/proto/clu_proto_inc.h new file mode 100644 index 0000000..011f395 --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/proto/clu_proto_inc.h
@@ -0,0 +1,21 @@ +/* Copyright 2022 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==============================================================================*/ + +#ifndef TENSORFLOW_LITE_SUPPORT_CC_TASK_TEXT_PROTO_CLU_PROTO_INC_H_ +#define TENSORFLOW_LITE_SUPPORT_CC_TASK_TEXT_PROTO_CLU_PROTO_INC_H_ + +#include "tensorflow_lite_support/cc/task/text/proto/clu.pb.h" + +#endif // TENSORFLOW_LITE_SUPPORT_CC_TASK_TEXT_PROTO_CLU_PROTO_INC_H_
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/vision/object_detector.cc b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/vision/object_detector.cc index ade2de7..0077501 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/vision/object_detector.cc +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/vision/object_detector.cc
@@ -20,9 +20,9 @@ #include <vector> #include <glog/logging.h> -#include "absl/memory/memory.h" // from @com_google_absl -#include "absl/status/status.h" // from @com_google_absl -#include "absl/strings/str_format.h" // from @com_google_absl +#include "absl/memory/memory.h" // from @com_google_absl +#include "absl/status/status.h" // from @com_google_absl +#include "absl/strings/str_format.h" // from @com_google_absl #include "absl/strings/string_view.h" // from @com_google_absl #include "tensorflow/lite/c/common.h" #include "tensorflow_lite_support/cc/common.h"
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/vision/proto/BUILD b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/vision/proto/BUILD index d845d16..6ed69ab 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/vision/proto/BUILD +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/vision/proto/BUILD
@@ -78,6 +78,18 @@ ], ) +support_py_proto_library( + name = "object_detector_options_py_pb2", + srcs = ["object_detector_options.proto"], + api_version = 2, + proto_deps = [":object_detector_options_proto"], + py_proto_deps = [ + "@org_tensorflow//tensorflow/lite/experimental/acceleration/configuration:configuration_proto_external_py", + "//tensorflow_lite_support/cc/task/core/proto:base_options_py_pb2", + "//tensorflow_lite_support/cc/task/core/proto:external_file_py_pb2", + ], +) + cc_library( name = "object_detector_options_proto_inc", hdrs = ["object_detector_options_proto_inc.h"], @@ -104,6 +116,13 @@ ], ) +support_py_proto_library( + name = "detections_py_pb2", + srcs = ["detections.proto"], + api_version = 2, + proto_deps = [":detections_proto"], +) + cc_library( name = "detections_proto_inc", hdrs = ["detections_proto_inc.h"], @@ -140,6 +159,7 @@ proto_deps = [":image_classifier_options_proto"], py_proto_deps = [ "@org_tensorflow//tensorflow/lite/experimental/acceleration/configuration:configuration_proto_external_py", + "//tensorflow_lite_support/cc/task/core/proto:base_options_py_pb2", "//tensorflow_lite_support/cc/task/core/proto:external_file_py_pb2", ], )
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/test/task/text/clu_lib/BUILD b/third_party/tflite_support/src/tensorflow_lite_support/cc/test/task/text/clu_lib/BUILD new file mode 100644 index 0000000..296c20ff --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/test/task/text/clu_lib/BUILD
@@ -0,0 +1,76 @@ +package( + default_visibility = ["//visibility:public"], + licenses = ["notice"], # Apache 2.0 +) + +cc_test( + name = "tflite_modules_test", + srcs = ["tflite_modules_test.cc"], + deps = [ + "//tensorflow_lite_support/cc/port:gtest_main", + "//tensorflow_lite_support/cc/port/default:status_matchers", + "//tensorflow_lite_support/cc/task/text/clu_lib:tflite_modules", + "//tensorflow_lite_support/cc/task/text/clu_lib:tflite_test_utils", + "//tensorflow_lite_support/cc/task/text/proto:bert_clu_annotator_options_proto_inc", + "//tensorflow_lite_support/cc/test:test_utils", + "//tensorflow_lite_support/cc/text/tokenizers:bert_tokenizer", + "@com_google_absl//absl/strings", + "@org_tensorflow//tensorflow/lite:framework", + "@org_tensorflow//tensorflow/lite:string_util", + ], +) + +cc_test( + name = "bert_utils_test", + srcs = ["bert_utils_test.cc"], + deps = [ + "//tensorflow_lite_support/cc/port:gtest_main", + "//tensorflow_lite_support/cc/port/default:status_matchers", + "//tensorflow_lite_support/cc/task/text/clu_lib:bert_utils", + "//tensorflow_lite_support/cc/test:test_utils", + "//tensorflow_lite_support/cc/text/tokenizers:bert_tokenizer", + "@org_tensorflow//tensorflow/lite:framework", # build_cleaner: keep (Otherwise, it fails to build in OSS) + ], +) + +cc_test( + name = "intent_repr_test", + srcs = [ + "intent_repr_test.cc", + ], + deps = [ + "//tensorflow_lite_support/cc/port:gtest_main", + "//tensorflow_lite_support/cc/port/default:status_matchers", + "//tensorflow_lite_support/cc/task/text/clu_lib:intent_repr", + "//tensorflow_lite_support/cc/test:test_utils", + ], +) + +cc_test( + name = "slot_repr_test", + srcs = [ + "slot_repr_test.cc", + ], + deps = [ + "//tensorflow_lite_support/cc/port:gtest_main", + "//tensorflow_lite_support/cc/port/default:status_matchers", + "//tensorflow_lite_support/cc/task/text/clu_lib:slot_repr", + "//tensorflow_lite_support/cc/test:test_utils", + "@com_google_absl//absl/strings", + ], +) + +cc_test( + name = "slot_tagging_output_test", + srcs = [ + "slot_tagging_output_test.cc", + ], + deps = [ + "//tensorflow_lite_support/cc/port:gtest_main", + "//tensorflow_lite_support/cc/port:status_macros", + "//tensorflow_lite_support/cc/port/default:status_matchers", + "//tensorflow_lite_support/cc/task/text/clu_lib:slot_tagging_output", + "//tensorflow_lite_support/cc/task/text/proto:clu_proto_inc", + "//tensorflow_lite_support/cc/test:test_utils", + ], +)
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/test/task/text/clu_lib/bert_utils_test.cc b/third_party/tflite_support/src/tensorflow_lite_support/cc/test/task/text/clu_lib/bert_utils_test.cc new file mode 100644 index 0000000..6fd9508 --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/test/task/text/clu_lib/bert_utils_test.cc
@@ -0,0 +1,473 @@ +/* Copyright 2022 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==============================================================================*/ + +#include "tensorflow_lite_support/cc/task/text/clu_lib/bert_utils.h" + +#include <memory> + +#include "tensorflow_lite_support/cc/port/default/status_matchers.h" +#include "tensorflow_lite_support/cc/port/gmock.h" +#include "tensorflow_lite_support/cc/port/gtest.h" +#include "tensorflow_lite_support/cc/test/test_utils.h" +#include "tensorflow_lite_support/cc/text/tokenizers/bert_tokenizer.h" + +namespace tflite::task::text::clu { +namespace { + +class BertUtilsTestClass : public ::testing::Test { + protected: + void SetUp() override { + const std::vector<std::string> wordpiece_vocab({ + "[PAD]", // 0 + "[UNK]", // 1 + "[CLS]", // 2 + "[SEP]", // 3 + "?", // 4 + "wanna", // 5 + "see", // 6 + "2", // 7 + "to", // 8 + "##night", // 9 + ",", // 10 + "good", // 11 + "he", // 12 + "##llo", // 13 + "how", // 14 + "are", // 15 + "you", // 16 + "plan", // 17 + "##s", // 18 + "gr", // 19 + "##eat" // 20 + }); + tokenizer_ = + std::make_unique<tflite::support::text::tokenizer::BertTokenizer>( + wordpiece_vocab); + } + + std::unique_ptr<tflite::support::text::tokenizer::BertTokenizer> tokenizer_; +}; + +TEST_F(BertUtilsTestClass, ZeroHistoryNotTrucated) { + const std::vector<absl::string_view> conversations_in_reverse_order = { + "wanna see avenger 2 tonight?", "any plans tonight?", + "good, how are you?", "hello how are you?"}; + const int max_seq_length = 10; + const int max_history_turns = 0; + + const std::vector<int> expected_token_ids = { + 2, // [CLS] + 5, // "wanna" + 6, // "see" + 1, // "[UNK]" + 7, // "0" + 8, // "to" + 9, // "##night" + 4, // "?" + 3 // [SEP] + }; + const std::vector<std::pair<int, int>> expected_token_alignments = { + {-1, -1}, // [CLS] + {0, 5}, // "wanna" + {6, 9}, // "see" + {10, 17}, // "[UNK]" + {18, 19}, // "0" + {20, 22}, // "to" + {22, 27}, // "##night" + {27, 28}, // "?" + {28, 28} // [SEP] + }; + const std::vector<int> expected_first_subword_indicators = { + 0, // [CLS] + 1, // "wanna" + 1, // "see" + 1, // "[UNK]" + 1, // "0" + 1, // "to" + 0, // "##night" + 1, // "?" + 0 // [SEP] + }; + const std::vector<int> expected_segment_id_list = { + 0, // [CLS] + 0, // "wanna" + 0, // "see" + 0, // "[UNK]" + 0, // "0" + 0, // "to" + 0, // "##night" + 0, // "?" + 0 // [SEP] + }; + const std::vector<int> expected_turn_id_list = { + 0, // [CLS] + 0, // "wanna" + 0, // "see" + 0, // "[UNK]" + 0, // "0" + 0, // "to" + 0, // "##night" + 0, // "?" + 0 // [SEP] + }; + + std::vector<int> token_ids; + std::vector<std::pair<int, int>> token_alignments; + std::vector<int> subword_indicators; + std::vector<int> segment_id_list; + std::vector<int> turn_id_list; + SUPPORT_ASSERT_OK(BertPreprocessing( + tokenizer_.get(), conversations_in_reverse_order, max_seq_length, + max_history_turns, &token_ids, &token_alignments, &subword_indicators, + &segment_id_list, &turn_id_list)); + EXPECT_THAT(token_ids, expected_token_ids); + EXPECT_THAT(token_alignments, expected_token_alignments); + EXPECT_THAT(subword_indicators, expected_first_subword_indicators); + EXPECT_THAT(segment_id_list, expected_segment_id_list); + EXPECT_THAT(turn_id_list, expected_turn_id_list); +} + +TEST_F(BertUtilsTestClass, ZeroHistoryTrucated) { + const std::vector<absl::string_view> conversations_in_reverse_order = { + "wanna see avenger 2 tonight?", "any plans tonight?", + "good, how are you?", "hello how are you?"}; + const int max_seq_length = 7; + const int max_history_turns = 0; + + // Subword token "to" of "tonight" is also truncated based on whole words. + const std::vector<int> expected_token_ids = { + 2, // [CLS] + 5, // "wanna" + 6, // "see" + 1, // "[UNK]" + 7, // "0" + 3 // [SEP] + }; + const std::vector<std::pair<int, int>> expected_token_alignments = { + {-1, -1}, // [CLS] + {0, 5}, // "wanna" + {6, 9}, // "see" + {10, 17}, // "[UNK]" + {18, 19}, // "0" + {19, 19} // [SEP] + }; + const std::vector<int> expected_first_subword_indicators = { + 0, // [CLS] + 1, // "wanna" + 1, // "see" + 1, // "[UNK]" + 1, // "0" + 0 // [SEP] + }; + const std::vector<int> expected_segment_id_list = { + 0, // [CLS] + 0, // "wanna" + 0, // "see" + 0, // "[UNK]" + 0, // "0" + 0 // [SEP] + }; + const std::vector<int> expected_turn_id_list = { + 0, // [CLS] + 0, // "wanna" + 0, // "see" + 0, // "[UNK]" + 0, // "0" + 0 // [SEP] + }; + + std::vector<int> token_ids; + std::vector<std::pair<int, int>> token_alignments; + std::vector<int> subword_indicators; + std::vector<int> segment_id_list; + std::vector<int> turn_id_list; + SUPPORT_ASSERT_OK(BertPreprocessing( + tokenizer_.get(), conversations_in_reverse_order, max_seq_length, + max_history_turns, &token_ids, &token_alignments, &subword_indicators, + &segment_id_list, &turn_id_list)); + EXPECT_THAT(token_ids, expected_token_ids); + EXPECT_THAT(token_alignments, expected_token_alignments); + EXPECT_THAT(subword_indicators, expected_first_subword_indicators); + EXPECT_THAT(segment_id_list, expected_segment_id_list); + EXPECT_THAT(turn_id_list, expected_turn_id_list); +} + +TEST_F(BertUtilsTestClass, WithHistoryNotTrucated) { + const std::vector<absl::string_view> conversations_in_reverse_order = { + "wanna see avenger 2 tonight?", "any plans tonight?", + "good, how are you?", "hello how are you?"}; + const int max_seq_length = 30; + const int max_history_turns = 2; + + const std::vector<int> expected_token_ids = { + 2, // [CLS] + 5, // "wanna" + 6, // "see" + 1, // "[UNK]" + 7, // "0" + 8, // "to" + 9, // "##night" + 4, // "?" + 3, // [SEP] + 1, // [UNK] + 17, // "plan" + 18, // "##s" + 8, // "to" + 9, // "##night" + 4, // "?" + 3, // [SEP] + 11, // "good" + 10, // "," + 14, // "how" + 15, // "are" + 16, // "you" + 4, // "?" + 3 // [SEP] + }; + const std::vector<std::pair<int, int>> expected_token_alignments = { + {-1, -1}, // [CLS] + {0, 5}, // "wanna" + {6, 9}, // "see" + {10, 17}, // "[UNK]" + {18, 19}, // "0" + {20, 22}, // "to" + {22, 27}, // "##night" + {27, 28}, // "?" + {28, 28}, // [SEP] + {0, 3}, // [UNK] + {4, 8}, // "plan" + {8, 9}, // "##s" + {10, 12}, // "to" + {12, 17}, // "##night" + {17, 18}, // "?" + {18, 18}, // [SEP] + {0, 4}, // "good" + {4, 5}, // "," + {6, 9}, // "how" + {10, 13}, // "are" + {14, 17}, // "you" + {17, 18}, // "?" + {18, 18} // [SEP] + }; + const std::vector<int> expected_first_subword_indicators = { + 0, // [CLS] + 1, // "wanna" + 1, // "see" + 1, // "[UNK]" + 1, // "0" + 1, // "to" + 0, // "##night" + 1, // "?" + 0, // [SEP] + 1, // [UNK] + 1, // "plan" + 0, // "##s" + 1, // "to" + 0, // "##night" + 1, // "?" + 0, // [SEP] + 1, // "good" + 1, // "," + 1, // "how" + 1, // "are" + 1, // "you" + 1, // "?" + 0 // [SEP] + }; + const std::vector<int> expected_segment_id_list = { + 0, // [CLS] + 0, // "wanna" + 0, // "see" + 0, // "[UNK]" + 0, // "0" + 0, // "to" + 0, // "##night" + 0, // "?" + 0, // [SEP] + 1, // [UNK] + 1, // "plan" + 1, // "##s" + 1, // "to" + 1, // "##night" + 1, // "?" + 1, // [SEP] + 1, // "good" + 1, // "," + 1, // "how" + 1, // "are" + 1, // "you" + 1, // "?" + 1 // [SEP] + }; + const std::vector<int> expected_turn_id_list = { + 0, // [CLS] + 0, // "wanna" + 0, // "see" + 0, // "[UNK]" + 0, // "0" + 0, // "to" + 0, // "##night" + 0, // "?" + 0, // [SEP] + 1, // [UNK] + 1, // "plan" + 1, // "##s" + 1, // "to" + 1, // "##night" + 1, // "?" + 1, // [SEP] + 2, // "good" + 2, // "," + 2, // "how" + 2, // "are" + 2, // "you" + 2, // "?" + 2 // [SEP] + }; + + std::vector<int> token_ids; + std::vector<std::pair<int, int>> token_alignments; + std::vector<int> subword_indicators; + std::vector<int> segment_id_list; + std::vector<int> turn_id_list; + SUPPORT_ASSERT_OK(BertPreprocessing( + tokenizer_.get(), conversations_in_reverse_order, max_seq_length, + max_history_turns, &token_ids, &token_alignments, &subword_indicators, + &segment_id_list, &turn_id_list)); + EXPECT_THAT(token_ids, expected_token_ids); + EXPECT_THAT(token_alignments, expected_token_alignments); + EXPECT_THAT(subword_indicators, expected_first_subword_indicators); + EXPECT_THAT(segment_id_list, expected_segment_id_list); + EXPECT_THAT(turn_id_list, expected_turn_id_list); +} + +TEST_F(BertUtilsTestClass, WithHistoryTrucated) { + const std::vector<absl::string_view> conversations_in_reverse_order = { + "wanna see avenger 2 tonight?", "any plans tonight?", + "great, how are you?", "hello how are you?"}; + const int max_seq_length = 18; + const int max_history_turns = 3; + + // The utterance "Great, how are you?" and its [SEP] are all truncated because + // the truncation is based on whole words. + const std::vector<int> expected_token_ids = { + 2, // [CLS] + 5, // "wanna" + 6, // "see" + 1, // "[UNK]" + 7, // "0" + 8, // "to" + 9, // "##night" + 4, // "?" + 3, // [SEP] + 1, // [UNK] + 17, // "plan" + 18, // "##s" + 8, // "to" + 9, // "##night" + 4, // "?" + 3, // [SEP] + }; + const std::vector<std::pair<int, int>> expected_token_alignments = { + {-1, -1}, // [CLS] + {0, 5}, // "wanna" + {6, 9}, // "see" + {10, 17}, // "[UNK]" + {18, 19}, // "0" + {20, 22}, // "to" + {22, 27}, // "##night" + {27, 28}, // "?" + {28, 28}, // [SEP] + {0, 3}, // [UNK] + {4, 8}, // "plan" + {8, 9}, // "##s" + {10, 12}, // "to" + {12, 17}, // "##night" + {17, 18}, // "?" + {18, 18} // [SEP] + }; + const std::vector<int> expected_first_subword_indicators = { + 0, // [CLS] + 1, // "wanna" + 1, // "see" + 1, // "[UNK]" + 1, // "0" + 1, // "to" + 0, // "##night" + 1, // "?" + 0, // [SEP] + 1, // [UNK] + 1, // "plan" + 0, // "##s" + 1, // "to" + 0, // "##night" + 1, // "?" + 0, // [SEP] + }; + const std::vector<int> expected_segment_id_list = { + 0, // [CLS] + 0, // "wanna" + 0, // "see" + 0, // "[UNK]" + 0, // "0" + 0, // "to" + 0, // "##night" + 0, // "?" + 0, // [SEP] + 1, // [UNK] + 1, // "plan" + 1, // "##s" + 1, // "to" + 1, // "##night" + 1, // "?" + 1, // [SEP] + }; + const std::vector<int> expected_turn_id_list = { + 0, // [CLS] + 0, // "wanna" + 0, // "see" + 0, // "[UNK]" + 0, // "0" + 0, // "to" + 0, // "##night" + 0, // "?" + 0, // [SEP] + 1, // [UNK] + 1, // "plan" + 1, // "##s" + 1, // "to" + 1, // "##night" + 1, // "?" + 1, // [SEP] + }; + + std::vector<int> token_ids; + std::vector<std::pair<int, int>> token_alignments; + std::vector<int> subword_indicators; + std::vector<int> segment_id_list; + std::vector<int> turn_id_list; + SUPPORT_ASSERT_OK(BertPreprocessing( + tokenizer_.get(), conversations_in_reverse_order, max_seq_length, + max_history_turns, &token_ids, &token_alignments, &subword_indicators, + &segment_id_list, &turn_id_list)); + EXPECT_THAT(token_ids, expected_token_ids); + EXPECT_THAT(token_alignments, expected_token_alignments); + EXPECT_THAT(subword_indicators, expected_first_subword_indicators); + EXPECT_THAT(segment_id_list, expected_segment_id_list); + EXPECT_THAT(turn_id_list, expected_turn_id_list); +} +} // namespace + +} // namespace tflite::task::text::clu
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/test/task/text/clu_lib/intent_repr_test.cc b/third_party/tflite_support/src/tensorflow_lite_support/cc/test/task/text/clu_lib/intent_repr_test.cc new file mode 100644 index 0000000..0501ec4a --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/test/task/text/clu_lib/intent_repr_test.cc
@@ -0,0 +1,53 @@ +/* Copyright 2022 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==============================================================================*/ + +#include "tensorflow_lite_support/cc/task/text/clu_lib/intent_repr.h" + +#include "tensorflow_lite_support/cc/port/default/status_matchers.h" +#include "tensorflow_lite_support/cc/port/gmock.h" +#include "tensorflow_lite_support/cc/port/gtest.h" +#include "tensorflow_lite_support/cc/test/test_utils.h" + +namespace tflite::task::text::clu { + +TEST(IntentClassification, IntentRepr) { + const auto intent_repr = IntentRepr::Create("open_intent", "media", false); + EXPECT_EQ(intent_repr.FullName(), "media~~open_intent"); +} + +TEST(IntentClassification, IntentRepr2) { + SUPPORT_ASSERT_OK_AND_ASSIGN(const auto intent_repr, + IntentRepr::CreateFromFullName("REQUEST")); + EXPECT_EQ(intent_repr.Name(), "REQUEST"); + EXPECT_EQ(intent_repr.Domain(), ""); +} + +TEST(IntentClassification, IntentRepr3) { + SUPPORT_ASSERT_OK_AND_ASSIGN( + const auto intent_repr, + IntentRepr::CreateFromFullName("nlp_semantic_parsing.models.planning." + "Planning.planning~~show_attribute=" + "SHOW_COUNT")); + EXPECT_EQ(intent_repr.Name(), "show_attribute=SHOW_COUNT"); + EXPECT_EQ(intent_repr.Domain(), + "nlp_semantic_parsing.models.planning.Planning.planning"); +} + +TEST(IntentClassification, IntentReprSharing) { + const auto intent_repr = IntentRepr::Create("open_intent", "media", true); + EXPECT_EQ(intent_repr.FullName(), "open_intent"); +} + +} // namespace tflite::task::text::clu
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/test/task/text/clu_lib/slot_repr_test.cc b/third_party/tflite_support/src/tensorflow_lite_support/cc/test/task/text/clu_lib/slot_repr_test.cc new file mode 100644 index 0000000..4c9f52f3 --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/test/task/text/clu_lib/slot_repr_test.cc
@@ -0,0 +1,145 @@ +/* Copyright 2022 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==============================================================================*/ + +#include "tensorflow_lite_support/cc/task/text/clu_lib/slot_repr.h" + +#include "absl/strings/str_join.h" // from @com_google_absl +#include "tensorflow_lite_support/cc/port/default/status_matchers.h" +#include "tensorflow_lite_support/cc/port/gmock.h" +#include "tensorflow_lite_support/cc/port/gtest.h" +#include "tensorflow_lite_support/cc/test/test_utils.h" + +namespace tflite::task::text::clu { +namespace { + +TEST(SlotTagging, SlotRepr) { + const auto slot_repr = SlotRepr::Create("num_people", "FLIGHT", false); + EXPECT_EQ(slot_repr.BTag(), "B-FLIGHT~~num_people"); + EXPECT_EQ(slot_repr.ITag(), "I-FLIGHT~~num_people"); + EXPECT_EQ(slot_repr.Domain(), "FLIGHT"); + EXPECT_EQ(slot_repr.Name(), "num_people"); +} + +TEST(SlotTagging, SlotReprWithSharing) { + const auto slot_repr = SlotRepr::Create("num_people", "FLIGHT", true); + EXPECT_EQ(slot_repr.BTag(), "B-num_people"); + EXPECT_EQ(slot_repr.Domain(), ""); + EXPECT_EQ(slot_repr.Name(), "num_people"); +} + +TEST(SlotTagging, SlotRepr2) { + const auto status_or_val = SlotRepr::CreateFromIob( + "B-nlp_semantic_parsing.models.planning.Planning.planning~~anchor[*]." + "time"); + SUPPORT_ASSERT_OK(status_or_val); + const auto& slot_repr = status_or_val.value(); + EXPECT_EQ(slot_repr.Domain(), + "nlp_semantic_parsing.models.planning.Planning.planning"); + EXPECT_EQ(slot_repr.Name(), "anchor[*].time"); +} + +TEST(SlotTagging, SlotRepr3) { + const auto status_or_val = SlotRepr::CreateFromIob("B-num_people"); + SUPPORT_ASSERT_OK(status_or_val); + const auto& slot_repr = status_or_val.value(); + EXPECT_EQ(slot_repr.FullName(), "num_people"); +} + +auto AssertSlotMentionStructEq(const SlotMentionStruct& lhs, + const SlotMentionStruct& rhs) { + EXPECT_EQ(lhs.repr, rhs.repr); + EXPECT_EQ(lhs.start, rhs.start); + EXPECT_EQ(lhs.exclusive_end, rhs.exclusive_end); + EXPECT_FLOAT_EQ(lhs.confidence, rhs.confidence); +} + +TEST(SlotTagging, DecodeSlotChunks) { + const std::vector<std::pair<int, int>> token_alignments = { + {-1, -1}, {0, 3}, {4, 9}, {10, 14}, {15, 19}, + {20, 26}, {26, 27}, {27, 28}, {29, 29}}; + const absl::string_view tag_names[] = {"O", + "O", + "B-restaurant_name", + "I-restaurant_name", + "I-restaurant_name", + "O", + "B-date", + "O", + "O"}; + const float tag_probs[] = {0.9, 0.9, 0.8, 0.91, 0.82, 0.84, 0.9, 0.9, 0.9}; + SUPPORT_ASSERT_OK_AND_ASSIGN( + auto slots, DecodeSlotChunks(tag_names, tag_probs, token_alignments)); + EXPECT_EQ(2, slots.size()); + auto slot1 = + SlotMentionStruct{SlotRepr::Create("restaurant_name"), 4, 19, 0.8}; + AssertSlotMentionStructEq(slot1, slots[0]); + auto slot2 = SlotMentionStruct{SlotRepr::Create("date"), 26, 27, 0.9}; + AssertSlotMentionStructEq(slot2, slots[1]); +} + +TEST(SlotTagging, DecodeSlotChunksEmptyToken) { + const std::vector<std::pair<int, int>> token_alignments = { + {-1, -1}, {0, 4}, {5, 5}, {5, 6}, {7, 7}}; + const absl::string_view tag_names[] = {"O", "B-time", "O", "O", "O"}; + const float tag_probs[] = {1.0, 0.9, 0.9, 0.91, 1.0}; + SUPPORT_ASSERT_OK_AND_ASSIGN( + auto slots, DecodeSlotChunks(tag_names, tag_probs, token_alignments)); + auto slot = SlotMentionStruct{SlotRepr::Create("time"), 0, 4, 0.9}; + AssertSlotMentionStructEq(slot, slots[0]); +} + +TEST(SlotTagging, DecodeSlotChunksBTagAfterEos) { + const std::vector<std::pair<int, int>> token_alignments = { + {-1, -1}, {0, 3}, {5, 9}, {15, 15}}; + const absl::string_view tag_names[] = {"O", "B-X", "I-X", "O", "B-Y"}; + const float tag_probs[] = {1, 1, 1, 1, 1}; + SUPPORT_ASSERT_OK_AND_ASSIGN( + auto slots, DecodeSlotChunks(tag_names, tag_probs, token_alignments)); + EXPECT_EQ(1, slots.size()); + auto slot1 = SlotMentionStruct{SlotRepr::Create("X"), 0, 9, 1}; + AssertSlotMentionStructEq(slot1, slots[0]); +} + +TEST(ResolveInconsistentIobTagSeq, Consistent) { + std::vector<std::string> input_seq = {"O", "B-time", "I-time", "B-per", "O"}; + std::vector<std::string> output_seq = input_seq; + SUPPORT_ASSERT_OK(ResolveInconsistentIobTagSeq(&output_seq)); + EXPECT_EQ(output_seq, input_seq); +} + +TEST(ResolveInconsistentIobTagSeq, InConsistent) { + std::vector<std::string> input_seq = {"O", "B-time", "I-per", "O"}; + SUPPORT_ASSERT_OK(ResolveInconsistentIobTagSeq(&input_seq)); + EXPECT_EQ(input_seq, std::vector<std::string>({"O", "B-time", "B-per", "O"})); + + input_seq = {"O", "O", "I-per", "O"}; + SUPPORT_ASSERT_OK(ResolveInconsistentIobTagSeq(&input_seq)); + EXPECT_EQ(input_seq, std::vector<std::string>({"O", "O", "B-per", "O"})); + + input_seq = {"O", "B-time", "I-time", "I-per", "O"}; + SUPPORT_ASSERT_OK(ResolveInconsistentIobTagSeq(&input_seq)); + EXPECT_EQ(input_seq, + std::vector<std::string>({"O", "B-time", "I-time", "B-per", "O"})); + + input_seq = {"O", "B-time", "I-time", "O", "I-per", + "B-per", "O", "I-loc", "I-loc", "O"}; + SUPPORT_ASSERT_OK(ResolveInconsistentIobTagSeq(&input_seq)); + EXPECT_EQ(input_seq, + std::vector<std::string>({"O", "B-time", "I-time", "O", "B-per", + "B-per", "O", "B-loc", "I-loc", "O"})); +} + +} // namespace +} // namespace tflite::task::text::clu
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/test/task/text/clu_lib/slot_tagging_output_test.cc b/third_party/tflite_support/src/tensorflow_lite_support/cc/test/task/text/clu_lib/slot_tagging_output_test.cc new file mode 100644 index 0000000..d40e55e6 --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/test/task/text/clu_lib/slot_tagging_output_test.cc
@@ -0,0 +1,245 @@ +/* Copyright 2022 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==============================================================================*/ + +#include "tensorflow_lite_support/cc/task/text/clu_lib/slot_tagging_output.h" + +#include "tensorflow_lite_support/cc/port/default/status_matchers.h" +#include "tensorflow_lite_support/cc/port/gmock.h" +#include "tensorflow_lite_support/cc/port/gtest.h" +#include "tensorflow_lite_support/cc/port/status_macros.h" +#include "tensorflow_lite_support/cc/task/text/proto/clu_proto_inc.h" +#include "tensorflow_lite_support/cc/test/message_matchers.h" +#include "tensorflow_lite_support/cc/test/test_utils.h" + +namespace tflite::task::text::clu { +namespace { + +using ::tflite::support::EqualsProto; +using ::tflite::task::ParseTextProtoOrDie; + +// Checks that the two provided `CluResponse` protos are equal. +// If the proto definition changes, please also change this function. +void ExpectApproximatelyEqual(const CluResponse& actual, + const CluResponse& expected) { + ASSERT_EQ(actual.noncategorical_slots_size(), + expected.noncategorical_slots_size()); + for (int i = 0; i < actual.noncategorical_slots_size(); ++i) { + const auto& a = actual.noncategorical_slots(i); + const auto& b = expected.noncategorical_slots(i); + EXPECT_THAT(a, EqualsProto(b)); + } +} + +TEST(SlotTaggingOutputTest, SlotModulePopulateResponseBasic) { + // Assuming 6 tokens: _BOS_ book at 4 pm _EOS_ + std::vector<absl::string_view> tag_names{"O", "O", "O", + "B-time", "I-time", "O"}; + std::vector<float> tag_scores{1.0, 0.9, 0.8, 0.7, 0.9, 1.0}; + std::vector<std::pair<int, int>> token_alignments{ + {-1, -1}, {0, 4}, {5, 7}, {8, 9}, {10, 12}, {12, 12}}; + std::vector<int> turn_ids{0, 0, 0, 0, 0, 0}; + std::vector<int> first_subword_indicators{0, 1, 1, 1, 1, 0}; + std::vector<absl::string_view> reverse_utterance_list_to_encode{ + "book at 4 pm"}; + // Domain predictions need to be pre-populated. + CluResponse response; + SUPPORT_ASSERT_OK(SlotModulePopulateResponse( + tag_names, tag_scores.data(), token_alignments, turn_ids, + first_subword_indicators, /*threshold=*/0.5, + reverse_utterance_list_to_encode, &response)); + ExpectApproximatelyEqual( + response, ParseTextProtoOrDie<CluResponse>(R"pb( + noncategorical_slots { + slot: "time" + extraction { value: "4 pm" start: 8 end: 12 score: 0.7 } + } + )pb")); +} + +TEST(SlotTaggingOutputTest, SlotModulePopulateResponseBelowThreshold) { + // Assuming 6 tokens: _BOS_ book at 4 pm _EOS_ + std::vector<absl::string_view> tag_names{"O", "O", "O", + "B-time", "I-time", "O"}; + std::vector<float> tag_scores{1.0, 0.9, 0.8, 0.7, 0.9, 1.0}; + std::vector<std::pair<int, int>> token_alignments{ + {-1, -1}, {0, 4}, {5, 7}, {8, 9}, {10, 12}, {12, 12}}; + std::vector<int> turn_ids{0, 0, 0, 0, 0, 0}; + std::vector<int> first_subword_indicators{0, 1, 1, 1, 1, 0}; + std::vector<absl::string_view> reverse_utterance_list_to_encode{ + "book at 4 pm"}; + // Domain predictions need to be pre-populated. + CluResponse response; + SUPPORT_ASSERT_OK(SlotModulePopulateResponse( + tag_names, tag_scores.data(), token_alignments, turn_ids, + first_subword_indicators, /*threshold=*/0.8, + reverse_utterance_list_to_encode, &response)); + ExpectApproximatelyEqual(response, + ParseTextProtoOrDie<CluResponse>(R"pb()pb")); +} + +TEST(SlotTaggingOutputTest, SlotModulePopulateResponseTruncated) { + // Assuming 6 tokens: _BOS_ book at 4 pm _EOS_ + // The last token "pm" is got truncated. _EOS_ is added after truncation. + std::vector<absl::string_view> tag_names{"O", "O", "O", "B-time", "O"}; + std::vector<float> tag_scores{1.0, 0.9, 0.8, 0.6, 0.9}; + std::vector<std::pair<int, int>> token_alignments{ + {-1, -1}, {0, 4}, {5, 7}, {8, 9}, {10, 12}, {12, 12}}; + std::vector<int> turn_ids{0, 0, 0, 0, 0, 0}; + std::vector<int> first_subword_indicators{0, 1, 1, 1, 1, 0}; + std::vector<absl::string_view> reverse_utterance_list_to_encode{ + "book at 4 pm"}; + // Domain predictions need to be pre-populated. + CluResponse response; + SUPPORT_ASSERT_OK(SlotModulePopulateResponse( + tag_names, tag_scores.data(), token_alignments, turn_ids, + first_subword_indicators, /*threshold=*/0.5, + reverse_utterance_list_to_encode, &response)); + ExpectApproximatelyEqual( + response, ParseTextProtoOrDie<CluResponse>(R"pb( + noncategorical_slots { + slot: "time" + extraction: { value: "4" start: 8 end: 9 score: 0.6 } + } + )pb")); +} + +TEST(SlotTaggingOutputTest, + SlotModulePopulateResponseMultipleTurnsPaddedPredictingOnFirstSubWord) { + // Assume that the current turn with two history turns (in the reverse + // chronological order): + // current utterance: "[CLS] book a ##t 4 pm [SEP]" + // the last turn: "Sun ##day ? [SEP]" + // the turn before the last: "book for 2 peo ##ple [SEP]" + // + // Note that "at", "Sunday", and "people" are broken into multiple subwords. + // Also assume that max_seq_length of BERT is 18 (with one padding). + std::vector<absl::string_view> reverse_utterance_list_to_encode{ + "book at 4 pm", + "Sunday?", + "book for 2 people", + }; + std::vector<absl::string_view> tag_names{ + "O", // [CLS] + "O", // "book" + "O", // "a" + "B-dummy", // "##t" + "B-time", // "4" + "I-time", // "pm" + "O", // [SEP] + "B-date", // "Sun" + "O", // "##day" + "O", // "?" + "O", // [SEP] + "O", // "book" + "O", // "for" + "B-people", // "2" + "I-people", // "peo" + "O", // "##ple" + "O", // [SEP] + "O", // [PAD] + }; + std::vector<float> tag_scores{ + 1.0, // [CLS] + 0.9, // "book" + 0.8, // "a" + 0.9, // "##t" + 0.7, // "4" + 0.9, // "pm" + 1.0, // [SEP] + 0.8, // "Sun" + 0.9, // "##day" + 0.9, // "?" + 0.7, // [SEP] + 1.0, // "book" + 0.9, // "for" + 0.8, // "2" + 0.5, // "peo" + 0.9, // "##ple" + 0.8, // [SEP] + 1.0 // [PAD] + }; + std::vector<std::pair<int, int>> token_alignments{ + {-1, -1}, // [CLS] + {0, 4}, // "book" + {5, 6}, // "a" + {6, 7}, // "##t" + {8, 9}, // "4" + {10, 12}, // "pm" + {12, 12}, // [SEP] + {0, 3}, // "Sun" + {3, 6}, // "##day" + {7, 8}, // "?" + {8, 8}, // [SEP] + {0, 4}, // "book" + {5, 8}, // "for" + {9, 11}, // "2" + {12, 15}, // "peo" + {15, 18}, // "##ple" + {18, 18} // [SEP] + }; + std::vector<int> token_turn_ids{ + 0, // [CLS] + 0, // "book" + 0, // "a" + 0, // "##t" + 0, // "4" + 0, // "pm" + 0, // [SEP] + 1, // "Sun" + 1, // "##day" + 1, // "?" + 1, // [SEP] + 2, // "book" + 2, // "for" + 2, // "2" + 2, // "peo" + 2, // "##ple" + 2, // [SEP] + }; + std::vector<int> first_subword_indicators{ + 0, // [CLS] + 1, // "book" + 1, // "a" + 0, // "##t" + 1, // "4" + 1, // "pm" + 0, // [SEP] + 1, // "Sun" + 0, // "##day" + 1, // "?" + 0, // [SEP] + 1, // "book" + 1, // "for" + 1, // "2" + 1, // "peo" + 0, // "##ple" + 0, // [SEP] + }; + // Domain predictions need to be pre-populated. + CluResponse response; + SUPPORT_ASSERT_OK(SlotModulePopulateResponse( + tag_names, tag_scores.data(), token_alignments, token_turn_ids, + first_subword_indicators, /*threshold=*/0.5, + reverse_utterance_list_to_encode, &response)); + ExpectApproximatelyEqual( + response, ParseTextProtoOrDie<CluResponse>(R"pb( + noncategorical_slots { + slot: "time" + extraction: { value: "4 pm" start: 8 end: 12 score: 0.7 } + } + )pb")); +} +} // namespace +} // namespace tflite::task::text::clu
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/test/task/text/clu_lib/tflite_modules_test.cc b/third_party/tflite_support/src/tensorflow_lite_support/cc/test/task/text/clu_lib/tflite_modules_test.cc new file mode 100644 index 0000000..6772d55 --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/test/task/text/clu_lib/tflite_modules_test.cc
@@ -0,0 +1,519 @@ +/* Copyright 2022 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==============================================================================*/ + +#include "tensorflow_lite_support/cc/task/text/clu_lib/tflite_modules.h" + +#include <memory> +#include <string> + +#include "absl/strings/str_split.h" // from @com_google_absl +#include "tensorflow/lite/interpreter.h" +#include "tensorflow/lite/string_util.h" +#include "tensorflow_lite_support/cc/port/default/status_matchers.h" +#include "tensorflow_lite_support/cc/port/gmock.h" +#include "tensorflow_lite_support/cc/port/gtest.h" +#include "tensorflow_lite_support/cc/task/text/clu_lib/tflite_test_utils.h" +#include "tensorflow_lite_support/cc/task/text/proto/bert_clu_annotator_options_proto_inc.h" +#include "tensorflow_lite_support/cc/test/message_matchers.h" +#include "tensorflow_lite_support/cc/test/test_utils.h" +#include "tensorflow_lite_support/cc/text/tokenizers/bert_tokenizer.h" + +namespace tflite::task::text::clu { +namespace { + +using ::testing::ElementsAre; +using ::testing::Pair; +using ::tflite::support::EqualsProto; +using ::tflite::support::proto::TextFormat; +using ::tflite::task::ParseTextProtoOrDie; + +class UtteranceSeqModuleBERTTest : public ::testing::Test { + protected: + void SetUp() override { + interpreter_.AddTensors(3); + utterance_seq_id_feat_t_.reset(interpreter_.tensor(0)); + utterance_mask_feat_t_.reset(interpreter_.tensor(1)); + utterance_segment_id_feat_t_.reset(interpreter_.tensor(2)); + interpreter_.SetInputs({0, 1, 2}); + interpreter_.AllocateTensors(); + max_seq_len_ = 4; + ReallocDynamicTensor<int64_t>({/*batch*/ 1, max_seq_len_}, + utterance_seq_id_feat_t_.get()); + ReallocDynamicTensor<int32_t>({/*batch*/ 1, max_seq_len_}, + utterance_mask_feat_t_.get()); + ReallocDynamicTensor<int64_t>({/*batch*/ 1, max_seq_len_}, + utterance_segment_id_feat_t_.get()); + + const std::vector<std::string> wordpiece_vocab = + absl::StrSplit("[PAD]\n[UNK]\n[CLS]\n[SEP]\nfoo\nbar\nbaz", '\n'); + tokenizer_ = + std::make_unique<tflite::support::text::tokenizer::BertTokenizer>( + wordpiece_vocab); + + options_ = std::make_unique<BertCluAnnotatorOptions>(); + tensor_index_map_ = std::make_unique<TensorIndexMap>(); + tensor_index_map_->token_id_idx = 0; + tensor_index_map_->token_mask_idx = 1; + tensor_index_map_->token_type_id_idx = 2; + + SUPPORT_ASSERT_OK_AND_ASSIGN( + utterance_seq_module_, + UtteranceSeqModule::Create(&interpreter_, tensor_index_map_.get(), + options_.get(), tokenizer_.get())); + } + + tflite::Interpreter interpreter_; + std::unique_ptr<BertCluAnnotatorOptions> options_; + int max_seq_len_; + UniqueTfLiteTensor utterance_seq_id_feat_t_; + UniqueTfLiteTensor utterance_mask_feat_t_; + UniqueTfLiteTensor utterance_segment_id_feat_t_; + std::unique_ptr<AbstractModule> utterance_seq_module_; + std::unique_ptr<tflite::support::text::tokenizer::BertTokenizer> tokenizer_; + std::unique_ptr<TensorIndexMap> tensor_index_map_; +}; + +TEST_F(UtteranceSeqModuleBERTTest, Truncation) { + // Setup. + // In this test, the last token should be truncated. + CluRequest request; + ASSERT_TRUE(TextFormat::ParseFromString(R"pb( + utterances: "foo bar baz" + )pb", + &request)); + Artifacts artifacts; + // Run Test. + SUPPORT_ASSERT_OK(utterance_seq_module_->Preprocess(request, &artifacts)); + // Assertions. + absl::Span<int64_t> output_seq_id(interpreter_.typed_input_tensor<int64_t>(0), + 1 * max_seq_len_); + EXPECT_THAT(output_seq_id, ElementsAre(2, 4, 5, 3)); + absl::Span<int32_t> output_mask(interpreter_.typed_input_tensor<int32_t>(1), + 1 * max_seq_len_); + EXPECT_THAT(output_mask, ElementsAre(1, 1, 1, 1)); + EXPECT_THAT(artifacts.token_alignments, + ElementsAre(Pair(-1, -1), Pair(0, 3), Pair(4, 7), Pair(7, 7))); + EXPECT_THAT(artifacts.token_turn_ids, ElementsAre(0, 0, 0, 0)); + EXPECT_THAT(artifacts.first_subword_indicators, ElementsAre(0, 1, 1, 0)); +} + +TEST_F(UtteranceSeqModuleBERTTest, Padding) { + // Setup. + // In this test, it should be padded with one [PAD] token. + CluRequest request; + ASSERT_TRUE(TextFormat::ParseFromString(R"pb( + utterances: "foo" + )pb", + &request)); + Artifacts artifacts; + // Run Test. + SUPPORT_ASSERT_OK(utterance_seq_module_->Preprocess(request, &artifacts)); + // Assertions. + absl::Span<int64_t> output_seq_id(interpreter_.typed_input_tensor<int64_t>(0), + 1 * max_seq_len_); + EXPECT_THAT(output_seq_id, ElementsAre(2, 4, 3, 0)); + absl::Span<int32_t> output_mask(interpreter_.typed_input_tensor<int32_t>(1), + 1 * max_seq_len_); + EXPECT_THAT(output_mask, ElementsAre(1, 1, 1, 0)); + EXPECT_THAT(artifacts.token_alignments, + ElementsAre(Pair(-1, -1), Pair(0, 3), Pair(3, 3))); + EXPECT_THAT(artifacts.token_turn_ids, ElementsAre(0, 0, 0)); + EXPECT_THAT(artifacts.first_subword_indicators, ElementsAre(0, 1, 0)); +} + +class UtteranceSeqModuleBERTWithHistoryTest : public ::testing::Test { + protected: + void SetUp() override { + interpreter_.AddTensors(3); + utterance_seq_id_feat_t_.reset(interpreter_.tensor(0)); + utterance_mask_feat_t_.reset(interpreter_.tensor(1)); + utterance_segment_id_feat_t_.reset(interpreter_.tensor(2)); + interpreter_.SetInputs({0, 1, 2}); + interpreter_.AllocateTensors(); + max_seq_len_ = 10; + ReallocDynamicTensor<int64_t>({/*batch*/ 1, max_seq_len_}, + utterance_seq_id_feat_t_.get()); + ReallocDynamicTensor<int32_t>({/*batch*/ 1, max_seq_len_}, + utterance_mask_feat_t_.get()); + ReallocDynamicTensor<int64_t>({/*batch*/ 1, max_seq_len_}, + utterance_segment_id_feat_t_.get()); + + options_ = std::make_unique<BertCluAnnotatorOptions>(); + options_->set_max_history_turns(2); + + const std::vector<std::string> wordpiece_vocab = + absl::StrSplit("[PAD]\n[UNK]\n[CLS]\n[SEP]\nfoo\nbar\nbaz", '\n'); + tokenizer_ = + std::make_unique<tflite::support::text::tokenizer::BertTokenizer>( + wordpiece_vocab); + tensor_index_map_ = std::make_unique<TensorIndexMap>(); + tensor_index_map_->token_id_idx = 0; + tensor_index_map_->token_mask_idx = 1; + tensor_index_map_->token_type_id_idx = 2; + SUPPORT_ASSERT_OK_AND_ASSIGN( + utterance_seq_module_, + UtteranceSeqModule::Create(&interpreter_, tensor_index_map_.get(), + options_.get(), tokenizer_.get())); + } + + tflite::Interpreter interpreter_; + std::unique_ptr<BertCluAnnotatorOptions> options_; + int max_seq_len_; + UniqueTfLiteTensor utterance_seq_id_feat_t_; + UniqueTfLiteTensor utterance_mask_feat_t_; + UniqueTfLiteTensor utterance_segment_id_feat_t_; + std::unique_ptr<AbstractModule> utterance_seq_module_; + std::unique_ptr<tflite::support::text::tokenizer::BertTokenizer> tokenizer_; + std::unique_ptr<TensorIndexMap> tensor_index_map_; +}; + +TEST_F(UtteranceSeqModuleBERTWithHistoryTest, Truncation) { + // Setup. + // In this test, the last token should be truncated. + CluRequest request; + ASSERT_TRUE(TextFormat::ParseFromString(R"pb( + utterances: "foo foo" + utterances: "baz baz" + utterances: "bar bar" + utterances: "foo bar baz" + )pb", + &request)); + Artifacts artifacts; + // Run Test. + SUPPORT_ASSERT_OK(utterance_seq_module_->Preprocess(request, &artifacts)); + // Assertions. + absl::Span<int64_t> output_seq_id(interpreter_.typed_input_tensor<int64_t>(0), + 1 * max_seq_len_); + EXPECT_THAT(output_seq_id, ElementsAre(2, 4, 5, 6, 3, 5, 5, 3, 6, 3)); + absl::Span<int32_t> output_mask(interpreter_.typed_input_tensor<int32_t>(1), + 1 * max_seq_len_); + EXPECT_THAT(output_mask, ElementsAre(1, 1, 1, 1, 1, 1, 1, 1, 1, 1)); + absl::Span<int64_t> output_segment_id( + interpreter_.typed_input_tensor<int64_t>(2), 1 * max_seq_len_); + EXPECT_THAT(output_segment_id, ElementsAre(0, 0, 0, 0, 0, 1, 1, 1, 1, 1)); + EXPECT_THAT(artifacts.reverse_utterance_list_to_encode.size(), 3); + EXPECT_THAT(artifacts.token_turn_ids, + ElementsAre(0, 0, 0, 0, 0, 1, 1, 1, 2, 2)); + EXPECT_THAT(artifacts.token_alignments, + ElementsAre(Pair(-1, -1), Pair(0, 3), Pair(4, 7), Pair(8, 11), + Pair(11, 11), Pair(0, 3), Pair(4, 7), Pair(7, 7), + Pair(0, 3), Pair(3, 3))); + EXPECT_THAT(artifacts.first_subword_indicators, + ElementsAre(0, 1, 1, 1, 0, 1, 1, 0, 1, 0)); +} + +TEST_F(UtteranceSeqModuleBERTWithHistoryTest, Padding) { + // Setup. + // In this test, it should be padded with [PAD] tokens. + CluRequest request; + ASSERT_TRUE(TextFormat::ParseFromString(R"pb( + utterances: "foo foo" + utterances: "baz" + utterances: "bar" + utterances: "foo" + )pb", + &request)); + Artifacts artifacts; + // Run Test. + SUPPORT_ASSERT_OK(utterance_seq_module_->Preprocess(request, &artifacts)); + // Assertions. + absl::Span<int64_t> output_seq_id(interpreter_.typed_input_tensor<int64_t>(0), + 1 * max_seq_len_); + EXPECT_THAT(output_seq_id, ElementsAre(2, 4, 3, 5, 3, 6, 3, 0, 0, 0)); + absl::Span<int32_t> output_mask(interpreter_.typed_input_tensor<int32_t>(1), + 1 * max_seq_len_); + EXPECT_THAT(output_mask, ElementsAre(1, 1, 1, 1, 1, 1, 1, 0, 0, 0)); + absl::Span<int64_t> output_segment_id( + interpreter_.typed_input_tensor<int64_t>(2), 1 * max_seq_len_); + EXPECT_THAT(output_segment_id, ElementsAre(0, 0, 0, 1, 1, 1, 1, 0, 0, 0)); + EXPECT_THAT(artifacts.reverse_utterance_list_to_encode.size(), 3); + EXPECT_THAT(artifacts.token_turn_ids, ElementsAre(0, 0, 0, 1, 1, 2, 2)); + EXPECT_THAT(artifacts.token_alignments, + ElementsAre(Pair(-1, -1), Pair(0, 3), Pair(3, 3), Pair(0, 3), + Pair(3, 3), Pair(0, 3), Pair(3, 3))); + EXPECT_THAT(artifacts.first_subword_indicators, + ElementsAre(0, 1, 0, 1, 0, 1, 0)); +} + +TEST(DomainModuleTest, PostProcess) { + // Set up the module and tensor outputs. + tflite::Interpreter interpreter; + UniqueTfLiteTensor domain_tags_t; + UniqueTfLiteTensor domain_confidences_t; + std::unique_ptr<AbstractModule> domain_module; + interpreter.AddTensors(2); + domain_tags_t.reset(interpreter.tensor(0)); + domain_confidences_t.reset(interpreter.tensor(1)); + interpreter.SetOutputs({0, 1}); + interpreter.AllocateTensors(); + const int num_of_domains = 4; + ReallocDynamicTensor<std::string>( + {/*batch*/ 1, /*num_of_domains*/ num_of_domains}, domain_tags_t.get()); + ReallocDynamicTensor<float>({/*batch*/ 1, /*num_of_domains*/ num_of_domains}, + domain_confidences_t.get()); + + tflite::DynamicBuffer buf; + buf.AddString("movies", 6); + buf.AddString("restaurants", 11); + buf.AddString("flights", 7); + buf.AddString("other", 5); + + buf.WriteToTensor(domain_tags_t.get(), nullptr); + std::vector<float> confidences{ + 0.2, // movies + 0.6, // restaurants + 0.1, // flights + 0.1, // other + }; + memcpy(domain_confidences_t->data.raw, confidences.data(), + confidences.size() * sizeof(float)); + + auto options = std::make_unique<BertCluAnnotatorOptions>(); + options->set_domain_threshold(0.5); + auto tensor_index_map = std::make_unique<TensorIndexMap>(); + tensor_index_map->domain_names_idx = 0; + tensor_index_map->domain_scores_idx = 1; + SUPPORT_ASSERT_OK_AND_ASSIGN( + domain_module, DomainModule::Create(&interpreter, tensor_index_map.get(), + options.get())); + + Artifacts artifacts; + CluResponse response; + // Run test. + SUPPORT_ASSERT_OK(domain_module->Postprocess(&artifacts, &response)); + // Assertions. + const auto& expected = ParseTextProtoOrDie<CluResponse>(R"pb( + domains { display_name: "restaurants" score: 0.6 } + )pb"); + EXPECT_THAT(response, EqualsProto(expected)); +} + +TEST(IntentModuleTest, PostProcess) { + // Set up the module and tensor outputs. + tflite::Interpreter interpreter; + UniqueTfLiteTensor intent_tags_t; + UniqueTfLiteTensor intent_confidences_t; + std::unique_ptr<AbstractModule> intent_module; + interpreter.AddTensors(2); + intent_tags_t.reset(interpreter.tensor(0)); + intent_confidences_t.reset(interpreter.tensor(1)); + interpreter.SetOutputs({0, 1}); + interpreter.AllocateTensors(); + const int num_of_intents = 4; + ReallocDynamicTensor<std::string>( + {/*batch*/ 1, /*num_of_intents*/ num_of_intents}, intent_tags_t.get()); + ReallocDynamicTensor<float>({/*batch*/ 1, /*num_of_intents*/ num_of_intents}, + intent_confidences_t.get()); + + tflite::DynamicBuffer buf; + buf.AddString("request(show_date)", 18); + buf.AddString("number_of_seats=2", 17); + buf.AddString("book_restaurant", 15); + buf.AddString("other", 5); + + buf.WriteToTensor(intent_tags_t.get(), nullptr); + std::vector<float> confidences{ + 0.5, // request(show_date) + 0.5, // number_of_seats=2 + 0.7, // book_restaurant + 0.1, // other + }; + memcpy(intent_confidences_t->data.raw, confidences.data(), + confidences.size() * sizeof(float)); + + auto options = std::make_unique<BertCluAnnotatorOptions>(); + + options->set_intent_threshold(0.6); + options->set_categorical_slot_threshold(0.5); + auto tensor_index_map = std::make_unique<TensorIndexMap>(); + tensor_index_map->intent_names_idx = 0; + tensor_index_map->intent_scores_idx = 1; + SUPPORT_ASSERT_OK_AND_ASSIGN( + intent_module, IntentModule::Create(&interpreter, tensor_index_map.get(), + options.get())); + + Artifacts artifacts; + CluResponse response; + // Run test. + SUPPORT_ASSERT_OK(intent_module->Postprocess(&artifacts, &response)); + // Assertions. + const auto& expected = ParseTextProtoOrDie<CluResponse>(R"pb( + intents { display_name: "book_restaurant" score: 0.7 } + categorical_slots { + slot: "number_of_seats" + prediction: { display_name: "2" score: 0.5 } + } + )pb"); + EXPECT_THAT(response, EqualsProto(expected)); +} + +TEST(SlotModuleTest, PostProcess) { + // Set up the module and tensor outputs. + tflite::Interpreter interpreter; + UniqueTfLiteTensor slot_tags_t; + UniqueTfLiteTensor slot_confidences_t; + std::unique_ptr<AbstractModule> slot_module; + interpreter.AddTensors(2); + slot_tags_t.reset(interpreter.tensor(0)); + slot_confidences_t.reset(interpreter.tensor(1)); + interpreter.SetOutputs({0, 1}); + interpreter.AllocateTensors(); + // Assume that the current turn with two history turns (in the reverse + // chronological order): + // current utterance: "[CLS] book a ##t 4 pm [SEP]" + // the last turn: "Sun ##day ? [SEP]" + // the turn before the last: "book for 2 peo ##ple [SEP]" + // + // Note that "at", "Sunday", and "people" are broken into multiple subwords. + // Also assume that max_seq_length of BERT is 18 (with one padding). + const int max_seq_len = 18; + ReallocDynamicTensor<std::string>({/*batch*/ 1, /*max_seq_len*/ max_seq_len}, + slot_tags_t.get()); + ReallocDynamicTensor<float>({/*batch*/ 1, /*max_seq_len*/ max_seq_len}, + slot_confidences_t.get()); + + tflite::DynamicBuffer buf; + buf.AddString("O", 1); // [CLS] + buf.AddString("O", 1); // "book" + buf.AddString("O", 1); // "a" + buf.AddString("B-ok", 4); // "##t" + buf.AddString("B-time", 6); // "4" + buf.AddString("I-time", 6); // "pm" + buf.AddString("O", 1); // [SEP] + buf.AddString("B-date", 6); // "Sun" + buf.AddString("O", 1); // "##day" + buf.AddString("O", 1); // "?" + buf.AddString("O", 1); // [SEP] + buf.AddString("O", 1); // "book" + buf.AddString("O", 1); // "for" + buf.AddString("B-people", 8); // "2" + buf.AddString("I-people", 8); // "peo" + buf.AddString("O", 1); // "##ple" + buf.AddString("O", 1); // "[SEP]" + buf.AddString("O", 1); // "[PAD]" + + buf.WriteToTensor(slot_tags_t.get(), nullptr); + std::vector<float> confidences{ + 1.0, // [CLS] + 0.9, // "book" + 0.8, // "a" + 0.9, // "##t" + 0.7, // "4" + 0.9, // "pm" + 1.0, // [SEP] + 0.8, // "Sun" + 0.9, // "##day" + 0.9, // "?" + 0.7, // [SEP] + 1.0, // "book" + 0.9, // "for" + 0.8, // "2" + 0.5, // "peo" + 0.9, // "##ple" + 0.8, // [SEP] + 1.0 // [PAD] + }; + memcpy(slot_confidences_t->data.raw, confidences.data(), + confidences.size() * sizeof(float)); + + auto options = std::make_unique<BertCluAnnotatorOptions>(); + options->set_noncategorical_slot_threshold(0.5); + options->set_max_history_turns(2); + auto tensor_index_map = std::make_unique<TensorIndexMap>(); + tensor_index_map->slot_names_idx = 0; + tensor_index_map->slot_scores_idx = 1; + SUPPORT_ASSERT_OK_AND_ASSIGN( + slot_module, + SlotModule::Create(&interpreter, tensor_index_map.get(), options.get())); + + // Set up the artifacts. + Artifacts artifacts; + artifacts.reverse_utterance_list_to_encode = std::vector<absl::string_view>{ + "book at 4 pm", + "Sunday?", + "book for 2 people", + }; + artifacts.token_turn_ids = { + 0, // [CLS] + 0, // "book" + 0, // "a" + 0, // "##t" + 0, // "4" + 0, // "pm" + 0, // [SEP] + 1, // "Sun" + 1, // "##day" + 1, // "?" + 1, // [SEP] + 2, // "book" + 2, // "for" + 2, // "2" + 2, // "peo" + 2, // "##ple" + 2, // [SEP] + }; + artifacts.token_alignments = { + {-1, -1}, // [CLS] + {0, 4}, // "book" + {5, 6}, // "a" + {6, 7}, // "##t" + {8, 9}, // "4" + {10, 12}, // "pm" + {12, 12}, // [SEP] + {0, 3}, // "Sun" + {3, 6}, // "##day" + {7, 8}, // "?" + {8, 8}, // [SEP] + {0, 4}, // "book" + {5, 8}, // "for" + {9, 11}, // "2" + {12, 15}, // "peo" + {15, 18}, // "##ple" + {18, 18} // [SEP] + }; + artifacts.first_subword_indicators = { + 0, // [CLS] + 1, // "book" + 1, // "a" + 0, // "##t" + 1, // "4" + 1, // "pm" + 0, // [SEP] + 1, // "Sun" + 0, // "##day" + 1, // "?" + 0, // [SEP] + 1, // "book" + 1, // "for" + 1, // "2" + 1, // "peo" + 0, // "##ple" + 0, // [SEP] + }; + CluResponse response; + // Run test. + SUPPORT_ASSERT_OK(slot_module->Postprocess(&artifacts, &response)); + // Assertions. + const auto& expected = ParseTextProtoOrDie<CluResponse>(R"pb( + noncategorical_slots { + slot: "time" + extraction: { value: "4 pm" start: 8 end: 12 score: 0.7 } + } + )pb"); + EXPECT_THAT(response, EqualsProto(expected)); +} + +} // namespace +} // namespace tflite::task::text::clu
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/test/testdata/task/audio/BUILD b/third_party/tflite_support/src/tensorflow_lite_support/cc/test/testdata/task/audio/BUILD new file mode 100644 index 0000000..3fb72e82 --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/test/testdata/task/audio/BUILD
@@ -0,0 +1,18 @@ +package( + default_visibility = ["//tensorflow_lite_support:internal"], + licenses = ["notice"], # Apache 2.0 +) + +filegroup( + name = "test_models", + srcs = glob([ + "*.tflite", + ]), +) + +filegroup( + name = "test_audio_clips", + srcs = glob([ + "*.wav", + ]), +)
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/test/testdata/task/audio/model_without_metadata.tflite b/third_party/tflite_support/src/tensorflow_lite_support/cc/test/testdata/task/audio/model_without_metadata.tflite new file mode 100644 index 0000000..3e41f193 --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/test/testdata/task/audio/model_without_metadata.tflite Binary files differ
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/test/testdata/task/audio/speech.wav b/third_party/tflite_support/src/tensorflow_lite_support/cc/test/testdata/task/audio/speech.wav new file mode 100644 index 0000000..8d64730 --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/test/testdata/task/audio/speech.wav Binary files differ
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/test/testdata/task/audio/two_heads.tflite b/third_party/tflite_support/src/tensorflow_lite_support/cc/test/testdata/task/audio/two_heads.tflite new file mode 100644 index 0000000..92e6272 --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/test/testdata/task/audio/two_heads.tflite Binary files differ
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/test/testdata/task/audio/two_heads.wav b/third_party/tflite_support/src/tensorflow_lite_support/cc/test/testdata/task/audio/two_heads.wav new file mode 100644 index 0000000..8a3785f --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/test/testdata/task/audio/two_heads.wav Binary files differ
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/test/testdata/task/audio/yamnet_audio_classifier_with_metadata.tflite b/third_party/tflite_support/src/tensorflow_lite_support/cc/test/testdata/task/audio/yamnet_audio_classifier_with_metadata.tflite new file mode 100644 index 0000000..76e8627 --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/test/testdata/task/audio/yamnet_audio_classifier_with_metadata.tflite Binary files differ
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/test/testdata/task/audio/yamnet_audio_classifier_with_metadata_edgetpu.tflite b/third_party/tflite_support/src/tensorflow_lite_support/cc/test/testdata/task/audio/yamnet_audio_classifier_with_metadata_edgetpu.tflite new file mode 100644 index 0000000..4df16bb --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/test/testdata/task/audio/yamnet_audio_classifier_with_metadata_edgetpu.tflite Binary files differ
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/test/testdata/task/audio/yamnet_embedding_metadata.tflite b/third_party/tflite_support/src/tensorflow_lite_support/cc/test/testdata/task/audio/yamnet_embedding_metadata.tflite new file mode 100644 index 0000000..5efa5a0c --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/test/testdata/task/audio/yamnet_embedding_metadata.tflite Binary files differ
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/examples/task/audio/desktop/audio_classifier_demo.cc b/third_party/tflite_support/src/tensorflow_lite_support/examples/task/audio/desktop/audio_classifier_demo.cc index 6339ed7..904673a9 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/examples/task/audio/desktop/audio_classifier_demo.cc +++ b/third_party/tflite_support/src/tensorflow_lite_support/examples/task/audio/desktop/audio_classifier_demo.cc
@@ -24,7 +24,7 @@ #include <iostream> #include <limits> -#include "absl/flags/flag.h" // from @com_google_absl +#include "absl/flags/flag.h" // from @com_google_absl #include "absl/flags/parse.h" // from @com_google_absl #include "tensorflow_lite_support/examples/task/audio/desktop/audio_classifier_lib.h"
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/ios/BUILD b/third_party/tflite_support/src/tensorflow_lite_support/ios/BUILD index b1e6c4c..6e326480 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/ios/BUILD +++ b/third_party/tflite_support/src/tensorflow_lite_support/ios/BUILD
@@ -23,10 +23,15 @@ "//tensorflow_lite_support/c/task/text:nl_classifier_common.h", "//tensorflow_lite_support/c/task/text:bert_question_answerer.h", "//tensorflow_lite_support/c/task/vision:image_classifier.h", + "//tensorflow_lite_support/c/task/vision:object_detector.h", + "//tensorflow_lite_support/c/task/vision:image_segmenter.h", "//tensorflow_lite_support/c/task/processor:bounding_box.h", "//tensorflow_lite_support/c/task/vision/core:frame_buffer.h", "//tensorflow_lite_support/c/task/processor:classification_result.h", + "//tensorflow_lite_support/c/task/processor:detection_result.h", + "//tensorflow_lite_support/c/task/processor:segmentation_result.h", "//tensorflow_lite_support/c/task/processor:classification_options.h", + "//tensorflow_lite_support/c/task/processor:category.h", "//tensorflow_lite_support/c/task/core:base_options.h", "//tensorflow_lite_support/c:common.h", ], @@ -66,17 +71,24 @@ hdrs = [ ":base_options.h", ":bounding_box.h", + ":category.h", ":classification_options.h", ":classification_result.h", ":common.h", + ":detection_result.h", ":frame_buffer.h", ":image_classifier.h", + ":image_segmenter.h", + ":object_detector.h", + ":segmentation_result.h", ], allowlist_symbols_file = ":allowlist_TensorFlowLiteTaskVision.txt", bundle_name = "TensorFlowLiteTaskVisionC", minimum_os_version = TFL_MINIMUM_OS_VERSION, deps = [ "//tensorflow_lite_support/c/task/vision:image_classifier", + "//tensorflow_lite_support/c/task/vision:image_segmenter", + "//tensorflow_lite_support/c/task/vision:object_detector", ], )
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/ios/task/processor/BUILD b/third_party/tflite_support/src/tensorflow_lite_support/ios/task/processor/BUILD index 01e06225..4476b34 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/ios/task/processor/BUILD +++ b/third_party/tflite_support/src/tensorflow_lite_support/ios/task/processor/BUILD
@@ -54,6 +54,14 @@ ) objc_library( + name = "TFLSegmentationResult", + hdrs = [ + "sources/TFLSegmentationResult.h", + ], + module_name = "TFLSegmentationResult", +) + +objc_library( name = "TFLClassificationOptionsHelpers", srcs = [ "sources/TFLClassificationOptions+Helpers.m", @@ -116,3 +124,15 @@ "//tensorflow_lite_support/ios/task/processor:TFLDetectionResult", ], ) + +objc_library( + name = "TFLSegmentationResultHelpers", + hdrs = [ + "sources/TFLSegmentationResult+Helpers.h", + ], + module_name = "TFLSegmentationResultHelpers", + deps = [ + "//tensorflow_lite_support/c/task/processor:segmentation_result", + "//tensorflow_lite_support/ios/task/processor:TFLSegmentationResult", + ], +)
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/ios/task/processor/sources/TFLSegmentationResult+Helpers.h b/third_party/tflite_support/src/tensorflow_lite_support/ios/task/processor/sources/TFLSegmentationResult+Helpers.h new file mode 100644 index 0000000..0a85efe --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/ios/task/processor/sources/TFLSegmentationResult+Helpers.h
@@ -0,0 +1,35 @@ +/* Copyright 2022 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ==============================================================================*/ +#include "tensorflow_lite_support/c/task/processor/segmentation_result.h" +#import "tensorflow_lite_support/ios/task/processor/sources/TFLSegmentationResult.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface TFLSegmentationResult (Helpers) +/** + * Creates and retrurns a TFLSegmentationResult from a TFLSegmentationResult + * returned by TFLite Task C Library Image Segmentation task. + * + * @param cSegmentationResult Segmentation results returned by TFLite Task + * C Library Image Segmentation task. + * + * @return Segmentation Result of type TFLSegmentationResult to be returned by + * inference methods of the iOS TF Lite Task Image Segmentation task. + */ ++ (TFLSegmentationResult*)segmentationResultWithCResult: + (TfLiteSegmentationResult*)cSegmentationResult; +@end + +NS_ASSUME_NONNULL_END
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/ios/task/processor/sources/TFLSegmentationResult.h b/third_party/tflite_support/src/tensorflow_lite_support/ios/task/processor/sources/TFLSegmentationResult.h new file mode 100644 index 0000000..f75aed5 --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/ios/task/processor/sources/TFLSegmentationResult.h
@@ -0,0 +1,130 @@ +/* Copyright 2022 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ==============================================================================*/ +#import <Foundation/Foundation.h> + +NS_ASSUME_NONNULL_BEGIN + +/** Holds a confidence mask belonging to a single class and its meta data. */ +@interface TFLConfidenceMask : NSObject + +/** + * Confidence masks of size `width` x `height` for any one class. + */ +@property(nonatomic, assign) float* mask; + +/** + * The width of the mask. This is an intrinsic parameter of the model being + * used, and does not depend on the input image dimensions. + */ +@property(nonatomic, assign) NSInteger width; + +/** + * The height of the mask. This is an intrinsic parameter of the model being + * used, and does not depend on the input image dimensions. + */ +@property(nonatomic, assign) NSInteger height; + +@end + +/** Holds category mask and its metadata. */ +@interface TFLCategoryMask : NSObject + +/** + * Flattened 2D-array of size `width` x `height`, in row major order. + * The value of each pixel in this mask represents the class to which the + * pixel belongs. + */ +@property(nonatomic, assign) UInt8* mask; + +/** + * The width of the mask. This is an intrinsic parameter of the model being + * used, and does not depend on the input image dimensions. + */ +@property(nonatomic, assign) NSInteger width; + +/** + * The height of the mask. This is an intrinsic parameter of the model being + * used, and does not depend on the input image dimensions. + */ +@property(nonatomic, assign) NSInteger height; + +@end + +/** Holds a label associated with an RGB color, for display purposes. */ +@interface TFLColoredLabel : NSObject + +/** The RGB color components for the label, in the [0, 255] range. */ +@property(nonatomic, assign) NSUInteger r; +@property(nonatomic, assign) NSUInteger g; +@property(nonatomic, assign) NSUInteger b; + +/** The class name, as provided in the label map packed in the TFLite Model + * Metadata. + */ +@property(nonatomic, copy) NSString* label; + +/** The display name, as provided in the label map (if available) packed in + * the TFLite Model Metadata. See `display_names_locale` field in + * ImageSegmenterOptions. + */ +@property(nonatomic, copy) NSString* displayName; + +@end + +/** Encapsulates a resulting segmentation mask and associated metadata. */ +@interface TFLSegmentation : NSObject + +/** + * Array of confidence masks where each element is a confidence mask of size + * `width` x `height`, one for each of the supported classes. + * The value of each pixel in these masks represents the confidence score for + * this particular class. + * This property is mutually exclusive with `categoryMask`. + */ +@property(nonatomic, copy, nullable) + NSArray<TFLConfidenceMask*>* confidenceMasks; + +/** Holds the category mask . + * The value of each pixel in this mask represents the class to which the + * pixel belongs. + * This property is mutually exclusive with `confidenceMasks`. + */ +@property(nonatomic, copy, nullable) TFLCategoryMask* categoryMask; + +/** + * The list of colored labels for all the supported categories (classes). + * Depending on which is present, this list is in 1:1 correspondence with: + * `category_mask` pixel values, i.e. a pixel with value `i` is associated with + * `colored_labels[i]`, `confidence_masks` indices, i.e. `confidence_masks[i]` + * is associated with `colored_labels[i]`. + */ +@property(nonatomic, copy) NSArray<TFLColoredLabel*>* coloredLabels; + +@end + +/** Encapsulates results of any image segmentation task. */ +@interface TFLSegmentationResult : NSObject + +/** Array of segmentations returned after inference by model. + * Note that at the time, this array is expected to have a single + * `TfLiteSegmentation`; the field is made an array for later extension to + * e.g. instance segmentation models, which may return one segmentation per + * object. + */ +@property(nonatomic, copy) NSArray<TFLSegmentation*>* segmentations; + +@end + +NS_ASSUME_NONNULL_END
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/ios/task/vision/BUILD b/third_party/tflite_support/src/tensorflow_lite_support/ios/task/vision/BUILD index bc6bc2c..1f01e1c 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/ios/task/vision/BUILD +++ b/third_party/tflite_support/src/tensorflow_lite_support/ios/task/vision/BUILD
@@ -46,3 +46,16 @@ "//tensorflow_lite_support/ios/task/vision/utils:GMLImageUtils", ], ) + +objc_library( + name = "TFLImageSegmenter", + hdrs = [ + "sources/TFLImageSegmenter.h", + ], + module_name = "TFLImageSegmenter", + deps = [ + "//tensorflow_lite_support/ios/task/core:TFLBaseOptions", + "//tensorflow_lite_support/ios/task/processor:TFLSegmentationResult", + "//tensorflow_lite_support/ios/task/vision/utils:GMLImageUtils", + ], +)
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/ios/task/vision/sources/TFLImageSegmenter.h b/third_party/tflite_support/src/tensorflow_lite_support/ios/task/vision/sources/TFLImageSegmenter.h new file mode 100644 index 0000000..eb0d5658 --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/ios/task/vision/sources/TFLImageSegmenter.h
@@ -0,0 +1,122 @@ +/* Copyright 2022 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ==============================================================================*/ +#import <Foundation/Foundation.h> +#import "tensorflow_lite_support/ios/task/core/sources/TFLBaseOptions.h" +#import "tensorflow_lite_support/ios/task/processor/sources/TFLSegmentationResult.h" +#import "tensorflow_lite_support/odml/ios/image/apis/GMLImage.h" + +NS_ASSUME_NONNULL_BEGIN + +/** + * Specifies the type of output segmentation mask to be returned as a result + * of the image segmentation operation. This allows specifying the type of + * post-processing to perform on the raw model results + * + * @seealso TfLiteSegmentationResult for more. + */ +typedef NS_ENUM(NSUInteger, TFLOutputType) { + /** Unspecified output type. */ + TFLUnspecifiedOutputType, + + /** + * Gives a single output mask where each pixel represents the class which + * the pixel in the original image was predicted to belong to. + */ + TFLCategoryMaskOutputType, + + /** + * Gives a list of output masks where, for each mask, each pixel represents + * the prediction confidence, usually in the [0, 1] range. + */ + TFLConfidenceMasksOutputType, + +}; + +/** + * Options to configure TFLImageSegmenter. + */ +@interface TFLImageSegmenterOptions : NSObject + +/** + * Base options that is used for creation of any type of task. + * @seealso TFLBaseOptions + */ +@property(nonatomic, copy) TFLBaseOptions* baseOptions; + +/** + * Specifies the type of output segmentation mask to be returned as a result + * of the image segmentation operation. + * @seealso TFLOutputType + */ +@property(nonatomic, assign) TFLOutputType outputType; + +/** Display names local for display names*/ +@property(nonatomic, copy) NSString* displayNamesLocale; + +/** + * Initializes TFLImageSegmenterOptions with the model path set to the specified + * path to a model file. + * @description The external model file, must be a single standalone TFLite + * file. It could be packed with TFLite Model Metadata[1] and associated files + * if exist. Fail to provide the necessary metadata and associated files might + * result in errors. Check the + * [documentation](https://www.tensorflow.org/lite/convert/metadata) for each + * task about the specific requirement. + * + * @param modelPath Path to a TFLite model file. + * + * @return An instance of TFLImageSegmenterOptions set to the specified + * modelPath. + */ +- (nullable instancetype)initWithModelPath:(nonnull NSString*)modelPath; + +@end + +@interface TFLImageSegmenter : NSObject + +/** + * Creates TFLImageSegmenter from a model file and specified options . + * + * @param options TFLImageSegmenterOptions instance with the necessary + * properties set. + * + * @return A TFLImageSegmenter instance. + */ ++ (nullable instancetype)imageSegmenterWithOptions: + (nonnull TFLImageSegmenterOptions*)options + error:(NSError**)error + NS_SWIFT_NAME(imageSegmenter(options:)); + +/** + * Performs image segmentation on a GMLImage input, returns the segmentation + * results. + * + * @param image input to the model. + * + * @return Segmentation Result of type TFLSegmentationResult holds the + * segmentation masks returned by the image segmentation task. + */ +- (nullable TFLSegmentationResult*)segmentWithGMLImage:(GMLImage*)image + error: + (NSError* _Nullable*)error + NS_SWIFT_NAME(segment(gmlImage:)); + +- (instancetype)init NS_UNAVAILABLE; + ++ (instancetype)new NS_UNAVAILABLE; + +@end + +NS_ASSUME_NONNULL_END
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_version.cc b/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_version.cc index 2e2f2fa..52f9335 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_version.cc +++ b/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_version.cc
@@ -22,8 +22,8 @@ #include <string> #include <vector> -#include "absl/strings/str_join.h" // from @com_google_absl -#include "absl/strings/str_split.h" // from @com_google_absl +#include "absl/strings/str_join.h" // from @com_google_absl +#include "absl/strings/str_split.h" // from @com_google_absl #include "flatbuffers/flatbuffers.h" // from @flatbuffers #include "tensorflow/lite/c/common.h" #include "tensorflow/lite/kernels/internal/compatibility.h" @@ -46,6 +46,7 @@ kSubGraphMetadataOutputTensorGroups = 6, kProcessUnitOptionsRegexTokenizerOptions = 7, kContentPropertiesAudioProperties = 8, + kAssociatedFileTypeScannIndexFile = 9, }; // Helper class to compare semantic versions in terms of three integers, major, @@ -110,6 +111,8 @@ return Version(1, 2, 1); case SchemaMembers::kContentPropertiesAudioProperties: return Version(1, 3, 0); + case SchemaMembers::kAssociatedFileTypeScannIndexFile: + return Version(1, 4, 0); default: // Should never happen. TFLITE_LOG(FATAL) << "Unsupported schema member: " @@ -154,6 +157,12 @@ GetMemberVersion(SchemaMembers::kAssociatedFileTypeVocabulary), min_version); } + + if (table->type() == AssociatedFileType_SCANN_INDEX_FILE) { + UpdateMinimumVersion( + GetMemberVersion(SchemaMembers::kAssociatedFileTypeScannIndexFile), + min_version); + } } template <>
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/metadata/java/src/java/org/tensorflow/lite/support/metadata/MetadataParser.java b/third_party/tflite_support/src/tensorflow_lite_support/metadata/java/src/java/org/tensorflow/lite/support/metadata/MetadataParser.java index 20f5566..1dbf9eb 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/metadata/java/src/java/org/tensorflow/lite/support/metadata/MetadataParser.java +++ b/third_party/tflite_support/src/tensorflow_lite_support/metadata/java/src/java/org/tensorflow/lite/support/metadata/MetadataParser.java
@@ -21,7 +21,7 @@ * The version of the metadata parser that this metadata extractor library is depending on. The * value should match the value of "Schema Semantic version" in metadata_schema.fbs. */ - public static final String VERSION = "1.3.0"; + public static final String VERSION = "1.4.0"; private MetadataParser() {} }
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/metadata/metadata_schema.fbs b/third_party/tflite_support/src/tensorflow_lite_support/metadata/metadata_schema.fbs index e0b95af..5b3cea5 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/metadata/metadata_schema.fbs +++ b/third_party/tflite_support/src/tensorflow_lite_support/metadata/metadata_schema.fbs
@@ -70,6 +70,7 @@ // Added output_tensor_group to SubGraphMetadata. // 1.2.1 - Added RegexTokenizerOptions to ProcessUnitOptions. // 1.3.0 - Added AudioProperties to ContentProperties. +// 1.4.0 - Added SCANN_INDEX_FILE type to AssociatedFileType. // File extension of any written files. file_extension "tflitemeta"; @@ -141,6 +142,12 @@ // [1]: https://github.com/tensorflow/tflite-support/blob/master/tensorflow_lite_support/metadata/python/tests/testdata/nl_classifier/vocab.txt // Added in: 1.0.1 VOCABULARY = 5, + + // TODO(b/222351186): introduce the ScaNN index file with links once the code + // is released. + // Contains on-devide ScaNN index file with LevelDB format. + // Added in: 1.4.0 + SCANN_INDEX_FILE = 6, } table AssociatedFile {
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/metadata/python/metadata.py b/third_party/tflite_support/src/tensorflow_lite_support/metadata/python/metadata.py index a312974..689ddb3 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/metadata/python/metadata.py +++ b/third_party/tflite_support/src/tensorflow_lite_support/metadata/python/metadata.py
@@ -348,7 +348,7 @@ associated files. """ # Load the model metadata from src_model_buf if exist. - metadata_buffer = _get_metadata_buffer(src_model_buf) + metadata_buffer = get_metadata_buffer(src_model_buf) if metadata_buffer: self.load_metadata_buffer(metadata_buffer) @@ -730,7 +730,7 @@ """ if not model_buffer: raise ValueError("model_buffer cannot be empty.") - metadata_buffer = _get_metadata_buffer(model_buffer) + metadata_buffer = get_metadata_buffer(model_buffer) if not metadata_buffer: raise ValueError("The model does not have metadata.") associated_file_list = cls._parse_packed_associted_file_list(model_buffer) @@ -843,7 +843,7 @@ " be a valid TFLite Metadata.") -def _get_metadata_buffer(model_buf): +def get_metadata_buffer(model_buf): """Returns the metadata in the model file as a buffer. Args:
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/odml/ios/image/apis/GMLImage.h b/third_party/tflite_support/src/tensorflow_lite_support/odml/ios/image/apis/GMLImage.h index 18797d8..0c49491 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/odml/ios/image/apis/GMLImage.h +++ b/third_party/tflite_support/src/tensorflow_lite_support/odml/ios/image/apis/GMLImage.h
@@ -19,8 +19,8 @@ NS_ASSUME_NONNULL_BEGIN /** Types of image sources. */ -typedef NSInteger GMLImageSourceType - NS_TYPED_ENUM NS_SWIFT_NAME(MLImageSourceType); +typedef NSInteger GMLImageSourceType NS_TYPED_ENUM + NS_SWIFT_NAME(MLImageSourceType); /** Image source is a `UIImage`. */ static const GMLImageSourceType GMLImageSourceTypeImage = 0; /** Image source is a `CVPixelBuffer`. */
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/odml/java/image/third_party_licenses/BUILD b/third_party/tflite_support/src/tensorflow_lite_support/odml/java/image/third_party_licenses/BUILD index b3c4abbc..4b75bc0 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/odml/java/image/third_party_licenses/BUILD +++ b/third_party/tflite_support/src/tensorflow_lite_support/odml/java/image/third_party_licenses/BUILD
@@ -59,7 +59,7 @@ "JSR 250": "third_party/java/jsr250_annotations/LICENSE", "JSR 305": "third_party/java/jsr305_annotations/LICENSE", "JSpecify": "third_party/java/jspecify_annotations/LICENSE", - "JsInterop Annotations": "third_party/java_src/jsinterop_annotations/java/jsinterop/annotations/LICENSE", + "JsInterop Annotations": "third_party/java_src/jsinterop_annotations/LICENSE", "TensorFlow Lite Support": "third_party/tensorflow_lite_support/LICENSE", "Kotlin": "third_party/kotlin/kotlin/LICENSE", },
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/python/task/core/BUILD b/third_party/tflite_support/src/tensorflow_lite_support/python/task/core/BUILD index ba30e5c..5d09409 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/python/task/core/BUILD +++ b/third_party/tflite_support/src/tensorflow_lite_support/python/task/core/BUILD
@@ -9,3 +9,13 @@ name = "task_options", srcs = ["task_options.py"], ) + +py_library( + name = "task_utils", + srcs = ["task_utils.py"], + deps = [ + ":task_options", + "//tensorflow_lite_support/cc/task/core/proto:base_options_py_pb2", + "//tensorflow_lite_support/python/task/core/proto:configuration_pb2", + ], +)
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/python/task/core/task_options.py b/third_party/tflite_support/src/tensorflow_lite_support/python/task/core/task_options.py index 69be1f3..cc8257e 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/python/task/core/task_options.py +++ b/third_party/tflite_support/src/tensorflow_lite_support/python/task/core/task_options.py
@@ -15,7 +15,7 @@ import dataclasses -from typing import Optional +from typing import Any, Optional @dataclasses.dataclass @@ -37,6 +37,23 @@ # The path to the file to open and mmap in memory. file_name: Optional[str] = None + def __eq__(self, other: Any) -> bool: + if self is other: + return True + + if not isinstance(other, self.__class__): + return False + + if self.file_name is not None and self.file_name == other.file_name: + return True + + if (self.file_content is not None and other.file_content is not None and + len(self.file_content) == len(other.file_content) and + self.file_content == other.file_content): + return True + + return False + @dataclasses.dataclass class BaseOptions: @@ -55,3 +72,9 @@ # If true, inference will be delegated to a connected Coral Edge TPU device. use_coral: bool = False + + def __eq__(self, other: Any) -> bool: + return (isinstance(other, self.__class__) and + self.model_file == other.model_file and + self.num_threads == other.num_threads and + self.use_coral == other.use_coral)
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/python/task/core/task_utils.py b/third_party/tflite_support/src/tensorflow_lite_support/python/task/core/task_utils.py new file mode 100644 index 0000000..f28facf --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/python/task/core/task_utils.py
@@ -0,0 +1,50 @@ +# Copyright 2021 The TensorFlow Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""Utils functions used in Task Python API.""" + +from tensorflow_lite_support.cc.task.core.proto import base_options_pb2 +from tensorflow_lite_support.python.task.core import task_options +from tensorflow_lite_support.python.task.core.proto import configuration_pb2 + +_ProtoBaseOptions = base_options_pb2.BaseOptions + + +def ConvertToProtoBaseOptions( + options: task_options.BaseOptions) -> _ProtoBaseOptions: + """Convert the Python BaseOptions to Proto BaseOptions. + + Python BaseOptions is a subset of the Proto BaseOptions that strips off + configurations that are useless in Python development. + + Args: + options: the Python BaseOptions object. + + Returns: + The Proto BaseOptions object. + """ + proto_options = _ProtoBaseOptions() + + if options.model_file.file_content: + proto_options.model_file.file_content = options.model_file.file_content + elif options.model_file.file_name: + proto_options.model_file.file_name = options.model_file.file_name + + proto_options.compute_settings.tflite_settings.cpu_settings.num_threads = ( + options.num_threads) + + if options.use_coral: + proto_options.compute_settings.tflite_settings.delegate = ( + configuration_pb2.Delegate.EDGETPU_CORAL) + + return proto_options
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/python/task/processor/proto/BUILD b/third_party/tflite_support/src/tensorflow_lite_support/python/task/processor/proto/BUILD index 31c5b6c..1a06edb 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/python/task/processor/proto/BUILD +++ b/third_party/tflite_support/src/tensorflow_lite_support/python/task/processor/proto/BUILD
@@ -22,3 +22,43 @@ srcs = ["bounding_box_pb2.py"], deps = ["//tensorflow_lite_support/cc/task/vision/proto:bounding_box_py_pb2"], ) + +py_library( + name = "class_pb2", + srcs = ["class_pb2.py"], + deps = [ + "//tensorflow_lite_support/cc/task/vision/proto:class_py_pb2", + ], +) + +py_library( + name = "classifications_pb2", + srcs = ["classifications_pb2.py"], + deps = [ + "//tensorflow_lite_support/cc/task/vision/proto:classifications_py_pb2", + ], +) + +py_library( + name = "classification_options_pb2", + srcs = ["classification_options_pb2.py"], + deps = [ + "//tensorflow_lite_support/cc/task/processor/proto:classification_options_py_pb2", + ], +) + +py_library( + name = "detections_pb2", + srcs = ["detections_pb2.py"], + deps = [ + "//tensorflow_lite_support/cc/task/vision/proto:detections_py_pb2", + ], +) + +py_library( + name = "detection_options_pb2", + srcs = ["detection_options_pb2.py"], + deps = [ + "//tensorflow_lite_support/cc/task/processor/proto:detection_options_py_pb2", + ], +)
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/python/task/processor/proto/class_pb2.py b/third_party/tflite_support/src/tensorflow_lite_support/python/task/processor/proto/class_pb2.py new file mode 100644 index 0000000..bc49373f --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/python/task/processor/proto/class_pb2.py
@@ -0,0 +1,18 @@ +# Copyright 2022 The TensorFlow Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""Class protobuf.""" + +from tensorflow_lite_support.cc.task.vision.proto import class_pb2 + +Category = class_pb2.Class
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/python/task/processor/proto/classification_options_pb2.py b/third_party/tflite_support/src/tensorflow_lite_support/python/task/processor/proto/classification_options_pb2.py new file mode 100644 index 0000000..f346d405 --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/python/task/processor/proto/classification_options_pb2.py
@@ -0,0 +1,18 @@ +# Copyright 2022 The TensorFlow Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""Classification options protobuf.""" + +from tensorflow_lite_support.cc.task.processor.proto import classification_options_pb2 + +ClassificationOptions = classification_options_pb2.ClassificationOptions
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/python/task/processor/proto/classifications_pb2.py b/third_party/tflite_support/src/tensorflow_lite_support/python/task/processor/proto/classifications_pb2.py new file mode 100644 index 0000000..c0466344 --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/python/task/processor/proto/classifications_pb2.py
@@ -0,0 +1,19 @@ +# Copyright 2022 The TensorFlow Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""Classifications protobuf.""" + +from tensorflow_lite_support.cc.task.vision.proto import classifications_pb2 + +Classifications = classifications_pb2.Classifications +ClassificationResult = classifications_pb2.ClassificationResult
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/python/task/processor/proto/detection_options_pb2.py b/third_party/tflite_support/src/tensorflow_lite_support/python/task/processor/proto/detection_options_pb2.py new file mode 100644 index 0000000..3a98a48 --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/python/task/processor/proto/detection_options_pb2.py
@@ -0,0 +1,18 @@ +# Copyright 2022 The TensorFlow Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""Detection options protobuf.""" + +from tensorflow_lite_support.cc.task.processor.proto import detection_options_pb2 + +DetectionOptions = detection_options_pb2.DetectionOptions
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/python/task/processor/proto/detections_pb2.py b/third_party/tflite_support/src/tensorflow_lite_support/python/task/processor/proto/detections_pb2.py new file mode 100644 index 0000000..e090df8 --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/python/task/processor/proto/detections_pb2.py
@@ -0,0 +1,19 @@ +# Copyright 2022 The TensorFlow Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""Detections protobuf.""" + +from tensorflow_lite_support.cc.task.vision.proto import detections_pb2 + +Detection = detections_pb2.Detection +DetectionResult = detections_pb2.DetectionResult
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/python/task/text/BUILD b/third_party/tflite_support/src/tensorflow_lite_support/python/task/text/BUILD new file mode 100644 index 0000000..5bdf1e22 --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/python/task/text/BUILD
@@ -0,0 +1,22 @@ +# Placeholder for internal Python strict library compatibility macro. + +package( + default_visibility = ["//tensorflow_lite_support:internal"], + licenses = ["notice"], # Apache 2.0 +) + +py_library( + name = "text_embedder", + srcs = [ + "text_embedder.py", + ], + visibility = ["//visibility:public"], + deps = [ + "//tensorflow_lite_support/python/task/core:task_options", + "//tensorflow_lite_support/python/task/core:task_utils", + "//tensorflow_lite_support/python/task/processor/proto:embedding_options_pb2", + "//tensorflow_lite_support/python/task/processor/proto:embeddings_pb2", + "//tensorflow_lite_support/python/task/text/pybinds:_pywrap_text_embedder", + "//tensorflow_lite_support/python/task/text/pybinds:text_embedder_options_pb2", + ], +)
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/python/task/text/__init__.py b/third_party/tflite_support/src/tensorflow_lite_support/python/task/text/__init__.py new file mode 100644 index 0000000..2512420 --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/python/task/text/__init__.py
@@ -0,0 +1,13 @@ +# Copyright 2022 The TensorFlow Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License.
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/python/task/text/pybinds/BUILD b/third_party/tflite_support/src/tensorflow_lite_support/python/task/text/pybinds/BUILD new file mode 100644 index 0000000..577459a --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/python/task/text/pybinds/BUILD
@@ -0,0 +1,29 @@ +# Placeholder for internal Python strict library compatibility macro. +load("@org_tensorflow//tensorflow:tensorflow.bzl", "pybind_extension") + +package( + default_visibility = [ + "//tensorflow_lite_support:internal", + ], + licenses = ["notice"], # Apache 2.0 +) + +py_library( + name = "text_embedder_options_pb2", + srcs = ["text_embedder_options_pb2.py"], + deps = ["//tensorflow_lite_support/cc/task/text/proto:text_embedder_options_py_pb2"], +) + +pybind_extension( + name = "_pywrap_text_embedder", + srcs = [ + "_pywrap_text_embedder.cc", + ], + module_name = "_pywrap_text_embedder", + deps = [ + "//tensorflow_lite_support/cc/task/text:text_embedder", + "@pybind11", + "@pybind11_abseil//pybind11_abseil:status_casters", + "@pybind11_protobuf//pybind11_protobuf:native_proto_caster", + ], +)
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/python/task/text/pybinds/text_embedder_options_pb2.py b/third_party/tflite_support/src/tensorflow_lite_support/python/task/text/pybinds/text_embedder_options_pb2.py new file mode 100644 index 0000000..ccbe7a2 --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/python/task/text/pybinds/text_embedder_options_pb2.py
@@ -0,0 +1,18 @@ +# Copyright 2021 The TensorFlow Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""TextEmbedderOptions protobuf.""" + +from tensorflow_lite_support.cc.task.text.proto import text_embedder_options_pb2 + +TextEmbedderOptions = text_embedder_options_pb2.TextEmbedderOptions
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/python/task/text/text_embedder.py b/third_party/tflite_support/src/tensorflow_lite_support/python/task/text/text_embedder.py new file mode 100644 index 0000000..7969cf3 --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/python/task/text/text_embedder.py
@@ -0,0 +1,131 @@ +# Copyright 2022 The TensorFlow Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""Text embedder task.""" + +import dataclasses +from typing import Any, Optional + +from tensorflow_lite_support.python.task.core import task_options +from tensorflow_lite_support.python.task.core import task_utils +from tensorflow_lite_support.python.task.processor.proto import embedding_options_pb2 +from tensorflow_lite_support.python.task.processor.proto import embeddings_pb2 +from tensorflow_lite_support.python.task.text.pybinds import _pywrap_text_embedder +from tensorflow_lite_support.python.task.text.pybinds import text_embedder_options_pb2 + +_ProtoTextEmbedderOptions = text_embedder_options_pb2.TextEmbedderOptions +_CppTextEmbedder = _pywrap_text_embedder.TextEmbedder + + +@dataclasses.dataclass +class TextEmbedderOptions: + """Options for the text embedder task.""" + base_options: task_options.BaseOptions + embedding_options: Optional[embedding_options_pb2.EmbeddingOptions] = None + + def __eq__(self, other: Any) -> bool: + if (not isinstance(other, self.__class__) or + self.base_options != other.base_options): + return False + + if self.embedding_options is None and other.embedding_options is None: + return True + elif (self.embedding_options and other.embedding_options and + self.embedding_options.SerializeToString() + == self.embedding_options.SerializeToString()): + return True + else: + return False + + +class TextEmbedder(object): + """Class that performs dense feature vector extraction on text.""" + + def __init__(self, options: TextEmbedderOptions, + cpp_embedder: _CppTextEmbedder) -> None: + """Initializes the `TextEmbedder` object.""" + self._options = options + self._embedder = cpp_embedder + + @classmethod + def create_from_options(cls, options: TextEmbedderOptions) -> "TextEmbedder": + """Creates the `TextEmbedder` object from text embedder options. + + Args: + options: Options for the text embedder task. + + Returns: + `TextEmbedder` object that's created from `options`. + + Raises: + TODO(b/220931229): Raise RuntimeError instead of status.StatusNotOk. + status.StatusNotOk if failed to create `TextEmbdder` object from + `TextEmbedderOptions` such as missing the model. Need to import the + module to catch this error: `from pybind11_abseil import status`, see + https://github.com/pybind/pybind11_abseil#abslstatusor. + """ + # Creates the object of C++ TextEmbedder class. + proto_options = _ProtoTextEmbedderOptions() + proto_options.base_options.CopyFrom( + task_utils.ConvertToProtoBaseOptions(options.base_options)) + if options.embedding_options: + embedding_options = proto_options.embedding_options.add() + embedding_options.CopyFrom(options.embedding_options) + embedder = _CppTextEmbedder.create_from_options(proto_options) + return cls(options, embedder) + + def embed(self, text: str) -> embeddings_pb2.EmbeddingResult: + """Performs actual feature vector extraction on the provided text. + + Args: + text: the input text, used to extract the feature vectors. + + Returns: + embedding result. + + Raises: + status.StatusNotOk if failed to get the embedding vector. Need to import + the module to catch this error: `from pybind11_abseil import status`, + see https://github.com/pybind/pybind11_abseil#abslstatusor. + """ + return self._embedder.embed(text) + + def cosine_similarity(self, u: embeddings_pb2.FeatureVector, + v: embeddings_pb2.FeatureVector) -> float: + """Computes cosine similarity [1] between two feature vectors.""" + return self._embedder.cosine_similarity(u, v) + + def get_embedding_dimension(self, output_index: int) -> int: + """Gets the dimensionality of the embedding output. + + Args: + output_index: The output index of output layer. + + Returns: + Dimensionality of the embedding output by the output_index'th output + layer. Returns -1 if `output_index` is out of bounds. + """ + return self._embedder.get_embedding_dimension(output_index) + + @property + def number_of_output_layers(self) -> int: + """Gets the number of output layers of the model.""" + return self._embedder.get_number_of_output_layers() + + def __eq__(self, other: Any) -> bool: + return (isinstance(other, self.__class__) and + self._options == other._options) + + @property + def options(self) -> TextEmbedderOptions: + return self._options
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/python/task/vision/BUILD b/third_party/tflite_support/src/tensorflow_lite_support/python/task/vision/BUILD index 59e2d82..a055a74 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/python/task/vision/BUILD +++ b/third_party/tflite_support/src/tensorflow_lite_support/python/task/vision/BUILD
@@ -18,7 +18,43 @@ "//tensorflow_lite_support/python/task/processor/proto:embeddings_pb2", "//tensorflow_lite_support/python/task/vision/core:tensor_image", "//tensorflow_lite_support/python/task/vision/core/pybinds:image_utils", - "//tensorflow_lite_support/python/task/vision/pybinds:image_embedder", + "//tensorflow_lite_support/python/task/vision/pybinds:_pywrap_image_embedder", "//tensorflow_lite_support/python/task/vision/pybinds:image_embedder_options_pb2", ], ) + +py_library( + name = "image_classifier", + srcs = [ + "image_classifier.py", + ], + deps = [ + "//tensorflow_lite_support/python/task/core:task_options", + "//tensorflow_lite_support/python/task/core:task_utils", + "//tensorflow_lite_support/python/task/processor/proto:bounding_box_pb2", + "//tensorflow_lite_support/python/task/processor/proto:classification_options_pb2", + "//tensorflow_lite_support/python/task/processor/proto:classifications_pb2", + "//tensorflow_lite_support/python/task/vision/core:tensor_image", + "//tensorflow_lite_support/python/task/vision/core/pybinds:image_utils", + "//tensorflow_lite_support/python/task/vision/pybinds:_pywrap_image_classifier", + "//tensorflow_lite_support/python/task/vision/pybinds:image_classifier_options_pb2", + ], +) + +py_library( + name = "object_detector", + srcs = [ + "object_detector.py", + ], + deps = [ + "//tensorflow_lite_support/python/task/core:task_options", + "//tensorflow_lite_support/python/task/core:task_utils", + "//tensorflow_lite_support/python/task/processor/proto:bounding_box_pb2", + "//tensorflow_lite_support/python/task/processor/proto:detection_options_pb2", + "//tensorflow_lite_support/python/task/processor/proto:detections_pb2", + "//tensorflow_lite_support/python/task/vision/core:tensor_image", + "//tensorflow_lite_support/python/task/vision/core/pybinds:image_utils", + "//tensorflow_lite_support/python/task/vision/pybinds:_pywrap_object_detector", + "//tensorflow_lite_support/python/task/vision/pybinds:object_detector_options_pb2", + ], +)
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/python/task/vision/image_classifier.py b/third_party/tflite_support/src/tensorflow_lite_support/python/task/vision/image_classifier.py new file mode 100644 index 0000000..b3ff5c2 --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/python/task/vision/image_classifier.py
@@ -0,0 +1,138 @@ +# Copyright 2022 The TensorFlow Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""Image classifier task.""" + +import dataclasses +from typing import Any, Optional + +from tensorflow_lite_support.python.task.core import task_options +from tensorflow_lite_support.python.task.core import task_utils +from tensorflow_lite_support.python.task.processor.proto import bounding_box_pb2 +from tensorflow_lite_support.python.task.processor.proto import classification_options_pb2 +from tensorflow_lite_support.python.task.processor.proto import classifications_pb2 +from tensorflow_lite_support.python.task.vision.core import tensor_image +from tensorflow_lite_support.python.task.vision.core.pybinds import image_utils +from tensorflow_lite_support.python.task.vision.pybinds import _pywrap_image_classifier +from tensorflow_lite_support.python.task.vision.pybinds import image_classifier_options_pb2 + +_ProtoImageClassifierOptions = image_classifier_options_pb2.ImageClassifierOptions +_CppImageClassifier = _pywrap_image_classifier.ImageClassifier + + +@dataclasses.dataclass +class ImageClassifierOptions: + """Options for the image classifier task.""" + base_options: task_options.BaseOptions + classification_options: Optional[ + classification_options_pb2.ClassificationOptions] = None + + def __eq__(self, other: Any) -> bool: + if (not isinstance(other, self.__class__) or + self.base_options != other.base_options): + return False + + if self.classification_options is None and other.classification_options is None: + return True + elif (self.classification_options and other.classification_options and + self.classification_options.SerializeToString() + == self.classification_options.SerializeToString()): + return True + else: + return False + + +class ImageClassifier(object): + """Class that performs classification on images.""" + + def __init__(self, options: ImageClassifierOptions, + classifier: _CppImageClassifier) -> None: + """Initializes the `ImageClassifier` object.""" + # Creates the object of C++ ImageClassifier class. + self._options = options + self._classifier = classifier + + @classmethod + def create_from_options(cls, + options: ImageClassifierOptions) -> "ImageClassifier": + """Creates the `ImageClassifier` object from image classifier options. + + Args: + options: Options for the image classifier task. + Returns: + `ImageClassifier` object that's created from `options`. + Raises: + TODO(b/220931229): Raise RuntimeError instead of status.StatusNotOk. + status.StatusNotOk if failed to create `ImageClassifier` object from + `ImageClassifierOptions` such as missing the model. Need to import the + module to catch this error: `from pybind11_abseil + import status`, see + https://github.com/pybind/pybind11_abseil#abslstatusor. + """ + proto_options = _ProtoImageClassifierOptions() + proto_options.base_options.CopyFrom( + task_utils.ConvertToProtoBaseOptions(options.base_options)) + + # Updates values from classification_options. + if options.classification_options: + if options.classification_options.display_names_locale: + proto_options.display_names_locale = options.classification_options.display_names_locale + if options.classification_options.max_results: + proto_options.max_results = options.classification_options.max_results + if options.classification_options.score_threshold: + proto_options.score_threshold = options.classification_options.score_threshold + if options.classification_options.class_name_allowlist: + proto_options.class_name_whitelist.extend( + options.classification_options.class_name_allowlist) + if options.classification_options.class_name_denylist: + proto_options.class_name_blacklist.extend( + options.classification_options.class_name_denylist) + + classifier = _CppImageClassifier.create_from_options(proto_options) + + return cls(options, classifier) + + def classify( + self, + image: tensor_image.TensorImage, + bounding_box: Optional[bounding_box_pb2.BoundingBox] = None + ) -> classifications_pb2.ClassificationResult: + """Performs classification on the provided TensorImage. + + Args: + image: Tensor image, used to extract the feature vectors. + bounding_box: Bounding box, optional. If set, performed feature vector + extraction only on the provided region of interest. Note that the region + of interest is not clamped, so this method will fail if the region is + out of bounds of the input image. + Returns: + classification result. + Raises: + status.StatusNotOk if failed to get the feature vector. Need to import the + module to catch this error: `from pybind11_abseil + import status`, see + https://github.com/pybind/pybind11_abseil#abslstatusor. + """ + image_data = image_utils.ImageData(image.get_buffer()) + if bounding_box is None: + return self._classifier.classify(image_data) + + return self._classifier.classify(image_data, bounding_box) + + def __eq__(self, other: Any) -> bool: + return (isinstance(other, self.__class__) and + self._options == other._options) + + @property + def options(self) -> ImageClassifierOptions: + return self._options
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/python/task/vision/image_embedder.py b/third_party/tflite_support/src/tensorflow_lite_support/python/task/vision/image_embedder.py index aeda42b1..9b7dd0b 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/python/task/vision/image_embedder.py +++ b/third_party/tflite_support/src/tensorflow_lite_support/python/task/vision/image_embedder.py
@@ -14,7 +14,7 @@ """Image embedder task.""" import dataclasses -from typing import Optional +from typing import Any, Optional from tensorflow_lite_support.python.task.core import task_options from tensorflow_lite_support.python.task.core.proto import configuration_pb2 @@ -36,6 +36,20 @@ base_options: task_options.BaseOptions embedding_options: Optional[embedding_options_pb2.EmbeddingOptions] = None + def __eq__(self, other: Any) -> bool: + if (not isinstance(other, self.__class__) or + self.base_options != other.base_options): + return False + + if self.embedding_options is None and other.embedding_options is None: + return True + elif (self.embedding_options and other.embedding_options and + self.embedding_options.SerializeToString() + == self.embedding_options.SerializeToString()): + return True + else: + return False + def _build_proto_options( options: ImageEmbedderOptions) -> _ProtoImageEmbedderOptions: @@ -69,9 +83,12 @@ class ImageEmbedder(object): """Class that performs dense feature vector extraction on images.""" - def __init__(self, embedder: _CppImageEmbedder) -> None: + def __init__(self, options: ImageEmbedderOptions, + cpp_embedder: _CppImageEmbedder) -> None: """Initializes the `ImageEmbedder` object.""" - self._embedder = embedder + # Creates the object of C++ ImageEmbedder class. + self._options = options + self._embedder = cpp_embedder @classmethod def create_from_options(cls, @@ -90,11 +107,9 @@ module to catch this error: `from pybind11_abseil import status`, see https://github.com/pybind/pybind11_abseil#abslstatusor. """ - # Creates the object of C++ ImageEmbedder class. proto_options = _build_proto_options(options) embedder = _CppImageEmbedder.create_from_options(proto_options) - - return cls(embedder) + return cls(options, embedder) def embed( self, @@ -166,3 +181,11 @@ def number_of_output_layers(self) -> int: """Gets the number of output layers of the model.""" return self._embedder.get_number_of_output_layers() + + def __eq__(self, other: Any) -> bool: + return (isinstance(other, self.__class__) and + self._options == other._options) + + @property + def options(self) -> ImageEmbedderOptions: + return self._options
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/python/task/vision/object_detector.py b/third_party/tflite_support/src/tensorflow_lite_support/python/task/vision/object_detector.py new file mode 100644 index 0000000..ada3888 --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/python/task/vision/object_detector.py
@@ -0,0 +1,121 @@ +# Copyright 2022 The TensorFlow Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""Object detector task.""" + +import dataclasses +from typing import Any, Optional + +from tensorflow_lite_support.python.task.core import task_options +from tensorflow_lite_support.python.task.core import task_utils +from tensorflow_lite_support.python.task.processor.proto import detection_options_pb2 +from tensorflow_lite_support.python.task.processor.proto import detections_pb2 +from tensorflow_lite_support.python.task.vision.core import tensor_image +from tensorflow_lite_support.python.task.vision.core.pybinds import image_utils +from tensorflow_lite_support.python.task.vision.pybinds import _pywrap_object_detector +from tensorflow_lite_support.python.task.vision.pybinds import object_detector_options_pb2 + +_ProtoObjectDetectorOptions = object_detector_options_pb2.ObjectDetectorOptions +_CppObjectDetector = _pywrap_object_detector.ObjectDetector + + +@dataclasses.dataclass +class ObjectDetectorOptions: + """Options for the object detector task.""" + base_options: task_options.BaseOptions + detection_options: Optional[detection_options_pb2.DetectionOptions] = None + + def __eq__(self, other: Any) -> bool: + if (not isinstance(other, self.__class__) or + self.base_options != other.base_options): + return False + + if self.detection_options is None and other.detection_options is None: + return True + elif (self.detection_options and other.detection_options and + self.detection_options.SerializeToString() + == self.detection_options.SerializeToString()): + return True + else: + return False + + +class ObjectDetector(object): + """Class that performs object detection on images.""" + + def __init__(self, options: ObjectDetectorOptions, + detector: _CppObjectDetector) -> None: + """Initializes the `ObjectDetector` object.""" + # Creates the object of C++ ObjectDetector class. + self._options = options + self._detector = detector + + @classmethod + def create_from_options(cls, + options: ObjectDetectorOptions) -> "ObjectDetector": + """Creates the `ObjectDetector` object from object detector options. + + Args: + options: Options for the object detector task. + + Returns: + `ObjectDetector` object that's created from `options`. + Raises: + TODO(b/220931229): Raise RuntimeError instead of status.StatusNotOk. + status.StatusNotOk if failed to create `ObjectDetector` object from + `ObjectDetectorOptions` such as missing the model. Need to import the + module to catch this error: `from pybind11_abseil + import status`, see + https://github.com/pybind/pybind11_abseil#abslstatusor. + """ + proto_options = _ProtoObjectDetectorOptions() + proto_options.base_options.CopyFrom( + task_utils.ConvertToProtoBaseOptions(options.base_options)) + + # Updates values from detection_options. + if options.detection_options: + if options.detection_options.display_names_locale: + proto_options.display_names_locale = options.detection_options.display_names_locale + if options.detection_options.max_results: + proto_options.max_results = options.detection_options.max_results + if options.detection_options.score_threshold: + proto_options.score_threshold = options.detection_options.score_threshold + if options.detection_options.class_name_allowlist: + proto_options.class_name_whitelist.extend( + options.detection_options.class_name_allowlist) + if options.detection_options.class_name_denylist: + proto_options.class_name_blacklist.extend( + options.detection_options.class_name_denylist) + + detector = _CppObjectDetector.create_from_options(proto_options) + + return cls(options, detector) + + def detect(self, + image: tensor_image.TensorImage) -> detections_pb2.DetectionResult: + """Performs object detection on the provided TensorImage. + + Args: + image: Tensor image, used to extract the feature vectors. + + Returns: + detection result. + Raises: + status.StatusNotOk if failed to get the feature vector. Need to import the + module to catch this error: `from pybind11_abseil + import status`, see + https://github.com/pybind/pybind11_abseil#abslstatusor. + """ + image_data = image_utils.ImageData(image.get_buffer()) + + return self._detector.detect(image_data)
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/python/task/vision/pybinds/BUILD b/third_party/tflite_support/src/tensorflow_lite_support/python/task/vision/pybinds/BUILD index 023001d..933600c0 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/python/task/vision/pybinds/BUILD +++ b/third_party/tflite_support/src/tensorflow_lite_support/python/task/vision/pybinds/BUILD
@@ -15,9 +15,9 @@ ) pybind_extension( - name = "image_embedder", + name = "_pywrap_image_embedder", srcs = [ - "image_embedder.cc", + "_pywrap_image_embedder.cc", ], module_name = "_pywrap_image_embedder", deps = [ @@ -29,3 +29,47 @@ "@pybind11_protobuf//pybind11_protobuf:native_proto_caster", ], ) + +py_library( + name = "image_classifier_options_pb2", + srcs = ["image_classifier_options_pb2.py"], + deps = ["//tensorflow_lite_support/cc/task/vision/proto:image_classifier_options_py_pb2"], +) + +pybind_extension( + name = "_pywrap_image_classifier", + srcs = [ + "_pywrap_image_classifier.cc", + ], + module_name = "_pywrap_image_classifier", + deps = [ + "//tensorflow_lite_support/cc/port:statusor", + "//tensorflow_lite_support/cc/task/vision:image_classifier", + "//tensorflow_lite_support/examples/task/vision/desktop/utils:image_utils", + "@pybind11", + "@pybind11_abseil//pybind11_abseil:status_casters", + "@pybind11_protobuf//pybind11_protobuf:native_proto_caster", + ], +) + +py_library( + name = "object_detector_options_pb2", + srcs = ["object_detector_options_pb2.py"], + deps = ["//tensorflow_lite_support/cc/task/vision/proto:object_detector_options_py_pb2"], +) + +pybind_extension( + name = "_pywrap_object_detector", + srcs = [ + "_pywrap_object_detector.cc", + ], + module_name = "_pywrap_object_detector", + deps = [ + "//tensorflow_lite_support/cc/port:statusor", + "//tensorflow_lite_support/cc/task/vision:object_detector", + "//tensorflow_lite_support/examples/task/vision/desktop/utils:image_utils", + "@pybind11", + "@pybind11_abseil//pybind11_abseil:status_casters", + "@pybind11_protobuf//pybind11_protobuf:native_proto_caster", + ], +)
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/python/task/vision/pybinds/image_classifier_options_pb2.py b/third_party/tflite_support/src/tensorflow_lite_support/python/task/vision/pybinds/image_classifier_options_pb2.py new file mode 100644 index 0000000..3da946d --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/python/task/vision/pybinds/image_classifier_options_pb2.py
@@ -0,0 +1,18 @@ +# Copyright 2021 The TensorFlow Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""ImageClassifierOptions protobuf.""" + +from tensorflow_lite_support.cc.task.vision.proto import image_classifier_options_pb2 as classifier_options_pb2 + +ImageClassifierOptions = classifier_options_pb2.ImageClassifierOptions
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/python/task/vision/pybinds/image_embedder_options_pb2.py b/third_party/tflite_support/src/tensorflow_lite_support/python/task/vision/pybinds/image_embedder_options_pb2.py index 4cdc513c..cb6a6404 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/python/task/vision/pybinds/image_embedder_options_pb2.py +++ b/third_party/tflite_support/src/tensorflow_lite_support/python/task/vision/pybinds/image_embedder_options_pb2.py
@@ -11,7 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -"""Embedder options protobuf.""" +"""ImageEmbedderOptions protobuf.""" from tensorflow_lite_support.cc.task.vision.proto import image_embedder_options_pb2 as embedder_options_pb2
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/python/task/vision/pybinds/object_detector_options_pb2.py b/third_party/tflite_support/src/tensorflow_lite_support/python/task/vision/pybinds/object_detector_options_pb2.py new file mode 100644 index 0000000..2707804 --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/python/task/vision/pybinds/object_detector_options_pb2.py
@@ -0,0 +1,18 @@ +# Copyright 2021 The TensorFlow Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""ObjectDetectorOptions protobuf.""" + +from tensorflow_lite_support.cc.task.vision.proto import object_detector_options_pb2 + +ObjectDetectorOptions = object_detector_options_pb2.ObjectDetectorOptions
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/python/test/BUILD b/third_party/tflite_support/src/tensorflow_lite_support/python/test/BUILD index 52b142e0..cf5d45a 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/python/test/BUILD +++ b/third_party/tflite_support/src/tensorflow_lite_support/python/test/BUILD
@@ -6,6 +6,13 @@ ) py_library( + name = "base_test", + testonly = 1, + srcs = ["base_test.py"], + srcs_version = "PY3", +) + +py_library( name = "test_util", testonly = 1, srcs = ["test_util.py"],
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/python/test/base_test.py b/third_party/tflite_support/src/tensorflow_lite_support/python/test/base_test.py new file mode 100644 index 0000000..edb42d0 --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/python/test/base_test.py
@@ -0,0 +1,50 @@ +# Copyright 2022 The TensorFlow Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""Base TestCase for the unit tests.""" + +import unittest + +__unittest = True # Allows shorter stack trace for .assertDeepAlmostEqual pylint: disable=invalid-name + + +class BaseTestCase(unittest.TestCase): + """Base test case.""" + + def assertDeepAlmostEqual(self, expected, actual, **kwargs): + """Compares lists, dicts and tuples recursively. + + Checks numeric values using test_case's + :py:meth:`unittest.TestCase.assertAlmostEqual` and checks all other values + with :py:meth:`unittest.TestCase.assertEqual`. Accepts additional keyword + arguments and pass those intact to assertAlmostEqual() (that's how you + specify comparison precision). + + Args: + expected: Expected object. + actual: Actual object. + **kwargs: Other parameters to be passed. + """ + if isinstance(expected, (int, float, complex)): + self.assertAlmostEqual(expected, actual, **kwargs) + elif isinstance(expected, (list, tuple)): + self.assertEqual(len(expected), len(actual)) + for index in range(len(expected)): + v1, v2 = expected[index], actual[index] + self.assertDeepAlmostEqual(v1, v2, **kwargs) + elif isinstance(expected, dict): + self.assertEqual(set(expected), set(actual)) + for key in expected: + self.assertDeepAlmostEqual(expected[key], actual[key], **kwargs) + else: + self.assertEqual(expected, actual)
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/python/test/task/text/BUILD b/third_party/tflite_support/src/tensorflow_lite_support/python/test/task/text/BUILD new file mode 100644 index 0000000..f34cbe8 --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/python/test/task/text/BUILD
@@ -0,0 +1,22 @@ +# Placeholder for internal Python strict test compatibility macro. + +package( + default_visibility = ["//visibility:private"], + licenses = ["notice"], # Apache 2.0 +) + +py_test( + name = "text_embedder_test", + srcs = ["text_embedder_test.py"], + data = [ + "//tensorflow_lite_support/cc/test/testdata/task/text:mobilebert_embedding_with_metadata", + "//tensorflow_lite_support/cc/test/testdata/task/text:regex_embedding_with_metadata", + ], + deps = [ + "//tensorflow_lite_support/python/task/core:task_options", + "//tensorflow_lite_support/python/task/processor/proto:embedding_options_pb2", + "//tensorflow_lite_support/python/task/text:text_embedder", + "//tensorflow_lite_support/python/test:test_util", + "@absl_py//absl/testing:parameterized", + ], +)
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/python/test/task/text/text_embedder_test.py b/third_party/tflite_support/src/tensorflow_lite_support/python/test/task/text/text_embedder_test.py new file mode 100644 index 0000000..12328f5 --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/python/test/task/text/text_embedder_test.py
@@ -0,0 +1,170 @@ +# Copyright 2022 The TensorFlow Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""Tests for text_embedder.""" + +import enum + +from absl.testing import parameterized + +from tensorflow_lite_support.python.task.core import task_options +from tensorflow_lite_support.python.task.processor.proto import embedding_options_pb2 +from tensorflow_lite_support.python.task.text import text_embedder +from tensorflow_lite_support.python.test import test_util +import unittest + +_BaseOptions = task_options.BaseOptions +_ExternalFile = task_options.ExternalFile +_TextEmbedder = text_embedder.TextEmbedder +_TextEmbedderOptions = text_embedder.TextEmbedderOptions + +_REGEX_MODEL = "regex_one_embedding_with_metadata.tflite" +_BERT_MODEL = "mobilebert_embedding_with_metadata.tflite" + + +class ModelFileType(enum.Enum): + FILE_CONTENT = 1 + FILE_NAME = 2 + + +class TextEmbedderTest(parameterized.TestCase, unittest.TestCase): + + def setUp(self): + super().setUp() + self.model_path = test_util.get_test_data_path(_REGEX_MODEL) + + def test_create_from_options_succeeds_with_valid_model_path(self): + options = _TextEmbedderOptions( + _BaseOptions(model_file=_ExternalFile(file_name=self.model_path))) + embedder = _TextEmbedder.create_from_options(options) + self.assertIsInstance(embedder, _TextEmbedder) + + def test_create_from_options_fails_with_invalid_model_path(self): + # Invalid empty model path. + with self.assertRaisesRegex( + Exception, + r"INVALID_ARGUMENT: Missing mandatory `model_file` field in " + r"`base_options` \[tflite::support::TfLiteSupportStatus='2'\]"): + options = _TextEmbedderOptions( + _BaseOptions(model_file=_ExternalFile(file_name=""))) + _TextEmbedder.create_from_options(options) + + def test_create_from_options_succeeds_with_valid_model_content(self): + # Creates with options containing model content successfully. + with open(self.model_path, "rb") as f: + options = _TextEmbedderOptions( + _BaseOptions(model_file=_ExternalFile(file_content=f.read()))) + embedder = _TextEmbedder.create_from_options(options) + self.assertIsInstance(embedder, _TextEmbedder) + + @parameterized.parameters( + (_REGEX_MODEL, False, False, ModelFileType.FILE_NAME, 16, 0.999937), + (_REGEX_MODEL, True, True, ModelFileType.FILE_NAME, 16, 0.999878), + (_BERT_MODEL, False, False, ModelFileType.FILE_CONTENT, 512, 0.969514), + (_BERT_MODEL, True, True, ModelFileType.FILE_CONTENT, 512, 0.966984), + ) + def test_embed(self, model_name, l2_normalize, quantize, model_file_type, + embedding_length, expected_similarity): + # Create embedder. + model_path = test_util.get_test_data_path(model_name) + if model_file_type is ModelFileType.FILE_NAME: + model_file = _ExternalFile(file_name=model_path) + elif model_file_type is ModelFileType.FILE_CONTENT: + with open(model_path, "rb") as f: + model_content = f.read() + model_file = _ExternalFile(file_content=model_content) + else: + # Should never happen + raise ValueError("model_file_type is invalid.") + + options = _TextEmbedderOptions( + _BaseOptions(model_file), + embedding_options_pb2.EmbeddingOptions( + l2_normalize=l2_normalize, quantize=quantize)) + embedder = _TextEmbedder.create_from_options(options) + + # Extract embeddings. + result0 = embedder.embed("it's a charming and often affecting journey") + result1 = embedder.embed("what a great and fantastic trip") + + # Check embedding sizes. + def _check_embedding_size(result): + self.assertLen(result.embeddings, 1) + feature_vector = result.embeddings[0].feature_vector + if quantize: + self.assertLen(feature_vector.value_string, embedding_length) + else: + self.assertLen(feature_vector.value_float, embedding_length) + + _check_embedding_size(result0) + _check_embedding_size(result1) + + def test_get_embedding_dimension(self): + options = _TextEmbedderOptions( + _BaseOptions(model_file=_ExternalFile(file_name=self.model_path))) + embedder = _TextEmbedder.create_from_options(options) + self.assertEqual(embedder.get_embedding_dimension(0), 16) + self.assertEqual(embedder.get_embedding_dimension(1), -1) + + def test_number_of_output_layers(self): + options = _TextEmbedderOptions( + _BaseOptions(model_file=_ExternalFile(file_name=self.model_path))) + embedder = _TextEmbedder.create_from_options(options) + self.assertEqual(embedder.number_of_output_layers, 1) + + def test_equal(self): + base_options1 = _BaseOptions( + model_file=_ExternalFile(file_name=self.model_path)) + options1 = _TextEmbedderOptions(base_options=base_options1) + embedder1 = _TextEmbedder.create_from_options(options1) + # Checks the same embedder object. + self.assertEqual(embedder1, embedder1) + + base_options2 = _BaseOptions( + model_file=_ExternalFile(file_name=self.model_path)) + options2 = _TextEmbedderOptions(base_options=base_options2) + embedder2 = _TextEmbedder.create_from_options(options2) + # Checks the embedders with same file name. + self.assertEqual(embedder1, embedder2) + + with open(self.model_path, "rb") as f: + model_content = f.read() + base_options3 = _BaseOptions( + model_file=_ExternalFile(file_content=model_content)) + options3 = _TextEmbedderOptions(base_options=base_options3) + embedder3 = _TextEmbedder.create_from_options(options3) + # Checks one embedder with file_name and the other with model_content. + self.assertNotEqual(embedder1, embedder3) + + base_options4 = _BaseOptions( + model_file=_ExternalFile(file_name=self.model_path)) + options4 = _TextEmbedderOptions(base_options=base_options4) + options4.embedding_options = embedding_options_pb2.EmbeddingOptions( + l2_normalize=True) + embedder4 = _TextEmbedder.create_from_options(options4) + # Checks the embedders with different embedding options. + self.assertNotEqual(embedder1, embedder4) + + bert_model_path = test_util.get_test_data_path(_BERT_MODEL) + with open(bert_model_path, "rb") as f: + model_content = f.read() + base_options5 = _BaseOptions( + model_file=_ExternalFile(file_content=model_content)) + options5 = _TextEmbedderOptions(base_options=base_options5) + embedder5 = _TextEmbedder.create_from_options(options5) + # Checks one embedder with different file_content. + self.assertNotEqual(embedder3, embedder5) + + +if __name__ == "__main__": + unittest.main()
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/python/test/task/vision/BUILD b/third_party/tflite_support/src/tensorflow_lite_support/python/test/task/vision/BUILD index 35ab9b4..2545943 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/python/test/task/vision/BUILD +++ b/third_party/tflite_support/src/tensorflow_lite_support/python/test/task/vision/BUILD
@@ -20,8 +20,50 @@ "//tensorflow_lite_support/python/task/vision:image_embedder", "//tensorflow_lite_support/python/task/vision/core:tensor_image", "//tensorflow_lite_support/python/test:test_util", - "//testing/pybase", "@absl_py//absl/testing:parameterized", - "@pybind11_abseil//pybind11_abseil:status", + ], +) + +py_test( + name = "image_classifier_test", + srcs = ["image_classifier_test.py"], + data = [ + "//tensorflow_lite_support/cc/test/testdata/task/vision:test_images", + "//tensorflow_lite_support/cc/test/testdata/task/vision:test_models", + ], + deps = [ + "//tensorflow_lite_support/python/task/core:task_options", + "//tensorflow_lite_support/python/task/processor/proto:bounding_box_pb2", + "//tensorflow_lite_support/python/task/processor/proto:class_pb2", + "//tensorflow_lite_support/python/task/processor/proto:classification_options_pb2", + "//tensorflow_lite_support/python/task/processor/proto:classifications_pb2", + "//tensorflow_lite_support/python/task/vision:image_classifier", + "//tensorflow_lite_support/python/task/vision/core:tensor_image", + "//tensorflow_lite_support/python/test:base_test", + "//tensorflow_lite_support/python/test:test_util", + "@absl_py//absl/testing:parameterized", + "@com_google_protobuf//:protobuf_python", + ], +) + +py_test( + name = "object_detector_test", + srcs = ["object_detector_test.py"], + data = [ + "//tensorflow_lite_support/cc/test/testdata/task/vision:test_images", + "//tensorflow_lite_support/cc/test/testdata/task/vision:test_models", + ], + deps = [ + "//tensorflow_lite_support/python/task/core:task_options", + "//tensorflow_lite_support/python/task/processor/proto:bounding_box_pb2", + "//tensorflow_lite_support/python/task/processor/proto:class_pb2", + "//tensorflow_lite_support/python/task/processor/proto:detection_options_pb2", + "//tensorflow_lite_support/python/task/processor/proto:detections_pb2", + "//tensorflow_lite_support/python/task/vision:object_detector", + "//tensorflow_lite_support/python/task/vision/core:tensor_image", + "//tensorflow_lite_support/python/test:base_test", + "//tensorflow_lite_support/python/test:test_util", + "@absl_py//absl/testing:parameterized", + "@com_google_protobuf//:protobuf_python", ], )
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/python/test/task/vision/image_classifier_test.py b/third_party/tflite_support/src/tensorflow_lite_support/python/test/task/vision/image_classifier_test.py new file mode 100644 index 0000000..950f75f --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/python/test/task/vision/image_classifier_test.py
@@ -0,0 +1,348 @@ +# Copyright 2022 The TensorFlow Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""Tests for image_classifier.""" + +import enum +import json + +from absl.testing import parameterized +from google.protobuf import json_format +# TODO(b/220067158): Change to import tensorflow and leverage tf.test once +# fixed the dependency issue. +import unittest +from tensorflow_lite_support.python.task.core import task_options +from tensorflow_lite_support.python.task.processor.proto import bounding_box_pb2 +from tensorflow_lite_support.python.task.processor.proto import class_pb2 +from tensorflow_lite_support.python.task.processor.proto import classification_options_pb2 +from tensorflow_lite_support.python.task.processor.proto import classifications_pb2 +from tensorflow_lite_support.python.task.vision import image_classifier +from tensorflow_lite_support.python.task.vision.core import tensor_image +from tensorflow_lite_support.python.test import base_test +from tensorflow_lite_support.python.test import test_util + +_BaseOptions = task_options.BaseOptions +_ExternalFile = task_options.ExternalFile +_ImageClassifier = image_classifier.ImageClassifier +_ImageClassifierOptions = image_classifier.ImageClassifierOptions + +_MODEL_FILE = 'mobilenet_v2_1.0_224.tflite' +_IMAGE_FILE = 'burger.jpg' +_ALLOW_LIST = ['cheeseburger', 'guacamole'] +_DENY_LIST = ['cheeseburger'] +_SCORE_THRESHOLD = 0.5 +_MAX_RESULTS = 3 +_ACCEPTABLE_ERROR_RANGE = 0.000001 + + +class ModelFileType(enum.Enum): + FILE_CONTENT = 1 + FILE_NAME = 2 + + +class ImageClassifierTest(parameterized.TestCase, base_test.BaseTestCase): + + def setUp(self): + super().setUp() + self.test_image_path = test_util.get_test_data_path(_IMAGE_FILE) + self.model_path = test_util.get_test_data_path(_MODEL_FILE) + + @staticmethod + def create_classifier_from_options(model_file, **classification_options): + base_options = _BaseOptions(model_file=model_file) + classification_options = classification_options_pb2.ClassificationOptions( + **classification_options) + options = _ImageClassifierOptions( + base_options=base_options, + classification_options=classification_options) + classifier = _ImageClassifier.create_from_options(options) + return classifier + + @staticmethod + def build_test_data(expected_categories): + classifications = classifications_pb2.Classifications(head_index=0) + classifications.classes.extend( + [class_pb2.Category(**args) for args in expected_categories]) + expected_result = classifications_pb2.ClassificationResult() + expected_result.classifications.append(classifications) + expected_result_dict = json.loads( + json_format.MessageToJson(expected_result)) + + return expected_result_dict + + def test_create_from_options_succeeds_with_valid_model_path(self): + # Creates with options containing model file successfully. + base_options = _BaseOptions( + model_file=_ExternalFile(file_name=self.model_path)) + options = _ImageClassifierOptions(base_options=base_options) + classifier = _ImageClassifier.create_from_options(options) + self.assertIsInstance(classifier, _ImageClassifier) + + def test_create_from_options_fails_with_missing_model_file(self): + # Missing the model file. + with self.assertRaisesRegex( + TypeError, + r"__init__\(\) missing 1 required positional argument: 'model_file'"): + _BaseOptions() + + def test_create_from_options_fails_with_invalid_model_path(self): + # Invalid empty model path. + with self.assertRaisesRegex( + Exception, + r'INVALID_ARGUMENT: Expected exactly one of `base_options.model_file` ' + r'or `model_file_with_metadata` to be provided, found 0. ' + r"\[tflite::support::TfLiteSupportStatus='2']"): + base_options = _BaseOptions(model_file=_ExternalFile(file_name='')) + options = _ImageClassifierOptions(base_options=base_options) + _ImageClassifier.create_from_options(options) + + def test_create_from_options_succeeds_with_valid_model_content(self): + # Creates with options containing model content successfully. + with open(self.model_path, 'rb') as f: + base_options = _BaseOptions( + model_file=_ExternalFile(file_content=f.read())) + options = _ImageClassifierOptions(base_options=base_options) + classifier = _ImageClassifier.create_from_options(options) + self.assertIsInstance(classifier, _ImageClassifier) + + @parameterized.parameters((ModelFileType.FILE_NAME, 3, [{ + 'index': 934, + 'score': 0.7399742007255554, + 'class_name': 'cheeseburger' + }, { + 'index': 925, + 'score': 0.026928534731268883, + 'class_name': 'guacamole' + }, { + 'index': 932, + 'score': 0.025737214833498, + 'class_name': 'bagel' + }]), (ModelFileType.FILE_CONTENT, 3, [{ + 'index': 934, + 'score': 0.7399742007255554, + 'class_name': 'cheeseburger' + }, { + 'index': 925, + 'score': 0.026928534731268883, + 'class_name': 'guacamole' + }, { + 'index': 932, + 'score': 0.025737214833498, + 'class_name': 'bagel' + }])) + def test_classify_model(self, model_file_type, max_results, + expected_categories): + # Creates classifier. + if model_file_type is ModelFileType.FILE_NAME: + model_file = _ExternalFile(file_name=self.model_path) + elif model_file_type is ModelFileType.FILE_CONTENT: + with open(self.model_path, 'rb') as f: + model_content = f.read() + model_file = _ExternalFile(file_content=model_content) + else: + # Should never happen + raise ValueError('model_file_type is invalid.') + + classifier = self.create_classifier_from_options( + model_file, max_results=max_results) + + # Loads image. + image = tensor_image.TensorImage.from_file(self.test_image_path) + + # Classifies the input. + image_result = classifier.classify(image, bounding_box=None) + image_result_dict = json.loads(json_format.MessageToJson(image_result)) + + # Builds test data. + expected_result_dict = self.build_test_data(expected_categories) + + # Comparing results (classification w/o bounding box). + self.assertDeepAlmostEqual( + image_result_dict, expected_result_dict, delta=_ACCEPTABLE_ERROR_RANGE) + + def test_classify_model_with_bounding_box(self): + # Creates classifier. + model_file = _ExternalFile(file_name=self.model_path) + + classifier = self.create_classifier_from_options(model_file, max_results=3) + + # Loads image. + image = tensor_image.TensorImage.from_file(self.test_image_path) + + # Bounding box in "burger.jpg" corresponding to "burger_crop.jpg". + bounding_box = bounding_box_pb2.BoundingBox( + origin_x=0, origin_y=0, width=400, height=325) + + # Classifies the input. + image_result = classifier.classify(image, bounding_box) + image_result_dict = json.loads(json_format.MessageToJson(image_result)) + + # Expected results. + expected_categories = [{ + 'index': 934, + 'score': 0.8815076351165771, + 'class_name': 'cheeseburger' + }, { + 'index': 925, + 'score': 0.019456762820482254, + 'class_name': 'guacamole' + }, { + 'index': 932, + 'score': 0.012489477172493935, + 'class_name': 'bagel' + }] + + # Builds test data. + expected_result_dict = self.build_test_data(expected_categories) + + # Comparing results (classification w/ bounding box). + self.assertDeepAlmostEqual( + image_result_dict, expected_result_dict, delta=_ACCEPTABLE_ERROR_RANGE) + + def test_max_results_option(self): + # Creates classifier. + model_file = _ExternalFile(file_name=self.model_path) + + classifier = self.create_classifier_from_options( + model_file, max_results=_MAX_RESULTS) + + # Loads image. + image = tensor_image.TensorImage.from_file(self.test_image_path) + + # Classifies the input. + image_result = classifier.classify(image, bounding_box=None) + image_result_dict = json.loads(json_format.MessageToJson(image_result)) + + categories = image_result_dict['classifications'][0]['classes'] + + self.assertLessEqual( + len(categories), _MAX_RESULTS, 'Too many results returned.') + + def test_score_threshold_option(self): + # Creates classifier. + model_file = _ExternalFile(file_name=self.model_path) + + classifier = self.create_classifier_from_options( + model_file, score_threshold=_SCORE_THRESHOLD) + + # Loads image. + image = tensor_image.TensorImage.from_file(self.test_image_path) + + # Classifies the input. + image_result = classifier.classify(image, bounding_box=None) + image_result_dict = json.loads(json_format.MessageToJson(image_result)) + + categories = image_result_dict['classifications'][0]['classes'] + + for category in categories: + score = category['score'] + self.assertGreaterEqual( + score, _SCORE_THRESHOLD, + 'Classification with score lower than threshold found. {0}'.format( + category)) + + def test_allowlist_option(self): + # Creates classifier. + model_file = _ExternalFile(file_name=self.model_path) + + classifier = self.create_classifier_from_options( + model_file, class_name_allowlist=_ALLOW_LIST) + + # Loads image. + image = tensor_image.TensorImage.from_file(self.test_image_path) + + # Classifies the input. + image_result = classifier.classify(image, bounding_box=None) + image_result_dict = json.loads(json_format.MessageToJson(image_result)) + + categories = image_result_dict['classifications'][0]['classes'] + + for category in categories: + label = category['className'] + self.assertIn( + label, _ALLOW_LIST, + 'Label "{0}" found but not in label allow list'.format(label)) + + def test_denylist_option(self): + # Creates classifier. + model_file = _ExternalFile(file_name=self.model_path) + + classifier = self.create_classifier_from_options( + model_file, score_threshold=0.01, class_name_denylist=_DENY_LIST) + + # Loads image + image = tensor_image.TensorImage.from_file(self.test_image_path) + + # Classifies the input. + image_result = classifier.classify(image, bounding_box=None) + image_result_dict = json.loads(json_format.MessageToJson(image_result)) + + categories = image_result_dict['classifications'][0]['classes'] + + for category in categories: + label = category['className'] + self.assertNotIn(label, _DENY_LIST, + 'Label "{0}" found but in deny list.'.format(label)) + + def test_combined_allowlist_and_denylist(self): + # Fails with combined allowlist and denylist + with self.assertRaisesRegex( + Exception, + r'INVALID_ARGUMENT: `class_name_whitelist` and `class_name_blacklist` ' + r'are mutually exclusive options. ' + r"\[tflite::support::TfLiteSupportStatus='2'\]"): + base_options = _BaseOptions( + model_file=_ExternalFile(file_name=self.model_path)) + classification_options = classification_options_pb2.ClassificationOptions( + class_name_allowlist=['foo'], class_name_denylist=['bar']) + options = _ImageClassifierOptions( + base_options=base_options, + classification_options=classification_options) + _ImageClassifier.create_from_options(options) + + def test_equal(self): + base_options1 = _BaseOptions( + model_file=_ExternalFile(file_name=self.model_path)) + options1 = _ImageClassifierOptions(base_options=base_options1) + classifier1 = _ImageClassifier.create_from_options(options1) + # Checks the same classifier object. + self.assertEqual(classifier1, classifier1) + + base_options2 = _BaseOptions( + model_file=_ExternalFile(file_name=self.model_path)) + options2 = _ImageClassifierOptions(base_options=base_options2) + classifier2 = _ImageClassifier.create_from_options(options2) + # Checks the classifiers with same file name. + self.assertEqual(classifier1, classifier2) + + with open(self.model_path, 'rb') as f: + model_content = f.read() + base_options3 = _BaseOptions( + model_file=_ExternalFile(file_content=model_content)) + options3 = _ImageClassifierOptions(base_options=base_options3) + classifier3 = _ImageClassifier.create_from_options(options3) + # Checks one classifier with file_name and the other with model_content. + self.assertNotEqual(classifier1, classifier3) + + base_options4 = _BaseOptions( + model_file=_ExternalFile(file_name=self.model_path)) + options4 = _ImageClassifierOptions(base_options=base_options4) + options4.classification_options = classification_options_pb2.ClassificationOptions( + score_threshold=0.5) + classifier4 = _ImageClassifier.create_from_options(options4) + # Checks the classifiers with different classification options. + self.assertNotEqual(classifier1, classifier4) + + +if __name__ == '__main__': + unittest.main()
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/python/test/task/vision/image_embedder_test.py b/third_party/tflite_support/src/tensorflow_lite_support/python/test/task/vision/image_embedder_test.py index 98c45b6..87090179 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/python/test/task/vision/image_embedder_test.py +++ b/third_party/tflite_support/src/tensorflow_lite_support/python/test/task/vision/image_embedder_test.py
@@ -174,6 +174,39 @@ embedder = _ImageEmbedder.create_from_options(options) self.assertEqual(embedder.number_of_output_layers, 1) + def test_equal(self): + base_options1 = _BaseOptions( + model_file=_ExternalFile(file_name=self.model_path)) + options1 = _ImageEmbedderOptions(base_options=base_options1) + embedder1 = _ImageEmbedder.create_from_options(options1) + # Checks the same embedder object. + self.assertEqual(embedder1, embedder1) + + base_options2 = _BaseOptions( + model_file=_ExternalFile(file_name=self.model_path)) + options2 = _ImageEmbedderOptions(base_options=base_options2) + embedder2 = _ImageEmbedder.create_from_options(options2) + # Checks the embedders with same file name. + self.assertEqual(embedder1, embedder2) + + with open(self.model_path, "rb") as f: + model_content = f.read() + base_options3 = _BaseOptions( + model_file=_ExternalFile(file_content=model_content)) + options3 = _ImageEmbedderOptions(base_options=base_options3) + embedder3 = _ImageEmbedder.create_from_options(options3) + # Checks one embedder with file_name and the other with model_content. + self.assertNotEqual(embedder1, embedder3) + + base_options4 = _BaseOptions( + model_file=_ExternalFile(file_name=self.model_path)) + options4 = _ImageEmbedderOptions(base_options=base_options4) + options4.embedding_options = embedding_options_pb2.EmbeddingOptions( + l2_normalize=True) + embedder4 = _ImageEmbedder.create_from_options(options4) + # Checks the embedders with different embedding options. + self.assertNotEqual(embedder1, embedder4) + if __name__ == "__main__": unittest.main()
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/python/test/task/vision/object_detector_test.py b/third_party/tflite_support/src/tensorflow_lite_support/python/test/task/vision/object_detector_test.py new file mode 100644 index 0000000..3db26c1 --- /dev/null +++ b/third_party/tflite_support/src/tensorflow_lite_support/python/test/task/vision/object_detector_test.py
@@ -0,0 +1,117 @@ +# Copyright 2022 The TensorFlow Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""Tests for object detector.""" + +import enum +import json + +from absl.testing import parameterized +# TODO(b/220067158): Change to import tensorflow and leverage tf.test once +# fixed the dependency issue. +from google.protobuf import json_format +import unittest +from tensorflow_lite_support.python.task.core import task_options +from tensorflow_lite_support.python.task.processor.proto import bounding_box_pb2 +from tensorflow_lite_support.python.task.processor.proto import class_pb2 +from tensorflow_lite_support.python.task.processor.proto import detection_options_pb2 +from tensorflow_lite_support.python.task.processor.proto import detections_pb2 +from tensorflow_lite_support.python.task.vision import object_detector +from tensorflow_lite_support.python.task.vision.core import tensor_image +from tensorflow_lite_support.python.test import base_test +from tensorflow_lite_support.python.test import test_util + +_BaseOptions = task_options.BaseOptions +_ExternalFile = task_options.ExternalFile +_ObjectDetector = object_detector.ObjectDetector +_ObjectDetectorOptions = object_detector.ObjectDetectorOptions + +_MODEL_FILE = 'coco_ssd_mobilenet_v1_1.0_quant_2018_06_29.tflite' +_IMAGE_FILE = 'cats_and_dogs.jpg' +_ACCEPTABLE_ERROR_RANGE = 0.000001 + + +class ModelFileType(enum.Enum): + FILE_CONTENT = 1 + FILE_NAME = 2 + + +class ObjectDetectorTest(parameterized.TestCase, base_test.BaseTestCase): + + def setUp(self): + super().setUp() + self.test_image_path = test_util.get_test_data_path(_IMAGE_FILE) + self.model_path = test_util.get_test_data_path(_MODEL_FILE) + + @classmethod + def create_detector_from_options(cls, model_file, **detection_options): + print(detection_options) + base_options = _BaseOptions(model_file=model_file) + detection_options = detection_options_pb2.DetectionOptions( + **detection_options) + options = _ObjectDetectorOptions( + base_options=base_options, detection_options=detection_options) + detector = _ObjectDetector.create_from_options(options) + return detector + + @classmethod + def build_test_data(cls, expected_detections): + expected_result = detections_pb2.DetectionResult() + + for index in range(len(expected_detections)): + bounding_box, category = expected_detections[index] + detection = detections_pb2.Detection() + detection.bounding_box.CopyFrom( + bounding_box_pb2.BoundingBox(**bounding_box)) + detection.classes.append(class_pb2.Category(**category)) + expected_result.detections.append(detection) + + expected_result_dict = json.loads( + json_format.MessageToJson(expected_result)) + + return expected_result_dict + + def test_top1_result(self): + # Creates detector. + model_file = _ExternalFile(file_name=self.model_path) + + detector = self.create_detector_from_options( + model_file=model_file, max_results=1) + + # Loads image. + image = tensor_image.TensorImage.from_file(self.test_image_path) + + # Performs object detection on the input. + image_result = detector.detect(image) + image_result_dict = json.loads(json_format.MessageToJson(image_result)) + + # Builds test data. + expected_detections = [({ + 'origin_x': 54, + 'origin_y': 396, + 'width': 393, + 'height': 196 + }, { + 'index': 16, + 'score': 0.64453125, + 'class_name': 'cat' + })] + expected_result_dict = self.build_test_data(expected_detections) + + # Comparing results. + self.assertDeepAlmostEqual( + image_result_dict, expected_result_dict, delta=_ACCEPTABLE_ERROR_RANGE) + + +if __name__ == '__main__': + unittest.main()
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/tools/ci_build/build_all.sh b/third_party/tflite_support/src/tensorflow_lite_support/tools/ci_build/build_all.sh index 4219a8e..1b10df8 100755 --- a/third_party/tflite_support/src/tensorflow_lite_support/tools/ci_build/build_all.sh +++ b/third_party/tflite_support/src/tensorflow_lite_support/tools/ci_build/build_all.sh
@@ -64,6 +64,7 @@ //tensorflow_lite_support/custom_ops/kernel/sentencepiece:all \ //tensorflow_lite_support/metadata/python/tests:metadata_test \ //tensorflow_lite_support/metadata/python/tests/metadata_writers:all \ + //tensorflow_lite_support/python/test/task/... bazel test -c opt $BAZEL_PARALLEL --test_output=all --build_tests_only \ --build_tag_filters=-tflite_emulator_test_android \
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/tools/ci_build/common.sh b/third_party/tflite_support/src/tensorflow_lite_support/tools/ci_build/common.sh index 17c38d2..135e428 100755 --- a/third_party/tflite_support/src/tensorflow_lite_support/tools/ci_build/common.sh +++ b/third_party/tflite_support/src/tensorflow_lite_support/tools/ci_build/common.sh
@@ -1,90 +1,95 @@ -#!/ usr / bin / env bash -#Copyright 2020 The TensorFlow Authors.All Rights Reserved. +#!/usr/bin/env bash +# Copyright 2020 The TensorFlow Authors. All Rights Reserved. # -#Licensed under the Apache License, Version 2.0(the "License"); -#you may not use this file except in compliance with the License. -#You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -#http: // www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # -#Unless required by applicable law or agreed to in writing, software -#distributed under the License is distributed on an "AS IS" BASIS, -#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -#See the License for the specific language governing permissions and -#limitations under the License. -#== == == == == == == == == == == == == == == == == == == == == == == == == == \ - == == == == == == == == == == == == == -#External `common.sh` +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================================== +# External `common.sh` -#Keep in sync with tensorflow core and configure.py. -LATEST_BAZEL_VERSION = 4.2.2 -#Run flaky functions with retries. -#run_with_retry cmd - function run_with_retry { +# Keep in sync with tensorflow core and configure.py. +LATEST_BAZEL_VERSION=4.2.2 + +# Run flaky functions with retries. +# run_with_retry cmd +function run_with_retry { eval "$1" -#If the command fails retry again in 60 seconds. - if [[ $? -ne 0 ]]; - then sleep 60 eval "$1" fi + # If the command fails retry again in 60 seconds. + if [[ $? -ne 0 ]]; then + sleep 60 + eval "$1" + fi } function die() { - echo "$@" 1 > &2; - exit 1; + echo "$@" 1>&2 ; exit 1; } -#A small utility to run the command and only print logs if the command fails. -#On success, all logs are hidden. -function readable_run{ -#Disable debug mode to avoid printing of variables here. - set + x result = - $("$@" 2 > &1) || die "$result" echo "$@" echo - "Command completed successfully at $(date)" set - - x} +# A small utility to run the command and only print logs if the command fails. +# On success, all logs are hidden. +function readable_run { + # Disable debug mode to avoid printing of variables here. + set +x + result=$("$@" 2>&1) || die "$result" + echo "$@" + echo "Command completed successfully at $(date)" + set -x +} -#TODO(b / 158448780) : Guard bazel installation with IfChangeThenChange. -function set_bazel_outdir{mkdir - p / tmpfs / bazel_output export TEST_TMPDIR = - / tmpfs / bazel_output} +# TODO(b/158448780): Guard bazel installation with IfChangeThenChange. +function set_bazel_outdir { + mkdir -p /tmpfs/bazel_output + export TEST_TMPDIR=/tmpfs/bazel_output +} -#Downloads bazelisk to ~ / bin as `bazel`. +# Downloads bazelisk to ~/bin as `bazel`. function install_bazelisk { date case "$(uname -s)" in - Darwin) local name=bazelisk-darwin-amd64 ; - ; - Linux) local name=bazelisk-linux-amd64 ; - ; - *) die "Unknown OS: $(uname -s)" ; - ; - esac mkdir - p "$HOME/bin" wget-- no - verbose - - O - "$HOME/bin/bazel" - "https://github.com/bazelbuild/bazelisk/releases/download/v1.3.0/" - "$name" chmod u + - x "$HOME/bin/bazel" if[[!":$PATH:" = ~:"$HOME" / bin / ?: ]]; - then PATH = - "$HOME/bin:$PATH" fi set_bazel_outdir which bazel bazel version date + Darwin) local name=bazelisk-darwin-amd64 ;; + Linux) local name=bazelisk-linux-amd64 ;; + *) die "Unknown OS: $(uname -s)" ;; + esac + mkdir -p "$HOME/bin" + wget --no-verbose -O "$HOME/bin/bazel" \ + "https://github.com/bazelbuild/bazelisk/releases/download/v1.3.0/$name" + chmod u+x "$HOME/bin/bazel" + if [[ ! ":$PATH:" =~ :"$HOME"/bin/?: ]]; then + PATH="$HOME/bin:$PATH" + fi + set_bazel_outdir + which bazel + bazel version + date } -#Install the given bazel version on linux +# Install the given bazel version on linux function update_bazel_linux { - if - [[-z "$1"]]; - then BAZEL_VERSION = $ { - LATEST_BAZEL_VERSION - } - else BAZEL_VERSION = - $1 fi rm - - rf ~ / bazel mkdir ~ / - bazel + if [[ -z "$1" ]]; then + BAZEL_VERSION=${LATEST_BAZEL_VERSION} + else + BAZEL_VERSION=$1 + fi + rm -rf ~/bazel + mkdir ~/bazel - pushd ~ / - bazel readable_run wget https - : // github.com/bazelbuild/bazel/releases/download/"${BAZEL_VERSION}"/bazel-"${BAZEL_VERSION}"-installer-linux-x86_64.sh - chmod + - x bazel - *.sh./ bazel - "${BAZEL_VERSION}" - installer - linux - - x86_64.sh-- user rm bazel - "${BAZEL_VERSION}" - installer - linux - - x86_64.sh popd + pushd ~/bazel + readable_run wget https://github.com/bazelbuild/bazel/releases/download/"${BAZEL_VERSION}"/bazel-"${BAZEL_VERSION}"-installer-linux-x86_64.sh + chmod +x bazel-*.sh + ./bazel-"${BAZEL_VERSION}"-installer-linux-x86_64.sh --user + rm bazel-"${BAZEL_VERSION}"-installer-linux-x86_64.sh + popd - PATH = - "/home/kbuilder/bin:$PATH" set_bazel_outdir which bazel bazel version + PATH="/home/kbuilder/bin:$PATH" + set_bazel_outdir + which bazel + bazel version }
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/tools/pip_package/rpi/Dockerfile.py3 b/third_party/tflite_support/src/tensorflow_lite_support/tools/pip_package/rpi/Dockerfile.py3 index 74ed5d9..a1eb166 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/tools/pip_package/rpi/Dockerfile.py3 +++ b/third_party/tflite_support/src/tensorflow_lite_support/tools/pip_package/rpi/Dockerfile.py3
@@ -29,6 +29,7 @@ git && \ apt-get clean +RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata # Install Python packages. RUN dpkg --add-architecture armhf RUN dpkg --add-architecture arm64 @@ -37,6 +38,7 @@ apt-get install -y \ python$PYTHON_VERSION \ python$PYTHON_VERSION-dev \ + python$PYTHON_VERSION-venv \ python$PYTHON_VERSION-distutils \ libpython$PYTHON_VERSION-dev \ libpython$PYTHON_VERSION-dev:armhf \
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/tools/pip_package/rpi/Makefile b/third_party/tflite_support/src/tensorflow_lite_support/tools/pip_package/rpi/Makefile index 3e5705e..fde8165 100644 --- a/third_party/tflite_support/src/tensorflow_lite_support/tools/pip_package/rpi/Makefile +++ b/third_party/tflite_support/src/tensorflow_lite_support/tools/pip_package/rpi/Makefile
@@ -13,7 +13,7 @@ # limitations under the License. # Values: debian:<version>, ubuntu:<version> -BASE_IMAGE ?= ubuntu:16.04 +BASE_IMAGE ?= ubuntu:18.04 PYTHON_VERSION ?= 3.9 # Nightly flag for build_arm_pip_package.sh
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/tools/pip_package/rpi/build_arm_pip_package.sh b/third_party/tflite_support/src/tensorflow_lite_support/tools/pip_package/rpi/build_arm_pip_package.sh index e2ad7ac..5580f4a 100755 --- a/third_party/tflite_support/src/tensorflow_lite_support/tools/pip_package/rpi/build_arm_pip_package.sh +++ b/third_party/tflite_support/src/tensorflow_lite_support/tools/pip_package/rpi/build_arm_pip_package.sh
@@ -1,37 +1,24 @@ -#!/ usr / bin / env bash -#Copyright 2021 The TensorFlow Authors.All Rights Reserved. +#!/usr/bin/env bash +# Copyright 2021 The TensorFlow Authors. All Rights Reserved. # -#Licensed under the Apache License, Version 2.0(the "License"); -#you may not use this file except in compliance with the License. -#You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -#http: // www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # -#Unless required by applicable law or agreed to in writing, software -#distributed under the License is distributed on an "AS IS" BASIS, -#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -#See the License for the specific language governing permissions and -#limitations under the License. -#== == == == == == == == == == == == == == == == == == == == == == == == == == \ - == == == == == == == == == == == == == +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================================== -set - ex +set -ex - NIGHTLY_FLAG = - $1 +NIGHTLY_FLAG=$1 - bazel build - - c opt-- config = - elinux_armhf tensorflow_lite_support / tools / - pip_package : build_pip_package EXTRA_PKG_NAME_FLAG = - "--plat-name=manylinux2014-armv7l"./ bazel - - bin / tensorflow_lite_support / tools / pip_package / - build_pip_package-- dst wheels ${NIGHTLY_FLAG} bazel build - - c opt-- config = - elinux_aarch64 tensorflow_lite_support / tools / - pip_package : build_pip_package EXTRA_PKG_NAME_FLAG = - "--plat-name=manylinux2014-aarch64"./ bazel - - bin / tensorflow_lite_support / tools / pip_package / - build_pip_package-- dst wheels $ { - NIGHTLY_FLAG -} +bazel build -c opt --config=elinux_armhf tensorflow_lite_support/tools/pip_package:build_pip_package +EXTRA_PKG_NAME_FLAG="--plat-name=manylinux2014-armv7l" ./bazel-bin/tensorflow_lite_support/tools/pip_package/build_pip_package --dst wheels ${NIGHTLY_FLAG} +bazel build -c opt --config=elinux_aarch64 tensorflow_lite_support/tools/pip_package:build_pip_package +EXTRA_PKG_NAME_FLAG="--plat-name=manylinux2014-aarch64" ./bazel-bin/tensorflow_lite_support/tools/pip_package/build_pip_package --dst wheels ${NIGHTLY_FLAG}
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/tools/pip_package/rpi/install_bazel.sh b/third_party/tflite_support/src/tensorflow_lite_support/tools/pip_package/rpi/install_bazel.sh index fd376bf8..9e3c076 100755 --- a/third_party/tflite_support/src/tensorflow_lite_support/tools/pip_package/rpi/install_bazel.sh +++ b/third_party/tflite_support/src/tensorflow_lite_support/tools/pip_package/rpi/install_bazel.sh
@@ -1,53 +1,40 @@ -#!/ usr / bin / env bash -#Copyright 2015 The TensorFlow Authors.All Rights Reserved. +#!/usr/bin/env bash +# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # -#Licensed under the Apache License, Version 2.0(the "License"); -#you may not use this file except in compliance with the License. -#You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -#http: // www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # -#Unless required by applicable law or agreed to in writing, software -#distributed under the License is distributed on an "AS IS" BASIS, -#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -#See the License for the specific language governing permissions and -#limitations under the License. -#== == == == == == == == == == == == == == == == == == == == == == == == == == \ - == == == == == == == == == == == == == +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================================== -#Select bazel version. -BAZEL_VERSION = "4.2.2" +# Select bazel version. +BAZEL_VERSION="4.2.2" - set + - e local_bazel_ver = - $(bazel version 2 > &1 | grep - i label | awk '{print $3}') +set +e +local_bazel_ver=$(bazel version 2>&1 | grep -i label | awk '{print $3}') - if[["$local_bazel_ver" == "$BAZEL_VERSION"]]; -then exit 0 fi +if [[ "$local_bazel_ver" == "$BAZEL_VERSION" ]]; then + exit 0 +fi - set - - e +set -e -#Install bazel. - mkdir - - p / bazel cd / - bazel if[[!-f "bazel-$BAZEL_VERSION-installer-linux-x86_64.sh"]]; -then curl - fSsL - - O https - : // github.com/bazelbuild/bazel/releases/download/$BAZEL_VERSION/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh - fi chmod + - x / bazel / bazel - - *.sh / bazel / bazel - - $BAZEL_VERSION - - installer - - linux - - x86_64.sh rm - - f / bazel / bazel - - $BAZEL_VERSION - - installer - - linux - - x86_64.sh +# Install bazel. +mkdir -p /bazel +cd /bazel +if [[ ! -f "bazel-$BAZEL_VERSION-installer-linux-x86_64.sh" ]]; then + curl -fSsL -O https://github.com/bazelbuild/bazel/releases/download/$BAZEL_VERSION/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh +fi +chmod +x /bazel/bazel-*.sh +/bazel/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh +rm -f /bazel/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh -#Enable bazel auto completion. - echo "source /usr/local/lib/bazel/bin/bazel-complete.bash" >> - ~ /.bashrc +# Enable bazel auto completion. +echo "source /usr/local/lib/bazel/bin/bazel-complete.bash" >> ~/.bashrc
diff --git a/third_party/tflite_support/src/third_party/pybind11_protobuf/com_google_protobuf_build.patch b/third_party/tflite_support/src/third_party/pybind11_protobuf/com_google_protobuf_build.patch index 6053378..01ecf02 100644 --- a/third_party/tflite_support/src/third_party/pybind11_protobuf/com_google_protobuf_build.patch +++ b/third_party/tflite_support/src/third_party/pybind11_protobuf/com_google_protobuf_build.patch
@@ -1,9 +1,9 @@ --- -BUILD++ + BUILD @ @-889, 6 + 889, - 8 @@ - "//conditions:default" : [], - ":use_fast_cpp_protos" - : ["//external:python_headers"], -}), +--- BUILD ++++ BUILD +@@ -889,6 +889,8 @@ + "//conditions:default": [], + ":use_fast_cpp_protos": ["//external:python_headers"], + }), + + visibility = ["//visibility:public"], )
diff --git a/third_party/webgpu-cts/scripts/generate_telemetry_expectations.js b/third_party/webgpu-cts/scripts/generate_telemetry_expectations.js index c3a8e76..37524b44 100644 --- a/third_party/webgpu-cts/scripts/generate_telemetry_expectations.js +++ b/third_party/webgpu-cts/scripts/generate_telemetry_expectations.js
@@ -20,8 +20,17 @@ try { const loader = new DefaultTestFileLoader(); for (const entry of expectations) { - for (const testcase of await loader.loadCases(parseQuery(entry.q))) { - const name = testcase.query.toString(); + const q = parseQuery(entry.q); + // Multicase query expectations with depthInLevel > 0, should be expanded out since the + // case parameters are unordered. + // ex.) you can suppress test:foo="b";* and/or test:bar="c";* and/or test:foo="d";bar="a";* + // All other expectations may end in a * wildcard since the prefix is stable. + const expandAllTestcases = q.isMultiCase && q.depthInLevel > 0; + const testcases = Array.from(await loader.loadCases(q)); + const tests = expandAllTestcases + ? testcases.map(testcase => testcase.query.toString()) + : [q.toString()]; + for (const name of tests) { if (entry.b) { outStream.write(entry.b); outStream.write(' '); @@ -47,6 +56,9 @@ outStream.write(' ]') } + if (!expandAllTestcases) { + outStream.write(` # ${testcases.length} testcases`); + } outStream.write('\n'); } }
diff --git a/third_party/widevine/cdm/widevine.gni b/third_party/widevine/cdm/widevine.gni index 8c2d16b..b5821bf 100644 --- a/third_party/widevine/cdm/widevine.gni +++ b/third_party/widevine/cdm/widevine.gni
@@ -24,7 +24,8 @@ # architectures. Notably on Android library CDM is not used and Widevine is # supported via Android MediaDrm API. library_widevine_cdm_available = - (is_chromeos && (target_cpu == "x64" || target_cpu == "arm")) || + (is_chromeos && + (target_cpu == "x64" || target_cpu == "arm" || target_cpu == "arm64")) || (target_os == "linux" && target_cpu == "x64") || (target_os == "mac" && (target_cpu == "x64" || target_cpu == "arm64")) || (target_os == "win" && (target_cpu == "x86" || target_cpu == "x64"))
diff --git a/third_party/wpt_tools/README.chromium b/third_party/wpt_tools/README.chromium index c5cc58b..636339fd 100644 --- a/third_party/wpt_tools/README.chromium +++ b/third_party/wpt_tools/README.chromium
@@ -1,7 +1,7 @@ Name: web-platform-tests - Test Suites for Web Platform specifications Short Name: wpt URL: https://github.com/web-platform-tests/wpt/ -Version: c4685f7e4b654d5ee7a1b37466286e782747d2b9 +Version: e0a72ad1cebe5f0cb794627777754decb3597e40 License: LICENSES FOR W3C TEST SUITES (https://www.w3.org/Consortium/Legal/2008/03-bsd-license.html) License File: NOT_SHIPPED Security Critical: no
diff --git a/third_party/wpt_tools/wpt/tools/gitignore/gitignore.py b/third_party/wpt_tools/wpt/tools/gitignore/gitignore.py index 1fd99e0..e9f3e534e 100644 --- a/third_party/wpt_tools/wpt/tools/gitignore/gitignore.py +++ b/third_party/wpt_tools/wpt/tools/gitignore/gitignore.py
@@ -27,7 +27,7 @@ def fnmatch_translate(pat): # type: (bytes) -> Tuple[bool, Pattern[bytes]] parts = [] - seq = None + seq = None # type: Optional[int] i = 0 any_char = b"[^/]" if pat[0:1] == b"/": @@ -60,10 +60,10 @@ # TODO: this doesn't really handle invalid sequences in the right way if c == b"]": seq = None - if parts[-1:] == b"[": + if parts[-1] == b"[": parts = parts[:-1] - elif parts[-1:] == b"^" and parts[-2:-1] == b"[": - parts = parts[:-2] + elif parts[-1] == b"^" and parts[-2] == b"[": + raise ValueError else: parts.append(c) elif c == b"-":
diff --git a/third_party/wpt_tools/wpt/tools/lint/lint.py b/third_party/wpt_tools/wpt/tools/lint/lint.py index 2ad0ee19..5474cacd 100644 --- a/third_party/wpt_tools/wpt/tools/lint/lint.py +++ b/third_party/wpt_tools/wpt/tools/lint/lint.py
@@ -581,8 +581,11 @@ errors.append(rules.VariantMissing.error(path)) else: variant = element.attrib["content"] - if variant != "" and variant[0] not in ("?", "#"): - errors.append(rules.MalformedVariant.error(path, (path,))) + if variant != "": + if (variant[0] not in ("?", "#") or + len(variant) == 1 or + (variant[0] == "?" and variant[1] == "#")): + errors.append(rules.MalformedVariant.error(path, (path,))) required_elements.extend(key for key, value in {"testharness": True, "testharnessreport": len(testharnessreport_nodes) > 0,
diff --git a/third_party/wpt_tools/wpt/tools/manifest/item.py b/third_party/wpt_tools/wpt/tools/manifest/item.py index 60164c5..58547e6 100644 --- a/third_party/wpt_tools/wpt/tools/manifest/item.py +++ b/third_party/wpt_tools/wpt/tools/manifest/item.py
@@ -8,16 +8,7 @@ MYPY = False if MYPY: # MYPY is set to True when run under Mypy. - from typing import Optional - from typing import Text - from typing import Dict - from typing import Tuple - from typing import List - from typing import Union - from typing import Type - from typing import Any - from typing import Sequence - from typing import Hashable + from typing import Any, Dict, Hashable, List, Optional, Sequence, Text, Tuple, Type, Union, cast from .manifest import Manifest Fuzzy = Dict[Optional[Tuple[Text, Text, Text]], List[int]] PageRanges = Dict[Text, List[int]] @@ -31,14 +22,23 @@ attribute, and otherwise behaves like an ABCMeta.""" def __new__(cls, name, bases, attrs): - # type: (Type[ManifestItemMeta], str, Tuple[ManifestItemMeta, ...], Dict[str, Any]) -> ManifestItemMeta - rv = super(ManifestItemMeta, cls).__new__(cls, name, bases, attrs) - if not isabstract(rv): - assert issubclass(rv, ManifestItem) - assert isinstance(rv.item_type, str) - item_types[rv.item_type] = rv + # type: (Type[ManifestItemMeta], str, Tuple[type], Dict[str, Any]) -> ManifestItemMeta + inst = super(ManifestItemMeta, cls).__new__(cls, name, bases, attrs) + if isabstract(inst): + return inst - return rv # type: ignore + assert issubclass(inst, ManifestItem) + if MYPY: + inst_ = cast(Type[ManifestItem], inst) + item_type = cast(str, inst_.item_type) + else: + inst_ = inst + assert isinstance(inst_.item_type, str) + item_type = inst_.item_type + + item_types[item_type] = inst_ + + return inst_ class ManifestItem(metaclass=ManifestItemMeta):
diff --git a/third_party/wpt_tools/wpt/tools/manifest/sourcefile.py b/third_party/wpt_tools/wpt/tools/manifest/sourcefile.py index b219485..d5f97cb 100644 --- a/third_party/wpt_tools/wpt/tools/manifest/sourcefile.py +++ b/third_party/wpt_tools/wpt/tools/manifest/sourcefile.py
@@ -174,7 +174,9 @@ doc = html5lib.parse(f, treebuilder="etree", useChardet=False) if MYPY: return cast(ElementTree.Element, doc) - return doc + else: + # (needs to be in else for mypy to believe this is reachable) + return doc def _parse_xml(f): # type: (BinaryIO) -> ElementTree.Element @@ -714,7 +716,12 @@ rv.append(variant) for variant in rv: - assert variant == "" or variant[0] in ["#", "?"], variant + if variant != "": + if variant[0] not in ("#", "?"): + raise ValueError("Non-empty variant must start with either a ? or a #") + if len(variant) == 1 or (variant[0] == "?" and variant[1] == "#"): + raise ValueError("Variants must not have empty fragment or query " + + "(omit the empty part instead)") if not rv: rv = [""]
diff --git a/third_party/wpt_tools/wpt/tools/manifest/typedata.py b/third_party/wpt_tools/wpt/tools/manifest/typedata.py index bd382a7d..6c7080f 100644 --- a/third_party/wpt_tools/wpt/tools/manifest/typedata.py +++ b/third_party/wpt_tools/wpt/tools/manifest/typedata.py
@@ -146,8 +146,8 @@ def __iter__(self): # type: () -> Iterator[Tuple[Text, ...]] """Iterator over keys in the TypeData in codepoint order""" - data_node = self._data # type: Optional[Dict[Text, Any]] - json_node = self._json_data # type: Optional[Dict[Text, Any]] + data_node = self._data # type: Optional[Union[Dict[Text, Any], Set[item.ManifestItem]]] + json_node = self._json_data # type: Optional[Union[Dict[Text, Any], List[Any]]] path = tuple() # type: Tuple[Text, ...] stack = [(data_node, json_node, path)] while stack: @@ -174,7 +174,7 @@ # type: () -> int count = 0 - stack = [self._data] + stack = [self._data] # type: List[Union[Dict[Text, Any], Set[item.ManifestItem]]] while stack: v = stack.pop() if isinstance(v, set): @@ -182,13 +182,13 @@ else: stack.extend(v.values()) - stack = [self._json_data] - while stack: - v = stack.pop() - if isinstance(v, list): + json_stack = [self._json_data] # type: List[Union[Dict[Text, Any], List[Any]]] + while json_stack: + json_v = json_stack.pop() + if isinstance(json_v, list): count += 1 else: - stack.extend(v.values()) + json_stack.extend(json_v.values()) return count
diff --git a/third_party/wpt_tools/wpt/tools/manifest/utils.py b/third_party/wpt_tools/wpt/tools/manifest/utils.py index 36c1a98..c8b6e6e3 100644 --- a/third_party/wpt_tools/wpt/tools/manifest/utils.py +++ b/third_party/wpt_tools/wpt/tools/manifest/utils.py
@@ -1,6 +1,6 @@ import os -import platform import subprocess +import sys MYPY = False if MYPY: @@ -31,7 +31,7 @@ def from_os_path(path): # type: (Text) -> Text - assert os.path.sep == u"/" or platform.system() == "Windows" + assert os.path.sep == u"/" or sys.platform == "win32" if u"/" == os.path.sep: rv = path else: @@ -43,7 +43,7 @@ def to_os_path(path): # type: (Text) -> Text - assert os.path.sep == u"/" or platform.system() == "Windows" + assert os.path.sep == u"/" or sys.platform == "win32" if u"\\" in path: raise ValueError("normalised path contains \\") if u"/" == os.path.sep: @@ -59,7 +59,7 @@ try: return subprocess.check_output(full_cmd, cwd=path, stderr=subprocess.STDOUT).decode('utf8') except Exception as e: - if platform.uname()[0] == "Windows" and isinstance(e, WindowsError): + if sys.platform == "win32" and isinstance(e, WindowsError): full_cmd[0] = u"git.bat" return subprocess.check_output(full_cmd, cwd=path, stderr=subprocess.STDOUT).decode('utf8') else:
diff --git a/third_party/wpt_tools/wpt/tools/manifest/vcs.py b/third_party/wpt_tools/wpt/tools/manifest/vcs.py index 65ba308..88ea5fd 100644 --- a/third_party/wpt_tools/wpt/tools/manifest/vcs.py +++ b/third_party/wpt_tools/wpt/tools/manifest/vcs.py
@@ -102,10 +102,7 @@ extras=[b".git/"], cache=self.ignore_cache) git = GitHasher(tests_root) - if git is not None: - self.hash_cache = git.hash_cache() - else: - self.hash_cache = {} + self.hash_cache = git.hash_cache() def __iter__(self): # type: () -> Iterator[Tuple[Text, Optional[Text], bool]]
diff --git a/third_party/wpt_tools/wpt/tools/webdriver/webdriver/bidi/transport.py b/third_party/wpt_tools/wpt/tools/webdriver/webdriver/bidi/transport.py index 4e0a670..afe0545 100644 --- a/third_party/wpt_tools/wpt/tools/webdriver/webdriver/bidi/transport.py +++ b/third_party/wpt_tools/wpt/tools/webdriver/webdriver/bidi/transport.py
@@ -12,10 +12,12 @@ def get_running_loop() -> asyncio.AbstractEventLoop: if sys.version_info >= (3, 7): return asyncio.get_running_loop() - # Unlike the above, this will actually create an event loop - # if there isn't one; hopefully running tests in Python >= 3.7 - # will allow us to catch any behaviour difference - return asyncio.get_event_loop() + else: + # Unlike the above, this will actually create an event loop + # if there isn't one; hopefully running tests in Python >= 3.7 + # will allow us to catch any behaviour difference + # (Needs to be in else for mypy to believe this is reachable) + return asyncio.get_event_loop() class Transport:
diff --git a/third_party/wpt_tools/wpt/tools/wpt/android.py b/third_party/wpt_tools/wpt/tools/wpt/android.py index d25aa47..e3e5a06 100644 --- a/third_party/wpt_tools/wpt/tools/wpt/android.py +++ b/third_party/wpt_tools/wpt/tools/wpt/android.py
@@ -5,6 +5,7 @@ import subprocess import requests +from .wpt import venv_dir android_device = None @@ -36,7 +37,7 @@ def get_sdk_path(dest): if dest is None: # os.getcwd() doesn't include the venv path - dest = os.path.join(wpt_root, "_venv") + dest = os.path.join(wpt_root, venv_dir()) dest = os.path.join(dest, 'android-sdk') return os.path.abspath(os.environ.get('ANDROID_SDK_PATH', dest))
diff --git a/third_party/wpt_tools/wpt/tools/wpt/browser.py b/third_party/wpt_tools/wpt/tools/wpt/browser.py index 4f2b383..b3c9ce2a 100644 --- a/third_party/wpt_tools/wpt/tools/wpt/browser.py +++ b/third_party/wpt_tools/wpt/tools/wpt/browser.py
@@ -13,6 +13,7 @@ import requests from .utils import call, get, rmtree, untar, unzip, get_download_to_descriptor, sha256sum +from .wpt import venv_dir uname = platform.uname() @@ -53,10 +54,10 @@ def __init__(self, logger): self.logger = logger - def _get_dest(self, dest, channel): + def _get_browser_binary_dir(self, dest, channel): if dest is None: # os.getcwd() doesn't include the venv path - dest = os.path.join(os.getcwd(), "_venv") + dest = os.path.join(os.getcwd(), venv_dir()) dest = os.path.join(dest, "browsers", channel) @@ -175,7 +176,7 @@ os_key = (self.platform, uname[4]) if dest is None: - dest = self._get_dest(None, channel) + dest = self._get_browser_binary_dir(None, channel) if channel not in product: raise ValueError("Unrecognised release channel: %s" % channel) @@ -216,7 +217,7 @@ """Install Firefox.""" import mozinstall - dest = self._get_dest(dest, channel) + dest = self._get_browser_binary_dir(dest, channel) filename = os.path.basename(dest) @@ -240,8 +241,7 @@ """Looks for the firefox binary in the virtual environment""" if path is None: - # os.getcwd() doesn't include the venv path - path = os.path.join(os.getcwd(), "_venv", "browsers", channel) + path = self._get_browser_binary_dir(None, channel) binary = None @@ -261,10 +261,8 @@ return binary def find_binary(self, venv_path=None, channel="nightly"): - if venv_path is None: - venv_path = os.path.join(os.getcwd(), "_venv") - path = os.path.join(venv_path, "browsers", channel) + path = self._get_browser_binary_dir(venv_path, channel) binary = self.find_binary_path(path, channel) if not binary and self.platform == "win": @@ -538,7 +536,7 @@ if channel != "nightly": raise NotImplementedError("We can only download Chrome Nightly (Chromium ToT) for you.") if dest is None: - dest = self._get_dest(None, channel) + dest = self._get_browser_binary_dir(None, channel) filename = self._chromium_package_name() + ".zip" url = self._latest_chromium_snapshot_url() + filename @@ -552,7 +550,7 @@ def install(self, dest=None, channel=None): if channel != "nightly": raise NotImplementedError("We can only install Chrome Nightly (Chromium ToT) for you.") - dest = self._get_dest(dest, channel) + dest = self._get_browser_binary_dir(dest, channel) installer_path = self.download(dest, channel) with open(installer_path, "rb") as f: @@ -633,7 +631,7 @@ def find_binary(self, venv_path=None, channel=None): if channel == "nightly": - return self.find_nightly_binary(self._get_dest(venv_path, channel)) + return self.find_nightly_binary(self._get_browser_binary_dir(venv_path, channel)) if uname[0] == "Linux": name = "google-chrome" @@ -1476,7 +1474,7 @@ bundle_url = base_download_dir + bundle_filename if dest is None: - dest = self._get_dest(None, channel) + dest = self._get_browser_binary_dir(None, channel) bundle_file_path = os.path.join(dest, bundle_filename) self.logger.info("Downloading WebKitGTK MiniBrowser bundle from %s" % bundle_url) @@ -1494,7 +1492,7 @@ return bundle_file_path def install(self, dest=None, channel=None, prompt=True): - dest = self._get_dest(dest, channel) + dest = self._get_browser_binary_dir(dest, channel) bundle_path = self.download(dest, channel) bundle_uncompress_directory = os.path.join(dest, "webkitgtk_minibrowser") @@ -1527,7 +1525,7 @@ def _find_executable_in_channel_bundle(self, binary, venv_path=None, channel=None): if venv_path: - venv_base_path = self._get_dest(venv_path, channel) + venv_base_path = self._get_browser_binary_dir(venv_path, channel) bundle_dir = os.path.join(venv_base_path, "webkitgtk_minibrowser") install_ok_file = os.path.join(bundle_dir, ".installation-ok") if os.path.isfile(install_ok_file):
diff --git a/third_party/wpt_tools/wpt/tools/wpt/run.py b/third_party/wpt_tools/wpt/tools/wpt/run.py index 01c29ea..f1bd610c 100644 --- a/third_party/wpt_tools/wpt/tools/wpt/run.py +++ b/third_party/wpt_tools/wpt/tools/wpt/run.py
@@ -395,9 +395,8 @@ kwargs["binary_args"].append("--no-sandbox") -class ChromeAndroid(BrowserSetup): - name = "chrome_android" - browser_cls = browser.ChromeAndroid +class ChromeAndroidBase(BrowserSetup): + experimental_channels = ("dev", "canary") def setup_kwargs(self, kwargs): if kwargs.get("device_serial"): @@ -428,7 +427,15 @@ kwargs["webdriver_binary"] = webdriver_binary else: raise WptrunError("Unable to locate or install chromedriver binary") - if browser_channel in ("dev", "canary"): + + +class ChromeAndroid(ChromeAndroidBase): + name = "chrome_android" + browser_cls = browser.ChromeAndroid + + def setup_kwargs(self, kwargs): + super(ChromeAndroid, self).setup_kwargs(kwargs) + if kwargs["browser_channel"] in self.experimental_channels: logger.info("Automatically turning on experimental features for Chrome Dev/Canary") kwargs["binary_args"].append("--enable-experimental-web-platform-features") # HACK(Hexcles): work around https://github.com/web-platform-tests/wpt/issues/16448 @@ -444,68 +451,21 @@ raise WptrunError("Unable to locate or install chromedriver binary") -class AndroidWeblayer(BrowserSetup): +class AndroidWeblayer(ChromeAndroidBase): name = "android_weblayer" browser_cls = browser.AndroidWeblayer - experimental_channels = ("dev", "canary") def setup_kwargs(self, kwargs): - if kwargs.get("device_serial"): - self.browser.device_serial = kwargs["device_serial"] - browser_channel = kwargs["browser_channel"] - if kwargs["webdriver_binary"] is None: - webdriver_binary = None - if not kwargs["install_webdriver"]: - webdriver_binary = self.browser.find_webdriver() - - if webdriver_binary is None: - install = self.prompt_install("chromedriver") - - if install: - logger.info("Downloading chromedriver") - webdriver_binary = self.browser.install_webdriver( - dest=self.venv.bin_path, - channel=browser_channel) - else: - logger.info("Using webdriver binary %s" % webdriver_binary) - - if webdriver_binary: - kwargs["webdriver_binary"] = webdriver_binary - else: - raise WptrunError("Unable to locate or install chromedriver binary") - if browser_channel in self.experimental_channels: + super(AndroidWeblayer, self).setup_kwargs(kwargs) + if kwargs["browser_channel"] in self.experimental_channels: logger.info("Automatically turning on experimental features for WebLayer Dev/Canary") kwargs["binary_args"].append("--enable-experimental-web-platform-features") -class AndroidWebview(BrowserSetup): +class AndroidWebview(ChromeAndroidBase): name = "android_webview" browser_cls = browser.AndroidWebview - def setup_kwargs(self, kwargs): - if kwargs.get("device_serial"): - self.browser.device_serial = kwargs["device_serial"] - if kwargs["webdriver_binary"] is None: - webdriver_binary = None - if not kwargs["install_webdriver"]: - webdriver_binary = self.browser.find_webdriver() - - if webdriver_binary is None: - install = self.prompt_install("chromedriver") - - if install: - logger.info("Downloading chromedriver") - webdriver_binary = self.browser.install_webdriver( - dest=self.venv.bin_path, - channel=kwargs["browser_channel"]) - else: - logger.info("Using webdriver binary %s" % webdriver_binary) - - if webdriver_binary: - kwargs["webdriver_binary"] = webdriver_binary - else: - raise WptrunError("Unable to locate or install chromedriver binary") - class Opera(BrowserSetup): name = "opera"
diff --git a/third_party/wpt_tools/wpt/tools/wpt/wpt.py b/third_party/wpt_tools/wpt/tools/wpt/wpt.py index ec67518..bcab012 100644 --- a/third_party/wpt_tools/wpt/tools/wpt/wpt.py +++ b/third_party/wpt_tools/wpt/tools/wpt/wpt.py
@@ -137,7 +137,7 @@ def venv_dir(): - return "_venv" + str(sys.version_info[0]) + return f"_venv{sys.version_info[0]}" def setup_virtualenv(path, skip_venv_setup, props):
diff --git a/third_party/wpt_tools/wpt/tools/wptrunner/requirements_edge.txt b/third_party/wpt_tools/wpt/tools/wptrunner/requirements_edge.txt index 600b6eb..6276db1 100644 --- a/third_party/wpt_tools/wpt/tools/wptrunner/requirements_edge.txt +++ b/third_party/wpt_tools/wpt/tools/wptrunner/requirements_edge.txt
@@ -1 +1 @@ -selenium==3.141.0 +selenium==4.1.2
diff --git a/third_party/wpt_tools/wpt/tools/wptrunner/requirements_firefox.txt b/third_party/wpt_tools/wpt/tools/wptrunner/requirements_firefox.txt index c8ac33a7b..76936b1 100644 --- a/third_party/wpt_tools/wpt/tools/wptrunner/requirements_firefox.txt +++ b/third_party/wpt_tools/wpt/tools/wptrunner/requirements_firefox.txt
@@ -7,4 +7,4 @@ mozprofile==2.5.0 mozrunner==8.2.1 mozversion==2.3.0 -psutil==5.8.0 +psutil==5.9.0
diff --git a/third_party/wpt_tools/wpt/tools/wptrunner/requirements_ie.txt b/third_party/wpt_tools/wpt/tools/wptrunner/requirements_ie.txt index 7ad0180..b385a35 100644 --- a/third_party/wpt_tools/wpt/tools/wptrunner/requirements_ie.txt +++ b/third_party/wpt_tools/wpt/tools/wptrunner/requirements_ie.txt
@@ -1,2 +1,2 @@ mozprocess==1.3.0 -selenium==3.141.0 +selenium==4.1.2
diff --git a/third_party/wpt_tools/wpt/tools/wptrunner/requirements_opera.txt b/third_party/wpt_tools/wpt/tools/wptrunner/requirements_opera.txt index 7ad0180..b385a35 100644 --- a/third_party/wpt_tools/wpt/tools/wptrunner/requirements_opera.txt +++ b/third_party/wpt_tools/wpt/tools/wptrunner/requirements_opera.txt
@@ -1,2 +1,2 @@ mozprocess==1.3.0 -selenium==3.141.0 +selenium==4.1.2
diff --git a/third_party/wpt_tools/wpt/tools/wptrunner/requirements_safari.txt b/third_party/wpt_tools/wpt/tools/wptrunner/requirements_safari.txt index e2d08e7..f371e20 100644 --- a/third_party/wpt_tools/wpt/tools/wptrunner/requirements_safari.txt +++ b/third_party/wpt_tools/wpt/tools/wptrunner/requirements_safari.txt
@@ -1 +1 @@ -psutil==5.8.0 +psutil==5.9.0
diff --git a/third_party/wpt_tools/wpt/tools/wptrunner/requirements_sauce.txt b/third_party/wpt_tools/wpt/tools/wptrunner/requirements_sauce.txt index 7d4ff9c..cc5bdf9 100644 --- a/third_party/wpt_tools/wpt/tools/wptrunner/requirements_sauce.txt +++ b/third_party/wpt_tools/wpt/tools/wptrunner/requirements_sauce.txt
@@ -1,2 +1,2 @@ -selenium==3.141.0 +selenium==4.1.2 requests==2.27.1
diff --git a/third_party/wpt_tools/wpt/tools/wptrunner/wptrunner/browsers/firefox.py b/third_party/wpt_tools/wpt/tools/wptrunner/wptrunner/browsers/firefox.py index 0ed7a36..afc7b589 100644 --- a/third_party/wpt_tools/wpt/tools/wptrunner/wptrunner/browsers/firefox.py +++ b/third_party/wpt_tools/wpt/tools/wptrunner/wptrunner/browsers/firefox.py
@@ -108,7 +108,8 @@ "browser_channel": kwargs["browser_channel"], "headless": kwargs["headless"], "preload_browser": kwargs["preload_browser"] and not kwargs["pause_after_test"] and not kwargs["num_test_groups"] == 1, - "specialpowers_path": kwargs["specialpowers_path"]} + "specialpowers_path": kwargs["specialpowers_path"], + "debug_test": kwargs["debug_test"]} def executor_kwargs(logger, test_type, test_environment, run_info_data, @@ -552,7 +553,7 @@ class ProfileCreator: def __init__(self, logger, prefs_root, config, test_type, extra_prefs, e10s, - enable_fission, browser_channel, binary, certutil_binary, + enable_fission, debug_test, browser_channel, binary, certutil_binary, ca_certificate_path): self.logger = logger self.prefs_root = prefs_root @@ -561,6 +562,7 @@ self.extra_prefs = extra_prefs self.e10s = e10s self.enable_fission = enable_fission + self.debug_test = debug_test self.browser_channel = browser_channel self.ca_certificate_path = ca_certificate_path self.binary = binary @@ -649,6 +651,9 @@ "5.1" in platform.version()): self.profile.set_preferences({"layers.acceleration.disabled": True}) + if self.debug_test: + profile.set_preferences({"devtools.console.stdout.content": True}) + def _setup_ssl(self, profile): """Create a certificate database to use in the test profile. This is configured to trust the CA Certificate that has signed the web-platform.test server @@ -710,7 +715,7 @@ stackfix_dir=None, binary_args=None, timeout_multiplier=None, leak_check=False, asan=False, stylo_threads=1, chaos_mode_flags=None, config=None, browser_channel="nightly", headless=None, preload_browser=False, - specialpowers_path=None, **kwargs): + specialpowers_path=None, debug_test=False, **kwargs): Browser.__init__(self, logger) self.logger = logger @@ -737,6 +742,7 @@ extra_prefs, e10s, enable_fission, + debug_test, browser_channel, binary, certutil_binary, @@ -817,7 +823,7 @@ certutil_binary=None, ca_certificate_path=None, e10s=False, enable_fission=False, stackfix_dir=None, leak_check=False, asan=False, stylo_threads=1, chaos_mode_flags=None, config=None, - browser_channel="nightly", headless=None, **kwargs): + browser_channel="nightly", headless=None, debug_test=False, **kwargs): super().__init__(logger, binary, webdriver_binary, webdriver_args) self.binary = binary @@ -840,6 +846,7 @@ extra_prefs, e10s, enable_fission, + debug_test, browser_channel, binary, certutil_binary, @@ -876,12 +883,13 @@ super().start(group_metadata, **kwargs) def stop(self, force=False): - # Initially wait for any WebDriver session to cleanly shutdown - # When this is called the executor is usually sending a end session + # Initially wait for any WebDriver session to cleanly shutdown if the + # process doesn't have to be force stopped. + # When this is called the executor is usually sending an end session # command to the browser. We don't have a synchronisation mechanism # that allows us to know that process is ongoing, so poll the status # endpoint until there isn't a session, before killing the driver. - if self.is_alive(): + if self.is_alive() and not force: end_time = time.time() + BrowserInstance.shutdown_timeout while time.time() < end_time: self.logger.debug("Waiting for WebDriver session to end")
diff --git a/third_party/wpt_tools/wpt/tools/wptrunner/wptrunner/browsers/firefox_android.py b/third_party/wpt_tools/wpt/tools/wptrunner/wptrunner/browsers/firefox_android.py index 66821b8..ebee299 100644 --- a/third_party/wpt_tools/wpt/tools/wptrunner/wptrunner/browsers/firefox_android.py +++ b/third_party/wpt_tools/wpt/tools/wptrunner/wptrunner/browsers/firefox_android.py
@@ -69,7 +69,8 @@ "config": config, "install_fonts": kwargs["install_fonts"], "tests_root": config.doc_root, - "specialpowers_path": kwargs["specialpowers_path"]} + "specialpowers_path": kwargs["specialpowers_path"], + "debug_test": kwargs["debug_test"]} def executor_kwargs(logger, test_type, test_environment, run_info_data, @@ -114,9 +115,9 @@ class ProfileCreator(FirefoxProfileCreator): def __init__(self, logger, prefs_root, config, test_type, extra_prefs, - enable_fission, browser_channel, certutil_binary, ca_certificate_path): + enable_fission, debug_test, browser_channel, certutil_binary, ca_certificate_path): super(ProfileCreator, self).__init__(logger, prefs_root, config, test_type, extra_prefs, - True, enable_fission, browser_channel, None, + True, enable_fission, debug_test, browser_channel, None, certutil_binary, ca_certificate_path) def _set_required_prefs(self, profile): @@ -155,7 +156,7 @@ binary_args=None, timeout_multiplier=None, leak_check=False, asan=False, stylo_threads=1, chaos_mode_flags=None, config=None, browser_channel="nightly", install_fonts=False, tests_root=None, specialpowers_path=None, adb_binary=None, - **kwargs): + debug_test=False, **kwargs): super(FirefoxAndroidBrowser, self).__init__(logger) self.prefs_root = prefs_root @@ -189,6 +190,7 @@ test_type, extra_prefs, False, + debug_test, browser_channel, certutil_binary, ca_certificate_path)
diff --git a/third_party/wpt_tools/wpt/tools/wptrunner/wptrunner/executors/executormarionette.py b/third_party/wpt_tools/wpt/tools/wptrunner/wptrunner/executors/executormarionette.py index b1ee026..cc81888 100644 --- a/third_party/wpt_tools/wpt/tools/wptrunner/wptrunner/executors/executormarionette.py +++ b/third_party/wpt_tools/wpt/tools/wptrunner/wptrunner/executors/executormarionette.py
@@ -274,15 +274,18 @@ self.marionette = self.parent.marionette def set(self, name, value): + if not isinstance(value, str): + value = str(value) + if value.lower() not in ("true", "false"): try: int(value) except ValueError: - value = "'%s'" % value + value = f"'{value}'" else: value = value.lower() - self.logger.info("Setting pref %s (%s)" % (name, value)) + self.logger.info(f"Setting pref {name} to {value}") script = """ let prefInterface = Components.classes["@mozilla.org/preferences-service;1"] @@ -325,7 +328,7 @@ self.marionette.execute_script(script) def clear(self, name): - self.logger.info("Clearing pref %s" % (name)) + self.logger.info(f"Clearing pref {name}") script = """ let prefInterface = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); @@ -353,7 +356,9 @@ } """ % name with self.marionette.using_context(self.marionette.CONTEXT_CHROME): - self.marionette.execute_script(script) + rv = self.marionette.execute_script(script) + self.logger.debug(f"Got pref {name} with value {rv}") + return rv class MarionetteStorageProtocolPart(StorageProtocolPart): @@ -900,7 +905,7 @@ return (test.result_cls(extra=extra, *data), []) def do_testharness(self, protocol, url, timeout): - parent_window = protocol.testharness.close_old_windows(protocol) + parent_window = protocol.testharness.close_old_windows(self.last_environment["protocol"]) if self.protocol.coverage.is_enabled: self.protocol.coverage.reset() @@ -967,6 +972,8 @@ self.debug = debug self.debug_test = debug_test + self.install_extensions = browser.extensions + with open(os.path.join(here, "reftest.js")) as f: self.script = f.read() with open(os.path.join(here, "test-wait.js")) as f: @@ -978,6 +985,11 @@ def setup(self, runner): super(MarionetteRefTestExecutor, self).setup(runner) + for extension_path in self.install_extensions: + self.logger.info("Installing extension from %s" % extension_path) + addons = Addons(self.protocol.marionette) + addons.install(extension_path) + self.implementation.setup(**self.implementation_kwargs) def teardown(self):
diff --git a/third_party/wpt_tools/wpt/tools/wptrunner/wptrunner/products.py b/third_party/wpt_tools/wpt/tools/wptrunner/wptrunner/products.py index e65df5ee..cf09d90 100644 --- a/third_party/wpt_tools/wpt/tools/wptrunner/wptrunner/products.py +++ b/third_party/wpt_tools/wpt/tools/wptrunner/wptrunner/products.py
@@ -4,16 +4,8 @@ from .browsers import product_list -def products_enabled(config): - names = config.get("products", {}).keys() - if not names: - return product_list - else: - return names - - def product_module(config, product): - if product not in products_enabled(config): + if product not in product_list: raise ValueError("Unknown product %s" % product) path = config.get("products", {}).get(product, None)
diff --git a/third_party/wpt_tools/wpt/tools/wptrunner/wptrunner/stability.py b/third_party/wpt_tools/wpt/tools/wptrunner/wptrunner/stability.py index efae240..e9dc3203 100644 --- a/third_party/wpt_tools/wpt/tools/wptrunner/wptrunner/stability.py +++ b/third_party/wpt_tools/wpt/tools/wptrunner/wptrunner/stability.py
@@ -288,19 +288,19 @@ # warning+ level logs only logger.add_handler(StreamHandler(log, JSONFormatter())) - # Use the number of iterations of the test suite that were run to process the results. - # if the runs were stopped to avoid hitting the maximum run time. _, test_status = wptrunner.run_tests(**kwargs) iterations = test_status.repeated_runs - all_skipped = test_status.all_skipped + + if not restart_after_iteration: + iterations = kwargs["rerun"] logger._state.handlers = initial_handlers logger._state.running_tests = set() logger._state.suite_started = False log.seek(0) - results, inconsistent, slow = process_results(log, iterations) - return results, inconsistent, slow, iterations, all_skipped + results, inconsistent, slow = process_results(log, test_status.repeated_runs) + return test_status, results, inconsistent, slow def get_steps(logger, repeat_loop, repeat_restart, kwargs_extras): @@ -375,8 +375,14 @@ logger.info(':::') logger.info('::: Running test verification step "%s"...' % desc) logger.info(':::') - results, inconsistent, slow, iterations, all_skipped = step_func(**kwargs) + test_status, results, inconsistent, slow = step_func(**kwargs) + # Use the number of iterations of the test suite that were run to process the results. + # if the runs were stopped to avoid hitting the maximum run time. + iterations = test_status.repeated_runs + all_skipped = test_status.all_skipped + + logger.info(f"::: Ran {iterations} of expected {expected_iterations} iterations.") if iterations <= 1 and expected_iterations > 1 and not all_skipped: step_results.append((desc, "FAIL")) logger.info("::: Reached iteration timeout before finishing 2 or more repeat runs.")
diff --git a/third_party/wpt_tools/wpt/tools/wptrunner/wptrunner/testrunner.py b/third_party/wpt_tools/wpt/tools/wptrunner/wptrunner/testrunner.py index ca214b7..0c75683 100644 --- a/third_party/wpt_tools/wpt/tools/wptrunner/wptrunner/testrunner.py +++ b/third_party/wpt_tools/wpt/tools/wptrunner/wptrunner/testrunner.py
@@ -247,9 +247,9 @@ initializing = namedtuple("initializing", ["test", "test_group", "group_metadata", "failure_count"]) running = namedtuple("running", ["test", "test_group", "group_metadata"]) - restarting = namedtuple("restarting", ["test", "test_group", "group_metadata"]) + restarting = namedtuple("restarting", ["test", "test_group", "group_metadata", "force_stop"]) error = namedtuple("error", []) - stop = namedtuple("stop", []) + stop = namedtuple("stop", ["force_stop"]) RunnerManagerState = _RunnerManagerState() @@ -351,7 +351,7 @@ RunnerManagerState.before_init: self.start_init, RunnerManagerState.initializing: self.init, RunnerManagerState.running: self.run_test, - RunnerManagerState.restarting: self.restart_runner + RunnerManagerState.restarting: self.restart_runner, } self.state = RunnerManagerState.before_init() @@ -386,8 +386,8 @@ raise finally: self.logger.debug("TestRunnerManager main loop terminating, starting cleanup") - clean = isinstance(self.state, RunnerManagerState.stop) - self.stop_runner(force=not clean) + force_stop = not isinstance(self.state, RunnerManagerState.stop) or self.state.force_stop + self.stop_runner(force=force_stop) self.teardown() self.logger.debug("TestRunnerManager main loop terminated") @@ -418,12 +418,15 @@ self.logger.debug("Got command: %r" % command) except IOError: self.logger.error("Got IOError from poll") - return RunnerManagerState.restarting(0) + return RunnerManagerState.restarting(self.state.test, + self.state.test_group, + self.state.group_metadata, + False) except Empty: if (self.debug_info and self.debug_info.interactive and self.browser.started and not self.browser.is_alive()): self.logger.debug("Debugger exited") - return RunnerManagerState.stop() + return RunnerManagerState.stop(False) if (isinstance(self.state, RunnerManagerState.running) and not self.test_runner_proc.is_alive()): @@ -443,7 +446,10 @@ self.logger.critical("Last test did not complete") return RunnerManagerState.error() self.logger.warning("More tests found, but runner process died, restarting") - return RunnerManagerState.restarting(0) + return RunnerManagerState.restarting(self.state.test, + self.state.test_group, + self.state.group_metadata, + False) else: f = (dispatch.get(self.state.__class__, {}).get(command) or dispatch.get(None, {}).get(command)) @@ -460,7 +466,7 @@ test, test_group, group_metadata = self.get_next_test() self.recording.set(["testrunner", "init"]) if test is None: - return RunnerManagerState.stop() + return RunnerManagerState.stop(True) else: return RunnerManagerState.initializing(test, test_group, group_metadata, 0) @@ -551,7 +557,8 @@ self.logger.info("Restarting browser for new test environment") return RunnerManagerState.restarting(self.state.test, self.state.test_group, - self.state.group_metadata) + self.state.group_metadata, + False) self.recording.set(["testrunner", "test"] + self.state.test.id.split("/")[1:]) self.logger.test_start(self.state.test.id) @@ -685,6 +692,7 @@ file_result.status in ("CRASH", "EXTERNAL-TIMEOUT", "INTERNAL-ERROR") or ((subtest_unexpected or is_unexpected) and self.restart_on_unexpected)) + force_stop = test.test_type == "wdspec" and file_result.status == "EXTERNAL-TIMEOUT" self.recording.set(["testrunner", "after-test"]) if (not file_result.status == "CRASH" and @@ -693,7 +701,7 @@ self.logger.info("Pausing until the browser exits") self.send_message("wait") else: - return self.after_test_end(test, restart_before_next) + return self.after_test_end(test, restart_before_next, force_stop=force_stop) def wait_finished(self, rerun=False): assert isinstance(self.state, RunnerManagerState.running) @@ -703,7 +711,7 @@ # post-stop processing return self.after_test_end(self.state.test, not rerun, force_rerun=rerun) - def after_test_end(self, test, restart, force_rerun=False): + def after_test_end(self, test, restart, force_rerun=False, force_stop=False): assert isinstance(self.state, RunnerManagerState.running) # Mixing manual reruns and automatic reruns is confusing; we currently assume # that as long as we've done at least the automatic run count in total we can @@ -711,7 +719,7 @@ if not force_rerun and self.run_count >= self.rerun: test, test_group, group_metadata = self.get_next_test() if test is None: - return RunnerManagerState.stop() + return RunnerManagerState.stop(force_stop) if test_group is not self.state.test_group: # We are starting a new group of tests, so force a restart self.logger.info("Restarting browser for new test group") @@ -720,14 +728,14 @@ test_group = self.state.test_group group_metadata = self.state.group_metadata if restart: - return RunnerManagerState.restarting(test, test_group, group_metadata) + return RunnerManagerState.restarting(test, test_group, group_metadata, force_stop) else: return RunnerManagerState.running(test, test_group, group_metadata) def restart_runner(self): """Stop and restart the TestRunner""" assert isinstance(self.state, RunnerManagerState.restarting) - self.stop_runner() + self.stop_runner(force=self.state.force_stop) return RunnerManagerState.initializing(self.state.test, self.state.test_group, self.state.group_metadata, 0) def log(self, data): @@ -794,7 +802,7 @@ def runner_teardown(self): self.ensure_runner_stopped() - return RunnerManagerState.stop() + return RunnerManagerState.stop(False) def send_message(self, command, *args): """Send a message to the remote queue (to Executor)."""
diff --git a/third_party/wpt_tools/wpt/tools/wptrunner/wptrunner/wptcommandline.py b/third_party/wpt_tools/wpt/tools/wptrunner/wptrunner/wptcommandline.py index ce50b3e..5fd9a3f 100644 --- a/third_party/wpt_tools/wpt/tools/wptrunner/wptrunner/wptcommandline.py +++ b/third_party/wpt_tools/wpt/tools/wptrunner/wptrunner/wptcommandline.py
@@ -38,8 +38,7 @@ from . import products if product_choices is None: - config_data = config.load() - product_choices = products.products_enabled(config_data) + product_choices = products.product_list parser = argparse.ArgumentParser(description="""Runner for web-platform-tests tests.""", usage="""%(prog)s [OPTION]... [TEST]... @@ -659,8 +658,7 @@ from . import products if product_choices is None: - config_data = config.load() - product_choices = products.products_enabled(config_data) + product_choices = products.product_list parser = argparse.ArgumentParser("web-platform-tests-update", description="Update script for web-platform-tests tests.")
diff --git a/third_party/wpt_tools/wpt/tools/wptrunner/wptrunner/wptrunner.py b/third_party/wpt_tools/wpt/tools/wptrunner/wptrunner/wptrunner.py index 42031ce9..40674cc6 100644 --- a/third_party/wpt_tools/wpt/tools/wptrunner/wptrunner/wptrunner.py +++ b/third_party/wpt_tools/wpt/tools/wptrunner/wptrunner/wptrunner.py
@@ -55,7 +55,9 @@ verify=kwargs.get("verify"), debug=debug, extras=run_info_extras, - enable_webrender=kwargs.get("enable_webrender")) + enable_webrender=kwargs.get("enable_webrender"), + device_serials=kwargs.get("device_serial"), + adb_binary=kwargs.get("adb_binary")) test_manifests = testloader.ManifestLoader(test_paths, force_manifest_update=kwargs["manifest_update"], manifest_download=kwargs["manifest_download"]).load()
diff --git a/third_party/wpt_tools/wpt/tools/wptrunner/wptrunner/wpttest.py b/third_party/wpt_tools/wpt/tools/wptrunner/wptrunner/wpttest.py index 752739b..03a89cd 100644 --- a/third_party/wpt_tools/wpt/tools/wptrunner/wptrunner/wpttest.py +++ b/third_party/wpt_tools/wpt/tools/wptrunner/wptrunner/wpttest.py
@@ -89,7 +89,9 @@ browser_channel=None, verify=None, extras=None, - enable_webrender=False): + enable_webrender=False, + device_serials=None, + adb_binary=None): import mozinfo self._update_mozinfo(metadata_root) self.update(mozinfo.info) @@ -125,6 +127,59 @@ self["webrender"] = enable_webrender + if adb_binary: + self["adb_binary"] = adb_binary + if device_serials: + # Assume all emulators are identical, so query an arbitrary one. + self._update_with_emulator_info(device_serials[0]) + self.pop("linux_distro", None) + + def _adb_run(self, device_serial, args, **kwargs): + adb_binary = self.get("adb_binary", "adb") + cmd = [adb_binary, "-s", device_serial, *args] + return subprocess.check_output(cmd, **kwargs) + + def _adb_get_property(self, device_serial, prop, **kwargs): + args = ["shell", "getprop", prop] + value = self._adb_run(device_serial, args, **kwargs) + return value.strip() + + def _update_with_emulator_info(self, device_serial): + """Override system info taken from the host if using an Android + emulator.""" + try: + self._adb_run(device_serial, ["wait-for-device"]) + emulator_info = { + "os": "android", + "os_version": self._adb_get_property( + device_serial, + "ro.build.version.release", + encoding="utf-8", + ), + } + emulator_info["version"] = emulator_info["os_version"] + + # Detect CPU info (https://developer.android.com/ndk/guides/abis#sa) + abi64, *_ = self._adb_get_property( + device_serial, + "ro.product.cpu.abilist64", + encoding="utf-8", + ).split(',') + if abi64: + emulator_info["processor"] = abi64 + emulator_info["bits"] = 64 + else: + emulator_info["processor"], *_ = self._adb_get_property( + device_serial, + "ro.product.cpu.abilist32", + encoding="utf-8", + ).split(',') + emulator_info["bits"] = 32 + + self.update(emulator_info) + except (OSError, subprocess.CalledProcessError): + pass + def _update_mozinfo(self, metadata_root): """Add extra build information from a mozinfo.json file in a parent directory"""
diff --git a/tools/aggregation_service/aggregation_service_tool.cc b/tools/aggregation_service/aggregation_service_tool.cc index 9a0cf85d..06c2865 100644 --- a/tools/aggregation_service/aggregation_service_tool.cc +++ b/tools/aggregation_service/aggregation_service_tool.cc
@@ -37,12 +37,15 @@ return absl::nullopt; } -absl::optional<content::TestAggregationService::ProcessingType> -ConvertToProcessingType(const std::string& processing_type_string) { - if (processing_type_string == "two-party") - return content::TestAggregationService::ProcessingType::kTwoParty; - if (processing_type_string == "single-server") - return content::TestAggregationService::ProcessingType::kSingleServer; +absl::optional<content::TestAggregationService::AggregationMode> +ConvertToAggregationMode(const std::string& aggregation_mode_string) { + if (aggregation_mode_string == "tee-based") + return content::TestAggregationService::AggregationMode::kTeeBased; + if (aggregation_mode_string == "experimental-poplar") + return content::TestAggregationService::AggregationMode:: + kExperimentalPoplar; + if (aggregation_mode_string == "default") + return content::TestAggregationService::AggregationMode::kDefault; return absl::nullopt; } @@ -127,7 +130,7 @@ std::string operation_str, std::string bucket_str, std::string value_str, - std::string processing_type_str, + std::string aggregation_mode_str, url::Origin reporting_origin, std::string privacy_budget_key, std::vector<GURL> processing_urls, @@ -153,10 +156,10 @@ return result; } - absl::optional<content::TestAggregationService::ProcessingType> - processing_type = ConvertToProcessingType(processing_type_str); - if (!processing_type.has_value()) { - LOG(ERROR) << "Invalid processing type: " << processing_type_str; + absl::optional<content::TestAggregationService::AggregationMode> + aggregation_mode = ConvertToAggregationMode(aggregation_mode_str); + if (!aggregation_mode.has_value()) { + LOG(ERROR) << "Invalid aggregation mode: " << aggregation_mode_str; return result; } @@ -166,7 +169,7 @@ } content::TestAggregationService::AssembleRequest request( - operation.value(), bucket, value, processing_type.value(), + operation.value(), bucket, value, aggregation_mode.value(), std::move(reporting_origin), std::move(privacy_budget_key), std::move(processing_urls), is_debug_mode_enabled);
diff --git a/tools/aggregation_service/aggregation_service_tool.h b/tools/aggregation_service/aggregation_service_tool.h index ffe7e54..ee72b9b6b 100644 --- a/tools/aggregation_service/aggregation_service_tool.h +++ b/tools/aggregation_service/aggregation_service_tool.h
@@ -58,7 +58,7 @@ base::Value::DictStorage AssembleReport(std::string operation_str, std::string bucket_str, std::string value_str, - std::string processing_type_str, + std::string aggregation_mode_str, url::Origin reporting_origin, std::string privacy_budget_key, std::vector<GURL> processing_urls,
diff --git a/tools/aggregation_service/aggregation_service_tool_main.cc b/tools/aggregation_service/aggregation_service_tool_main.cc index 53fe69ab..e767b630 100644 --- a/tools/aggregation_service/aggregation_service_tool_main.cc +++ b/tools/aggregation_service/aggregation_service_tool_main.cc
@@ -31,7 +31,8 @@ constexpr char kSwitchOperation[] = "operation"; constexpr char kSwitchBucket[] = "bucket"; constexpr char kSwitchValue[] = "value"; -constexpr char kSwitchProcessingType[] = "processing-type"; +constexpr char kSwitchAlternativeAggregationMode[] = + "alternative-aggregation-mode"; constexpr char kSwitchReportingOrigin[] = "reporting-origin"; constexpr char kSwitchPrivacyBudgetKey[] = "privacy-budget-key"; constexpr char kSwitchHelperKeyUrls[] = "helper-key-urls"; @@ -44,7 +45,7 @@ constexpr char kHelpMsg[] = R"( aggregation_service_tool [--operation=<operation>] --bucket=<bucket> - --value=<value> --processing-type=<processing_type> + --value=<value> --aggregation-mode=<aggregation_mode> --reporting-origin=<reporting_origin> --privacy-budget-key=<privacy_budget_key> --helper-keys=<helper_server_keys> [--output=<output_file>] @@ -53,7 +54,7 @@ Examples: aggregation_service_tool --operation="histogram" --bucket=1234 --value=5 - --processing-type="two-party" --reporting-origin="https://example.com" + --alternative-aggregation-mode="experimental-poplar" --reporting-origin="https://example.com" --privacy-budget-key="test_privacy_budget_key" --helper-key-urls="https://a.com/keys.json https://b.com/path/to/keys.json" --output-file="output.json" --enable-debug-mode @@ -61,7 +62,7 @@ "source_site=https://publisher.example,attribution_destination=https://advertiser.example" or aggregation_service_tool --bucket=1234 --value=5 - --processing-type="single-server" --reporting-origin="https://example.com" + --reporting-origin="https://example.com" --privacy-budget-key="test_privacy_budget_key" --helper-key-files="keys.json" --output-url="https://c.com/reports" @@ -79,8 +80,10 @@ integer. --value = Bucket value of the histogram contribution, must be non-negative integer. - --processing-type = The processing type to use, either "single-server" or - "two-party". + --alternative-aggregation-mode = Optional switch to specify an alternative + aggregation mode. Supports "tee-based", + "experimental-poplar" and "default" + (default value, equivalent to "tee-based"). --reporting-origin = The reporting origin endpoint. --privacy-budget-key = The privacy budgeting key. --helper-key-urls = Optional switch to specify the URL(s) to fetch the public @@ -132,7 +135,7 @@ kSwitchOperation, kSwitchBucket, kSwitchValue, - kSwitchProcessingType, + kSwitchAlternativeAggregationMode, kSwitchReportingOrigin, kSwitchPrivacyBudgetKey, kSwitchHelperKeyUrls, @@ -159,8 +162,8 @@ } const std::vector<std::string> kRequiredSwitches = { - kSwitchBucket, kSwitchValue, kSwitchProcessingType, - kSwitchReportingOrigin, kSwitchPrivacyBudgetKey}; + kSwitchBucket, kSwitchValue, kSwitchReportingOrigin, + kSwitchPrivacyBudgetKey}; for (const std::string& required_switch : kRequiredSwitches) { if (!command_line.HasSwitch(required_switch.c_str())) { LOG(ERROR) << "aggregation_service_tool expects " << required_switch @@ -249,10 +252,10 @@ ? command_line.GetSwitchValueASCII(kSwitchOperation) : "histogram"; - std::string processing_type = - command_line.HasSwitch(kSwitchProcessingType) - ? command_line.GetSwitchValueASCII(kSwitchProcessingType) - : "two-party"; + std::string aggregation_mode = + command_line.HasSwitch(kSwitchAlternativeAggregationMode) + ? command_line.GetSwitchValueASCII(kSwitchAlternativeAggregationMode) + : "default"; url::Origin reporting_origin = url::Origin::Create( GURL(command_line.GetSwitchValueASCII(kSwitchReportingOrigin))); @@ -265,7 +268,7 @@ base::Value::DictStorage report_dict = tool.AssembleReport( std::move(operation), command_line.GetSwitchValueASCII(kSwitchBucket), command_line.GetSwitchValueASCII(kSwitchValue), - std::move(processing_type), std::move(reporting_origin), + std::move(aggregation_mode), std::move(reporting_origin), std::move(privacy_budget_key), std::move(processing_urls), is_debug_mode_enabled); if (report_dict.empty()) {
diff --git a/tools/licenses.py b/tools/licenses.py index 7d09d1c4..d64eccd 100755 --- a/tools/licenses.py +++ b/tools/licenses.py
@@ -131,6 +131,8 @@ os.path.join('third_party', 'boringssl', 'src', 'third_party', 'fiat'), os.path.join('third_party', 'devtools-frontend', 'src', 'front_end', 'third_party'), + os.path.join('third_party', 'devtools-frontend-internal', 'front_end', + 'third_party'), os.path.join('tools', 'gyp'), os.path.join('tools', 'page_cycler', 'acid3'), os.path.join('url', 'third_party', 'mozilla'),
diff --git a/tools/mac/power/analyze.py b/tools/mac/power/analyze.py index e758d7c..5422812 100755 --- a/tools/mac/power/analyze.py +++ b/tools/mac/power/analyze.py
@@ -72,13 +72,14 @@ 'package_joules', ]) # Expected processor fields on M1. - out_sample['processor'] = GetDictionaryKeys(parsed_sample['processor'], [ - 'ane_energy', - 'dram_energy', - 'cpu_energy', - 'gpu_energy', - 'package_energy', - ]) + out_sample['processor'].update( + GetDictionaryKeys(parsed_sample['processor'], [ + 'ane_energy', + 'dram_energy', + 'cpu_energy', + 'gpu_energy', + 'package_energy', + ])) if 'clusters' in parsed_sample['processor']: for cluster in parsed_sample['processor']['clusters']: out_sample['processor'][cluster['name']] = GetDictionaryKeys(
diff --git a/tools/memory/partition_allocator/pa_tcache_inspect.cc b/tools/memory/partition_allocator/pa_tcache_inspect.cc index 16d8b44..a89af28 100644 --- a/tools/memory/partition_allocator/pa_tcache_inspect.cc +++ b/tools/memory/partition_allocator/pa_tcache_inspect.cc
@@ -327,7 +327,9 @@ return false; size_t freelist_size = - bucket.get_slots_per_span() - allocated_unprovisioned; + active_slot_span.is_decommitted() + ? 0 + : (bucket.get_slots_per_span() - allocated_unprovisioned); stats.freelist_size += freelist_size; stats.freelist_sizes.push_back(freelist_size); @@ -495,11 +497,16 @@ base::Value{slot_span.freelist_is_sorted()}); result.SetKey("freelist_is_sorted", base::Value{slot_span.freelist_is_sorted()}); - size_t freelist_size = slots_per_span - slot_span.num_allocated_slots - - slot_span.num_unprovisioned_slots; + size_t freelist_size = + slot_span.is_decommitted() + ? 0 + : (slots_per_span - slot_span.num_allocated_slots - + slot_span.num_unprovisioned_slots); result.SetKey("freelist_size", base::Value{static_cast<int>(freelist_size)}); result.SetKey("marked_full", base::Value{slot_span.marked_full}); + result.SetKey("is_empty", base::Value{slot_span.is_empty()}); + result.SetKey("is_decommitted", base::Value{slot_span.is_decommitted()}); return result; };
diff --git a/tools/memory/partition_allocator/plot_bucket_stats.py b/tools/memory/partition_allocator/plot_bucket_stats.py index 94350bbe..b772329 100755 --- a/tools/memory/partition_allocator/plot_bucket_stats.py +++ b/tools/memory/partition_allocator/plot_bucket_stats.py
@@ -14,6 +14,7 @@ import argparse import json +import matplotlib from matplotlib import pylab as plt import numpy as np @@ -27,19 +28,20 @@ def PlotData(data, output_filename): rows, cols = 6, 5 fig, axs = plt.subplots(rows, cols, figsize=(30, 30)) - fig.suptitle( - 'Active Slot Spans fill-in - Green is allocated, red freelist,' - ' grey unprovisioned', - fontsize=16) + fig.suptitle('Active Slot Spans fill-in - %s' % output_filename, fontsize=16) for index, bucket in enumerate(data['buckets'][:rows * cols]): ax = axs[int(index / cols), index % cols] active_slot_spans = bucket['active_slot_spans'] - freelist_sizes = np.array([s['freelist_size'] for s in active_slot_spans]) + freelist_sizes = np.array([ + s['freelist_size'] if not s['is_decommitted'] else 0 + for s in active_slot_spans + ]) allocated_slots = np.array( [s['num_allocated_slots'] for s in active_slot_spans]) unprovisioned_slots = np.array( [s['num_unprovisioned_slots'] for s in active_slot_spans]) + hatch = ['//' if s['freelist_is_sorted'] else '' for s in active_slot_spans] slot_size = bucket['slot_size'] allocated_size = bucket['allocated_slots'] * slot_size @@ -48,15 +50,32 @@ (slot_size, allocated_size // 1024, free_size // 1024)) indices = range(len(active_slot_spans)) bottom = np.zeros(len(indices)) - ax.bar(indices, allocated_slots, bottom=bottom, color='green') + b1 = ax.bar(indices, allocated_slots, bottom=bottom, color='green') bottom += allocated_slots - ax.bar(indices, freelist_sizes, bottom=bottom, color='red') + b2 = ax.bar(indices, + freelist_sizes, + bottom=bottom, + color=[ + 'darkgrey' if s['is_decommitted'] else 'red' + for s in active_slot_spans + ], + hatch=hatch) bottom += freelist_sizes ax.bar(indices, unprovisioned_slots, bottom=bottom, color='lightgrey') ax.set_xlim(left=-.5, right=len(indices) - .5) fig.tight_layout() fig.subplots_adjust(top=.95) + handles = [ + matplotlib.patches.Patch(facecolor='green', label='Allocated'), + matplotlib.patches.Patch(facecolor='red', + hatch='//', + label='Sorted freelist'), + matplotlib.patches.Patch(facecolor='red', label='Free'), + matplotlib.patches.Patch(facecolor='grey', label='Unprovisioned'), + matplotlib.patches.Patch(facecolor='darkgrey', label='Decommitted') + ] + fig.legend(handles=handles, loc='lower right', fontsize=20) plt.savefig(output_filename)
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index 1962864..0632d00 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -37407,6 +37407,7 @@ <int value="4178" label="SecureContextIncorrectForSharedWorker"/> <int value="4179" label="V8FunctionPrototypeArguments"/> <int value="4180" label="V8FunctionPrototypeCaller"/> + <int value="4181" label="BluetoothDeviceForget"/> </enum> <enum name="FeaturePolicyAllowlistType"> @@ -53361,6 +53362,7 @@ <int value="-864232986" label="StartSurfaceAndroid:disabled"/> <int value="-864205629" label="enable-offline-load-stale-cache"/> <int value="-863581676" label="BluetoothFixA2dpPacketSize:disabled"/> + <int value="-863269581" label="WebFeedOnboarding:disabled"/> <int value="-861678473" label="disable-offer-upload-credit-cards"/> <int value="-861524874" label="AutofillParseMerchantPromoCodeFields:enabled"/> <int value="-861343291" label="ChromeHome:disabled"/> @@ -53718,6 +53720,7 @@ <int value="-614223913" label="ClickToCallContextMenuForSelectedText:enabled"/> <int value="-613596048" label="new-canvas-2d-api"/> + <int value="-612860466" label="Projector:disabled"/> <int value="-612633819" label="NotificationScrollBar:disabled"/> <int value="-612480090" label="FasterLocationReload:enabled"/> <int value="-610411643" label="enable-printer-app-search"/> @@ -53799,6 +53802,7 @@ <int value="-556218705" label="SlowDCTimerInterruptsWin:enabled"/> <int value="-556021689" label="ArcEnableVirtioBlkForData:disabled"/> <int value="-555341956" label="AutofillSaveAndFillVPA:enabled"/> + <int value="-552425893" label="ProjectorAnnotator:disabled"/> <int value="-552407626" label="ContextualSearchNewSettings:disabled"/> <int value="-551434067" label="QuickActionSearchWidgetAndroidDinoVariant:enabled"/> @@ -53851,6 +53855,7 @@ <int value="-519345823" label="CrOSEnforceSystemAecNsAgc:enabled"/> <int value="-519342886" label="PrintWithPostScriptType42Fonts:disabled"/> <int value="-518104091" label="NewAudioRenderingMixingStrategy:enabled"/> + <int value="-518037829" label="ProjectorExcludeTranscript:disabled"/> <int value="-516845951" label="enable-embedded-extension-options"/> <int value="-515913489" label="EphemeralTabUsingBottomSheet:disabled"/> <int value="-514076866" label="MovablePartialScreenshot:disabled"/> @@ -54319,6 +54324,7 @@ <int value="-175692563" label="Vp9kSVCHWDecoding:disabled"/> <int value="-175666252" label="Portals:disabled"/> <int value="-175574799" label="finch-seed-no-charging-requirement"/> + <int value="-175112908" label="ProjectorAnnotator:enabled"/> <int value="-174829803" label="TabOutlinesInLowContrastThemes:enabled"/> <int value="-174706795" label="WebPaymentsPerMethodCanMakePaymentQuota:enabled"/> @@ -54787,6 +54793,7 @@ <int value="151173516" label="CellularUseAttachApn:enabled"/> <int value="151630887" label="WebUIA11yEnhancements:disabled"/> <int value="151825088" label="MessagesForAndroidPermissionUpdate:enabled"/> + <int value="152126026" label="ProjectorExcludeTranscript:enabled"/> <int value="153347646" label="SmartDimModelV3:disabled"/> <int value="155977192" label="EnableFileManagerFormatDialog:disabled"/> <int value="156285060" label="UseMultipleOverlays:disabled"/> @@ -56781,6 +56788,7 @@ <int value="1552753678" label="DnsHttpssvc:disabled"/> <int value="1553310752" label="AccessibilityCursorColor:enabled"/> <int value="1553422694" label="EnablePalmOnMaxTouchMajor:enabled"/> + <int value="1553430984" label="Projector:enabled"/> <int value="1553777815" label="enable-search-prefetch-service"/> <int value="1556554961" label="DriveFsBidirectionalNativeMessaging:enabled"/> <int value="1557680135" label="PartitionedCookies:disabled"/> @@ -57232,6 +57240,7 @@ <int value="1861067469" label="SystemJapanesePhysicalTyping:disabled"/> <int value="1861251313" label="enable-message-center-always-scroll-up-upon-notification-removal"/> + <int value="1861515782" label="WebFeedOnboarding:enabled"/> <int value="1861521561" label="OmniboxLocalEntitySuggestions:enabled"/> <int value="1862126613" label="DesktopPWAsRunOnOsLogin:enabled"/> <int value="1862207743" label="enable-android-spellchecker"/>
diff --git a/tools/metrics/histograms/metadata/apps/histograms.xml b/tools/metrics/histograms/metadata/apps/histograms.xml index e599b9cc..3139842c 100644 --- a/tools/metrics/histograms/metadata/apps/histograms.xml +++ b/tools/metrics/histograms/metadata/apps/histograms.xml
@@ -520,7 +520,7 @@ </histogram> <histogram name="Apps.AppList.HelpAppProvider.ListSearchResultState" - enum="HelpAppProviderListSearchResultState" expires_after="2022-04-19"> + enum="HelpAppProviderListSearchResultState" expires_after="2022-10-19"> <owner>tby@chromium.org</owner> <owner>thanhdng@chromium.org</owner> <owner>wrong@chromium.org</owner> @@ -534,7 +534,7 @@ </histogram> <histogram name="Apps.AppList.HelpAppProvider.QueryTime" units="ms" - expires_after="2022-04-19"> + expires_after="2022-10-19"> <owner>thanhdng@chromium.org</owner> <owner>tby@chromium.org</owner> <owner>wrong@chromium.org</owner> @@ -547,7 +547,7 @@ </histogram> <histogram name="Apps.AppList.ItemSuggestCache.ResponseSize" units="bytes" - expires_after="2022-04-24"> + expires_after="2022-10-24"> <owner>tby@chromium.org</owner> <owner>thanhdng@chromium.org</owner> <owner>wrong@chromium.org</owner> @@ -559,7 +559,7 @@ </histogram> <histogram name="Apps.AppList.ItemSuggestCache.Status" - enum="ItemSuggestCacheStatus" expires_after="2022-04-17"> + enum="ItemSuggestCacheStatus" expires_after="2022-10-17"> <owner>tby@chromium.org</owner> <owner>thanhdng@chromium.org</owner> <owner>wrong@chromium.org</owner> @@ -570,7 +570,7 @@ </histogram> <histogram name="Apps.AppList.ItemSuggestCache.UpdateCacheLatency" units="ms" - expires_after="2022-04-24"> + expires_after="2022-10-24"> <owner>tby@chromium.org</owner> <owner>thanhdng@chromium.org</owner> <owner>wrong@chromium.org</owner> @@ -878,7 +878,7 @@ </histogram> <histogram name="Apps.AppList.SuggestedContent.Enabled" enum="BooleanEnabled" - expires_after="2022-04-10"> + expires_after="2022-10-10"> <owner>wrong@chromium.org</owner> <owner>tby@chromium.org</owner> <owner>thanhdng@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/others/histograms.xml b/tools/metrics/histograms/metadata/others/histograms.xml index 2a0afa70..01fdc1c 100644 --- a/tools/metrics/histograms/metadata/others/histograms.xml +++ b/tools/metrics/histograms/metadata/others/histograms.xml
@@ -9222,9 +9222,12 @@ </histogram> <histogram name="PLT.iOS.BrowserInitiatedPageLoadTime2" units="ms" - expires_after="2022-08-09"> + expires_after="never"> +<!-- expires-never: guiding metric (internal: go/chrome-browser-guiding-metrics) --> + <owner>djean@chromium.org</owner> <owner>ajuma@chromium.org</owner> + <owner>chrome-analysis-team@google.com</owner> <summary> Page load time for Browser-initiated navigations. @@ -9264,6 +9267,9 @@ Any navigation that is not considered browser-initiated is considered to be renderer-initiated (see PLT.iOS.RendererInitiatedPageLoadTime2). + + Do not modify this metric in any way without contacting + chrome-analysis-team@google.com. </summary> </histogram>
diff --git a/tools/metrics/histograms/metadata/quota/histograms.xml b/tools/metrics/histograms/metadata/quota/histograms.xml index 01e6c64..dbd59de 100644 --- a/tools/metrics/histograms/metadata/quota/histograms.xml +++ b/tools/metrics/histograms/metadata/quota/histograms.xml
@@ -33,7 +33,8 @@ </histogram> <histogram name="Quota.AgeOfOriginInDays" units="days" - expires_after="2022-03-15"> + expires_after="2023-03-09"> + <owner>ayui@chromium.org</owner> <owner>jarrydg@chromium.org</owner> <owner>chrome-owp-storage@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/storage/histograms.xml b/tools/metrics/histograms/metadata/storage/histograms.xml index 9e899606..8a08c05 100644 --- a/tools/metrics/histograms/metadata/storage/histograms.xml +++ b/tools/metrics/histograms/metadata/storage/histograms.xml
@@ -724,7 +724,8 @@ </histogram> <histogram name="Storage.StoragePressure.Bubble" - enum="StoragePressureBubbleUserAction" expires_after="2022-03-12"> + enum="StoragePressureBubbleUserAction" expires_after="2023-03-09"> + <owner>ayui@chromium.org</owner> <owner>jarrydg@chromium.org</owner> <owner>chrome-owp-storage@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/tab/histograms.xml b/tools/metrics/histograms/metadata/tab/histograms.xml index 4db295c..804484c 100644 --- a/tools/metrics/histograms/metadata/tab/histograms.xml +++ b/tools/metrics/histograms/metadata/tab/histograms.xml
@@ -3114,6 +3114,7 @@ [Desktop] The size in pixels of the {TabActiveState} tab logged when a tab is added. Used to collect size data for scrolling tabs. </summary> + <token key="TabActiveState" variants="TabActiveState"/> </histogram> <histogram name="TabStrip.ReasonToShow" enum="TabStripReasonToShow"
diff --git a/tools/metrics/histograms/metadata/v8/histograms.xml b/tools/metrics/histograms/metadata/v8/histograms.xml index 27348dec..89940c8 100644 --- a/tools/metrics/histograms/metadata/v8/histograms.xml +++ b/tools/metrics/histograms/metadata/v8/histograms.xml
@@ -379,6 +379,17 @@ </summary> </histogram> +<histogram name="V8.GC.Cycle.CollectionRate.Full" units="%" + expires_after="M109"> + <owner>nikolaos@chromium.org</owner> + <owner>v8-memory-sheriffs@google.com</owner> + <summary> + The percentage of managed JavaScript memory that has been collected by a + full garbage collection of the unified heap. Reported at the end of the + garbage collection cycle. + </summary> +</histogram> + <histogram name="V8.GC.Cycle.CollectionRate.Full.Cpp" units="%" expires_after="M109"> <owner>omerkatz@chromium.org</owner> @@ -396,8 +407,18 @@ <owner>v8-memory-sheriffs@google.com</owner> <summary> The percentage of managed JavaScript memory that has been collected by a - young generation garbage collection of the managed JavaScript heap. Reported - at the end of the garbage collection cycle. + young generation garbage collection of the JavaScript heap. Reported at the + end of the garbage collection cycle. + </summary> +</histogram> + +<histogram name="V8.GC.Cycle.Efficiency.Full" units="KB/ms" + expires_after="M109"> + <owner>nikolaos@chromium.org</owner> + <owner>v8-memory-sheriffs@google.com</owner> + <summary> + The speed at which a full garbage collection of the unified heap reclaims + unused memory. Reported at the end of the garbage collection cycle. </summary> </histogram> @@ -411,6 +432,17 @@ </summary> </histogram> +<histogram name="V8.GC.Cycle.Efficiency.MainThread.Full" units="KB/ms" + expires_after="M109"> + <owner>nikolaos@chromium.org</owner> + <owner>v8-memory-sheriffs@google.com</owner> + <summary> + The speed at which a full garbage collection of the unified heap reclaims + unused memory on the main thread only. This histogram ignores concurrent + garbage collection. Reported at the end of the garbage collection cycle. + </summary> +</histogram> + <histogram name="V8.GC.Cycle.Efficiency.MainThread.Full.Cpp" units="KB/ms" expires_after="M109"> <owner>omerkatz@chromium.org</owner> @@ -427,10 +459,10 @@ <owner>nikolaos@chromium.org</owner> <owner>v8-memory-sheriffs@google.com</owner> <summary> - The speed at which a young generation garbage collection of the managed - JavaScript heap reclaims unused memory on the main thread only. This - histogram ignores concurrent garbage collection. Reported at the end of the - garbage collection cycle. + The speed at which a young generation garbage collection of the JavaScript + heap reclaims unused memory on the main thread only. This histogram ignores + concurrent garbage collection. Reported at the end of the garbage collection + cycle. </summary> </histogram> @@ -439,9 +471,27 @@ <owner>nikolaos@chromium.org</owner> <owner>v8-memory-sheriffs@google.com</owner> <summary> - The speed at which a young generation garbage collection of the managed - JavaScript heap reclaims unused memory. Reported at the end of the garbage - collection cycle. + The speed at which a young generation garbage collection of the JavaScript + heap reclaims unused memory. Reported at the end of the garbage collection + cycle. + </summary> +</histogram> + +<histogram name="V8.GC.Cycle.Full" units="ms" expires_after="M109"> + <owner>nikolaos@chromium.org</owner> + <owner>v8-memory-sheriffs@google.com</owner> + <summary> + Overall duration of a full garbage collection of the unified heap. Reported + at the end of the garbage collection cycle. + </summary> +</histogram> + +<histogram name="V8.GC.Cycle.Full.Compact" units="ms" expires_after="M109"> + <owner>nikolaos@chromium.org</owner> + <owner>v8-memory-sheriffs@google.com</owner> + <summary> + Time spent on compaction during a full garbage collection of the unified + heap. Reported at the end of the garbage collection cycle. </summary> </histogram> @@ -463,6 +513,15 @@ </summary> </histogram> +<histogram name="V8.GC.Cycle.Full.Mark" units="ms" expires_after="M109"> + <owner>nikolaos@chromium.org</owner> + <owner>v8-memory-sheriffs@google.com</owner> + <summary> + Time spent on marking during a full garbage collection of the unified heap. + Reported at the end of the garbage collection cycle. + </summary> +</histogram> + <histogram name="V8.GC.Cycle.Full.Mark.Cpp" units="ms" expires_after="M109"> <owner>omerkatz@chromium.org</owner> <owner>v8-memory-sheriffs@google.com</owner> @@ -472,6 +531,15 @@ </summary> </histogram> +<histogram name="V8.GC.Cycle.Full.Sweep" units="ms" expires_after="M109"> + <owner>nikolaos@chromium.org</owner> + <owner>v8-memory-sheriffs@google.com</owner> + <summary> + Time spent on sweeping during a full garbage collection of the unified heap. + Reported at the end of the garbage collection cycle. + </summary> +</histogram> + <histogram name="V8.GC.Cycle.Full.Sweep.Cpp" units="ms" expires_after="M109"> <owner>omerkatz@chromium.org</owner> <owner>v8-memory-sheriffs@google.com</owner> @@ -481,6 +549,15 @@ </summary> </histogram> +<histogram name="V8.GC.Cycle.Full.Weak" units="ms" expires_after="M109"> + <owner>nikolaos@chromium.org</owner> + <owner>v8-memory-sheriffs@google.com</owner> + <summary> + Time spent on weakness handling during a full garbage collection of the + unified heap. Reported at the end of the garbage collection cycle. + </summary> +</histogram> + <histogram name="V8.GC.Cycle.Full.Weak.Cpp" units="ms" expires_after="M109"> <owner>omerkatz@chromium.org</owner> <owner>v8-memory-sheriffs@google.com</owner> @@ -490,6 +567,39 @@ </summary> </histogram> +<histogram name="V8.GC.Cycle.MainThread.Full" units="ms" expires_after="M109"> + <owner>nikolaos@chromium.org</owner> + <owner>v8-memory-sheriffs@google.com</owner> + <summary> + Main-thread only duration of a full garbage collection of the unified heap. + Reported at the end of the garbage collection cycle. + </summary> +</histogram> + +<histogram name="V8.GC.Cycle.MainThread.Full.Atomic" units="ms" + expires_after="M109"> + <owner>nikolaos@chromium.org</owner> + <owner>v8-memory-sheriffs@google.com</owner> + <summary> + Overall main thread duration of the atomic pause of a garbage collection of + the unified heap. There is only a single atomic pause event per cycle but it + may cover several sub-events. Reported at the end of the garbage collection + cycle. + </summary> +</histogram> + +<histogram name="V8.GC.Cycle.MainThread.Full.Atomic.Compact" units="ms" + expires_after="M109"> + <owner>nikolaos@chromium.org</owner> + <owner>v8-memory-sheriffs@google.com</owner> + <summary> + Overall duration of compaction on the main thread during the atomic pause of + a garbage collection of the unified heap. There is only a single atomic + pause compaction event per cycle but it may cover several sub-events. + Reported at the end of the garbage collection cycle. + </summary> +</histogram> + <histogram name="V8.GC.Cycle.MainThread.Full.Atomic.Compact.Cpp" units="ms" expires_after="M109"> <owner>omerkatz@chromium.org</owner> @@ -514,6 +624,18 @@ </summary> </histogram> +<histogram name="V8.GC.Cycle.MainThread.Full.Atomic.Mark" units="ms" + expires_after="M109"> + <owner>nikolaos@chromium.org</owner> + <owner>v8-memory-sheriffs@google.com</owner> + <summary> + Overall duration of marking on the main thread during the atomic pause of a + garbage collection of the unified heap. There is only a single atomic pause + marking event per cycle but it may cover several sub-events. Reported at the + end of the garbage collection cycle. + </summary> +</histogram> + <histogram name="V8.GC.Cycle.MainThread.Full.Atomic.Mark.Cpp" units="ms" expires_after="M109"> <owner>omerkatz@chromium.org</owner> @@ -526,6 +648,18 @@ </summary> </histogram> +<histogram name="V8.GC.Cycle.MainThread.Full.Atomic.Sweep" units="ms" + expires_after="M109"> + <owner>nikolaos@chromium.org</owner> + <owner>v8-memory-sheriffs@google.com</owner> + <summary> + Overall duration of sweeping on the main thread during the atomic pasue of a + garbage collection of the unified heap. There is only a single atomic pause + sweeping event per cycle but it may cover several sub-events. Reported at + the end of the garbage collection cycle. + </summary> +</histogram> + <histogram name="V8.GC.Cycle.MainThread.Full.Atomic.Sweep.Cpp" units="ms" expires_after="M109"> <owner>omerkatz@chromium.org</owner> @@ -538,6 +672,18 @@ </summary> </histogram> +<histogram name="V8.GC.Cycle.MainThread.Full.Atomic.Weak" units="ms" + expires_after="M109"> + <owner>nikolaos@chromium.org</owner> + <owner>v8-memory-sheriffs@google.com</owner> + <summary> + Overall duration of weakness handling on the main thread during the atomic + pause of a garbage collection of the unified heap. There is only a single + atomic pause weakness handling event per cycle but it may cover several + sub-events. Reported at the end of the garbage collection cycle. + </summary> +</histogram> + <histogram name="V8.GC.Cycle.MainThread.Full.Atomic.Weak.Cpp" units="ms" expires_after="M109"> <owner>omerkatz@chromium.org</owner> @@ -550,6 +696,16 @@ </summary> </histogram> +<histogram name="V8.GC.Cycle.MainThread.Full.Compact" units="ms" + expires_after="M109"> + <owner>nikolaos@chromium.org</owner> + <owner>v8-memory-sheriffs@google.com</owner> + <summary> + Time spent on compaction on the main thread during a full garbage collection + of the unified heap. Reported at the end of the garbage collection cycle. + </summary> +</histogram> + <histogram name="V8.GC.Cycle.MainThread.Full.Compact.Cpp" units="ms" expires_after="M109"> <owner>omerkatz@chromium.org</owner> @@ -571,6 +727,16 @@ </summary> </histogram> +<histogram name="V8.GC.Cycle.MainThread.Full.Mark" units="ms" + expires_after="M109"> + <owner>nikolaos@chromium.org</owner> + <owner>v8-memory-sheriffs@google.com</owner> + <summary> + Time spent on marking on the main thread during a full garbage collection of + the unified heap. Reported at the end of the garbage collection cycle. + </summary> +</histogram> + <histogram name="V8.GC.Cycle.MainThread.Full.Mark.Cpp" units="ms" expires_after="M109"> <owner>omerkatz@chromium.org</owner> @@ -582,6 +748,16 @@ </summary> </histogram> +<histogram name="V8.GC.Cycle.MainThread.Full.Sweep" units="ms" + expires_after="M109"> + <owner>nikolaos@chromium.org</owner> + <owner>v8-memory-sheriffs@google.com</owner> + <summary> + Time spent on sweeping on the main thread during a full garbage collection + of the unified heap. Reported at the end of the garbage collection cycle. + </summary> +</histogram> + <histogram name="V8.GC.Cycle.MainThread.Full.Sweep.Cpp" units="ms" expires_after="M109"> <owner>omerkatz@chromium.org</owner> @@ -593,6 +769,17 @@ </summary> </histogram> +<histogram name="V8.GC.Cycle.MainThread.Full.Weak" units="ms" + expires_after="M109"> + <owner>nikolaos@chromium.org</owner> + <owner>v8-memory-sheriffs@google.com</owner> + <summary> + Time spent on weakness handling on the main thread during a full garbage + collection of the unified heap. Reported at the end of the garbage + collection cycle. + </summary> +</histogram> + <histogram name="V8.GC.Cycle.MainThread.Full.Weak.Cpp" units="ms" expires_after="M109"> <owner>omerkatz@chromium.org</owner> @@ -653,6 +840,16 @@ </summary> </histogram> +<histogram name="V8.GC.Cycle.Reason.Full" enum="GarbageCollectionReason" + expires_after="M109"> + <owner>nikolaos@chromium.org</owner> + <owner>v8-memory-sheriffs@google.com</owner> + <summary> + Reason a full garbage collection was started in V8. Reported at the end of + the garbage collection cycle. + </summary> +</histogram> + <histogram name="V8.GC.Cycle.Reason.Young" enum="GarbageCollectionReason" expires_after="M109"> <owner>nikolaos@chromium.org</owner>
diff --git a/tools/perf/core/perfetto_binary_roller/binary_deps.json b/tools/perf/core/perfetto_binary_roller/binary_deps.json index ab2bf7d..cdb9ca7 100644 --- a/tools/perf/core/perfetto_binary_roller/binary_deps.json +++ b/tools/perf/core/perfetto_binary_roller/binary_deps.json
@@ -5,24 +5,24 @@ "remote_path": "perfetto_binaries/trace_processor_shell/linux_arm64/49b4b5dcbc312d8d2c3751cf29238b8efeb4e494/trace_processor_shell" }, "win": { - "hash": "babaf8a1dca71ffed6e81ec4897e05b736c6a32c", - "remote_path": "perfetto_binaries/trace_processor_shell/win/6eb273237653c5c8d417fd1b556c6d361eb6a79d/trace_processor_shell.exe" + "hash": "6f2d55046183bf7228946d4df574445e044c866e", + "remote_path": "perfetto_binaries/trace_processor_shell/win/e26fd0a8a5e96b82f71b3c86240d8c8c0429245e/trace_processor_shell.exe" }, "linux_arm": { "hash": "58893933be305d3bfe0a72ebebcacde2ac3ca893", "remote_path": "perfetto_binaries/trace_processor_shell/linux_arm/49b4b5dcbc312d8d2c3751cf29238b8efeb4e494/trace_processor_shell" }, "mac": { - "hash": "60156e037b80b1e4296bfee9ed2533392a747df6", - "remote_path": "perfetto_binaries/trace_processor_shell/mac/6eb273237653c5c8d417fd1b556c6d361eb6a79d/trace_processor_shell" + "hash": "d061a6f8b30142d4747c6f0ef7e4e98bd3495312", + "remote_path": "perfetto_binaries/trace_processor_shell/mac/e26fd0a8a5e96b82f71b3c86240d8c8c0429245e/trace_processor_shell" }, "mac_arm64": { "hash": "c0397e87456ad6c6a7aa0133e5b81c97adbab4ab", "remote_path": "perfetto_binaries/trace_processor_shell/mac_arm64/cefb3e0ec3a0580c996f801e854fe02963c03d5c/trace_processor_shell" }, "linux": { - "hash": "c2652fc498ebb179503a234d4100dc551666d0ae", - "remote_path": "perfetto_binaries/trace_processor_shell/linux/6eb273237653c5c8d417fd1b556c6d361eb6a79d/trace_processor_shell" + "hash": "4796f7ebe3ae11e2bb8e59c7dac9a91dcc450bb8", + "remote_path": "perfetto_binaries/trace_processor_shell/linux/e26fd0a8a5e96b82f71b3c86240d8c8c0429245e/trace_processor_shell" } }, "power_profile.sql": {
diff --git a/tools/perf/expectations.config b/tools/perf/expectations.config index 93242e54..78d7126 100644 --- a/tools/perf/expectations.config +++ b/tools/perf/expectations.config
@@ -232,6 +232,7 @@ crbug.com/1229671 [ win ] rendering.desktop/espn_2018 [ Skip ] crbug.com/1230060 [ win-laptop ] rendering.desktop/yahoo_news_2018 [ Skip ] crbug.com/1277970 [ win-laptop ] rendering.desktop/yahoo_sports_2018 [ Skip ] +crbug.com/1114664 [ win-laptop ] rendering.desktop/maps_move_2018 [ Skip ] # Benchmark: rendering.mobile crbug.com/785485 [ android-webview ] rendering.mobile/kevs_3d [ Skip ]
diff --git a/tools/perf/recording_benchmarks.md b/tools/perf/recording_benchmarks.md new file mode 100644 index 0000000..b171f19 --- /dev/null +++ b/tools/perf/recording_benchmarks.md
@@ -0,0 +1,189 @@ +# Updating WPR Recorded Stories + +## Preparation (Android only) +You will need a device with USB debugging enabled, connected to your computer. In addition: + +- If you only have one such device connected, you can simply run + +``` +export ID=android +``` + + +- If you have multiple such devices connected, you’ll need to pick one to record sites, find its serial number from the system settings (Settings > About Phone > Model & Hardware) and then execute + +``` +# Verify that the device has connected to your workstation successfully: its +# serial number must be listed below and have "device" next to it: +third_party/catapult/devil/bin/deps/linux2/x86_64/bin/adb devices +... +<serial> device +... + + +# Set mobile device ID: +export $ID=<serial> +``` + +# To update or add a story + +1. Look in [The WPR Playbook (Googlers Only)]() to see if the story has any maintenance instructions defined. If it doesn’t, create an entry and fill it out (you will likely update it as you record). +2. If you are updating a story, find the story class definition in src/tools/perf/page_sets (codesearching the test name will likely be easiest). +Copy the story class and add this year as the suffix to the class and the story name. +Example: CnnStory2019 and NAME='browse:news:cnn:2019' +Set the tag for this year: TAGS = [ ... , story_tags.YEAR_2019] + +## Guided Process (Recommended) + +The following command will guide you through all of the steps required to record, validate, and upload a new recording. + +* NOTE: BSS stands for Benchmark or Story Set. If you’re recording a system health benchmark, use desktop_system_health_story_set or mobile_system_health_story_set. Otherwise, use the actual name of the benchmark. + +``` +# Desktop: +vpython tools/perf/update_wpr -s "$NAME" -bss "$BSS" auto +# Mobile: +vpython tools/perf/update_wpr -s "$NAME" -d=$ID -bss "$BSS" auto +``` +## Manual Process (via update_wpr) + +You can run specific steps from the guided process described above with the following commands: + +### Run on a live site + +``` +# Desktop: +vpython tools/perf/update_wpr -s "$NAME" -bss "$BSS" live +# Mobile: +vpython tools/perf/update_wpr -s "$NAME" -d=$ID -bss "$BSS" live +``` + + +### Record the story into a new WPR archive + +``` +# Desktop: +vpython tools/perf/update_wpr -s "$NAME" -bss "$BSS" record +# Mobile: +vpython tools/perf/update_wpr -s "$NAME" -d=$ID -bss "$BSS" record +``` + +If the story requires login, then you need to add SKIP_LOGIN = False to the story class definition while recording and remove it after recording (crbug.com/882479). In order to make the WPR archive more robust, temporarily add pauses using action_runner.Wait(10) between the user interactions like page navigation and at the end of the story. + + +### Replay using the recorded WPR + +``` +# Desktop: +vpython tools/perf/update_wpr -s "$NAME" -bss "$BSS" replay +# Mobile: +vpython tools/perf/update_wpr -s "$NAME" -d=$ID -bss "$BSS" replay +``` + +Check that the console:error:all metrics have low values and are similar to the live run. + +### Handling missing URLs + +If there are missing files or broken request you can try to manually add static files to the existing archive. Typically you have to ignore requests to ad networks as they include many randomly generated query parameters or domain names, which causes the replay server to miss. +Note that this does work well only for static files, as there is currently no way to specify cookies. You will find the $WPR_ARCHIVE in the system_health_{desktop/mobile}.json file. See the catapult instructions on how to install the required go packages. + +``` +go run third_party/catapult/web_page_replay_go/src/httparchive.go add "$WPR_ARCHIVE" "$WPR_ARCHIVE" url1 url2... +``` + +After updating the archive, go back to the previous replay step and iterate. + +### Uploading a new WPR archive + +``` +# Desktop: +vpython tools/perf/update_wpr --story="$NAME" upload +# Mobile: +vpython tools/perf/update_wpr --story="$NAME" -d=$ID upload +``` + +### Final Steps + +Commit all changes and upload a CL with the following description: + +``` +[perf] Add $NAME system health story + +Bug:878390 +``` + +Run a pinpoint job and check that there are the same low number of console:error:all metrics. + +``` +# Desktop: +vpython tools/perf/update_wpr --story="$NAME" --pageset-repeat=20 pinpoint +# Mobile: +vpython tools/perf/update_wpr --story="$NAME" --pageset-repeat=20 -d=$ID pinpoint +``` + +Or manually test the newly created story by using a pinpoint job + +``` +# Desktop +Bot: linux-perf +Benchmark: system_health.common_desktop +Story: $NAME +Extra Test Arguments: --pageset-repeat=20 + +# Mobile +Bot: Android Pixel2 Perf +Benchmark: system_health.common_mobile +Story: $NAME +Extra Test Arguments: --pageset-repeat=20 +``` + +Once the pinpoint jobs finish, check the console:error:* metrics. The task log output will also contain the specific error messages. + +If everything looks good, send the CL to browser-perf-engprod@google.com for review. + +## Manual Process (using record_wpr, run_benchmark, and upload_to_google_storage.py) + +To run a story on a live site: + +``` +# Desktop: +./tools/perf/run_benchmark run system_health.memory_desktop --browser-executable=$(pwd)/out/Release/chrome --browser=exact --output-format=html --show-stdout --reset-results --use-live-sites --story-filter="$NAME" + +# Mobile: +./tools/perf/run_benchmark run system_health.memory_mobile --browser-executable=$(pwd)/out/Release/apks/ChromePublic.apk --browser=exact --device=$YOUR_DEVICE_ID --output-format=html --show-stdout --reset-results --use-live-sites --story-filter="$NAME" +``` + + +Adjust the story definition if the run fails and try again. + +To record a story: + +``` +# Desktop: +tools/perf/record_wpr --browser-executable=$(pwd)/out/Release/chrome --story-filter="$NAME" desktop_system_health_story_set + +# Mobile: +tools/perf/record_wpr --device=YOUR_DEVICE_ID --browser-executable=$(pwd)/out/Release/apks/ChromePublic.apk --story-filter="$NAME" mobile_system_health_story_set +``` + +In order to reduce HTTP 404 errors, add action_runner.Wait(10) commands in story interaction before pages navigations and the story end. + +To test a recording: + +- same as "To run a story on a live site" but without the --use-live-sites +- Assert that the console:error:all metrics have low values +- To assess flakiness use --pageset-repeat=10 + +To upload a recording: + +Look up the wpr version number $NNN in the associated .json file (example - tools/perf/page_sets/data/system_health_desktop.json): + +``` +# Desktop: +upload_to_google_storage.py --bucket chrome-partner-telemetry tools/perf/page_sets/data/system_health_desktop_${NNN}.wprgo + +# Mobile: +upload_to_google_storage.py --bucket chrome-partner-telemetry tools/perf/page_sets/data/system_health_mobile_${NNN}.wprgo +``` + +Running this command will generate a .sha1 file. Add this to your CL.
diff --git a/tools/traffic_annotation/summary/annotations.xml b/tools/traffic_annotation/summary/annotations.xml index b61d2f5..12e31e53 100644 --- a/tools/traffic_annotation/summary/annotations.xml +++ b/tools/traffic_annotation/summary/annotations.xml
@@ -359,4 +359,5 @@ <item id="device_trust_key_rotation" added_in_milestone="100" content_hash_code="05cc1b9b" os_list="linux" file_path="chrome/browser/enterprise/connectors/device_trust/key_management/core/network/linux_key_network_delegate.cc" /> <item id="sct_auditing_hashdance" added_in_milestone="100" content_hash_code="00ea07d2" os_list="linux,windows,android,chromeos" file_path="chrome/browser/ssl/sct_reporting_service.cc" /> <item id="pull_template_request" added_in_milestone="101" content_hash_code="06335b4a" os_list="android" file_path="components/content_creation/notes/core/templates/template_fetcher.cc" /> + <item id="webapk_create_for_service" added_in_milestone="101" content_hash_code="00107cfb" os_list="android" file_path="chrome/browser/android/webapk/webapk_installer.cc" /> </annotations>
diff --git a/tools/traffic_annotation/summary/grouping.xml b/tools/traffic_annotation/summary/grouping.xml index 94d68a8..7447e61 100644 --- a/tools/traffic_annotation/summary/grouping.xml +++ b/tools/traffic_annotation/summary/grouping.xml
@@ -42,6 +42,7 @@ <traffic_annotation unique_id="pull_template_request"/> <traffic_annotation unique_id="rlz"/> <traffic_annotation unique_id="webapk_create"/> + <traffic_annotation unique_id="webapk_create_for_service"/> <traffic_annotation unique_id="webapk_update"/> <traffic_annotation unique_id="webview_proxy_config"/> </sender>
diff --git a/ui/accessibility/ax_enum_util.cc b/ui/accessibility/ax_enum_util.cc index b17a4c2..f97bc84d 100644 --- a/ui/accessibility/ax_enum_util.cc +++ b/ui/accessibility/ax_enum_util.cc
@@ -638,6 +638,8 @@ return "replaceSelectedText"; case ax::mojom::Action::kResumeMedia: return "resumeMedia"; + case ax::mojom::Action::kRunScreenAi: + return "runScreenAi"; case ax::mojom::Action::kScrollBackward: return "scrollBackward"; case ax::mojom::Action::kScrollForward:
diff --git a/ui/accessibility/ax_enums.mojom b/ui/accessibility/ax_enums.mojom index 272552a..14616aed 100644 --- a/ui/accessibility/ax_enums.mojom +++ b/ui/accessibility/ax_enums.mojom
@@ -370,7 +370,7 @@ // In contrast to |AXDefaultActionVerb|, these describe what happens to the // object, e.g. "FOCUS". // Next version: 2 -// Next value: 38 +// Next value: 39 [Extensible, Stable, Uuid="ed8e4466-0522-4f98-ac28-59a523b70232"] enum Action { [Default]kNone = 0, @@ -431,6 +431,9 @@ [MinVersion=1] kResumeMedia = 34, + // Runs Screen AI on the current screen. + [MinVersion=2] kRunScreenAi = 38, + // Scrolls by approximately one screen in a specific direction. Should be // called on a node that has scrollable boolean set to true. kScrollBackward = 18,
diff --git a/ui/accessibility/ax_node_data.cc b/ui/accessibility/ax_node_data.cc index 77ad61e..36af7c7 100644 --- a/ui/accessibility/ax_node_data.cc +++ b/ui/accessibility/ax_node_data.cc
@@ -735,6 +735,7 @@ case ax::mojom::Action::kInternalInvalidateTree: case ax::mojom::Action::kLoadInlineTextBoxes: case ax::mojom::Action::kReplaceSelectedText: + case ax::mojom::Action::kRunScreenAi: case ax::mojom::Action::kScrollToMakeVisible: case ax::mojom::Action::kScrollToPoint: case ax::mojom::Action::kSetAccessibilityFocus:
diff --git a/ui/android/java/res/values-v17/styles.xml b/ui/android/java/res/values-v17/styles.xml index f05fcca..de3f4dab 100644 --- a/ui/android/java/res/values-v17/styles.xml +++ b/ui/android/java/res/values-v17/styles.xml
@@ -38,7 +38,8 @@ <item name="android:paddingStart">24dp</item> <item name="android:paddingEnd">24dp</item> <item name="android:textAppearance">@style/TextAppearance.Button.Text.Filled</item> - <item name="buttonColor">@color/filled_button_bg</item> + <item name="buttonTextColor">?attr/globalFilledButtonTextColor</item> + <item name="buttonColor">?attr/globalFilledButtonBgColor</item> <item name="rippleColor">@color/filled_button_ripple_color</item> <item name="buttonRaised">true</item> </style> @@ -49,14 +50,11 @@ <item name="android:paddingStart">8dp</item> <item name="android:paddingEnd">8dp</item> <item name="android:textAppearance">@style/TextAppearance.Button.Text.Blue</item> + <item name="buttonTextColor">?attr/globalTextButtonTextColor</item> <item name="buttonColor">@android:color/transparent</item> <item name="rippleColor">@color/text_button_ripple_color</item> <item name="buttonRaised">false</item> </style> - <style name="TextButton.Inverse" tools:ignore="UnusedResources"> - <item name="android:textAppearance">@style/TextAppearance.Button.Text.Inverse</item> - <item name="rippleColor">@color/filled_button_ripple_color</item> - </style> <!-- Used by Chrome and Content --> <style name="TextAppearance" parent="android:TextAppearance" tools:ignore="UnusedResources" />
diff --git a/ui/android/java/res/values/attrs.xml b/ui/android/java/res/values/attrs.xml index 0e85ac7..c1d96f2 100644 --- a/ui/android/java/res/values/attrs.xml +++ b/ui/android/java/res/values/attrs.xml
@@ -15,6 +15,9 @@ <declare-styleable name="ButtonCompat"> <!-- The color of the button background. --> <attr name="buttonColor" format="color"/> + <!-- The color of the button text. This attribute will override the text color set in + android:textAppearance. --> + <attr name="buttonTextColor" format="reference"/> <attr name="rippleColor"/> <!-- Whether the button is elevated. --> <attr name="buttonRaised" format="boolean"/> @@ -29,6 +32,17 @@ <attr name="rippleCornerRadiusBottomEnd" format="reference|dimension" /> </declare-styleable> + <!-- The attributes prefixed with 'global' are used to control the button, link and URL colors + throughout the app. They are defined in ThemeOverlay.DynamicButtons and are applied + conditionally to the activity theme. This enables us to toggle dynamic colors for the + mentioned UI elements using a feature flag. These attributes may not be set in the themes, + so the code dealing with them should handle their absence. --> + <attr name="globalFilledButtonBgColor" format="color"/> + <attr name="globalFilledButtonTextColor" format="reference"/> + <attr name="globalTextButtonTextColor" format="reference"/> + <attr name="globalLinkTextColor" format="color"/> + <attr name="globalClickableSpanColor" format="color"/> + <declare-styleable name="TextViewWithLeading"> <attr name="leading" format="reference|dimension"/> </declare-styleable>
diff --git a/ui/android/java/src/org/chromium/ui/text/NoUnderlineClickableSpan.java b/ui/android/java/src/org/chromium/ui/text/NoUnderlineClickableSpan.java index 5a755753..754e1452 100644 --- a/ui/android/java/src/org/chromium/ui/text/NoUnderlineClickableSpan.java +++ b/ui/android/java/src/org/chromium/ui/text/NoUnderlineClickableSpan.java
@@ -14,6 +14,7 @@ import org.chromium.base.Callback; import org.chromium.ui.R; +import org.chromium.ui.util.AttrUtils; /** * Shows a blue clickable link with underlines turned off. @@ -27,7 +28,9 @@ * @param onClickCallback The callback notified when the span is clicked. */ public NoUnderlineClickableSpan(Context context, Callback<View> onClickCallback) { - this(context, R.color.default_text_color_link_baseline, onClickCallback); + mColor = AttrUtils.resolveColor(context.getTheme(), R.attr.globalClickableSpanColor, + R.color.default_text_color_link_baseline); + mOnClick = onClickCallback; } /**
diff --git a/ui/android/java/src/org/chromium/ui/util/AttrUtils.java b/ui/android/java/src/org/chromium/ui/util/AttrUtils.java index ba5e155..f5da269 100644 --- a/ui/android/java/src/org/chromium/ui/util/AttrUtils.java +++ b/ui/android/java/src/org/chromium/ui/util/AttrUtils.java
@@ -9,6 +9,7 @@ import androidx.annotation.AttrRes; import androidx.annotation.ColorInt; +import androidx.annotation.ColorRes; /** Helper functions for working with attributes. */ public final class AttrUtils { @@ -28,4 +29,18 @@ theme.resolveAttribute(attrRes, typedValue, /*resolveRefs=*/true); return typedValue.data; } -} \ No newline at end of file + + /** + * Returns the given color attribute from the theme or resolves and returns the given default + * resource if the attribute is not set in the theme. + */ + public static @ColorInt int resolveColor( + Theme theme, @AttrRes int attrRes, @ColorRes int defaultColorRes) { + TypedValue typedValue = new TypedValue(); + if (theme.resolveAttribute(attrRes, typedValue, /*resolveRefs=*/true)) { + return typedValue.data; + } else { + return theme.getResources().getColor(defaultColorRes, theme); + } + } +}
diff --git a/ui/android/java/src/org/chromium/ui/widget/ButtonCompat.java b/ui/android/java/src/org/chromium/ui/widget/ButtonCompat.java index aebf630..117eca2 100644 --- a/ui/android/java/src/org/chromium/ui/widget/ButtonCompat.java +++ b/ui/android/java/src/org/chromium/ui/widget/ButtonCompat.java
@@ -12,7 +12,9 @@ import android.util.AttributeSet; import android.view.ContextThemeWrapper; +import androidx.annotation.ColorRes; import androidx.annotation.StyleRes; +import androidx.appcompat.content.res.AppCompatResources; import androidx.appcompat.widget.AppCompatButton; import org.chromium.ui.R; @@ -82,6 +84,15 @@ final int bottomEndRippleRadius = a.getDimensionPixelSize( R.styleable.ButtonCompat_rippleCornerRadiusBottomEnd, defaultRadius); + // If this attribute is not set, the text will keep the color set by android:textAppearance. + // This would have been handled in #super(). + final @ColorRes int textColorRes = + a.getResourceId(R.styleable.ButtonCompat_buttonTextColor, -1); + + if (textColorRes != -1) { + setTextColor(AppCompatResources.getColorStateList(getContext(), textColorRes)); + } + float[] radii; if (getLayoutDirection() == LAYOUT_DIRECTION_RTL) { radii = new float[] {topEndRippleRadius, topEndRippleRadius, topStartRippleRadius,
diff --git a/ui/android/java/src/org/chromium/ui/widget/TextViewWithTightWrapTest.java b/ui/android/java/src/org/chromium/ui/widget/TextViewWithTightWrapTest.java index 2303e20..861ae845 100644 --- a/ui/android/java/src/org/chromium/ui/widget/TextViewWithTightWrapTest.java +++ b/ui/android/java/src/org/chromium/ui/widget/TextViewWithTightWrapTest.java
@@ -93,6 +93,6 @@ Button snoozeButton = (Button) mView.findViewById(R.id.button_snooze); TestThreadUtils.runOnUiThreadBlocking(() -> { snoozeButton.setVisibility(View.VISIBLE); }); // Render UI Elements. - mRenderTestRule.render(mView, "TextViewWithTightWrap_MatchParent"); + mRenderTestRule.render(mView, "TextViewWithTightWrap_MatchParent_WithSnooze"); } }
diff --git a/ui/base/BUILD.gn b/ui/base/BUILD.gn index b702c9e2..85a49141 100644 --- a/ui/base/BUILD.gn +++ b/ui/base/BUILD.gn
@@ -1257,7 +1257,7 @@ # Same as locales, but includes "en" on Apple platforms. # Apple platforms use "en" instead of "en-US" (see the definition of -# |locales_as_mac_outputs| in locales.gni). However, we still want to keep +# |locales_as_apple_outputs| in locales.gni). However, we still want to keep # "en-US" in the list as the |ResourceBundle::GetLocaleFilePath| implementations # in ui/base/resource/resource_bundle_{mac,ios}.mm return a valid path for # "en-US" (as they internally rewrite it as "en" instead).
diff --git a/ui/chromeos/file_manager_strings.grdp b/ui/chromeos/file_manager_strings.grdp index 31245c5..27be0750 100644 --- a/ui/chromeos/file_manager_strings.grdp +++ b/ui/chromeos/file_manager_strings.grdp
@@ -641,6 +641,12 @@ <message name="IDS_FILE_BROWSER_COPY_ITEMS_REMAINING_LONG" desc="File Manager status message including destination folder when copying multiple files or folders. 'Item' is used here as a generic term for file or directory."> Copying <ph name="NUMBER_OF_ITEMS">$1<ex>3</ex></ph> items to <ph name="FOLDER_NAME">$2<ex>images</ex></ph> </message> + <message name="IDS_FILE_BROWSER_EXTRACT_FILE_NAME" desc="File Manager status message."> + Extracting <ph name="FILE_NAME">$1<ex>movie.avi</ex></ph>... + </message> + <message name="IDS_FILE_BROWSER_EXTRACT_ITEMS_REMAINING" desc="File Manager status message. 'Item' is used here as a generic term for file or directory."> + Extracting <ph name="NUMBER_OF_ITEMS">$1<ex>3</ex></ph> items... + </message> <message name="IDS_FILE_BROWSER_TIME_REMAINING_ESTIMATE" desc="The progress panel message indicating estimate of remaining time of a file operation. The time will be in 1 part (hour or minute) like '2 hours' or '3 min'."> About <ph name="REMAINING_TIME">$1<ex>1 min</ex></ph> remaining
diff --git a/ui/chromeos/file_manager_strings_grdp/IDS_FILE_BROWSER_EXTRACT_FILE_NAME.png.sha1 b/ui/chromeos/file_manager_strings_grdp/IDS_FILE_BROWSER_EXTRACT_FILE_NAME.png.sha1 new file mode 100644 index 0000000..eb7c6b4 --- /dev/null +++ b/ui/chromeos/file_manager_strings_grdp/IDS_FILE_BROWSER_EXTRACT_FILE_NAME.png.sha1
@@ -0,0 +1 @@ +4dc62496a54f0b82b0f587bf4f8d326fa7f53e4b \ No newline at end of file
diff --git a/ui/chromeos/file_manager_strings_grdp/IDS_FILE_BROWSER_EXTRACT_ITEMS_REMAINING.png.sha1 b/ui/chromeos/file_manager_strings_grdp/IDS_FILE_BROWSER_EXTRACT_ITEMS_REMAINING.png.sha1 new file mode 100644 index 0000000..b214eda6 --- /dev/null +++ b/ui/chromeos/file_manager_strings_grdp/IDS_FILE_BROWSER_EXTRACT_ITEMS_REMAINING.png.sha1
@@ -0,0 +1 @@ +89c344840f25eccb276326ff80ab6afdfb13a600 \ No newline at end of file
diff --git a/ui/file_manager/file_manager/foreground/js/ui/progress_center_panel.js b/ui/file_manager/file_manager/foreground/js/ui/progress_center_panel.js index dfbd5cb0..1891fb1 100644 --- a/ui/file_manager/file_manager/foreground/js/ui/progress_center_panel.js +++ b/ui/file_manager/file_manager/foreground/js/ui/progress_center_panel.js
@@ -69,6 +69,9 @@ if (item.type === ProgressItemType.COPY) { return strf('COPY_FILE_NAME', source); } + if (item.type === ProgressItemType.EXTRACT) { + return strf('EXTRACT_FILE_NAME', source); + } if (item.type === ProgressItemType.MOVE) { return strf('MOVE_FILE_NAME', source); } @@ -82,6 +85,9 @@ if (item.type === ProgressItemType.COPY) { return strf('COPY_ITEMS_REMAINING', count); } + if (item.type === ProgressItemType.EXTRACT) { + return strf('EXTRACT_ITEMS_REMAINING', count); + } if (item.type === ProgressItemType.MOVE) { return strf('MOVE_ITEMS_REMAINING', count); }
diff --git a/ui/gl/gl_image_native_pixmap.cc b/ui/gl/gl_image_native_pixmap.cc index 38f8064..f5aef7ad 100644 --- a/ui/gl/gl_image_native_pixmap.cc +++ b/ui/gl/gl_image_native_pixmap.cc
@@ -157,11 +157,14 @@ if (format_ == gfx::BufferFormat::YUV_420_BIPLANAR || format_ == gfx::BufferFormat::YVU_420) { - // TODO(b/220336463): setting this to EGL_ITU_REC601_EXT always is not - // correct. We need to plumb enough information so that we can determine - // the right value for this attribute. + // TODO(b/220336463): setting these attributes to EGL_ITU_REC601_EXT and + // EGL_YUV_NARROW_RANGE_EXT always is not necessarily correct. We need to + // plumb enough information so that we can determine the right values for + // these attributes. attrs.push_back(EGL_YUV_COLOR_SPACE_HINT_EXT); attrs.push_back(EGL_ITU_REC601_EXT); + attrs.push_back(EGL_SAMPLE_RANGE_HINT_EXT); + attrs.push_back(EGL_YUV_NARROW_RANGE_EXT); } if (plane_ == gfx::BufferPlane::DEFAULT) {
diff --git a/ui/views/bubble/bubble_dialog_delegate_view.h b/ui/views/bubble/bubble_dialog_delegate_view.h index 3f3efb2..954927f 100644 --- a/ui/views/bubble/bubble_dialog_delegate_view.h +++ b/ui/views/bubble/bubble_dialog_delegate_view.h
@@ -460,31 +460,10 @@ VIEW_BUILDER_PROPERTY(bool, ShowCloseButton) VIEW_BUILDER_PROPERTY(bool, ShowIcon) VIEW_BUILDER_PROPERTY(bool, ShowTitle) -// Manually define the SetTitle methods to resolve the overloads properly. -BuilderT& SetTitle(const std::u16string& value) & { - auto setter = std::make_unique<::views::internal::PropertySetter< - ViewClass_, std::u16string, - decltype((static_cast<void (WidgetDelegate::*)(const std::u16string&)>( - &ViewClass_::SetTitle))), - &WidgetDelegate::SetTitle>>(value); - ::views::internal::ViewBuilderCore::AddPropertySetter(std::move(setter)); - return *static_cast<BuilderT*>(this); -} -BuilderT&& SetTitle(const std::u16string& value) && { - return std::move(this->SetTitle(value)); -} -BuilderT& SetTitle(int value) & { - auto setter = std::make_unique<::views::internal::PropertySetter< - ViewClass_, int, - decltype( - (static_cast<void (WidgetDelegate::*)(int)>(&ViewClass_::SetTitle))), - &WidgetDelegate::SetTitle>>(value); - ::views::internal::ViewBuilderCore::AddPropertySetter(std::move(setter)); - return *static_cast<BuilderT*>(this); -} -BuilderT&& SetTitle(int value) && { - return std::move(this->SetTitle(value)); -} +VIEW_BUILDER_OVERLOAD_METHOD_CLASS(WidgetDelegate, + SetTitle, + const std::u16string&) +VIEW_BUILDER_OVERLOAD_METHOD_CLASS(WidgetDelegate, SetTitle, int) #if defined(USE_AURA) VIEW_BUILDER_PROPERTY(bool, CenterTitle) #endif
diff --git a/ui/views/controls/button/image_button.h b/ui/views/controls/button/image_button.h index 751e7325..18d6a85 100644 --- a/ui/views/controls/button/image_button.h +++ b/ui/views/controls/button/image_button.h
@@ -115,36 +115,12 @@ ImageHorizontalAlignment) VIEW_BUILDER_PROPERTY(ImageButton::VerticalAlignment, ImageVerticalAlignment) VIEW_BUILDER_PROPERTY(gfx::Size, MinimumImageSize) -// Explicitly declare the overloaded SetImage methods in order to properly -// disambiguate between them. -BuilderT& SetImage(Button::ButtonState state, const gfx::ImageSkia* image) & { - auto setter = std::make_unique<::views::internal::ClassMethodCaller< - ViewClass_, - decltype((static_cast<void (ViewClass_::*)(Button::ButtonState, - const gfx::ImageSkia*)>( - &ViewClass_::SetImage))), - &ViewClass_::SetImage, Button::ButtonState, const gfx::ImageSkia*>>( - state, image); - ::views::internal::ViewBuilderCore::AddPropertySetter(std::move(setter)); - return *static_cast<BuilderT*>(this); -} -BuilderT&& SetImage(Button::ButtonState state, const gfx::ImageSkia* image) && { - return std::move(this->SetImage(state, image)); -} -BuilderT& SetImage(Button::ButtonState state, const gfx::ImageSkia& image) & { - auto setter = std::make_unique<::views::internal::ClassMethodCaller< - ViewClass_, - decltype((static_cast<void (ViewClass_::*)(Button::ButtonState, - const gfx::ImageSkia&)>( - &ViewClass_::SetImage))), - &ViewClass_::SetImage, Button::ButtonState, const gfx::ImageSkia&>>( - state, image); - ::views::internal::ViewBuilderCore::AddPropertySetter(std::move(setter)); - return *static_cast<BuilderT*>(this); -} -BuilderT&& SetImage(Button::ButtonState state, const gfx::ImageSkia& image) && { - return std::move(this->SetImage(state, image)); -} +VIEW_BUILDER_OVERLOAD_METHOD(SetImage, + Button::ButtonState, + const gfx::ImageSkia*) +VIEW_BUILDER_OVERLOAD_METHOD(SetImage, + Button::ButtonState, + const gfx::ImageSkia&) END_VIEW_BUILDER ////////////////////////////////////////////////////////////////////////////////
diff --git a/ui/views/controls/image_view.h b/ui/views/controls/image_view.h index 7198a2f..81d33c9 100644 --- a/ui/views/controls/image_view.h +++ b/ui/views/controls/image_view.h
@@ -5,9 +5,6 @@ #ifndef UI_VIEWS_CONTROLS_IMAGE_VIEW_H_ #define UI_VIEWS_CONTROLS_IMAGE_VIEW_H_ -#include <memory> -#include <utility> - #include "base/memory/raw_ptr.h" #include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/models/image_model.h" @@ -105,44 +102,9 @@ }; BEGIN_VIEW_BUILDER(VIEWS_EXPORT, ImageView, ImageViewBase) -// Explicitly declare the overloaded SetImage methods in order to properly -// disambiguate between them. -BuilderT& SetImage(const gfx::ImageSkia& value) & { - auto setter = std::make_unique<::views::internal::PropertySetter< - ViewClass_, gfx::ImageSkia, - decltype((static_cast<void (ViewClass_::*)(const gfx::ImageSkia&)>( - &ViewClass_::SetImage))), - &ViewClass_::SetImage>>(value); - ::views::internal::ViewBuilderCore::AddPropertySetter(std::move(setter)); - return *static_cast<BuilderT*>(this); -} -BuilderT&& SetImage(const gfx::ImageSkia& value) && { - return std::move(this->SetImage(value)); -} -BuilderT& SetImage(const gfx::ImageSkia* value) & { - auto setter = std::make_unique<::views::internal::PropertySetter< - ViewClass_, const gfx::ImageSkia*, - decltype((static_cast<void (ViewClass_::*)(const gfx::ImageSkia*)>( - &ViewClass_::SetImage))), - &ViewClass_::SetImage>>(value); - ::views::internal::ViewBuilderCore::AddPropertySetter(std::move(setter)); - return *static_cast<BuilderT*>(this); -} -BuilderT&& SetImage(const gfx::ImageSkia* value) && { - return std::move(this->SetImage(value)); -} -BuilderT& SetImage(const ui::ImageModel& value) & { - auto setter = std::make_unique<::views::internal::PropertySetter< - ViewClass_, ui::ImageModel, - decltype((static_cast<void (ViewClass_::*)(const ui::ImageModel&)>( - &ViewClass_::SetImage))), - &ViewClass_::SetImage>>(value); - ::views::internal::ViewBuilderCore::AddPropertySetter(std::move(setter)); - return *static_cast<BuilderT*>(this); -} -BuilderT&& SetImage(const ui::ImageModel& value) && { - return std::move(this->SetImage(value)); -} +VIEW_BUILDER_OVERLOAD_METHOD(SetImage, const gfx::ImageSkia&) +VIEW_BUILDER_OVERLOAD_METHOD(SetImage, const gfx::ImageSkia*) +VIEW_BUILDER_OVERLOAD_METHOD(SetImage, const ui::ImageModel&) END_VIEW_BUILDER } // namespace views
diff --git a/ui/views/controls/link.h b/ui/views/controls/link.h index 6d49ac3..e45d754 100644 --- a/ui/views/controls/link.h +++ b/ui/views/controls/link.h
@@ -108,30 +108,8 @@ }; BEGIN_VIEW_BUILDER(VIEWS_EXPORT, Link, Label) -BuilderT& SetCallback(base::RepeatingClosure callback) & { - auto setter = std::make_unique<::views::internal::PropertySetter< - ViewClass_, base::RepeatingClosure, - decltype((static_cast<void (ViewClass_::*)(base::RepeatingClosure)>( - &ViewClass_::SetCallback))), - &Link::SetCallback>>(std::move(callback)); - ::views::internal::ViewBuilderCore::AddPropertySetter(std::move(setter)); - return *static_cast<BuilderT*>(this); -} -BuilderT&& SetCallback(base::RepeatingClosure callback) && { - return std::move(this->SetCallback(std::move(callback))); -} -BuilderT& SetCallback(Link::ClickedCallback callback) & { - auto setter = std::make_unique<::views::internal::PropertySetter< - ViewClass_, Link::ClickedCallback, - decltype((static_cast<void (ViewClass_::*)(Link::ClickedCallback)>( - &ViewClass_::SetCallback))), - &Link::SetCallback>>(std::move(callback)); - ::views::internal::ViewBuilderCore::AddPropertySetter(std::move(setter)); - return *static_cast<BuilderT*>(this); -} -BuilderT&& SetCallback(Link::ClickedCallback callback) && { - return std::move(this->SetCallback(std::move(callback))); -} +VIEW_BUILDER_OVERLOAD_METHOD(SetCallback, base::RepeatingClosure) +VIEW_BUILDER_OVERLOAD_METHOD(SetCallback, Link::ClickedCallback) VIEW_BUILDER_PROPERTY(bool, ForceUnderline) END_VIEW_BUILDER
diff --git a/ui/views/metadata/view_factory.h b/ui/views/metadata/view_factory.h index 8ea6632..b4e49aa8 100644 --- a/ui/views/metadata/view_factory.h +++ b/ui/views/metadata/view_factory.h
@@ -259,6 +259,48 @@ // class VIEWS_EXPORT LabelButtonBuilder // : public LabelButtonBuilderT<LabelButtonBuilder, LabelButton> {}; +// The maximum number of overloaded params is 10. This should be overkill since +// a function with 10 params is well into the "suspect" territory anyway. +// TODO(kylixrd@): Evaluate whether a max of 5 may be more reasonable. +#define NUM_ARGS_IMPL(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, N, ...) N +#define NUM_ARGS(...) NUM_ARGS_IMPL(__VA_ARGS__, _10, 9, 8, 7, 6, 5, 4, 3, 2, 1) + +#define BUILD_MACRO_NAME_IMPL(a, b) a##b +#define BUILD_MACRO_NAME(a, b) BUILD_MACRO_NAME_IMPL(a, b) + +// This will expand the list of types into a parameter declaration list. +// eg: DECL_PARAMS(int, char, float, double) will expand to: +// int param4, char param3, float param2, double param1 +#define DECL_PARAM1(type) type param1 +#define DECL_PARAM2(type, ...) type param2, DECL_PARAM1(__VA_ARGS__) +#define DECL_PARAM3(type, ...) type param3, DECL_PARAM2(__VA_ARGS__) +#define DECL_PARAM4(type, ...) type param4, DECL_PARAM3(__VA_ARGS__) +#define DECL_PARAM5(type, ...) type param5, DECL_PARAM4(__VA_ARGS__) +#define DECL_PARAM6(type, ...) type param6, DECL_PARAM5(__VA_ARGS__) +#define DECL_PARAM7(type, ...) type param7, DECL_PARAM6(__VA_ARGS__) +#define DECL_PARAM8(type, ...) type param8, DECL_PARAM7(__VA_ARGS__) +#define DECL_PARAM9(type, ...) type param9, DECL_PARAM8(__VA_ARGS__) +#define DECL_PARAM10(type, ...) type param10, DECL_PARAM9(__VA_ARGS__) +#define DECL_PARAMS(...) \ + BUILD_MACRO_NAME(DECL_PARAM, NUM_ARGS(__VA_ARGS__))(__VA_ARGS__) + +// This will expand into list of parameters suitable for calling a function +// using the same param names from the above expansion. +// eg: PASS_PARAMS(int, char, float, double) +// param4, param3, param2, param1 +#define PASS_PARAM1(type) param1 +#define PASS_PARAM2(type, ...) param2, PASS_PARAM1(__VA_ARGS__) +#define PASS_PARAM3(type, ...) param3, PASS_PARAM2(__VA_ARGS__) +#define PASS_PARAM4(type, ...) param4, PASS_PARAM3(__VA_ARGS__) +#define PASS_PARAM5(type, ...) param5, PASS_PARAM4(__VA_ARGS__) +#define PASS_PARAM6(type, ...) param6, PASS_PARAM5(__VA_ARGS__) +#define PASS_PARAM7(type, ...) param7, PASS_PARAM6(__VA_ARGS__) +#define PASS_PARAM8(type, ...) param8, PASS_PARAM7(__VA_ARGS__) +#define PASS_PARAM9(type, ...) param9, PASS_PARAM8(__VA_ARGS__) +#define PASS_PARAM10(type, ...) param10, PASS_PARAM9(__VA_ARGS__) +#define PASS_PARAMS(...) \ + BUILD_MACRO_NAME(PASS_PARAM, NUM_ARGS(__VA_ARGS__))(__VA_ARGS__) + // BEGIN_VIEW_BUILDER, END_VIEW_BUILDER and VIEW_BUILDER_XXXX macros should // be placed into the same namespace as the 'view_class' parameter. @@ -316,6 +358,31 @@ GET_VB_MACRO(__VA_ARGS__, VIEW_BUILDER_PROPERTY3, VIEW_BUILDER_PROPERTY2) \ (__VA_ARGS__) +// Sometimes the method being called is on the ancestor to ViewClass_. This +// macro will ensure the overload casts function correctly by specifying the +// ancestor class on which the method is declared. In most cases the following +// macro will be used. +// NOTE: See the Builder declaration for DialogDelegateView in dialog_delegate.h +// for an example. +#define VIEW_BUILDER_OVERLOAD_METHOD_CLASS(class_name, method_name, ...) \ + BuilderT& method_name(DECL_PARAMS(__VA_ARGS__))& { \ + auto caller = std::make_unique<::views::internal::ClassMethodCaller< \ + ViewClass_, \ + decltype((static_cast<void (class_name::*)(__VA_ARGS__)>( \ + &ViewClass_::method_name))), \ + &class_name::method_name, __VA_ARGS__>>(PASS_PARAMS(__VA_ARGS__)); \ + ::views::internal::ViewBuilderCore::AddPropertySetter(std::move(caller)); \ + return *static_cast<BuilderT*>(this); \ + } \ + BuilderT&& method_name(DECL_PARAMS(__VA_ARGS__))&& { \ + return std::move(this->method_name(PASS_PARAMS(__VA_ARGS__))); \ + } + +// Unless the above scenario is in play, please favor the use of this macro for +// declaring overloaded builder methods. +#define VIEW_BUILDER_OVERLOAD_METHOD(method_name, ...) \ + VIEW_BUILDER_OVERLOAD_METHOD_CLASS(ViewClass_, method_name, __VA_ARGS__) + #define VIEW_BUILDER_METHOD(method_name, ...) \ template <typename... Args> \ BuilderT& method_name(Args&&... args)& { \
diff --git a/ui/views/widget/widget.cc b/ui/views/widget/widget.cc index 41a1166..29a02eb 100644 --- a/ui/views/widget/widget.cc +++ b/ui/views/widget/widget.cc
@@ -1334,7 +1334,19 @@ // Widgets in a widget tree should share the same ShouldPaintAsActive(). // Lock the parent as paint-as-active when this widget becomes active. - if (!active && !paint_as_active_refcount_) + // If we're in the process of closing the widget, delay resetting the + // `parent_paint_as_active_lock_` until the owning native widget destroys this + // widget (i.e. wait until widget destruction). Do this as closing a widget + // may result in synchronously calling into this method, which can cause the + // parent to immediately paint as inactive. This is an issue if, after this + // widget has been closed, the parent widget is the next widget to receive + // activation. If using a desktop native widget, the next widget to receive + // activation may be determined by the system's window manager and this may + // not happen synchronously with closing the Widget. By waiting for the owning + // native widget to destroy this widget we ensure that resetting the paint + // lock happens synchronously with the activation the next widget (see + // crbug/1303549). + if (!active && !paint_as_active_refcount_ && !widget_closed_) parent_paint_as_active_lock_.reset(); else if (parent()) parent_paint_as_active_lock_ = parent()->LockPaintAsActive();
diff --git a/ui/views/widget/widget_unittest.cc b/ui/views/widget/widget_unittest.cc index fc5cb982..069f754 100644 --- a/ui/views/widget/widget_unittest.cc +++ b/ui/views/widget/widget_unittest.cc
@@ -2354,6 +2354,38 @@ EXPECT_EQ(other_control.CallCount(), 4); } +// Tests to make sure that child widgets do not cause their parent widget to +// paint inactive immediately when they are closed. This avoids having the +// parent paint as inactive in the time between when the bubble is closed and +// when it's eventually destroyed by its native widget (see crbug.com/1303549). +TEST_F(DesktopWidgetTest, + ClosingActiveChildDoesNotPrematurelyPaintParentInactive) { + // top_level_widget that owns the bubble widget. + auto top_level_widget = CreateTestWidget(); + top_level_widget->Show(); + + // Create the child bubble widget. + auto bubble_widget = std::make_unique<Widget>(); + Widget::InitParams init_params = + CreateParamsForTestWidget(Widget::InitParams::TYPE_BUBBLE); + init_params.parent = top_level_widget->GetNativeView(); + bubble_widget->Init(std::move(init_params)); + bubble_widget->Show(); + + EXPECT_TRUE(bubble_widget->ShouldPaintAsActive()); + EXPECT_TRUE(top_level_widget->ShouldPaintAsActive()); + + // Closing the bubble wiget should not immediately cause the top level widget + // to paint inactive. + PaintAsActiveCallbackCounter top_level_counter(top_level_widget.get()); + PaintAsActiveCallbackCounter bubble_counter(bubble_widget.get()); + bubble_widget->Close(); + EXPECT_FALSE(bubble_widget->ShouldPaintAsActive()); + EXPECT_TRUE(top_level_widget->ShouldPaintAsActive()); + EXPECT_EQ(top_level_counter.CallCount(), 0); + EXPECT_EQ(bubble_counter.CallCount(), 0); +} + // Widget used to destroy itself when OnNativeWidgetDestroyed is called. class TestNativeWidgetDestroyedWidget : public Widget { public:
diff --git a/ui/views/window/dialog_delegate.h b/ui/views/window/dialog_delegate.h index 159befd..68ecf2d 100644 --- a/ui/views/window/dialog_delegate.h +++ b/ui/views/window/dialog_delegate.h
@@ -404,31 +404,10 @@ VIEW_BUILDER_PROPERTY(bool, ShowCloseButton) VIEW_BUILDER_PROPERTY(bool, ShowIcon) VIEW_BUILDER_PROPERTY(bool, ShowTitle) -// Manually define the SetTitle methods to resolve the overloads properly. -BuilderT& SetTitle(const std::u16string& value) & { - auto setter = std::make_unique<::views::internal::PropertySetter< - ViewClass_, std::u16string, - decltype((static_cast<void (WidgetDelegate::*)(const std::u16string&)>( - &ViewClass_::SetTitle))), - &WidgetDelegate::SetTitle>>(value); - ::views::internal::ViewBuilderCore::AddPropertySetter(std::move(setter)); - return *static_cast<BuilderT*>(this); -} -BuilderT&& SetTitle(const std::u16string& value) && { - return std::move(this->SetTitle(value)); -} -BuilderT& SetTitle(int value) & { - auto setter = std::make_unique<::views::internal::PropertySetter< - ViewClass_, int, - decltype( - (static_cast<void (WidgetDelegate::*)(int)>(&ViewClass_::SetTitle))), - &WidgetDelegate::SetTitle>>(value); - ::views::internal::ViewBuilderCore::AddPropertySetter(std::move(setter)); - return *static_cast<BuilderT*>(this); -} -BuilderT&& SetTitle(int value) && { - return std::move(this->SetTitle(value)); -} +VIEW_BUILDER_OVERLOAD_METHOD_CLASS(WidgetDelegate, + SetTitle, + const std::u16string&) +VIEW_BUILDER_OVERLOAD_METHOD_CLASS(WidgetDelegate, SetTitle, int) #if defined(USE_AURA) VIEW_BUILDER_PROPERTY(bool, CenterTitle) #endif
diff --git a/ui/webui/resources/cr_elements/cr_auto_img/cr_auto_img.js b/ui/webui/resources/cr_elements/cr_auto_img/cr_auto_img.js index 6ccfb833..f8d74b4 100644 --- a/ui/webui/resources/cr_elements/cr_auto_img/cr_auto_img.js +++ b/ui/webui/resources/cr_elements/cr_auto_img/cr_auto_img.js
@@ -44,7 +44,14 @@ } attributeChangedCallback(name, oldValue, newValue) { - if (name !== AUTO_SRC) { + if (name !== AUTO_SRC && name !== WITH_COOKIES) { + return; + } + + // Changes to |WITH_COOKIES| are only interesting when the attribute is + // being added or removed. + if (name === WITH_COOKIES && + ((oldValue === null) === (newValue === null))) { return; } @@ -56,7 +63,7 @@ let url = null; try { - url = new URL(newValue || ''); + url = new URL(this.getAttribute(AUTO_SRC) || ''); } catch (_) { } @@ -95,14 +102,18 @@ return this.getAttribute(CLEAR_SRC); } - /** @param {string} _ */ - set withCookies(_) { - this.setAttribute(WITH_COOKIES, ''); + /** @param {boolean} enabled */ + set withCookies(enabled) { + if (enabled) { + this.setAttribute(WITH_COOKIES, ''); + } else { + this.removeAttribute(WITH_COOKIES); + } } - /** @return {string} */ + /** @return {boolean} */ get withCookies() { - return this.getAttribute(WITH_COOKIES); + return this.hasAttribute(WITH_COOKIES); } }
diff --git a/weblayer/browser/navigation_browsertest.cc b/weblayer/browser/navigation_browsertest.cc index 3f00c67b..4c9ec2a 100644 --- a/weblayer/browser/navigation_browsertest.cc +++ b/weblayer/browser/navigation_browsertest.cc
@@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <memory> #include "weblayer/test/weblayer_browser_test.h" #include "base/callback.h" @@ -11,6 +12,8 @@ #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" #include "base/test/bind.h" +#include "base/test/metrics/histogram_tester.h" +#include "base/test/scoped_feature_list.h" #include "build/build_config.h" #include "components/variations/net/variations_http_headers.h" #include "components/variations/variations_ids_provider.h" @@ -21,6 +24,7 @@ #include "net/test/embedded_test_server/controllable_http_response.h" #include "net/test/embedded_test_server/embedded_test_server.h" #include "net/test/embedded_test_server/http_response.h" +#include "third_party/blink/public/common/features.h" #include "third_party/blink/public/common/web_preferences/web_preferences.h" #include "weblayer/browser/tab_impl.h" #include "weblayer/public/browser.h" @@ -527,8 +531,27 @@ EXPECT_EQ(header_value, response_2.http_request()->headers.at(header_name)); } -IN_PROC_BROWSER_TEST_F(NavigationBrowserTest, PageSeesUserAgentString) { - ASSERT_TRUE(embedded_test_server()->Start()); +class NavigationBrowserTestUserAgentOverrideSubstring + : public NavigationBrowserTest { + public: + void SetUp() override { + scoped_feature_list_.InitAndEnableFeature( + blink::features::kUserAgentOverrideExperiment); + NavigationBrowserTest::SetUp(); + } + + private: + base::test::ScopedFeatureList scoped_feature_list_; +}; + +IN_PROC_BROWSER_TEST_F(NavigationBrowserTestUserAgentOverrideSubstring, + PageSeesUserAgentString) { + net::test_server::EmbeddedTestServer https_server( + net::test_server::EmbeddedTestServer::TYPE_HTTPS); + https_server.AddDefaultHandlers( + base::FilePath(FILE_PATH_LITERAL("weblayer/test/data"))); + + ASSERT_TRUE(https_server.Start()); const std::string custom_ua = "custom"; NavigationObserverImpl observer(GetNavigationController()); @@ -536,10 +559,15 @@ base::BindLambdaForTesting([&](Navigation* navigation) { navigation->SetUserAgentString(custom_ua); })); + base::HistogramTester histogram; OneShotNavigationObserver navigation_observer(shell()); - shell()->LoadURL(embedded_test_server()->GetURL("/simple_page.html")); + shell()->LoadURL(https_server.GetURL("/simple_page.html")); navigation_observer.WaitForNavigation(); + histogram.ExpectBucketCount( + blink::UserAgentOverride::kUserAgentOverrideHistogram, + blink::UserAgentOverride::UserAgentOverriden, 1); + base::RunLoop run_loop; shell()->tab()->ExecuteScript( u"navigator.userAgent;", false, @@ -549,6 +577,17 @@ run_loop.Quit(); })); run_loop.Run(); + + // Ensure that userAgentData is blank when custom user agent is set. + base::RunLoop run_loop2; + shell()->tab()->ExecuteScript( + u"navigator.userAgentData.platform;", false, + base::BindLambdaForTesting([&](base::Value value) { + ASSERT_TRUE(value.is_string()); + EXPECT_EQ("", value.GetString()); + run_loop2.Quit(); + })); + run_loop2.Run(); } IN_PROC_BROWSER_TEST_F(NavigationBrowserTest, Reload) { @@ -567,12 +606,19 @@ EXPECT_TRUE(observer2.is_reload()); } -IN_PROC_BROWSER_TEST_F(NavigationBrowserTest, SetUserAgentString) { - net::test_server::ControllableHttpResponse response_1(embedded_test_server(), - "", true); - net::test_server::ControllableHttpResponse response_2(embedded_test_server(), - "", true); - ASSERT_TRUE(embedded_test_server()->Start()); +IN_PROC_BROWSER_TEST_F(NavigationBrowserTestUserAgentOverrideSubstring, + SetUserAgentString) { + std::unique_ptr<net::test_server::EmbeddedTestServer> https_server = + std::make_unique<net::test_server::EmbeddedTestServer>( + net::test_server::EmbeddedTestServer::TYPE_HTTPS); + https_server->AddDefaultHandlers( + base::FilePath(FILE_PATH_LITERAL("weblayer/test/data"))); + + net::test_server::ControllableHttpResponse response_1(https_server.get(), "", + true); + net::test_server::ControllableHttpResponse response_2(https_server.get(), "", + true); + ASSERT_TRUE(https_server->Start()); const std::string custom_ua = "CUSTOM"; NavigationObserverImpl observer(GetNavigationController()); @@ -581,7 +627,8 @@ navigation->SetUserAgentString(custom_ua); })); - shell()->LoadURL(embedded_test_server()->GetURL("/simple_page.html")); + base::HistogramTester histogram; + shell()->LoadURL(https_server->GetURL("/simple_page.html")); response_1.WaitForRequest(); // |custom_ua| should be present in initial request. @@ -591,6 +638,15 @@ net::HttpRequestHeaders::kUserAgent); EXPECT_EQ(custom_ua, new_header); + ASSERT_TRUE(base::Contains(response_1.http_request()->headers, "sec-ch-ua")); + const std::string new_ch_header = + response_1.http_request()->headers.at("Sec-CH-UA"); + EXPECT_EQ("", new_ch_header); + content::FetchHistogramsFromChildProcesses(); + histogram.ExpectBucketCount( + blink::UserAgentOverride::kUserAgentOverrideHistogram, + blink::UserAgentOverride::UserAgentOverriden, 1); + // Header should carry through to redirect. response_1.Send( "HTTP/1.1 302 Moved Temporarily\r\nLocation: /new_doc\r\n\r\n"); @@ -598,6 +654,7 @@ response_2.WaitForRequest(); EXPECT_EQ(custom_ua, response_2.http_request()->headers.at( net::HttpRequestHeaders::kUserAgent)); + EXPECT_EQ("", response_2.http_request()->headers.at("Sec-CH-UA")); } #if BUILDFLAG(IS_ANDROID)
diff --git a/weblayer/public/java/org/chromium/weblayer/Navigation.java b/weblayer/public/java/org/chromium/weblayer/Navigation.java index c942799..25fe931 100644 --- a/weblayer/public/java/org/chromium/weblayer/Navigation.java +++ b/weblayer/public/java/org/chromium/weblayer/Navigation.java
@@ -329,7 +329,10 @@ /** * Sets the user-agent string that applies to the current navigation. This user-agent is not * sticky, it applies to this navigation only (and any redirects or resources that are loaded). - * This method may only be called from {@link NavigationCallback.onNavigationStarted}. + * This method may only be called from {@link NavigationCallback.onNavigationStarted}. Setting + * this to a non empty string will cause will cause the User-Agent Client Hint header values and + * the values returned by `navigator.userAgentData` to be empty for requests this override is + * applied to. * * Note that this user agent won't be sent again if the frame html is fetched again due to a * user reloading the page, navigating back and forth etc... when this fetch couldn't be cached
diff --git a/weblayer/public/navigation.h b/weblayer/public/navigation.h index b03a3b84..98bdc86b 100644 --- a/weblayer/public/navigation.h +++ b/weblayer/public/navigation.h
@@ -125,7 +125,10 @@ // function may only be called from NavigationObserver::NavigationStarted(). // Any value specified during start carries through to a redirect. |value| // must not contain any illegal characters as documented in - // SetRequestHeader(). + // SetRequestHeader(). Setting this to a non empty string will cause the + // User-Agent Client Hint header values and the values returned by + // `navigator.userAgentData` to be empty for requests this override is applied + // to. virtual void SetUserAgentString(const std::string& value) = 0; // Disables auto-reload for this navigation if the network is down and comes